duanrong5927 2013-07-09 11:45
浏览 48
已采纳

如何通过直接在zend框架中输入url来限制学生和教师访问每个页面?

localhost.test/teacher/marklist - teacher is controller and marklist is view page.

A student logging in and typing the above url will display the page. How to prevent this?

  • 写回答

1条回答 默认 最新

  • doumaoao0182 2013-07-09 11:48
    关注

    There are many ways to prevent it but the suggested way in Zend is to use Zend_Acl and make roles: Student, Teacher and resources.

    You can read more about Zend Access Control List here.

    From Zend Page:

    Zend_Acl provides a lightweight and flexible access control list (ACL) implementation for privileges management. In general, an application may utilize such ACL's to control access to certain protected objects by other requesting objects.

    For the purposes of this documentation:

    • a resource is an object to which access is controlled.

    • a role is an object that may request access to a Resource

    So basicly you need to make:

    1. Autentication - simple login form and keeping data in session
    2. Authorization - Zend_Acl may be useful.
    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 如何用stata画出文献中常见的安慰剂检验图
  • ¥15 c语言链表结构体数据插入
  • ¥40 使用MATLAB解答线性代数问题
  • ¥15 COCOS的问题COCOS的问题
  • ¥15 FPGA-SRIO初始化失败
  • ¥15 MapReduce实现倒排索引失败
  • ¥15 ZABBIX6.0L连接数据库报错,如何解决?(操作系统-centos)
  • ¥15 找一位技术过硬的游戏pj程序员
  • ¥15 matlab生成电测深三层曲线模型代码
  • ¥50 随机森林与房贷信用风险模型