Online PHP editor is going to be changed...

We are going to:

  1. Redesign the site
  2. Work with SSH instead of FTP
  3. Switch to HTTPS
  4. Work without "session" to improve security
  5. And, of course, remain open source

Please consider...

  1. Checking our new PHP blog
  2. Visit the new Facebook page


I'm using SSH and I will continue using online-php.com

<? Online-PHP::Tutorials ?>

« Back

  • ZF: Create basic ACL object

    The definition of the ACL can be based on some resources like the URL, or the modules, but in my vase it'is based on the controllers and the actions. This is the most convenient way for me to use it. So here is the class (which is defined under the file name 'Acl.php', and it's located in the 'application/models'  directory)

    
    class Application_Model_Acl extends Zend_Acl
    {
    
    	public function __construct() {
    
    		$this->addRole(new Zend_Acl_Role('guest'))
    			->addRole(new Zend_Acl_Role('developer'), 'guest')
    			->addRole(new Zend_Acl_Role('qa'), 'developer');
    
    		$this->add(new Zend_Acl_Resource('index'))
    			->add(new Zend_Acl_Resource('auth'))
    			->add(new Zend_Acl_Resource('projects'))
    			->add(new Zend_Acl_Resource('issues'))
    			->add(new Zend_Acl_Resource('comments'));
    
    		// guest
    		$this->allow('guest');
    		$this->deny('guest', null, array('create', 'update', 'delete'));
    
    		// developer
    		$this->allow('developer');
    		$this->deny('developer', null, array('update', 'delete'));
    
    		// qa - allow all
    		$this->allow('qa');
    
    	}
    
    }