Example #1
0
<?php

$url = OCA_mozilla_sync\Utils::getSyncUrl();
if ($url === false) {
    OCA_mozilla_sync\Utils::changeHttpStatus(404);
    exit;
}
$service = OCA_mozilla_sync\Utils::getServiceType();
$urlParser = new OCA_mozilla_sync\UrlParser($url);
if (!$urlParser->isValid()) {
    OCA_mozilla_sync\Utils::changeHttpStatus(404);
    exit;
}
OCA_mozilla_sync\Utils::generateMozillaTimestamp();
if ($service === 'userapi') {
    $userService = new OCA_mozilla_sync\UserService($urlParser);
    $userService->run();
} else {
    if ($service === 'storageapi') {
        $storageService = new OCA_mozilla_sync\StorageService($urlParser);
        $storageService->run();
    }
}
Example #2
0
 private function deleteUser()
 {
     $this->clearRequest();
     OCA_mozilla_sync\Utils::$requestMethod = 'DELETE';
     $_SERVER['PHP_AUTH_USER'] = $this->userHash;
     $_SERVER['PHP_AUTH_PW'] = $this->password;
     $urlParser = new OCA_mozilla_sync\UrlParser('/1.0/' . $this->userHash);
     $userService = new OCA_mozilla_sync\UserService($urlParser);
     $userService->run();
 }