mountPoint: this.mountPoint,
backend: this.backend,
authMechanism: this.authMechanism,
- backendOptions: this.backendOptions
+ backendOptions: this.backendOptions,
+ origin: 'settings'
};
if (this.id) {
data.id = this.id;
$.ajax({
type: 'GET',
url: OC.generateUrl(this._url + '/{id}', {id: this.id}),
+ data: {'origin': 'settings'},
success: options.success,
error: options.error
});
$.ajax({
type: 'GET',
url: OC.generateUrl('apps/files_external/userglobalstorages'),
+ data: {'origin' : 'settings'},
contentType: 'application/json',
success: function(result) {
var onCompletion = jQuery.Deferred();
defObj = $.ajax({
type: 'GET',
url: OC.webroot + '/index.php/apps/files_external/' + ((mountData.type === 'personal') ? 'userstorages' : 'userglobalstorages') + '/' + mountData.id,
+ data: {'origin' : 'statusmanager'},
success: function (response) {
if (response && response.status === 0) {
self.mountStatus[mountData.mount_point] = response;
$mountOptions,
$applicableUsers,
$applicableGroups,
- $priority
+ $priority,
+ $origin = null
) {
$storage = $this->createStorage(
$mountPoint,
);
}
- $this->updateStorageStatus($storage);
+ $this->updateStorageStatus($storage, $origin);
return new DataResponse(
$storage,
*
* @param StorageConfig $storage storage configuration
*/
- protected function updateStorageStatus(StorageConfig &$storage) {
+ protected function updateStorageStatus(StorageConfig &$storage, $origin = null) {
try {
$this->manipulateStorageConfig($storage);
\OC_Mount_Config::getBackendStatus(
$backend->getStorageClass(),
$storage->getBackendOptions(),
- false
+ false,
+ $origin
)
);
} catch (InsufficientDataForMeaningfulAnswerException $e) {
*
* @return DataResponse
*/
- public function show($id) {
+ public function show($id, $origin = null) {
try {
$storage = $this->service->getStorage($id);
- $this->updateStorageStatus($storage);
+ $this->updateStorageStatus($storage, $origin);
} catch (NotFoundException $e) {
return new DataResponse(
[
*
* @NoAdminRequired
*/
- public function show($id) {
+ public function show($id, $origin = null) {
try {
$storage = $this->service->getStorage($id);
- $this->updateStorageStatus($storage);
+ $this->updateStorageStatus($storage, $origin);
} catch (NotFoundException $e) {
return new DataResponse(
[
*/
public function update(
$id,
- $backendOptions
+ $backendOptions,
+ $origin = null
) {
try {
$storage = $this->service->getStorage($id);
*
* {@inheritdoc}
*/
- public function show($id) {
- return parent::show($id);
+ public function show($id, $origin = null) {
+ return parent::show($id, $origin);
}
/**
$backend,
$authMechanism,
$backendOptions,
- $mountOptions
+ $mountOptions,
+ $origin = null
) {
$storage = $this->createStorage(
$mountPoint,
);
}
- $this->updateStorageStatus($storage);
+ $this->updateStorageStatus($storage, $origin);
return new DataResponse(
$storage,
* @return int see self::STATUS_*
* @throws Exception
*/
- public static function getBackendStatus($class, $options, $isPersonal) {
+ public static function getBackendStatus($class, $options, $isPersonal, $origin = null) {
if (self::$skipTest) {
return StorageNotAvailableException::STATUS_SUCCESS;
}
$storage = new $class($options);
try {
- $result = $storage->test($isPersonal);
+ $result = $storage->test($isPersonal, $origin);
$storage->setAvailability($result);
if ($result) {
return StorageNotAvailableException::STATUS_SUCCESS;