草庐IT

Gmail-Auth

全部标签

php - 在 CakePHP Auth 中允许整个 Controller 并且 allow() 不起作用

我已经尝试过$this->Auth->allow()inbeforeFilter()但是,我需要添加整个Controller作为异常(exception),即它需要公开并且不需要用户登录。只是一种执行$this->Auth->allow(every-function-in-this-controller)的快捷方式答案?编辑:我有这个:Auth->allow('index');}publicfunctionindex(){$this->layout='main';$this->set('Hello',"Helloworld");}}正在调用Auth-login()

php - Kohana Auth 模块无法登录

对于那些熟悉Kohana中的Auth模块的人来说,我无法登录用户。我可以很好地创建用户,但显然哈希值不匹配。我已经使用提供的MySql模式来创建数据库,并且我正在使用模块模型。这是我创建的用户代码:publicfunctionuser_create(){$user=ORM::factory('user');$user->username="user";$this->auth=Auth::instance();$user->email="info@test.com";$user->password=$this->auth->hash_password('admin');$user->ad

php - 我如何使用 php api 阅读 gmail 主题?

在女巫模式下可以使用phpapi读取电子邮件主题吗?我做这段代码//GettheAPIclientandconstructtheserviceobject.$client=getClient();$service=newGoogle_Service_Gmail($client);//Printthelabelsintheuser'saccount.$user='me';$results=$service->users_messages->listUsersMessages($user);foreach($resultsas$mail){$optParamsGet['format']='

PHP+Ubuntu 使用gmail form localhost发送邮件

我已经搜索了几篇关于此的帖子,但没有找到。每个人都在使用后缀。但是当我浏览文本时https://help.ubuntu.com/community/PostfixWhatisaMailTransferAgentInotherwords,it'samailservernotamailclientlikeThunderbird,Evolution,Outlook,Eudora,oraweb-basedemailservicelikeYahoo,GMail,Hotmail,Earthlink,Comcast,SBCGlobal.net,ATT.netetc....Ifyouworkedfor

php - Gmail fsockopen() : SSL operation failed error with Codeigniter and XAMPP

Errormessage1:Message:fsockopen():SSLoperationfailedwithcode1.OpenSSLErrormessages:error:14090086:SSLroutines:ssl3_get_server_certificate:certificateverifyfailedFilename:libraries/Email.phpLineNumber:1962Errormessage2:Message:fsockopen():FailedtoenablecryptoErrormessage3:Message:fsockopen():unab

php - Laravel 5.2 Auth facade 和 Auth::guard($guard)

我是Laravel的新手。我正在浏览默认的身份验证中间件,我看到它正在使用:Auth::guard($guard)->guest()检查用户是否是访客。文档位于https://laravel.com/docs/5.2/authentication#retrieving-the-authenticated-user告诉我们可以使用:Auth::check()确定用户是否通过身份验证。(我想这与guest()相反?我尝试更改要使用的默认代码Auth::guest()我得到了完全相同的结果。我的问题是,在这种情况下,有没有guard($guard)->有什么区别?一个相关的问题。guest(

php - Gmail SMTP 在 ec2 实例中不工作

我正在使用基于Ubuntu的ec2实例,最近我将我的代码转移到aws上,但电子邮件功能似乎无法正常工作。我正在使用gmailSMTP服务下面是我的代码'Smtpmail'=>array('class'=>'application.extensions.smtpmail.PHPMailer','Host'=>"smtp.gmail.com",'Username'=>'username','Password'=>'password','From'=>'fromaddr','setForm'=>'fromname','Mailer'=>'smtp','SMTPSecure'=>'tls','

php - 防护 'Google_Auth_Exception' 获取 OAuth2 访问 token 时出错,消息 : 'invalid_client' ' error

我正在尝试通过gmailapi从Google获取邮件在收到token后对Google_Client进行身份验证时出现此错误fatalerror:未捕获异常“Google_Auth_Exception”,消息“获取OAuth2访问token时出错,消息:‘invalid_client’”在我的代码使用google-api-php-client-master很简单,我的代码如下require_once('config.php');require_once'autoload.php';$client=newGoogle_Client();$client->setScopes(array('h

php - Laravel-5 添加 hasRole 方法到 Auth

我正在尝试扩展Laravel-5.1Auth中间件,以便我可以向其中添加我自己的方法:Auth::hasRole()我需要做什么才能将新方法hasRole添加到Auth?这是我的路线文件:/*AdministratorRoutes*/Route::group(['namespace'=>'Admin','middleware'=>'timesheets.admin:Administrator'],function(){Route::get('home','AdminController@index');});这是我的中间件文件:auth=$auth;}/***Handleanincom

php - Laravel 5.6 在 Controller 构造函数中访问 auth()->user()?

我试图在Controller构造函数中访问auth()->user(),但它总是返回null。我在下面尝试过,但没有成功!protected$user;function__construct(){$this->middleware(function($request,$next){$this->user=auth()->user();return$next($request);});}有什么办法吗?--谢谢 最佳答案 ControllerConstructor在Middlewares之前被调用。所以在Constructor()中无法