Assembla home | Assembla project page
 

Changeset 136

Show
Ignore:
Timestamp:
07/23/07 17:12:28 (1 year ago)
Author:
digitalspaghetti
Message:

Started implementing ACL & Auth

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • branch/app_controller.php

    r132 r136  
    4242        var $components = array('othAuth','Conf','RequestHandler','Session','Nav','Openid'); 
    4343        var $othAuthRestrictions = array('add','edit','delete',CAKE_ADMIN); 
    44          
     44        var $publicControllers = array('pages'); 
    4545        var $level = 0; 
    4646         
     
    5858                $level_check = $this->othAuth->group('level'); 
    5959        if (!empty($level_check)) $this->level = $level_check; 
     60                 
     61                /* Not replaced ACL Yet*/ 
     62                /* 
     63                if (isset($this->Auth)) { 
     64                $this->Auth->userScope = array('User.disabled' => 0); 
     65                    $this->Auth->loginAction = '/users/login'; 
     66                    $this->Auth->loginRedirect = '/users/account'; 
     67                    $this->Auth->fields = array('username' => 'username', 'password' => 'passwd'); 
     68                    $this->Auth->authorize = 'actions'; 
     69 
     70                    if (in_array(low($this->params['controller']), $this->publicControllers)) { 
     71                        $this->Auth->allow(); 
     72                        } 
     73            }*/ 
     74                 
    6075                 
    6176                $sitetheme = "default"; 
  • branch/models/group.php

    r55 r136  
    1010                'users_count' => VALID_NOT_EMPTY, 
    1111        ); 
     12         
     13        //var $actsAs = array('Acl'); 
    1214 
    1315        //The Associations below have been created with all possible keys, those that are not needed can be removed 
     
    2628        ); 
    2729 
    28         var $hasAndBelongsToMany = array( 
     30        /*var $hasAndBelongsToMany = array( 
    2931                        'Permission' => array('className' => 'Permission', 
    3032                                                'joinTable' => 'groups_permissions', 
     
    4042                                                'deleteQuery' => '', 
    4143                                                'insertQuery' => ''), 
    42         ); 
     44        );*/ 
     45         
     46        function parentNode(){ 
     47        if (!$this->id) { 
     48                return null; 
     49        } 
     50 
     51                $data = $this->read(); 
     52 
     53                if (!$data['Group']['parent_id']){ 
     54                        return null; 
     55                } else { 
     56                        return $data['Group']['parent_id']; 
     57                } 
     58        } 
    4359 
    4460} 
  • branch/models/user.php

    r133 r136  
    4949        ); 
    5050         
    51          
     51        function parentNode(){ 
     52        if (!$this->id) { 
     53                return null; 
     54        } 
     55 
     56                $data = $this->read(); 
     57 
     58                if (!$data['User']['group_id']){ 
     59                        return null; 
     60                } else { 
     61                        return array('model' => 'Group', 'foreign_key' => $data['User']['group_id']); 
     62                } 
     63        } 
    5264 
    5365}