예제 #1
0
                    $response = "success";
                } else {
                    $response = "Error";
                }
            } else {
                if (isset($_GET['clubid'])) {
                    if (ClubUser::userExists($session->user_id, $_GET['clubid'])) {
                        $object = ClubUser::getUser($session->user_id, $_GET['clubid']);
                        $object->update();
                        $response = "success";
                    } else {
                        $response = "Error";
                    }
                } else {
                    if (isset($_GET['groupid'])) {
                        if (GroupUser::userExists($session->user_id, $_GET['groupid'])) {
                            $object = GroupUser::getUser($session->user_id, $_GET['groupid']);
                            $object->update();
                            $response = "success";
                        } else {
                            $response = "Error";
                        }
                    }
                }
            }
        }
    }
    $log = new Log($session->user_id, $clientip, "WEB", "JOINED");
    $log->create();
} else {
    $response = "error";
예제 #2
0
파일: invite.php 프로젝트: NemOry/Skoolyf
         $notification->itemid = $object->id;
         $notification->itemtype = "clubuser";
         $notification->title = "Invites you";
         $notification->create();
         $response = "success";
     } else {
         $theuser = ClubUser::getUser($user->id, $_GET['clubid']);
         if ($theuser->pending == 0) {
             $response = "This user is already a member.";
         } else {
             $response = "This user is already pending.";
         }
     }
 } else {
     if (isset($_GET['groupid'])) {
         if (!GroupUser::userExists($user->id, $_GET['groupid'])) {
             $group = Group::get_by_id($_GET['groupid']);
             $object = new GroupUser();
             $object->userid = $user->id;
             $object->groupid = $group->id;
             $object->level = 0;
             $object->role = "student";
             $object->enabled = 1;
             $object->pending = 1;
             $object->create();
             $notification = new Notification();
             $notification->fromuserid = $session->user_id;
             $notification->touserid = $user->id;
             $notification->itemid = $object->id;
             $notification->itemtype = "groupuser";
             $notification->title = "Invites you";
예제 #3
0
파일: optout.php 프로젝트: NemOry/Skoolyf
         $notification->fromuserid = $loggeduser->id;
         $notification->itemid = $object->id;
         $notification->itemtype = "message";
         $notification->title = "Opted Out";
         $admins = ClubUser::getAdmins($club->id);
         foreach ($admins as $admin) {
             $notification->touserid = $admin->userid;
             $notification->create();
         }
     } else {
         $response = "Error";
     }
 } else {
     if (isset($_GET['groupid'])) {
         $group = Group::get_by_id($_GET['groupid']);
         if (GroupUser::userExists($loggeduser->id, $_GET['groupid'])) {
             $object = GroupUser::getUser($loggeduser->id, $_GET['groupid']);
             $object->delete();
             $response = "success";
             $notification = new Notification();
             $notification->fromuserid = $loggeduser->id;
             $notification->itemid = $object->id;
             $notification->itemtype = "message";
             $notification->title = "Opted Out";
             $admins = GroupUser::getAdmins($group->id);
             foreach ($admins as $admin) {
                 $notification->touserid = $admin->userid;
                 $notification->create();
             }
         } else {
             $response = "Error";