Exemplo n.º 1
0
 /**
  * Delete user
  *
  * @access	private
  * @param   array 	$_post _POST array
  * @return  void
  */
 private function deleting($_post)
 {
     $msg = null;
     // check permission
     $msg = AdmUtils_helper::chk_priv_level($_SESSION['xuid'], 'users', $_post['id'], 4);
     if (is_null($msg)) {
         // do action
         $mod = new User_model();
         $result = $mod->delete($_post['id']);
         // set message
         $msg = AdmUtils_helper::set_msg($result);
         // clear useless permissions
         if ($result[1]) {
             $perm = new Permission_model();
             // clean permission on user
             $perm->deleting_by_what('users', $_post['id']);
             // clean user permissions
             $perm->deleting_by_user($_post['id']);
             // set what update
             $msg->update[] = array('element' => 'tdown', 'url' => BASE_URL . 'users', 'title' => null);
         }
     }
     $this->response($msg);
 }