Rename variable
This commit is contained in:
parent
8526bbb347
commit
110edd3d3c
|
@ -300,7 +300,7 @@ StorageConfig.prototype = {
|
||||||
backend: this.backend,
|
backend: this.backend,
|
||||||
authMechanism: this.authMechanism,
|
authMechanism: this.authMechanism,
|
||||||
backendOptions: this.backendOptions,
|
backendOptions: this.backendOptions,
|
||||||
origin: 'settings'
|
testOnly: true
|
||||||
};
|
};
|
||||||
if (this.id) {
|
if (this.id) {
|
||||||
data.id = this.id;
|
data.id = this.id;
|
||||||
|
@ -327,7 +327,7 @@ StorageConfig.prototype = {
|
||||||
$.ajax({
|
$.ajax({
|
||||||
type: 'GET',
|
type: 'GET',
|
||||||
url: OC.generateUrl(this._url + '/{id}', {id: this.id}),
|
url: OC.generateUrl(this._url + '/{id}', {id: this.id}),
|
||||||
data: {'origin': 'settings'},
|
data: {'testOnly': true},
|
||||||
success: options.success,
|
success: options.success,
|
||||||
error: options.error
|
error: options.error
|
||||||
});
|
});
|
||||||
|
@ -910,7 +910,7 @@ MountConfigListView.prototype = _.extend({
|
||||||
$.ajax({
|
$.ajax({
|
||||||
type: 'GET',
|
type: 'GET',
|
||||||
url: OC.generateUrl('apps/files_external/userglobalstorages'),
|
url: OC.generateUrl('apps/files_external/userglobalstorages'),
|
||||||
data: {'origin' : 'settings'},
|
data: {'testOnly' : true},
|
||||||
contentType: 'application/json',
|
contentType: 'application/json',
|
||||||
success: function(result) {
|
success: function(result) {
|
||||||
var onCompletion = jQuery.Deferred();
|
var onCompletion = jQuery.Deferred();
|
||||||
|
|
|
@ -78,7 +78,7 @@ OCA.External.StatusManager = {
|
||||||
defObj = $.ajax({
|
defObj = $.ajax({
|
||||||
type: 'GET',
|
type: 'GET',
|
||||||
url: OC.webroot + '/index.php/apps/files_external/' + ((mountData.type === 'personal') ? 'userstorages' : 'userglobalstorages') + '/' + mountData.id,
|
url: OC.webroot + '/index.php/apps/files_external/' + ((mountData.type === 'personal') ? 'userstorages' : 'userglobalstorages') + '/' + mountData.id,
|
||||||
data: {'origin' : 'statusmanager'},
|
data: {'testOnly' : false},
|
||||||
success: function (response) {
|
success: function (response) {
|
||||||
if (response && response.status === 0) {
|
if (response && response.status === 0) {
|
||||||
self.mountStatus[mountData.mount_point] = response;
|
self.mountStatus[mountData.mount_point] = response;
|
||||||
|
|
|
@ -140,7 +140,7 @@ class GlobalStoragesController extends StoragesController {
|
||||||
$applicableUsers,
|
$applicableUsers,
|
||||||
$applicableGroups,
|
$applicableGroups,
|
||||||
$priority,
|
$priority,
|
||||||
$origin = null
|
$testOnly = null
|
||||||
) {
|
) {
|
||||||
$storage = $this->createStorage(
|
$storage = $this->createStorage(
|
||||||
$mountPoint,
|
$mountPoint,
|
||||||
|
@ -173,7 +173,7 @@ class GlobalStoragesController extends StoragesController {
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
$this->updateStorageStatus($storage, $origin);
|
$this->updateStorageStatus($storage, $testOnly);
|
||||||
|
|
||||||
return new DataResponse(
|
return new DataResponse(
|
||||||
$storage,
|
$storage,
|
||||||
|
|
|
@ -238,7 +238,7 @@ abstract class StoragesController extends Controller {
|
||||||
*
|
*
|
||||||
* @param StorageConfig $storage storage configuration
|
* @param StorageConfig $storage storage configuration
|
||||||
*/
|
*/
|
||||||
protected function updateStorageStatus(StorageConfig &$storage, $origin = null) {
|
protected function updateStorageStatus(StorageConfig &$storage, $testOnly = null) {
|
||||||
try {
|
try {
|
||||||
$this->manipulateStorageConfig($storage);
|
$this->manipulateStorageConfig($storage);
|
||||||
|
|
||||||
|
@ -250,7 +250,7 @@ abstract class StoragesController extends Controller {
|
||||||
$backend->getStorageClass(),
|
$backend->getStorageClass(),
|
||||||
$storage->getBackendOptions(),
|
$storage->getBackendOptions(),
|
||||||
false,
|
false,
|
||||||
$origin
|
$testOnly
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
} catch (InsufficientDataForMeaningfulAnswerException $e) {
|
} catch (InsufficientDataForMeaningfulAnswerException $e) {
|
||||||
|
@ -294,11 +294,11 @@ abstract class StoragesController extends Controller {
|
||||||
*
|
*
|
||||||
* @return DataResponse
|
* @return DataResponse
|
||||||
*/
|
*/
|
||||||
public function show($id, $origin = null) {
|
public function show($id, $testOnly = null) {
|
||||||
try {
|
try {
|
||||||
$storage = $this->service->getStorage($id);
|
$storage = $this->service->getStorage($id);
|
||||||
|
|
||||||
$this->updateStorageStatus($storage, $origin);
|
$this->updateStorageStatus($storage, $testOnly);
|
||||||
} catch (NotFoundException $e) {
|
} catch (NotFoundException $e) {
|
||||||
return new DataResponse(
|
return new DataResponse(
|
||||||
[
|
[
|
||||||
|
|
|
@ -111,11 +111,11 @@ class UserGlobalStoragesController extends StoragesController {
|
||||||
*
|
*
|
||||||
* @NoAdminRequired
|
* @NoAdminRequired
|
||||||
*/
|
*/
|
||||||
public function show($id, $origin = null) {
|
public function show($id, $testOnly = null) {
|
||||||
try {
|
try {
|
||||||
$storage = $this->service->getStorage($id);
|
$storage = $this->service->getStorage($id);
|
||||||
|
|
||||||
$this->updateStorageStatus($storage, $origin);
|
$this->updateStorageStatus($storage, $testOnly);
|
||||||
} catch (NotFoundException $e) {
|
} catch (NotFoundException $e) {
|
||||||
return new DataResponse(
|
return new DataResponse(
|
||||||
[
|
[
|
||||||
|
@ -147,7 +147,7 @@ class UserGlobalStoragesController extends StoragesController {
|
||||||
public function update(
|
public function update(
|
||||||
$id,
|
$id,
|
||||||
$backendOptions,
|
$backendOptions,
|
||||||
$origin = null
|
$testOnly = null
|
||||||
) {
|
) {
|
||||||
try {
|
try {
|
||||||
$storage = $this->service->getStorage($id);
|
$storage = $this->service->getStorage($id);
|
||||||
|
@ -172,7 +172,7 @@ class UserGlobalStoragesController extends StoragesController {
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
$this->updateStorageStatus($storage);
|
$this->updateStorageStatus($storage, $testOnly);
|
||||||
$this->sanitizeStorage($storage);
|
$this->sanitizeStorage($storage);
|
||||||
|
|
||||||
return new DataResponse(
|
return new DataResponse(
|
||||||
|
|
|
@ -101,8 +101,8 @@ class UserStoragesController extends StoragesController {
|
||||||
*
|
*
|
||||||
* {@inheritdoc}
|
* {@inheritdoc}
|
||||||
*/
|
*/
|
||||||
public function show($id, $origin = null) {
|
public function show($id, $testOnly = null) {
|
||||||
return parent::show($id, $origin);
|
return parent::show($id, $testOnly);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -171,7 +171,7 @@ class UserStoragesController extends StoragesController {
|
||||||
$authMechanism,
|
$authMechanism,
|
||||||
$backendOptions,
|
$backendOptions,
|
||||||
$mountOptions,
|
$mountOptions,
|
||||||
$origin = null
|
$testOnly = null
|
||||||
) {
|
) {
|
||||||
$storage = $this->createStorage(
|
$storage = $this->createStorage(
|
||||||
$mountPoint,
|
$mountPoint,
|
||||||
|
@ -201,7 +201,7 @@ class UserStoragesController extends StoragesController {
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
$this->updateStorageStatus($storage, $origin);
|
$this->updateStorageStatus($storage, $testOnly);
|
||||||
|
|
||||||
return new DataResponse(
|
return new DataResponse(
|
||||||
$storage,
|
$storage,
|
||||||
|
|
|
@ -215,7 +215,7 @@ class OC_Mount_Config {
|
||||||
* @return int see self::STATUS_*
|
* @return int see self::STATUS_*
|
||||||
* @throws Exception
|
* @throws Exception
|
||||||
*/
|
*/
|
||||||
public static function getBackendStatus($class, $options, $isPersonal, $origin = null) {
|
public static function getBackendStatus($class, $options, $isPersonal, $testOnly = null) {
|
||||||
if (self::$skipTest) {
|
if (self::$skipTest) {
|
||||||
return StorageNotAvailableException::STATUS_SUCCESS;
|
return StorageNotAvailableException::STATUS_SUCCESS;
|
||||||
}
|
}
|
||||||
|
@ -228,7 +228,7 @@ class OC_Mount_Config {
|
||||||
$storage = new $class($options);
|
$storage = new $class($options);
|
||||||
|
|
||||||
try {
|
try {
|
||||||
$result = $storage->test($isPersonal, $origin);
|
$result = $storage->test($isPersonal, $testOnly);
|
||||||
$storage->setAvailability($result);
|
$storage->setAvailability($result);
|
||||||
if ($result) {
|
if ($result) {
|
||||||
return StorageNotAvailableException::STATUS_SUCCESS;
|
return StorageNotAvailableException::STATUS_SUCCESS;
|
||||||
|
|
Loading…
Reference in New Issue