如何在 Zend 框架中创建管理员? [英] How to create admin in Zend framework?

查看:36
本文介绍了如何在 Zend 框架中创建管理员?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是一名 Zend 开发人员,我开发了一个没有管理面板的应用程序.现在我想为此开发一个管理面板,那么我如何从一开始就开发它?

I am a Zend developer and I have developed one application without an admin panel. Now I want to develop an admin panel for that, so how can I develop it from the start?

  1. 重定向到管理面板我需要写些什么,比如http://localhost/zend/public"?

如何添加管理控制器或模块?

How do I add an admin controller or module?

管理员的布局.

我应该将管理文件夹放在哪里,或者我在 Bootstrap 中需要更改哪些内容?

Where do I put an admin folder or what do I change in Bootstrap?

推荐答案

嗯,方法很多.这取决于您实际需要什么样的管理界面.

Well there are many ways. It depends on what sort of admin interface you actually need.

但通常:

1) 您应该有一个单独的管理界面模块.这意味着基于模块的 MVC 结构.

1) You should have a separate module for the admin interface. That implies module based MVC structure.

2) 您需要使用 Zend_Acl 来定义用户访问列表.IE.创建角色(例如:访客、用户、版主、管理员)并定义他们应该拥有或不应该访问哪些模块/控制器/操作.

2) You will want to use Zend_Acl to define user access list. I.e. create roles (for instance: guest, user, moderator, admin) and define what modules/controllers/actions they should have or should not have access to.

3) 使用 Zend_Auth 对用户进行身份验证.

3) Use Zend_Auth to authenticate users.

4) 可能通过使用 Zend_Session 和 Zend_Session_Namespace 的会话传播用户信息.

4) Probably propagate the user information through session using Zend_Session and Zend_Session_Namespace.

5) 至少做一些基本的安全措施(针对 SQL 注入和 $this->view->escape 针对 XSS 的准备语句,可能对所有形式使用 CSRF 令牌).如果是商业应用,获得证书.

5) Do at least basic security measures (prepared statements against SQL injections and $this->view->escape against XSS, possibly use CSRF token for all forms). If it is a commercial application, get a certificate.

这篇关于如何在 Zend 框架中创建管理员?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆