Skip to content

Commit 3dac15a

Browse files
committed
Move calls to \OCP\JSON to private \OC_JSON
They should be properly fixed at some point. Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
1 parent f843b7e commit 3dac15a

25 files changed

Lines changed: 96 additions & 96 deletions

apps/files/ajax/list.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
use OCP\Files\StorageNotAvailableException;
2828
use OCP\Files\StorageInvalidException;
2929

30-
OCP\JSON::checkLoggedIn();
30+
\OC_JSON::checkLoggedIn();
3131
\OC::$server->getSession()->close();
3232
$l = \OC::$server->getL10N('files');
3333

@@ -79,26 +79,26 @@
7979
$data['files'] = \OCA\Files\Helper::formatFileInfos($files);
8080
$data['permissions'] = $permissions;
8181

82-
OCP\JSON::success(array('data' => $data));
82+
\OC_JSON::success(array('data' => $data));
8383
} catch (\OCP\Files\StorageNotAvailableException $e) {
8484
\OC::$server->getLogger()->logException($e, ['app' => 'files']);
85-
OCP\JSON::error([
85+
\OC_JSON::error([
8686
'data' => [
8787
'exception' => StorageNotAvailableException::class,
8888
'message' => $l->t('Storage is temporarily not available')
8989
]
9090
]);
9191
} catch (\OCP\Files\StorageInvalidException $e) {
9292
\OC::$server->getLogger()->logException($e, ['app' => 'files']);
93-
OCP\JSON::error(array(
93+
\OC_JSON::error(array(
9494
'data' => array(
9595
'exception' => StorageInvalidException::class,
9696
'message' => $l->t('Storage invalid')
9797
)
9898
));
9999
} catch (\Exception $e) {
100100
\OC::$server->getLogger()->logException($e, ['app' => 'files']);
101-
OCP\JSON::error(array(
101+
\OC_JSON::error(array(
102102
'data' => array(
103103
'exception' => \Exception::class,
104104
'message' => $l->t('Unknown error')

apps/files_external/ajax/applicable.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,10 @@
2121
* along with this program. If not, see <http://www.gnu.org/licenses/>
2222
*
2323
*/
24-
OCP\JSON::checkAppEnabled('files_external');
25-
OCP\JSON::callCheck();
24+
\OC_JSON::checkAppEnabled('files_external');
25+
\OC_JSON::callCheck();
2626

27-
OCP\JSON::checkAdminUser();
27+
\OC_JSON::checkAdminUser();
2828

2929
$pattern = '';
3030
$limit = null;
@@ -51,4 +51,4 @@
5151

5252
$results = array('groups' => $groups, 'users' => $users);
5353

54-
\OCP\JSON::success($results);
54+
\\OC_JSON::success($results);

apps/files_external/ajax/oauth2.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,9 @@
2222
* along with this program. If not, see <http://www.gnu.org/licenses/>
2323
*
2424
*/
25-
OCP\JSON::checkAppEnabled('files_external');
26-
OCP\JSON::checkLoggedIn();
27-
OCP\JSON::callCheck();
25+
\OC_JSON::checkAppEnabled('files_external');
26+
\OC_JSON::checkLoggedIn();
27+
\OC_JSON::callCheck();
2828
$l = \OC::$server->getL10N('files_external');
2929

3030
// TODO: implement redirect to which storage backend requested this

apps/files_trashbin/ajax/delete.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,8 @@
2424
* along with this program. If not, see <http://www.gnu.org/licenses/>
2525
*
2626
*/
27-
OCP\JSON::checkLoggedIn();
28-
OCP\JSON::callCheck();
27+
\OC_JSON::checkLoggedIn();
28+
\OC_JSON::callCheck();
2929
\OC::$server->getSession()->close();
3030

3131
$folder = isset($_POST['dir']) ? $_POST['dir'] : '/';
@@ -83,8 +83,8 @@
8383
}
8484
$l = \OC::$server->getL10N('files_trashbin');
8585
$message = $l->t("Couldn't delete %s permanently", array(rtrim($filelist, ', ')));
86-
OCP\JSON::error(array("data" => array("message" => $message,
86+
\OC_JSON::error(array("data" => array("message" => $message,
8787
"success" => $success, "error" => $error)));
8888
} else {
89-
OCP\JSON::success(array("data" => array("success" => $success)));
89+
\OC_JSON::success(array("data" => array("success" => $success)));
9090
}

apps/files_trashbin/ajax/isEmpty.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,12 +22,12 @@
2222
*
2323
*/
2424

25-
OCP\JSON::checkLoggedIn();
26-
OCP\JSON::callCheck();
25+
\OC_JSON::checkLoggedIn();
26+
\OC_JSON::callCheck();
2727
\OC::$server->getSession()->close();
2828

2929
$trashStatus = OCA\Files_Trashbin\Trashbin::isEmpty(OCP\User::getUser());
3030

31-
OCP\JSON::success(array("data" => array("isEmpty" => $trashStatus)));
31+
\OC_JSON::success(array("data" => array("isEmpty" => $trashStatus)));
3232

3333

apps/files_trashbin/ajax/list.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
* along with this program. If not, see <http://www.gnu.org/licenses/>
2222
*
2323
*/
24-
OCP\JSON::checkLoggedIn();
24+
\OC_JSON::checkLoggedIn();
2525
\OC::$server->getSession()->close();
2626

2727
// Load the files
@@ -44,5 +44,5 @@
4444
$data['directory'] = $dir;
4545
$data['files'] = \OCA\Files_Trashbin\Helper::formatFileInfos($files);
4646

47-
OCP\JSON::success(array('data' => $data));
47+
\OC_JSON::success(array('data' => $data));
4848

apps/files_trashbin/ajax/undelete.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,8 @@
2626
* along with this program. If not, see <http://www.gnu.org/licenses/>
2727
*
2828
*/
29-
OCP\JSON::checkLoggedIn();
30-
OCP\JSON::callCheck();
29+
\OC_JSON::checkLoggedIn();
30+
\OC_JSON::callCheck();
3131
\OC::$server->getSession()->close();
3232

3333
$dir = '/';
@@ -88,8 +88,8 @@
8888
}
8989
$l = OC::$server->getL10N('files_trashbin');
9090
$message = $l->t("Couldn't restore %s", array(rtrim($filelist, ', ')));
91-
OCP\JSON::error(array("data" => array("message" => $message,
91+
\OC_JSON::error(array("data" => array("message" => $message,
9292
"success" => $success, "error" => $error)));
9393
} else {
94-
OCP\JSON::success(array("data" => array("success" => $success)));
94+
\OC_JSON::success(array("data" => array("success" => $success)));
9595
}

apps/files_versions/ajax/getVersions.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,9 @@
2424
* along with this program. If not, see <http://www.gnu.org/licenses/>
2525
*
2626
*/
27-
OCP\JSON::checkLoggedIn();
28-
OCP\JSON::callCheck();
29-
OCP\JSON::checkAppEnabled('files_versions');
27+
\OC_JSON::checkLoggedIn();
28+
\OC_JSON::callCheck();
29+
\OC_JSON::checkAppEnabled('files_versions');
3030

3131
$source = (string)$_GET['source'];
3232
$start = (int)$_GET['start'];
@@ -47,10 +47,10 @@
4747
unset($version['path']);
4848
}
4949

50-
\OCP\JSON::success(array('data' => array('versions' => $versions, 'endReached' => $endReached)));
50+
\\OC_JSON::success(array('data' => array('versions' => $versions, 'endReached' => $endReached)));
5151

5252
} else {
5353

54-
\OCP\JSON::success(array('data' => array('versions' => [], 'endReached' => true)));
54+
\\OC_JSON::success(array('data' => array('versions' => [], 'endReached' => true)));
5555

5656
}

apps/files_versions/ajax/rollbackVersion.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -26,16 +26,16 @@
2626
* along with this program. If not, see <http://www.gnu.org/licenses/>
2727
*
2828
*/
29-
OCP\JSON::checkLoggedIn();
30-
OCP\JSON::checkAppEnabled('files_versions');
31-
OCP\JSON::callCheck();
29+
\OC_JSON::checkLoggedIn();
30+
\OC_JSON::checkAppEnabled('files_versions');
31+
\OC_JSON::callCheck();
3232

3333
$file = (string)$_GET['file'];
3434
$revision=(int)$_GET['revision'];
3535

3636
if(OCA\Files_Versions\Storage::rollback( $file, $revision )) {
37-
OCP\JSON::success(array("data" => array( "revision" => $revision, "file" => $file )));
37+
\OC_JSON::success(array("data" => array( "revision" => $revision, "file" => $file )));
3838
}else{
3939
$l = \OC::$server->getL10N('files_versions');
40-
OCP\JSON::error(array("data" => array( "message" => $l->t("Could not revert: %s", array($file) ))));
40+
\OC_JSON::error(array("data" => array( "message" => $l->t("Could not revert: %s", array($file) ))));
4141
}

apps/files_versions/download.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,8 @@
2525
*
2626
*/
2727

28-
OCP\JSON::checkAppEnabled('files_versions');
29-
OCP\JSON::checkLoggedIn();
28+
\OC_JSON::checkAppEnabled('files_versions');
29+
\OC_JSON::checkLoggedIn();
3030

3131
$file = $_GET['file'];
3232
$revision=(int)$_GET['revision'];

0 commit comments

Comments
 (0)