<bdo id='bY0aZ'></bdo><ul id='bY0aZ'></ul>

<small id='bY0aZ'></small><noframes id='bY0aZ'>

  • <tfoot id='bY0aZ'></tfoot>
    <i id='bY0aZ'><tr id='bY0aZ'><dt id='bY0aZ'><q id='bY0aZ'><span id='bY0aZ'><b id='bY0aZ'><form id='bY0aZ'><ins id='bY0aZ'></ins><ul id='bY0aZ'></ul><sub id='bY0aZ'></sub></form><legend id='bY0aZ'></legend><bdo id='bY0aZ'><pre id='bY0aZ'><center id='bY0aZ'></center></pre></bdo></b><th id='bY0aZ'></th></span></q></dt></tr></i><div id='bY0aZ'><tfoot id='bY0aZ'></tfoot><dl id='bY0aZ'><fieldset id='bY0aZ'></fieldset></dl></div>

    1. <legend id='bY0aZ'><style id='bY0aZ'><dir id='bY0aZ'><q id='bY0aZ'></q></dir></style></legend>

      1. Zend_Auth 最佳实践

        Zend_Auth best practices(Zend_Auth 最佳实践)
            <bdo id='vhELE'></bdo><ul id='vhELE'></ul>

              <legend id='vhELE'><style id='vhELE'><dir id='vhELE'><q id='vhELE'></q></dir></style></legend>
              <tfoot id='vhELE'></tfoot>
              <i id='vhELE'><tr id='vhELE'><dt id='vhELE'><q id='vhELE'><span id='vhELE'><b id='vhELE'><form id='vhELE'><ins id='vhELE'></ins><ul id='vhELE'></ul><sub id='vhELE'></sub></form><legend id='vhELE'></legend><bdo id='vhELE'><pre id='vhELE'><center id='vhELE'></center></pre></bdo></b><th id='vhELE'></th></span></q></dt></tr></i><div id='vhELE'><tfoot id='vhELE'></tfoot><dl id='vhELE'><fieldset id='vhELE'></fieldset></dl></div>
                <tbody id='vhELE'></tbody>
            • <small id='vhELE'></small><noframes id='vhELE'>

                1. 本文介绍了Zend_Auth 最佳实践的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  我的目标是要求某些页面登录.我正在使用 Zend Framework MVC,并且正在尝试查找有关最佳实践的示例.

                  My goal is to require login for certain pages. I am using Zend Framework MVC, and I'm trying to find examples regarding best practices.

                  关于我正在寻找的内容的一些说明:

                  Some notes on what I'm looking for:

                  • 我希望未登录的用户获得一个登录框,然后在通过身份验证后返回到登录版本的页面
                  • 我想使用依赖注入,避免单例
                  • 代码占用空间小 - 与 Zend mvc 结构相结合
                  • 登录框应该是一个单独的控制器并进行标头重定向吗?认证成功后如何返回登陆页面?简单地调用登录控制器操作以在登录页面中显示登录框的想法,或者这是否是搜索引擎索引的缺点?
                  • 能够使用外部库来处理 cookie

                  或者完全不同的东西.我对 Zend 框架还很陌生,我想以正确的方式"来做.

                  Or something completely different. I'm fairly new to the Zend framework, and I want to do it 'the right way'.

                  推荐答案

                  • 我想让非登录用户得到一个登录框,然后返回到登录状态在页面的版本中,一次已认证

                  使用 FrontController 插件 并重定向或转发它们到您的登录操作.

                  Use a FrontController plugin and redirect or forward them to your loginAction.

                  • 我想使用依赖注入,避免单例

                  Zend 框架,目前不提供任何 DI 系统,但是 Zend_Application_Resource_* 实际上取代了它.这里需要什么样的依赖?

                  Zend Framework, doesn't currently ship any DI system, however, the Zend_Application_Resource_* actually replace it. What kind of dependency would you need here?

                  • 代码占用空间小 - 与 Zend mvc 结构相结合

                  这取决于你.

                  • 登录框应该是一个单独的控制器并进行标头重定向吗?如何认证后返回登陆页面成功?一个简单地调用的想法登录控制器操作以显示登陆页面中的登录框,或者这是搜索的缺点引擎索引?

                  我主要使用一个特殊的 AuthControllerLoginAction &注销操作.为了将用户重定向到试图查看的页面,我总是在我的表单中添加一个 returnUrl 元素,并注入请求的 URL 的值以便能够重定向用户,如果没有,我将他重定向到索引/仪表板,这取决于.

                  I mostly use a special AuthController with LoginAction & LogoutAction. To redirect the user to the page is was trying to view, I always add a returnUrl element in my forms, and I inject the value of the requested URL to be able to redirect the user, and if none, I redirect him to the index/dashboard, depends.

                  • 能够使用外部库来处理 cookie

                  Zend_Auth 允许您设置您的 自己的存储机制,所以只需要实现接口即可.

                  Zend_Auth allows you to set your own storage mechanism, so just implement the interface.

                  $auth = Zend_Auth::getInstance();
                  $auth->setStorage(new My_Auth_Storage());
                  

                  但是从不将身份验证结果存储在 cookie 中,修改它并访问您的网站非常容易.

                  But never store authentication result in a cookie, it's so easy to modify it and access your website.

                  您还可以查看我的一个之前的答案.

                  You may also take a look to one of my previous answer.

                  这篇关于Zend_Auth 最佳实践的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                  本站部分内容来源互联网,如果有图片或者内容侵犯了您的权益,请联系我们,我们会在确认后第一时间进行删除!

                  相关文档推荐

                  DeepL的翻译效果还是很强大的,如果我们要用php实现DeepL翻译调用,该怎么办呢?以下是代码示例,希望能够帮到需要的朋友。 在这里需要注意,这个DeepL的账户和api申请比较难,不支持中国大陆申请,需要拥有香港或者海外信用卡才行,没账号的话,目前某宝可以
                  PHP通过phpspreadsheet导入Excel日期,导入系统后,全部变为了4开头的几位数字,这是为什么呢?原因很简单,将Excel的时间设置问文本,我们就能看到该日期本来的数值,上图对应的数值为: 要怎么解决呢?进行数据转换就行,这里可以封装方法,或者用第三方的
                  mediatemple - can#39;t send email using codeigniter(mediatemple - 无法使用 codeigniter 发送电子邮件)
                  Laravel Gmail Configuration Error(Laravel Gmail 配置错误)
                  Problem with using PHPMailer for SMTP(将 PHPMailer 用于 SMTP 的问题)
                  Issue on how to setup SMTP using PHPMailer in GoDaddy server(关于如何在 GoDaddy 服务器中使用 PHPMailer 设置 SMTP 的问题)
                      <tbody id='utuGl'></tbody>
                    • <bdo id='utuGl'></bdo><ul id='utuGl'></ul>
                    • <legend id='utuGl'><style id='utuGl'><dir id='utuGl'><q id='utuGl'></q></dir></style></legend>

                        <i id='utuGl'><tr id='utuGl'><dt id='utuGl'><q id='utuGl'><span id='utuGl'><b id='utuGl'><form id='utuGl'><ins id='utuGl'></ins><ul id='utuGl'></ul><sub id='utuGl'></sub></form><legend id='utuGl'></legend><bdo id='utuGl'><pre id='utuGl'><center id='utuGl'></center></pre></bdo></b><th id='utuGl'></th></span></q></dt></tr></i><div id='utuGl'><tfoot id='utuGl'></tfoot><dl id='utuGl'><fieldset id='utuGl'></fieldset></dl></div>
                        1. <tfoot id='utuGl'></tfoot>

                            <small id='utuGl'></small><noframes id='utuGl'>