Beispiel #1
0
 function add_privilege($id, $uri)
 {
     $data = array('role_id' => $id, 'uri' => $uri);
     parent::before_save($data);
     $this->_db()->insert('privilege_role', $data);
     $this->cache->context_delete($this->CACHE_KEY_PRIVILEGE);
 }
Beispiel #2
0
 function save($data, $id)
 {
     parent::save($data, $id);
     $this->cache->context_delete($this->_model()->CACHE_KEY);
 }
Beispiel #3
0
 function before_save(&$data, $id = null)
 {
     parent::before_save($data, $id);
     if (empty($data['password'])) {
         unset($data['password']);
     } else {
         $data['password'] = md5($data['password']);
     }
 }