English 中文(简体)
Zend Application with multilogin
原标题:Zend Application with Multiple login

我想对单一被搁置的申请作多个记录。

我有5个A、B、C、D、E和4类用户(P、Q、R、S),包括匿名用户。 本节有小节。 A、B、C节要求登录。 D节和E节可由所有类型的用户使用,但有一些行动可以由特定类型的用户采取。

P只能记录A,Q可以登录到B,R可以登录到C。

请建议我应使用哪些目录结构,我应如何使用多个标识。

增 编

问题回答

名录结构与准入权无关。 您的全部应用可以是单一控制器,能够发挥你们的作用和权利概念,但不会是单条码。

如果你不使用anna大麻的话(不问) 你们可以通过实施一个简单的概念来解决这一问题:

create an application module for each of your "sections" including a PublicController in each application which will be accessible by anyone later. then you should implement a front controller plugin which could look like the folloing

public function preDispatch()
{
    $identity = Zend_Auth::getInstance()->getIdentity();        
    $module = $this->getRequest()->getModuleName();
    $controller = $this->getRequest()->getControllerName();

    if($controller ==  public ) {

        return;
    }

    switch ($identity->role) {

        case  A :
            if ($module !=  P ) {
                $this->myNotAuthorized();
            }
            break;

        // cases for other roles/modules
    }
}

You are likely looking for a Role based Access Control List.
Zend Framework offers this through Zend_Acl.

另见:

如果你不希望执行,你也可以这样做。

使用会议变量和核对模块接入。





相关问题
Brute-force/DoS prevention in PHP [closed]

I am trying to write a script to prevent brute-force login attempts in a website I m building. The logic goes something like this: User sends login information. Check if username and password is ...

please can anyone check this while loop and if condition

<?php $con=mysql_connect("localhost","mts","mts"); if(!con) { die( unable to connect . mysql_error()); } mysql_select_db("mts",$con); /* date_default_timezone_set ("Asia/Calcutta"); $date = ...

定值美元

如何确认来自正确来源的数字。

Generating a drop down list of timezones with PHP

Most sites need some way to show the dates on the site in the users preferred timezone. Below are two lists that I found and then one method using the built in PHP DateTime class in PHP 5. I need ...

Text as watermarking in PHP

I want to create text as a watermark for an image. the water mark should have the following properties front: Impact color: white opacity: 31% Font style: regular, bold Bevel and Emboss size: 30 ...

How does php cast boolean variables?

How does php cast boolean variables? I was trying to save a boolean value to an array: $result["Users"]["is_login"] = true; but when I use debug the is_login value is blank. and when I do ...

热门标签