Пример #1
0
 function getUserInfo($live = false)
 {
     $settings = $this->getSettings();
     if ($live && empty($settings['api-key'])) {
         delete_option($this->_option_cachedUserResults);
         return new WP_Error(-1, __('You must set an API key.'));
     }
     $userAccountAccess = new EcordiaUserAccount($settings['api-key'], $settings['use-ssl'], $live);
     if ($live) {
         $userAccountAccess->UserAccountStatus();
         if ($userAccountAccess->hasError()) {
             return new WP_Error($userAccountAccess->getErrorType(), $userAccountAccess->getErrorMessage() . $userAccountAccess->client->response . '<br /> ' . $userAccountAccess->client->request, $userAccountAccess);
         }
     } elseif (!$userAccountAccess->has_results()) {
         return new WP_Error(-100, __('Fetching Information...'));
     }
     return $userAccountAccess;
 }