Example #1
0
     } catch (Exception $e) {
         $serviceResponse->ErrorServerError('Unable to create SOAP Server');
     }
     break;
 case 'oauth':
     Debug::LogEntry('audit', 'OAuth Webservice call');
     Kit::ClassLoader('ServiceOAuth');
     $oauth = new ServiceOAuth();
     if (method_exists($oauth, $method)) {
         $oauth->{$method}();
     } else {
         $serviceResponse->ErrorServerError('Unknown Request.');
     }
     break;
 case 'rest':
     $serviceResponse->StartTransaction();
     // OAuth authorization.
     if (OAuthRequestVerifier::requestIsSigned()) {
         try {
             $request = new OAuthRequestVerifier();
             $userID = $request->verify();
             if ($userID) {
                 // Create the login control system.
                 $userClass = Config::GetSetting('userModule');
                 $userClass = explode('.', $userClass);
                 Kit::ClassLoader($userClass[0]);
                 // Create a user.
                 $user = new User($db);
                 // Log this user in.
                 if (!$user->LoginServices($userID)) {
                     $serviceResponse->ErrorServerError('Unknown User.');