예제 #1
0
 /**
  * Validates the user and throws a validation error if there are any errors.
  * @throws ValidationException if there are any validation errors
  * @access private
  */
 private function ValidateUser()
 {
     if ($this->GetOAuthInfo() != NULL) {
         parent::ValidateOAuthInfo();
     } else {
         if ($this->GetOAuth2Info() != NULL) {
             parent::ValidateOAuth2Info();
         } else {
             if ($this->GetAuthToken() == NULL) {
                 if (!isset($this->email)) {
                     throw new ValidationException('email', NULL, 'email is required and cannot be NULL.');
                 }
                 if (!isset($this->password)) {
                     throw new ValidationException('password', NULL, 'password is required and cannot be NULL.');
                 }
                 // Generate an authToken.
                 $this->RegenerateAuthToken();
             }
         }
     }
     if ($this->GetApplicationName() == NULL) {
         throw new ValidationException('applicationName', NULL, 'applicationName is required and cannot be NULL.');
     }
 }
 /**
  * Validates the user and throws a validation error if there are any errors.
  * @throws ValidationException if there are any validation errors
  */
 public function ValidateUser()
 {
     if ($this->GetOAuthInfo() != NULL) {
         parent::ValidateOAuthInfo();
     } else {
         if ($this->GetAuthToken() == NULL) {
             if (!isset($this->email)) {
                 throw new ValidationException('email', NULL, 'email is required and cannot be NULL.');
             }
             if (!isset($this->password)) {
                 throw new ValidationException('password', NULL, 'password is required and cannot be NULL.');
             }
             // Generate an authToken.
             $this->RegenerateAuthToken();
         }
     }
     if ($this->GetUserAgent() == NULL) {
         throw new ValidationException('userAgent', NULL, 'userAgent is required and cannot be NULL.');
     }
     if ($this->GetDeveloperToken() == NULL) {
         throw new ValidationException('developerToken', NULL, 'developerToken is required and cannot be NULL.');
     }
 }