Exemplo n.º 1
0
 public function delete()
 {
     if (file_exists(self::$example_file)) {
         unlink(self::$example_file);
     }
     return data::success(array('file' => false));
 }
Exemplo n.º 2
0
 public function delete($args)
 {
     $users_id = get($args, 'users_id');
     if ($users_id) {
         if ($user = DBTable::get('users')->loadRow($users_id)) {
             DBTable::deleteRow($user);
             return data::success($user->export());
         }
         return data::error('invalid user id');
     }
     return data::error('user id required');
 }
Exemplo n.º 3
0
 public function logout($args)
 {
     extract(extractable(array('users_id', 'key'), $args));
     $users_id = intval($users_id);
     if ($users_id) {
         if ($session = DBTable::get('session')->loadRowsWhere(array('key' => $key))) {
             $session = $session[0];
             $session->logged_in = 0;
             $session->save();
             return data::success($session->export());
         }
         return data::error('unable to locate session');
     }
     return data::error('user_id required');
 }