Exemplo n.º 1
0
 public function post_delete()
 {
     if (!isset($_POST['id'])) {
         return $this->error('Missing parameter: id');
     }
     if (!isset($_POST['user'])) {
         return $this->error('Missing parameter: user');
     }
     $link = new \user\Link($_POST['id']);
     if ($link->error) {
         error_log($link->error);
         return $this->error('An unexpected error occurred.');
     }
     if (!$link->remove()) {
         error_log($link->error);
         return $this->error('An unexpected error occurred.');
     }
     return $this->get__default($_POST['user']);
     //return true;
 }
Exemplo n.º 2
0
 /**
  * Get all social links for the current user.
  * Alias of `user\Link::for_user ($user_id)`
  */
 public function links()
 {
     return user\Link::for_user($this->id);
 }