* Response::result(array('status' => true, 'data' => $dataporten->SOME_FUNCTION($iD))); * }, 'DESCRIPTION OF ROUTE'); */ /** * Run account checkups with TechSmith Relay */ $router->map('POST', '/users/verify/', function () { global $relay; Response::result($relay->verifyAccountList($_POST)); }, 'Verify array of usernames/emails.'); /** * Migrate user accounts (old login -> new login) */ $router->map('POST', '/users/migrate/', function () { global $relay; Response::result($relay->migrateUserAccounts($_POST)); }, 'Migrate supplied user accounts from old user/email to new.'); // -------------------- UTILS -------------------- // // Restrict access to specified org function verifyOrgAccess() { global $feide; if (!$feide->isUserSuperAdmin()) { Response::error(401, $_SERVER["SERVER_PROTOCOL"] . ' 401 Unauthorized (USER is missing required access rights). '); } if (!$feide->hasAdminScope()) { Response::error(401, $_SERVER["SERVER_PROTOCOL"] . ' 401 Unauthorized (CLIENT is missing required scope). '); } } /** * http://stackoverflow.com/questions/4861053/php-sanitize-values-of-a-array/4861211#4861211
}, 'Org subfolders in Shared Meetings folder'); /** * CREATE rooms from POSTED data (CSV, prefix and folder) */ $router->map('POST', '/rooms/create/', function () { verifyOrgAccess($_POST['user_org_shortname']); global $connect; Response::result($connect->createRooms($_POST)); }); /** * CREATE users from POSTED data */ $router->map('POST', '/users/create/', function () { verifyOrgAccess($_POST['user_org_shortname']); global $connect; Response::result($connect->createUsers($_POST)); }); // -------------------- UTILS -------------------- // // Make sure requested org name is the same as logged in user's org function verifyOrgAccess($orgName) { global $dataporten; if (strcasecmp($orgName, $dataporten->getUserOrg()) !== 0) { Response::error(401, $_SERVER["SERVER_PROTOCOL"] . ' 401 Unauthorized (request mismatch org/user). '); } } /** * * * http://stackoverflow.com/questions/4861053/php-sanitize-values-of-a-array/4861211#4861211 */
private function _checkCORS() { // Access-Control headers are received during OPTIONS requests if ($_SERVER['REQUEST_METHOD'] == 'OPTIONS') { Response::result('CORS OK :-)'); } }
Response::result(array('status' => true, 'data' => $connect->SOME_FUNCTION($iD))); }, 'DESCRIPTION OF ROUTE'); */ /** * Run account checkups with Adobe Connect */ $router->map('POST', '/users/verify/', function () { global $connect; Response::result($connect->verifyAccountList($_POST)); }, 'Verify array of usernames [[oldLogin, newLogin], [...,...], ...] '); /** * Migrate user accounts (old login -> new login) */ $router->map('POST', '/users/migrate/', function () { global $connect; Response::result($connect->migrateUserAccounts($_POST)); }, 'Migrate supplied user accounts from current_login to new_login.'); // -------------------- UTILS -------------------- // // Restrict access to specified org function verifyOrgAccess() { global $feide; if (!$feide->isUserSuperAdmin()) { Response::error(401, $_SERVER["SERVER_PROTOCOL"] . ' 401 Unauthorized (USER is missing required access rights). '); } if (!$feide->hasAdminScope()) { Response::error(401, $_SERVER["SERVER_PROTOCOL"] . ' 401 Unauthorized (CLIENT is missing required scope). '); } } /** * http://stackoverflow.com/questions/4861053/php-sanitize-values-of-a-array/4861211#4861211