diff options
author | Roeland Jago Douma <roeland@famdouma.nl> | 2018-03-22 13:19:29 +0100 |
---|---|---|
committer | Roeland Jago Douma <roeland@famdouma.nl> | 2018-03-22 13:19:29 +0100 |
commit | 3dac15a8911fea1e8473af7e7a26d7a57e68328b (patch) | |
tree | eaf7dca00a5b171f2d2336c93a53bd486e2c19d3 /apps/user_ldap/ajax | |
parent | f843b7edfe7b3bc6e45d4610778d2df98b3985e3 (diff) | |
download | nextcloud-server-3dac15a8911fea1e8473af7e7a26d7a57e68328b.tar.gz nextcloud-server-3dac15a8911fea1e8473af7e7a26d7a57e68328b.zip |
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>
Diffstat (limited to 'apps/user_ldap/ajax')
-rw-r--r-- | apps/user_ldap/ajax/clearMappings.php | 10 | ||||
-rw-r--r-- | apps/user_ldap/ajax/deleteConfiguration.php | 10 | ||||
-rw-r--r-- | apps/user_ldap/ajax/getConfiguration.php | 8 | ||||
-rw-r--r-- | apps/user_ldap/ajax/getNewServerConfigPrefix.php | 8 | ||||
-rw-r--r-- | apps/user_ldap/ajax/setConfiguration.php | 8 | ||||
-rw-r--r-- | apps/user_ldap/ajax/testConfiguration.php | 16 | ||||
-rw-r--r-- | apps/user_ldap/ajax/wizard.php | 30 |
7 files changed, 45 insertions, 45 deletions
diff --git a/apps/user_ldap/ajax/clearMappings.php b/apps/user_ldap/ajax/clearMappings.php index 4ec03307296..01b6b7f0ef2 100644 --- a/apps/user_ldap/ajax/clearMappings.php +++ b/apps/user_ldap/ajax/clearMappings.php @@ -27,9 +27,9 @@ use OCA\User_LDAP\Mapping\UserMapping; use OCA\User_LDAP\Mapping\GroupMapping; // Check user and app status -OCP\JSON::checkAdminUser(); -OCP\JSON::checkAppEnabled('user_ldap'); -OCP\JSON::callCheck(); +\OC_JSON::checkAdminUser(); +\OC_JSON::checkAppEnabled('user_ldap'); +\OC_JSON::callCheck(); $subject = (string)$_POST['ldap_clear_mapping']; $mapping = null; @@ -43,7 +43,7 @@ try { $l = \OC::$server->getL10N('user_ldap'); throw new \Exception($l->t('Failed to clear the mappings.')); } - OCP\JSON::success(); + \OC_JSON::success(); } catch (\Exception $e) { - OCP\JSON::error(array('message' => $e->getMessage())); + \OC_JSON::error(array('message' => $e->getMessage())); } diff --git a/apps/user_ldap/ajax/deleteConfiguration.php b/apps/user_ldap/ajax/deleteConfiguration.php index 220f4c13c4a..fa2ab36770f 100644 --- a/apps/user_ldap/ajax/deleteConfiguration.php +++ b/apps/user_ldap/ajax/deleteConfiguration.php @@ -27,15 +27,15 @@ */ // Check user and app status -OCP\JSON::checkAdminUser(); -OCP\JSON::checkAppEnabled('user_ldap'); -OCP\JSON::callCheck(); +\OC_JSON::checkAdminUser(); +\OC_JSON::checkAppEnabled('user_ldap'); +\OC_JSON::callCheck(); $prefix = (string)$_POST['ldap_serverconfig_chooser']; $helper = new \OCA\User_LDAP\Helper(\OC::$server->getConfig()); if($helper->deleteServerConfiguration($prefix)) { - OCP\JSON::success(); + \OC_JSON::success(); } else { $l = \OC::$server->getL10N('user_ldap'); - OCP\JSON::error(array('message' => $l->t('Failed to delete the server configuration'))); + \OC_JSON::error(array('message' => $l->t('Failed to delete the server configuration'))); } diff --git a/apps/user_ldap/ajax/getConfiguration.php b/apps/user_ldap/ajax/getConfiguration.php index a6c3d975782..72404d6b304 100644 --- a/apps/user_ldap/ajax/getConfiguration.php +++ b/apps/user_ldap/ajax/getConfiguration.php @@ -25,9 +25,9 @@ */ // Check user and app status -OCP\JSON::checkAdminUser(); -OCP\JSON::checkAppEnabled('user_ldap'); -OCP\JSON::callCheck(); +\OC_JSON::checkAdminUser(); +\OC_JSON::checkAppEnabled('user_ldap'); +\OC_JSON::callCheck(); $prefix = (string)$_POST['ldap_serverconfig_chooser']; $ldapWrapper = new OCA\User_LDAP\LDAP(); @@ -37,4 +37,4 @@ if (isset($configuration['ldap_agent_password']) && $configuration['ldap_agent_p // hide password $configuration['ldap_agent_password'] = '**PASSWORD SET**'; } -OCP\JSON::success(array('configuration' => $configuration)); +\OC_JSON::success(array('configuration' => $configuration)); diff --git a/apps/user_ldap/ajax/getNewServerConfigPrefix.php b/apps/user_ldap/ajax/getNewServerConfigPrefix.php index c0c81be14d7..b0e6ce31a83 100644 --- a/apps/user_ldap/ajax/getNewServerConfigPrefix.php +++ b/apps/user_ldap/ajax/getNewServerConfigPrefix.php @@ -24,9 +24,9 @@ */ // Check user and app status -OCP\JSON::checkAdminUser(); -OCP\JSON::checkAppEnabled('user_ldap'); -OCP\JSON::callCheck(); +\OC_JSON::checkAdminUser(); +\OC_JSON::checkAppEnabled('user_ldap'); +\OC_JSON::callCheck(); $helper = new \OCA\User_LDAP\Helper(\OC::$server->getConfig()); $serverConnections = $helper->getServerConfigurationPrefixes(); @@ -48,4 +48,4 @@ if(isset($_POST['copyConfig'])) { } $newConfig->saveConfiguration(); -OCP\JSON::success($resultData); +\OC_JSON::success($resultData); diff --git a/apps/user_ldap/ajax/setConfiguration.php b/apps/user_ldap/ajax/setConfiguration.php index 51737cc9953..1ed1a36d093 100644 --- a/apps/user_ldap/ajax/setConfiguration.php +++ b/apps/user_ldap/ajax/setConfiguration.php @@ -26,9 +26,9 @@ */ // Check user and app status -OCP\JSON::checkAdminUser(); -OCP\JSON::checkAppEnabled('user_ldap'); -OCP\JSON::callCheck(); +\OC_JSON::checkAdminUser(); +\OC_JSON::checkAppEnabled('user_ldap'); +\OC_JSON::callCheck(); $prefix = (string)$_POST['ldap_serverconfig_chooser']; @@ -47,4 +47,4 @@ $ldapWrapper = new OCA\User_LDAP\LDAP(); $connection = new \OCA\User_LDAP\Connection($ldapWrapper, $prefix); $connection->setConfiguration($_POST); $connection->saveConfiguration(); -OCP\JSON::success(); +\OC_JSON::success(); diff --git a/apps/user_ldap/ajax/testConfiguration.php b/apps/user_ldap/ajax/testConfiguration.php index 1b33a025440..b1f339e6148 100644 --- a/apps/user_ldap/ajax/testConfiguration.php +++ b/apps/user_ldap/ajax/testConfiguration.php @@ -28,9 +28,9 @@ */ // Check user and app status -OCP\JSON::checkAdminUser(); -OCP\JSON::checkAppEnabled('user_ldap'); -OCP\JSON::callCheck(); +\OC_JSON::checkAdminUser(); +\OC_JSON::checkAppEnabled('user_ldap'); +\OC_JSON::callCheck(); $l = \OC::$server->getL10N('user_ldap'); @@ -69,20 +69,20 @@ try { $ldapWrapper->read($connection->getConnectionResource(), '', 'objectClass=*', array('dn')); } catch (\Exception $e) { if($e->getCode() === 1) { - OCP\JSON::error(array('message' => $l->t('Invalid configuration: Anonymous binding is not allowed.'))); + \OC_JSON::error(array('message' => $l->t('Invalid configuration: Anonymous binding is not allowed.'))); exit; } } - OCP\JSON::success(array('message' + \OC_JSON::success(array('message' => $l->t('Valid configuration, connection established!'))); } else { - OCP\JSON::error(array('message' + \OC_JSON::error(array('message' => $l->t('Valid configuration, but binding failed. Please check the server settings and credentials.'))); } } else { - OCP\JSON::error(array('message' + \OC_JSON::error(array('message' => $l->t('Invalid configuration. Please have a look at the logs for further details.'))); } } catch (\Exception $e) { - OCP\JSON::error(array('message' => $e->getMessage())); + \OC_JSON::error(array('message' => $e->getMessage())); } diff --git a/apps/user_ldap/ajax/wizard.php b/apps/user_ldap/ajax/wizard.php index d25a70b41c8..f0ce8f87c39 100644 --- a/apps/user_ldap/ajax/wizard.php +++ b/apps/user_ldap/ajax/wizard.php @@ -29,20 +29,20 @@ */ // Check user and app status -OCP\JSON::checkAdminUser(); -OCP\JSON::checkAppEnabled('user_ldap'); -OCP\JSON::callCheck(); +\OC_JSON::checkAdminUser(); +\OC_JSON::checkAppEnabled('user_ldap'); +\OC_JSON::callCheck(); $l = \OC::$server->getL10N('user_ldap'); if(!isset($_POST['action'])) { - \OCP\JSON::error(array('message' => $l->t('No action specified'))); + \\OC_JSON::error(array('message' => $l->t('No action specified'))); } $action = (string)$_POST['action']; if(!isset($_POST['ldap_serverconfig_chooser'])) { - \OCP\JSON::error(array('message' => $l->t('No configuration specified'))); + \\OC_JSON::error(array('message' => $l->t('No configuration specified'))); } $prefix = (string)$_POST['ldap_serverconfig_chooser']; @@ -94,14 +94,14 @@ switch($action) { try { $result = $wizard->$action(); if($result !== false) { - OCP\JSON::success($result->getResultArray()); + \OC_JSON::success($result->getResultArray()); exit; } } catch (\Exception $e) { - \OCP\JSON::error(array('message' => $e->getMessage(), 'code' => $e->getCode())); + \\OC_JSON::error(array('message' => $e->getMessage(), 'code' => $e->getCode())); exit; } - \OCP\JSON::error(); + \\OC_JSON::error(); exit; break; @@ -110,14 +110,14 @@ switch($action) { $loginName = $_POST['ldap_test_loginname']; $result = $wizard->$action($loginName); if($result !== false) { - OCP\JSON::success($result->getResultArray()); + \OC_JSON::success($result->getResultArray()); exit; } } catch (\Exception $e) { - \OCP\JSON::error(array('message' => $e->getMessage())); + \\OC_JSON::error(array('message' => $e->getMessage())); exit; } - \OCP\JSON::error(); + \\OC_JSON::error(); exit; break; } @@ -126,14 +126,14 @@ switch($action) { $key = isset($_POST['cfgkey']) ? $_POST['cfgkey'] : false; $val = isset($_POST['cfgval']) ? $_POST['cfgval'] : null; if($key === false || is_null($val)) { - \OCP\JSON::error(array('message' => $l->t('No data specified'))); + \\OC_JSON::error(array('message' => $l->t('No data specified'))); exit; } $cfg = array($key => $val); $setParameters = array(); $configuration->setConfiguration($cfg, $setParameters); if(!in_array($key, $setParameters)) { - \OCP\JSON::error(array('message' => $l->t($key. + \\OC_JSON::error(array('message' => $l->t($key. ' Could not set configuration %s', $setParameters[0]))); exit; } @@ -141,9 +141,9 @@ switch($action) { //clear the cache on save $connection = new \OCA\User_LDAP\Connection($ldapWrapper, $prefix); $connection->clearCache(); - OCP\JSON::success(); + \OC_JSON::success(); break; default: - \OCP\JSON::error(array('message' => $l->t('Action does not exist'))); + \\OC_JSON::error(array('message' => $l->t('Action does not exist'))); break; } |