示例#1
0
 /**
  * Регистрация. Заполнение обязательных полей.
  * 
  * @param  array $aParams массив входящих данных
  * @return array $aResult ответ
  */
 protected function x____users_signup_required($aParams = array())
 {
     $this->_validDevice($aParams);
     require_once ABS_PATH . '/classes/registration.php';
     $registration = new registration();
     if (!$registration->actionSaveInfoMobile($aParams)) {
         if (!empty($registration->error['uname'])) {
             switch ($registration->errno['uname']) {
                 case 1:
                     $this->error(EXTERNAL_ERR_EMPTY_FIRSTNAME);
                     break;
                 case 2:
                     $this->error(EXTERNAL_ERR_INVALID_FIRSTNAME);
                     break;
             }
         }
         if (!empty($registration->error['usurname'])) {
             switch ($registration->errno['usurname']) {
                 case 1:
                     $this->error(EXTERNAL_ERR_EMPTY_LASTNAME);
                     break;
                 case 2:
                     $this->error(EXTERNAL_ERR_INVALID_LASTNAME);
                     break;
             }
         }
         if (!empty($registration->error['birthday'])) {
             switch ($registration->errno['birthday']) {
                 case 1:
                     $this->error(EXTERNAL_ERR_EMPTY_BIRTHDAY);
                     break;
                 case 2:
                     $this->error(EXTERNAL_ERR_INVALID_BIRTHDAY);
                     break;
             }
         }
         if (!empty($registration->error['country'])) {
             $this->error(EXTERNAL_ERR_EMPTY_COUNTRY);
         }
         if (!empty($registration->error['city'])) {
             $this->error(EXTERNAL_ERR_EMPTY_CITY);
         }
         if (!empty($registration->error['spec'])) {
             switch ($registration->errno['spec']) {
                 case 1:
                     $this->error(EXTERNAL_ERR_EMPTY_PROF_ID);
                     break;
                 case 2:
                     $this->error(EXTERNAL_ERR_PROF_ID_LAST_MOD);
                     break;
             }
         }
         $this->error(EXTERNAL_ERR_SERVER_ERROR);
     }
     return array();
 }