diff options
author | Christoph Wurst <christoph@winzerhof-wurst.at> | 2020-03-26 09:30:18 +0100 |
---|---|---|
committer | Christoph Wurst <christoph@winzerhof-wurst.at> | 2020-03-26 16:34:56 +0100 |
commit | b80ebc96748b45fd2e0ba9323308657c4b00b7ec (patch) | |
tree | ec20e0ffa2f86b9b54939a83a785407319f94559 /apps/user_ldap/ajax | |
parent | 62403d0932be7d620c7bdadc6b4e13eb496fcd6f (diff) | |
download | nextcloud-server-b80ebc96748b45fd2e0ba9323308657c4b00b7ec.tar.gz nextcloud-server-b80ebc96748b45fd2e0ba9323308657c4b00b7ec.zip |
Use the short array syntax, everywhere
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
Diffstat (limited to 'apps/user_ldap/ajax')
-rw-r--r-- | apps/user_ldap/ajax/clearMappings.php | 2 | ||||
-rw-r--r-- | apps/user_ldap/ajax/deleteConfiguration.php | 2 | ||||
-rw-r--r-- | apps/user_ldap/ajax/getConfiguration.php | 2 | ||||
-rw-r--r-- | apps/user_ldap/ajax/getNewServerConfigPrefix.php | 2 | ||||
-rw-r--r-- | apps/user_ldap/ajax/setConfiguration.php | 4 | ||||
-rw-r--r-- | apps/user_ldap/ajax/testConfiguration.php | 18 | ||||
-rw-r--r-- | apps/user_ldap/ajax/wizard.php | 20 |
7 files changed, 25 insertions, 25 deletions
diff --git a/apps/user_ldap/ajax/clearMappings.php b/apps/user_ldap/ajax/clearMappings.php index 3e98162904c..f847b818db0 100644 --- a/apps/user_ldap/ajax/clearMappings.php +++ b/apps/user_ldap/ajax/clearMappings.php @@ -56,5 +56,5 @@ try { } \OC_JSON::success(); } catch (\Exception $e) { - \OC_JSON::error(array('message' => $e->getMessage())); + \OC_JSON::error(['message' => $e->getMessage()]); } diff --git a/apps/user_ldap/ajax/deleteConfiguration.php b/apps/user_ldap/ajax/deleteConfiguration.php index d6bce7439f7..c2bf4f265d0 100644 --- a/apps/user_ldap/ajax/deleteConfiguration.php +++ b/apps/user_ldap/ajax/deleteConfiguration.php @@ -36,5 +36,5 @@ if($helper->deleteServerConfiguration($prefix)) { \OC_JSON::success(); } else { $l = \OC::$server->getL10N('user_ldap'); - \OC_JSON::error(array('message' => $l->t('Failed to delete the server configuration'))); + \OC_JSON::error(['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 b8ed917de6e..8c9a3a6c3f6 100644 --- a/apps/user_ldap/ajax/getConfiguration.php +++ b/apps/user_ldap/ajax/getConfiguration.php @@ -38,4 +38,4 @@ if (isset($configuration['ldap_agent_password']) && $configuration['ldap_agent_p // hide password $configuration['ldap_agent_password'] = '**PASSWORD SET**'; } -\OC_JSON::success(array('configuration' => $configuration)); +\OC_JSON::success(['configuration' => $configuration]); diff --git a/apps/user_ldap/ajax/getNewServerConfigPrefix.php b/apps/user_ldap/ajax/getNewServerConfigPrefix.php index 9c6f63fc3de..9d93b2b8971 100644 --- a/apps/user_ldap/ajax/getNewServerConfigPrefix.php +++ b/apps/user_ldap/ajax/getNewServerConfigPrefix.php @@ -35,7 +35,7 @@ $lk = array_pop($serverConnections); $ln = (int)str_replace('s', '', $lk); $nk = 's'.str_pad($ln+1, 2, '0', STR_PAD_LEFT); -$resultData = array('configPrefix' => $nk); +$resultData = ['configPrefix' => $nk]; $newConfig = new \OCA\User_LDAP\Configuration($nk, false); if(isset($_POST['copyConfig'])) { diff --git a/apps/user_ldap/ajax/setConfiguration.php b/apps/user_ldap/ajax/setConfiguration.php index 31aa80d0945..fd8a2b0c1b5 100644 --- a/apps/user_ldap/ajax/setConfiguration.php +++ b/apps/user_ldap/ajax/setConfiguration.php @@ -35,8 +35,8 @@ $prefix = (string)$_POST['ldap_serverconfig_chooser']; // Checkboxes are not submitted, when they are unchecked. Set them manually. // only legacy checkboxes (Advanced and Expert tab) need to be handled here, // the Wizard-like tabs handle it on their own -$chkboxes = array('ldap_configuration_active', 'ldap_override_main_server', - 'ldap_turn_off_cert_check'); +$chkboxes = ['ldap_configuration_active', 'ldap_override_main_server', + 'ldap_turn_off_cert_check']; foreach($chkboxes as $boxid) { if(!isset($_POST[$boxid])) { $_POST[$boxid] = 0; diff --git a/apps/user_ldap/ajax/testConfiguration.php b/apps/user_ldap/ajax/testConfiguration.php index 00393ff66e3..a21cb407558 100644 --- a/apps/user_ldap/ajax/testConfiguration.php +++ b/apps/user_ldap/ajax/testConfiguration.php @@ -66,23 +66,23 @@ try { * pass (like e.g. expected syntax error). */ try { - $ldapWrapper->read($connection->getConnectionResource(), '', 'objectClass=*', array('dn')); + $ldapWrapper->read($connection->getConnectionResource(), '', 'objectClass=*', ['dn']); } catch (\Exception $e) { if($e->getCode() === 1) { - \OC_JSON::error(array('message' => $l->t('Invalid configuration: Anonymous binding is not allowed.'))); + \OC_JSON::error(['message' => $l->t('Invalid configuration: Anonymous binding is not allowed.')]); exit; } } - \OC_JSON::success(array('message' - => $l->t('Valid configuration, connection established!'))); + \OC_JSON::success(['message' + => $l->t('Valid configuration, connection established!')]); } else { - \OC_JSON::error(array('message' - => $l->t('Valid configuration, but binding failed. Please check the server settings and credentials.'))); + \OC_JSON::error(['message' + => $l->t('Valid configuration, but binding failed. Please check the server settings and credentials.')]); } } else { - \OC_JSON::error(array('message' - => $l->t('Invalid configuration. Please have a look at the logs for further details.'))); + \OC_JSON::error(['message' + => $l->t('Invalid configuration. Please have a look at the logs for further details.')]); } } catch (\Exception $e) { - \OC_JSON::error(array('message' => $e->getMessage())); + \OC_JSON::error(['message' => $e->getMessage()]); } diff --git a/apps/user_ldap/ajax/wizard.php b/apps/user_ldap/ajax/wizard.php index 3cce732f070..1756e978de2 100644 --- a/apps/user_ldap/ajax/wizard.php +++ b/apps/user_ldap/ajax/wizard.php @@ -36,13 +36,13 @@ $l = \OC::$server->getL10N('user_ldap'); if(!isset($_POST['action'])) { - \OC_JSON::error(array('message' => $l->t('No action specified'))); + \OC_JSON::error(['message' => $l->t('No action specified')]); } $action = (string)$_POST['action']; if(!isset($_POST['ldap_serverconfig_chooser'])) { - \OC_JSON::error(array('message' => $l->t('No configuration specified'))); + \OC_JSON::error(['message' => $l->t('No configuration specified')]); } $prefix = (string)$_POST['ldap_serverconfig_chooser']; @@ -99,7 +99,7 @@ switch($action) { exit; } } catch (\Exception $e) { - \OC_JSON::error(array('message' => $e->getMessage(), 'code' => $e->getCode())); + \OC_JSON::error(['message' => $e->getMessage(), 'code' => $e->getCode()]); exit; } \OC_JSON::error(); @@ -115,7 +115,7 @@ switch($action) { exit; } } catch (\Exception $e) { - \OC_JSON::error(array('message' => $e->getMessage())); + \OC_JSON::error(['message' => $e->getMessage()]); exit; } \OC_JSON::error(); @@ -127,15 +127,15 @@ switch($action) { $key = isset($_POST['cfgkey']) ? $_POST['cfgkey'] : false; $val = isset($_POST['cfgval']) ? $_POST['cfgval'] : null; if($key === false || is_null($val)) { - \OC_JSON::error(array('message' => $l->t('No data specified'))); + \OC_JSON::error(['message' => $l->t('No data specified')]); exit; } - $cfg = array($key => $val); - $setParameters = array(); + $cfg = [$key => $val]; + $setParameters = []; $configuration->setConfiguration($cfg, $setParameters); if(!in_array($key, $setParameters)) { - \OC_JSON::error(array('message' => $l->t($key. - ' Could not set configuration %s', $setParameters[0]))); + \OC_JSON::error(['message' => $l->t($key. + ' Could not set configuration %s', $setParameters[0])]); exit; } $configuration->saveConfiguration(); @@ -145,6 +145,6 @@ switch($action) { \OC_JSON::success(); break; default: - \OC_JSON::error(array('message' => $l->t('Action does not exist'))); + \OC_JSON::error(['message' => $l->t('Action does not exist')]); break; } |