问题标签 [zfcuser]

For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Note JavaScript is NOT the same as Java! Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.

0 投票
1 回答
891 浏览

authentication - zf2 - zfcuser 仅检查某些模块的身份验证

我是 zf2 的新手。zfcuser 按照安装指南进行设置。我能够注册,登录和注销。

我已经为前端和后端创建了模块。我试图检查用户是否登录后端 - 管理员和所有子模块。

我试图包括

在我的 admin/module.php 函数 onBootStrap

它确实检查了登录,但不仅针对管理员,还针对包括前端在内的整个模块。

我只需要检查管理模块的登录,以及管理的所有子模块。

无法弄清楚如何。请帮忙

0 投票
1 回答
1152 浏览

doctrine-orm - 用户在 zf2 项目中的学说实体中的 PrePersist 上引用创建的集合

在我的 zf2 项目中,我有学说 2 个实体,它们引用由以下创建的用户实体:

我想在 中设置这个引用,PrePersist我该怎么做?我尝试了以下(我不知道它是否正确):

但主要问题是它$userId是一个整数,并且createdBy必须保存用户的引用而不是用户ID。

有更好的方法吗?如果没有,我怎样才能得到参考而不是用户 ID?

0 投票
1 回答
155 浏览

zend-framework2 - 检查代码中的登录数据

我正在为我的网站编写 API。对于身份验证。我使用 ZfcUser。是否可以检查登录数据?就像我的 API 一样,获取每个帖子用户名/电子邮件和密码。现在我想检查用户名/电子邮件和密码是否正确。我也想在代码中创建一个用户。但我的问题是 ZfcUser 中的相同密码具有不同的哈希值。我知道 ZfcUser 使用 Bycrypt,但我不知道成本如何。在 ZfcUser 我发现这一行:

ZfcUser:https ://github.com/ZF-Commons/ZfcUser

制造 ternes3

0 投票
1 回答
272 浏览

php - 如何在 ZF2 中手动销毁 zfcuser 会话变量?

有谁知道如何销毁 Zfcuser 会话变量?

如果发生某些事件,我想结束会话吗?

我检查了 wiki,唯一的讨论是关于设置自动超时。我想手动销毁会话。

0 投票
1 回答
1075 浏览

zend-framework2 - ZF2 ZfcUser 强制登录

我有一个安装了模块 ZfcUser 的 ZF2。

注册和登录表单工作正常。我制作了一个自定义模块来连接到 Linkedin 并获取用户的信息,然后在数据库中注册用户数据。

注册部分已经完成,但我面临的问题是我需要使用数据库中的数据登录用户(我有关于用户的所有信息,所以我知道应该登录哪个用户),但我可以找不到让 ZfcUser 使用 PHP 而不是登录表单登录特定用户的方法。

我不擅长适配器和\Zend\Authentication。我将不胜感激任何帮助或指示。

我试图查看 ZfcUser 控制器中的登录过程,但它让我感到困惑,而不是帮助我。

我也尝试在谷歌中寻找答案,但我没有找到关于该主题的任何内容。

如果可能的话,我希望“强制登录过程”位于 ZfcUser 模块之外。

在查看 ZfcUser 控制器几个小时后,我设法构建了一个方法来做我想做的事

0 投票
1 回答
294 浏览

zfcuser - ZfcUser - 用户注册后的闪烁消息

我正在尝试在用户注册后添加一些闪存消息

但是,在我被重定向到登录页面后,我没有看到任何消息。有人知道原因吗?

有显示消息的视图助手

在其他页面上闪烁消息工作正常。

谢谢!

0 投票
1 回答
471 浏览

zend-framework2 - ZfcUser authentication for an API

In the project I am currently working on, I have the following situation: there is a web application that is accessible for human users through a browser, where the user can manipulate data in a database (representing the state of household devices in a house) after he has logged in. The logging functionality is implemented with the ZfcUser module. Furthermore, the application is accessible for a computer (a raspberry pi that is installed in the house with the devices and is responsible for turning them on and off), which sees the state of the database and reacts accordingly.

The communication between the computer and the application is implemented using JSON and works fine. But right now, the computer does not send any user specific information (email, password...) so that the application functionality used by the raspberry can be accessed by any post request to the right URL. I would like to include the email and the password of the user into the JSON object sent by the computer, so that before executing a function, the web application checks whether the request is valid.

What I would like to know is whether there is a simple possibility to check whether the credentials (email and password, both represented as strings) are valid using ZfcUser (if I understand it correctly, the zfcUserAuthentification() methods can not be used for this task because they work with the cookies stored by the browser).

0 投票
1 回答
1496 浏览

php - 授予 bjyauthorize 从 CLI 运行 ZF2 的 mvc 应用程序的权限

我在 ZF2 上有一个完全运行的 mvc 应用程序。我想从命令行运行一些操作。我已经正确设置了我的控制台路由和其他环境。当我从 CLI 运行我的应用程序时,我得到了 Permission denied 异常,如下所示:

我的数据库中已经有一些用户。如何使用这些凭据授权 CLI 用户运行操作?

编辑

以下是 bjyauthorize.global.php 中提到的控制器的警卫数组。

我也使用过 ZfcUser 。如何从 CLI 传递用户登录凭据。或者,如果有任何方法可以从 cli 使用用户会话。

谢谢

0 投票
1 回答
400 浏览

forms - zfcUser 两个注册表单?

我正在使用 zfcUser 进行注册和身份验证,我有一些问题。用户可以通过 2 种类型的配置文件进行注册,并且形式不同,所以问题是,在 zfcUser 中使用少量注册表单的最佳实践是什么,在一个页面上,使用选项卡。

0 投票
3 回答
2659 浏览

php - 无法重新生成会话 id zend 框架 2?

我将 ZFcuser 模块用于我的管理面板。当我登录到管理面板时,它会返回如下错误:

警告:session_regenerate_id():无法重新生成会话 id - 标头已在第 260 行的 /home/public_html/dev/vendor/zendframework/zendframework/library/Zend/Session/SessionManager.php 中发送

这在我的本地 Windows 系统中运行良好,但在我的 linux 托管服务器中运行时会返回这样的警告。

需要帮助来解决这个问题。提前致谢。