English 中文(简体)
Zend Front 已安装。 正在子文件夹中安装 wordpress 。 我如何将 Zend 用户认证转到 WP 页面?
原标题:Zend Framework installed. Wordpress being installed in sub-folder. How do I carry over Zend user authentication to WP pages?

我正在用安装 Zend 框架的工作建立一个网站。 Zend 控制用户认证( 登录、 登录、 身份、 等) 。

我想将 Wordpress 安装到子文件夹中, 在查看 Wordpress 创建的页面/ 日志时访问合适的用户数据( 用户名、 登录/ 退出状态等) 。

为此,我需要采取什么步骤?

注意: 在我之前安装和使用 Zend 的程序员, 我熟悉Zend, 但不太熟悉细节, 所以您可能需要用更多外行语言来解释。 我经常使用Wordpress, 并且非常了解它 。

问题回答

Wordpress 的某处( 您可能知道您熟悉 Wordpress 的地方), 您会使用以下 Zend 框架代码 :

$auth = Zend_Auth::getInstance();
if ($auth->hasIdentity()) {
  // Identity exists; get it
  $identity = $auth->getIdentity();
}

上述代码正在检查会话名称空间, 并确定身份是否已经存储。 如果存在身份, 某人已经认证, 您可以检索授权身份 。

上述代码假设您可以从 wordpress( 自动装入, 包括_ path 等) 装入 Zend_ 命名空间前缀的类 。





相关问题
ajax login using httpRequest?

I am trying to develop my login script to give feedback to the user if the login is valid or not. Basically if it isn t correct a div box will show saying its wrong, if its correct it will show its ...

Remotely authenticating client Windows user on demand

Suppose I am writing a server for a particular network protocol. If I know that the client is running on a Windows machine, is it possible for my server to authenticate the Windows user that owns the ...

Role/Permission based forms authorizing/authentication?

While looking into forms authorizing/authentication, I found that it is possible to do role based authorizing by adding an array of roles to a FormsAuthenticationTicket. That way I can write User....

热门标签