Changeset 155
- Timestamp:
- 11/11/08 20:13:16 (1 year ago)
- Files:
-
- trunk/modules/auth/controllers/admin/acl_permissions.php (modified) (3 diffs)
- trunk/user_guide/general/changelog.html (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/modules/auth/controllers/admin/acl_permissions.php
r154 r155 119 119 function save() 120 120 { 121 $aro = $this->input->post('aro'); 121 // Get values from form 122 $id = $this->input->post('id'); 123 $allow = $this->input->post('allow'); 124 125 // INFO: This is a bit of a dirty fix for bug #20 there must be a better way 126 if($id != NULL) 127 { 128 // Form has been submited, so we need to fetch the 129 // aro and aco values from the database 130 $result = $this->access_control_model->getPermissions(NULL,array('acl.id'=>$id)); 131 $row = $result[$id]; 132 133 $_POST['aro'] = $row['aro']; 134 $_POST['aco'] = $row['aco']; 135 } 136 137 $aro = $this->input->post('aro'); 122 138 $aco = $this->input->post('aco'); 123 $allow = $this->input->post('allow');124 $id = $this->input->post('id');125 139 126 140 $this->load->library('khacl'); … … 128 142 $this->db->trans_start(); 129 143 130 // Remove old actions 131 if($id != '')144 // Remove old actions if modifying 145 if($id != NULL) 132 146 $this->access_control_model->delete('access_actions',array('access_id'=>$id)); 133 147 134 // Create permission135 148 // First we will process the actions 136 149 foreach($_POST as $key=>$value) … … 147 160 148 161 // Now process the main permission 149 switch($allow) 150 { 151 case 'Y':$this->khacl->allow($aro,$aco);break; 152 case 'N':$this->khacl->deny($aro,$aco);break; 162 if($id == NULL) 163 { 164 switch($allow) 165 { 166 case 'Y':$this->khacl->allow($aro,$aco);break; 167 case 'N':$this->khacl->deny($aro,$aco);break; 168 } 153 169 } 154 170 trunk/user_guide/general/changelog.html
r152 r155 69 69 <h3>Bug Fixes</h3> 70 70 <ul> 71 <li>Fixed bug where when modifying a permission, instead of saving it, it created a new permission, See <a href="http://trac2.assembla.com/backendpro/ticket/20">Bug #20</a></li> 71 72 <li>Fixed bug where status messages would get repeated if an ajax controller method was called, See <a href="http://trac2.assembla.com/backendpro/ticket/4">Bug #4</a></li> 72 73 <li>Fixed bug where if no user profile fields are created but the user profiles are turned on, it would error saying "Must you set method" when trying to save a edited user account, See <a href="http://trac2.assembla.com/backendpro/ticket/51">Bug #51</a></li>