예제 #1
0
     if (!isset($_GET['street']) || !$adminService->isStringR($_GET['street'])) {
         $errorFields[] = 'limitedStreet';
     }
     if (!isset($_GET['city']) || !$adminService->isStringR($_GET['city'])) {
         $errorFields[] = 'limitedCity';
     }
     if (!isset($_GET['state']) || !$adminService->isStringR($_GET['state']) || strlen($_GET['state']) > 2) {
         $errorFields[] = 'limitedState';
     }
     if (!isset($_GET['zip']) || !$adminService->isIntR($_GET['zip'])) {
         $errorFields[] = 'limitedZip';
     }
     if (count($errorFields)) {
         throw new Exception('validation');
     }
     $ajaxReturn['data'] = $adminService->createLimitedUser($_GET['name'], $_GET['email'], $_GET['street'], $_GET['city'], $_GET['state'], $_GET['zip']);
 } elseif ($_GET['function'] === 'createUser') {
     if (!isset($_GET['email']) || !$adminService->isEmailR($_GET['email'])) {
         $errorFields[] = 'newEmail';
         throw new Exception('validation');
     }
     $access = isset($_GET['admin']) ? 1 : 2;
     $ajaxReturn['data'] = $adminService->createUser($_GET['email'], $access);
 } elseif ($_GET['function'] === 'deactivateJob') {
     if (!isset($_GET['jobID']) || !$adminService->isIntR($_GET['jobID'])) {
         $errorFields[] = 'jobID';
         throw new Exception('validation');
     }
     $ajaxReturn['data'] = $adminService->deactivateJob($_GET['jobID']);
 } elseif ($_GET['function'] === 'deactivateUser') {
     if (!isset($_GET['userID']) || !$adminService->isIntR($_GET['userID'])) {