Beispiel #1
0
 public static function decline($id_user)
 {
     $u = User::get_user_logged_id();
     $a = new UserObject();
     if ($u != null) {
         if ($a->load($id_user)) {
             if (!FriendshipObject::isFriend($u, $id_user) && sizeof($req = FriendshipObject::loadAllPendingRequests($id_user, $u)) > 0) {
                 $friendship = new FriendshipObject();
                 $friendship->load($id_user, $u);
                 $friendship->delete();
             }
             header("location: " . Page::url("/profile/{$id_user}"));
             return;
         }
         header("location: " . Page::url("/profile"));
         return;
     }
     header("location: " . Page::url("/"));
     return;
 }