public function json_RejectInvitationToGroup() { $data = json_decode(file_get_contents('php://input'), true); $data['username'] = user_decrypt($data['username']); $check = $this->checkInput($data, array('username', 'gid')); if ($check == '') { if ($this->memberCheck($data['username'], $data['gid'])) { if (rejectGroup($data['gid'], $data['username'])) { $return['error'] = 0; $return['value'] = "Successfully rejected group and society. I hate everyone"; } else { $return['error'] = -2; $return['value'] = "User doesn't exist"; } } else { $return['error'] = -1; $return['value'] = "How did you get this invite? Tell me now before I cut you"; } } else { $return['error'] = -3; $return['value'] = $check; } $jsonstring = json_encode($return); echo $jsonstring; }
} updateEvent(5, 'Lunch 3', null, null, null); displayAllEvents($user, 'unsw'); //$results = getEvents($user,'unsw'); $results = getEventsForAMonth($user, 'unsw', 10, 2014); //print_r($results); print "--------------- Calendars of {$user} ---------------\n"; printTable(getCalendars($user)); print_r($results); print "--------------- All groups {$user} belongs to ---------------\n"; printTable(memberOf($user)); foreach (memberOf($user) as $group) { if ($group['name'] == 'KKK') { $kkk = $group['gid']; } } print "---------------------- Members of KKK ---------------\n"; printTable(getGroupMembers($kkk)); print "---------------------- All KKK member events ---------------\n"; //printTable(getGroupMemberEvents(1)); print_r(getGroupMemberEvents($kkk)); rejectGroup(5, $user); acceptGroup(5, $user); //function updateEvent($eid,$ename,$estart,$eend){ print_r(getGroupMemberEventsForAMonth($kkk, 12, 2014)); //removeCalendar($user,'unsw'); /* require_once '../controllers/scraper.php'; $ss = new Scraper(); $ss->unsw(); tokenAccess($user);*/