草庐IT

auth_user

全部标签

php - Laravel Passport "auth:api"中间件充当 "web, auth"中间件

我已经按照官方文档(https://laravel.com/docs/5.3/passport#introduction)中的描述为Laravel5.3设置了LaravelPassport包。我希望移动应用程序使用该API,因此我尝试实现密码授予token。我已经创建了一个密码授予客户端,并且token请求过程...$response=$http->post('http://my-app.com/oauth/token',['form_params'=>['grant_type'=>'password','client_id'=>'client-id','client_secret'=

php - GCP SQL Postgres 权限问题 : can't run a query with postgres user with generated symfony db

我正在努力使用GoogleCloudPlatform的CloudSQL组件解决这个问题。我的技术栈包括在GoogleKubernetesEngine(GKE)部署中托管我的应用程序,使用CloudSQL代理sidecar连接到pod内的数据库。后端是一个Symfony项目。我按照以下步骤创建和填充数据库(没有成功):创建CloudSQLPostgres实例将代理添加到k8s容器以使用所有凭据连接到CloudSQL实例,如GCPdocumentation中所述进入我的Symfony(phpfpm)pod并运行命令phpbin/consoledoctrine:schema:update--

php - Kohana 3 auth 模块,如何配置用户表和字段

我在模块加载器中取消注释以加载auth,但我不明白的是如何告诉auth模块它应该使用哪个表的哪些字段来进行身份验证?我也没有在Kohana3的用户指南中找到它,因为我发现auth模块的用户指南不存在。所以请告诉是否有人已经在使用它。如果它使用某些表的一些默认字段,那么我该如何修改它?感谢您阅读我的问题并努力回答。 最佳答案 这是适合你的步骤取消注释bootstrap.php中的Auth模块(您已经完成了)在ORMModule中,是的,在ORMModule中你会发现auth-schema-mysql.sql&auth-schema-p

php - Symfony2 : How to modify the current user's entity using a form?

我正在尝试添加一个简单的表单以允许我的用户编辑他们的个人资料。我的问题是:由于“链接”到表单的实体与当前用户对象相同($user===$entity,见下文),如果表单验证失败,则View是使用修改后的用户对象呈现(即使用无效形式的值)。这是我的(经典)Controller:publicfunctionprofileAction(){$em=$this->getDoctrine()->getEntityManager();$user=$this->get('security.context')->getToken()->getUser();$entity=$em->getReposit

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()

user-interface - 使用 PHP CLI 创建 GUI

是否可以在bashshell上使用PHPCLI在PHP中重新创建以下界面?如果有人能给我指出正确的方向-我将不胜感激。 最佳答案 据我所知,这类事情通常用ncurses完成。 关于user-interface-使用PHPCLI创建GUI,我们在StackOverflow上找到一个类似的问题: https://stackoverflow.com/questions/9402532/

php - 拉维尔 5.2 : How to get the role of current user when using `Zizaco/entrust` ?

我正在使用Laravel5.2和Zizaco/entrust5.2,我的问题是:使用Zizaco/entrust时如何获取当前用户的角色?名称和角色.phpnamespaceApp\Services;useApp\User;useApp\Role;useZizaco\Entrust\EntrustRole;useIlluminate\Support\Facades\Cache;classNameAndRole{public$username;public$role;publicfunction__construct(){$user=\Auth::user();$this->userna

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 和 mySQLi : Do I still need to check user input when using prepare statements?

如果我在mySQLi中使用prepare语句,我是否仍然需要以任何方式转义或检查用户输入。例如,如果我有代码:$members=newmysqli("localhost","user","pass","members");$r_email=$_POST['r_email'];$check=$members->prepare("selectuser_idfromuserswhereemail=?");$check->bind_param('s',$r_email);$check->execute();$check->store_result();if($check->num_rows>0

php - 我应该为 User 类的唯一实例使用哪种模式?

我有这个用户类classUser{private$logged=false;private$id;publicfunctionUser(){//>Checkiftheuserisloggedinwithacookie-databaseandset$logged=true;}publicfunctionisLogged(){}publicfunctioneditPerms(){}//>othermethods}现在考虑到我不能有超过1个用户登录(当然因为我们正在谈论单个http请求)我应该在哪里存储我的istance的引用?在这种情况下,单例会很有用,但现在每个人都说单例是邪恶的(比如静