Ejemplo n.º 1
0
         $errorFields[] = 'location';
     }
     if (!isset($_GET['job']) || !$adminService->isStringR($_GET['job'])) {
         $errorFields[] = 'job';
     }
     if (!isset($_GET['account']) || !$adminService->isStringR($_GET['account'])) {
         $errorFields[] = 'account';
     }
     if (!isset($_GET['rate']) || !$adminService->isNumberR($_GET['rate'])) {
         $errorFields[] = 'rate';
     }
     $flat = isset($_GET['flat']) ? 1 : 0;
     if (count($errorFields)) {
         throw new Exception('validation');
     }
     $ajaxReturn['data'] = $adminService->createJob($_GET['location'], $_GET['job'], $_GET['account'], $_GET['rate'], $flat);
 } elseif ($_GET['function'] === 'createLimitedUser') {
     if (!isset($_GET['name']) || !$adminService->isStringR($_GET['name'])) {
         $errorFields[] = 'limitedName';
     }
     if (!isset($_GET['email']) || !$adminService->isEmail($_GET['email'])) {
         $errorFields[] = 'limitedEmail';
     }
     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';