@@ -33,69 +33,69 @@ |
||
| 33 | 33 | use OCP\Template; |
| 34 | 34 | |
| 35 | 35 | class Admin implements ISettings { |
| 36 | - /** @var IL10N */ |
|
| 37 | - private $l; |
|
| 36 | + /** @var IL10N */ |
|
| 37 | + private $l; |
|
| 38 | 38 | |
| 39 | - /** |
|
| 40 | - * @param IL10N $l |
|
| 41 | - */ |
|
| 42 | - public function __construct(IL10N $l) { |
|
| 43 | - $this->l = $l; |
|
| 44 | - } |
|
| 39 | + /** |
|
| 40 | + * @param IL10N $l |
|
| 41 | + */ |
|
| 42 | + public function __construct(IL10N $l) { |
|
| 43 | + $this->l = $l; |
|
| 44 | + } |
|
| 45 | 45 | |
| 46 | - /** |
|
| 47 | - * @return TemplateResponse |
|
| 48 | - */ |
|
| 49 | - public function getForm() { |
|
| 50 | - $helper = new Helper(\OC::$server->getConfig()); |
|
| 51 | - $prefixes = $helper->getServerConfigurationPrefixes(); |
|
| 52 | - if(count($prefixes) === 0) { |
|
| 53 | - $newPrefix = $helper->getNextServerConfigurationPrefix(); |
|
| 54 | - $config = new Configuration($newPrefix, false); |
|
| 55 | - $config->setConfiguration($config->getDefaults()); |
|
| 56 | - $config->saveConfiguration(); |
|
| 57 | - $prefixes[] = $newPrefix; |
|
| 58 | - } |
|
| 46 | + /** |
|
| 47 | + * @return TemplateResponse |
|
| 48 | + */ |
|
| 49 | + public function getForm() { |
|
| 50 | + $helper = new Helper(\OC::$server->getConfig()); |
|
| 51 | + $prefixes = $helper->getServerConfigurationPrefixes(); |
|
| 52 | + if(count($prefixes) === 0) { |
|
| 53 | + $newPrefix = $helper->getNextServerConfigurationPrefix(); |
|
| 54 | + $config = new Configuration($newPrefix, false); |
|
| 55 | + $config->setConfiguration($config->getDefaults()); |
|
| 56 | + $config->saveConfiguration(); |
|
| 57 | + $prefixes[] = $newPrefix; |
|
| 58 | + } |
|
| 59 | 59 | |
| 60 | - $hosts = $helper->getServerConfigurationHosts(); |
|
| 60 | + $hosts = $helper->getServerConfigurationHosts(); |
|
| 61 | 61 | |
| 62 | - $wControls = new Template('user_ldap', 'part.wizardcontrols'); |
|
| 63 | - $wControls = $wControls->fetchPage(); |
|
| 64 | - $sControls = new Template('user_ldap', 'part.settingcontrols'); |
|
| 65 | - $sControls = $sControls->fetchPage(); |
|
| 62 | + $wControls = new Template('user_ldap', 'part.wizardcontrols'); |
|
| 63 | + $wControls = $wControls->fetchPage(); |
|
| 64 | + $sControls = new Template('user_ldap', 'part.settingcontrols'); |
|
| 65 | + $sControls = $sControls->fetchPage(); |
|
| 66 | 66 | |
| 67 | - $parameters['serverConfigurationPrefixes'] = $prefixes; |
|
| 68 | - $parameters['serverConfigurationHosts'] = $hosts; |
|
| 69 | - $parameters['settingControls'] = $sControls; |
|
| 70 | - $parameters['wizardControls'] = $wControls; |
|
| 67 | + $parameters['serverConfigurationPrefixes'] = $prefixes; |
|
| 68 | + $parameters['serverConfigurationHosts'] = $hosts; |
|
| 69 | + $parameters['settingControls'] = $sControls; |
|
| 70 | + $parameters['wizardControls'] = $wControls; |
|
| 71 | 71 | |
| 72 | - // assign default values |
|
| 73 | - if(!isset($config)) { |
|
| 74 | - $config = new Configuration('', false); |
|
| 75 | - } |
|
| 76 | - $defaults = $config->getDefaults(); |
|
| 77 | - foreach($defaults as $key => $default) { |
|
| 78 | - $parameters[$key.'_default'] = $default; |
|
| 79 | - } |
|
| 72 | + // assign default values |
|
| 73 | + if(!isset($config)) { |
|
| 74 | + $config = new Configuration('', false); |
|
| 75 | + } |
|
| 76 | + $defaults = $config->getDefaults(); |
|
| 77 | + foreach($defaults as $key => $default) { |
|
| 78 | + $parameters[$key.'_default'] = $default; |
|
| 79 | + } |
|
| 80 | 80 | |
| 81 | - return new TemplateResponse('user_ldap', 'settings', $parameters); |
|
| 82 | - } |
|
| 81 | + return new TemplateResponse('user_ldap', 'settings', $parameters); |
|
| 82 | + } |
|
| 83 | 83 | |
| 84 | - /** |
|
| 85 | - * @return string the section ID, e.g. 'sharing' |
|
| 86 | - */ |
|
| 87 | - public function getSection() { |
|
| 88 | - return 'ldap'; |
|
| 89 | - } |
|
| 84 | + /** |
|
| 85 | + * @return string the section ID, e.g. 'sharing' |
|
| 86 | + */ |
|
| 87 | + public function getSection() { |
|
| 88 | + return 'ldap'; |
|
| 89 | + } |
|
| 90 | 90 | |
| 91 | - /** |
|
| 92 | - * @return int whether the form should be rather on the top or bottom of |
|
| 93 | - * the admin section. The forms are arranged in ascending order of the |
|
| 94 | - * priority values. It is required to return a value between 0 and 100. |
|
| 95 | - * |
|
| 96 | - * E.g.: 70 |
|
| 97 | - */ |
|
| 98 | - public function getPriority() { |
|
| 99 | - return 5; |
|
| 100 | - } |
|
| 91 | + /** |
|
| 92 | + * @return int whether the form should be rather on the top or bottom of |
|
| 93 | + * the admin section. The forms are arranged in ascending order of the |
|
| 94 | + * priority values. It is required to return a value between 0 and 100. |
|
| 95 | + * |
|
| 96 | + * E.g.: 70 |
|
| 97 | + */ |
|
| 98 | + public function getPriority() { |
|
| 99 | + return 5; |
|
| 100 | + } |
|
| 101 | 101 | } |
@@ -49,7 +49,7 @@ discard block |
||
| 49 | 49 | public function getForm() { |
| 50 | 50 | $helper = new Helper(\OC::$server->getConfig()); |
| 51 | 51 | $prefixes = $helper->getServerConfigurationPrefixes(); |
| 52 | - if(count($prefixes) === 0) { |
|
| 52 | + if (count($prefixes) === 0) { |
|
| 53 | 53 | $newPrefix = $helper->getNextServerConfigurationPrefix(); |
| 54 | 54 | $config = new Configuration($newPrefix, false); |
| 55 | 55 | $config->setConfiguration($config->getDefaults()); |
@@ -70,11 +70,11 @@ discard block |
||
| 70 | 70 | $parameters['wizardControls'] = $wControls; |
| 71 | 71 | |
| 72 | 72 | // assign default values |
| 73 | - if(!isset($config)) { |
|
| 73 | + if (!isset($config)) { |
|
| 74 | 74 | $config = new Configuration('', false); |
| 75 | 75 | } |
| 76 | 76 | $defaults = $config->getDefaults(); |
| 77 | - foreach($defaults as $key => $default) { |
|
| 77 | + foreach ($defaults as $key => $default) { |
|
| 78 | 78 | $parameters[$key.'_default'] = $default; |
| 79 | 79 | } |
| 80 | 80 | |
@@ -2,14 +2,14 @@ |
||
| 2 | 2 | <p> |
| 3 | 3 | <select id="ldap_serverconfig_chooser" name="ldap_serverconfig_chooser"> |
| 4 | 4 | <?php |
| 5 | - $i = 1; |
|
| 6 | - $sel = ' selected'; |
|
| 7 | - foreach($_['serverConfigurationPrefixes'] as $prefix) { |
|
| 8 | - ?> |
|
| 5 | + $i = 1; |
|
| 6 | + $sel = ' selected'; |
|
| 7 | + foreach($_['serverConfigurationPrefixes'] as $prefix) { |
|
| 8 | + ?> |
|
| 9 | 9 | <option value="<?php p($prefix); ?>"<?php p($sel); $sel = ''; ?>><?php p($l->t('%s. Server:', array($i++)));?> <?php p(' '.$_['serverConfigurationHosts'][$prefix]); ?></option> |
| 10 | 10 | <?php |
| 11 | - } |
|
| 12 | - ?> |
|
| 11 | + } |
|
| 12 | + ?> |
|
| 13 | 13 | </select> |
| 14 | 14 | <button type="button" id="ldap_action_add_configuration" |
| 15 | 15 | name="ldap_action_add_configuration" class="icon-add icon-default-style" |
@@ -4,23 +4,23 @@ discard block |
||
| 4 | 4 | <?php |
| 5 | 5 | $i = 1; |
| 6 | 6 | $sel = ' selected'; |
| 7 | - foreach($_['serverConfigurationPrefixes'] as $prefix) { |
|
| 7 | + foreach ($_['serverConfigurationPrefixes'] as $prefix) { |
|
| 8 | 8 | ?> |
| 9 | - <option value="<?php p($prefix); ?>"<?php p($sel); $sel = ''; ?>><?php p($l->t('%s. Server:', array($i++)));?> <?php p(' '.$_['serverConfigurationHosts'][$prefix]); ?></option> |
|
| 9 | + <option value="<?php p($prefix); ?>"<?php p($sel); $sel = ''; ?>><?php p($l->t('%s. Server:', array($i++))); ?> <?php p(' '.$_['serverConfigurationHosts'][$prefix]); ?></option> |
|
| 10 | 10 | <?php |
| 11 | 11 | } |
| 12 | 12 | ?> |
| 13 | 13 | </select> |
| 14 | 14 | <button type="button" id="ldap_action_add_configuration" |
| 15 | 15 | name="ldap_action_add_configuration" class="icon-add icon-default-style" |
| 16 | - title="<?php p($l->t('Add a new configuration'));?>"> </button> |
|
| 16 | + title="<?php p($l->t('Add a new configuration')); ?>"> </button> |
|
| 17 | 17 | <button type="button" id="ldap_action_copy_configuration" |
| 18 | 18 | name="ldap_action_copy_configuration" |
| 19 | 19 | class="ldapIconCopy icon-default-style" |
| 20 | - title="<?php p($l->t('Copy current configuration into new directory binding'));?>"> </button> |
|
| 20 | + title="<?php p($l->t('Copy current configuration into new directory binding')); ?>"> </button> |
|
| 21 | 21 | <button type="button" id="ldap_action_delete_configuration" |
| 22 | 22 | name="ldap_action_delete_configuration" class="icon-delete icon-default-style" |
| 23 | - title="<?php p($l->t('Delete the current configuration'));?>"> </button> |
|
| 23 | + title="<?php p($l->t('Delete the current configuration')); ?>"> </button> |
|
| 24 | 24 | </p> |
| 25 | 25 | |
| 26 | 26 | <div class="hostPortCombinator"> |
@@ -29,14 +29,14 @@ discard block |
||
| 29 | 29 | <div class="table"> |
| 30 | 30 | <input type="text" class="host" id="ldap_host" |
| 31 | 31 | name="ldap_host" |
| 32 | - placeholder="<?php p($l->t('Host'));?>" |
|
| 33 | - title="<?php p($l->t('You can omit the protocol, unless you require SSL. If so, start with ldaps://'));?>" |
|
| 32 | + placeholder="<?php p($l->t('Host')); ?>" |
|
| 33 | + title="<?php p($l->t('You can omit the protocol, unless you require SSL. If so, start with ldaps://')); ?>" |
|
| 34 | 34 | /> |
| 35 | 35 | <span class="hostPortCombinatorSpan"> |
| 36 | 36 | <input type="number" id="ldap_port" name="ldap_port" |
| 37 | - placeholder="<?php p($l->t('Port'));?>" /> |
|
| 37 | + placeholder="<?php p($l->t('Port')); ?>" /> |
|
| 38 | 38 | <button class="ldapDetectPort" name="ldapDetectPort" type="button"> |
| 39 | - <?php p($l->t('Detect Port'));?> |
|
| 39 | + <?php p($l->t('Detect Port')); ?> |
|
| 40 | 40 | </button> |
| 41 | 41 | </span> |
| 42 | 42 | </div> |
@@ -46,19 +46,19 @@ discard block |
||
| 46 | 46 | <div class="tablerow"> |
| 47 | 47 | <input type="text" id="ldap_dn" name="ldap_dn" |
| 48 | 48 | class="tablecell" |
| 49 | - placeholder="<?php p($l->t('User DN'));?>" autocomplete="off" |
|
| 50 | - title="<?php p($l->t('The DN of the client user with which the bind shall be done, e.g. uid=agent,dc=example,dc=com. For anonymous access, leave DN and Password empty.'));?>" |
|
| 49 | + placeholder="<?php p($l->t('User DN')); ?>" autocomplete="off" |
|
| 50 | + title="<?php p($l->t('The DN of the client user with which the bind shall be done, e.g. uid=agent,dc=example,dc=com. For anonymous access, leave DN and Password empty.')); ?>" |
|
| 51 | 51 | /> |
| 52 | 52 | </div> |
| 53 | 53 | |
| 54 | 54 | <div class="tablerow"> |
| 55 | 55 | <input type="password" id="ldap_agent_password" |
| 56 | 56 | class="tablecell" name="ldap_agent_password" |
| 57 | - placeholder="<?php p($l->t('Password'));?>" autocomplete="off" |
|
| 58 | - title="<?php p($l->t('For anonymous access, leave DN and Password empty.'));?>" |
|
| 57 | + placeholder="<?php p($l->t('Password')); ?>" autocomplete="off" |
|
| 58 | + title="<?php p($l->t('For anonymous access, leave DN and Password empty.')); ?>" |
|
| 59 | 59 | /> |
| 60 | 60 | <button class="ldapSaveAgentCredentials" name="ldapSaveAgentCredentials" type="button"> |
| 61 | - <?php p($l->t('Save Credentials'));?> |
|
| 61 | + <?php p($l->t('Save Credentials')); ?> |
|
| 62 | 62 | </button> |
| 63 | 63 | </div> |
| 64 | 64 | <div class="tablerow"> </div> |
@@ -66,24 +66,24 @@ discard block |
||
| 66 | 66 | <div class="tablerow"> |
| 67 | 67 | <textarea id="ldap_base" name="ldap_base" |
| 68 | 68 | class="tablecell" |
| 69 | - placeholder="<?php p($l->t('One Base DN per line'));?>" |
|
| 70 | - title="<?php p($l->t('You can specify Base DN for users and groups in the Advanced tab'));?>"> |
|
| 69 | + placeholder="<?php p($l->t('One Base DN per line')); ?>" |
|
| 70 | + title="<?php p($l->t('You can specify Base DN for users and groups in the Advanced tab')); ?>"> |
|
| 71 | 71 | </textarea> |
| 72 | 72 | <button class="ldapDetectBase" name="ldapDetectBase" type="button"> |
| 73 | - <?php p($l->t('Detect Base DN'));?> |
|
| 73 | + <?php p($l->t('Detect Base DN')); ?> |
|
| 74 | 74 | </button> |
| 75 | 75 | <button class="ldapTestBase" name="ldapTestBase" type="button"> |
| 76 | - <?php p($l->t('Test Base DN'));?> |
|
| 76 | + <?php p($l->t('Test Base DN')); ?> |
|
| 77 | 77 | </button> |
| 78 | 78 | </div> |
| 79 | 79 | |
| 80 | 80 | <div class="tablerow left"> |
| 81 | 81 | <input type="checkbox" id="ldap_experienced_admin" value="1" |
| 82 | 82 | name="ldap_experienced_admin" class="tablecell" |
| 83 | - title="<?php p($l->t('Avoids automatic LDAP requests. Better for bigger setups, but requires some LDAP knowledge.'));?>" |
|
| 83 | + title="<?php p($l->t('Avoids automatic LDAP requests. Better for bigger setups, but requires some LDAP knowledge.')); ?>" |
|
| 84 | 84 | /> |
| 85 | 85 | <label for="ldap_experienced_admin" class="tablecell"> |
| 86 | - <?php p($l->t('Manually enter LDAP filters (recommended for large directories)'));?> |
|
| 86 | + <?php p($l->t('Manually enter LDAP filters (recommended for large directories)')); ?> |
|
| 87 | 87 | </label> |
| 88 | 88 | </div> |
| 89 | 89 | |