Example #1
0
                 break;
         }
     }
     break;
 case "groupList":
     // this for adding groups, removeing groups or changeging group name
     if ($request_obj->account_priv == "Admin") {
         switch ($request_obj->action) {
             case "DELETE":
                 deleteGroup($request_obj);
                 break;
             case "POST":
                 createNewGroup($request_obj);
                 break;
             case "PUT":
                 changeGroupName($request_obj);
                 break;
         }
     }
     break;
 case "memberList":
     // this is for adding people to members or changing their rank
     switch ($request_obj->action) {
         case "POST":
             if ($request_obj->account_priv == "Admin" or $request_obj->account_priv == "Officer") {
                 createNewAccount($request_obj);
             }
             break;
         case "PUT":
             if ($request_obj->account_priv == "Admin") {
                 changeMemberRank($request_obj);
Example #2
0
         echo json_encode(['success' => true, 'number' => $number]);
     } else {
         echo json_encode(['error' => 'No name or correct phone number supplied!', 'code' => 400]);
     }
     break;
     /**
      *		Update the name of a group
      */
 /**
  *		Update the name of a group
  */
 case 'changeGroupName':
     requireAuth();
     // We need the exact ID: this means no 003106 (only 316...)
     if (isset($_GET['gid']) && is_numeric($_GET['gid']) && isset($_GET['name'])) {
         $result = changeGroupName($_GET['gid'], $_GET['name'], true);
         echo json_encode($result);
     } else {
         echo json_encode(['error' => 'No Gid or name provided!', 'code' => 400]);
     }
     break;
     /**
      *		Update whatsspy config.
      */
 /**
  *		Update whatsspy config.
  */
 case 'updateConfig':
     requireAuth();
     $account_show_timeline_length = is_numeric($_GET['account_show_timeline_length']) ? $_GET['account_show_timeline_length'] : 14;
     $account_show_timeline_tracker = $_GET['account_show_timeline_tracker'] == 'true' ? true : false;