summaryrefslogtreecommitdiff
path: root/lib/plugins
diff options
context:
space:
mode:
authorAnika Henke <anika@selfthinker.org>2014-01-05 16:25:21 +0000
committerAnika Henke <anika@selfthinker.org>2014-01-05 16:25:21 +0000
commit8491e52805a9aaef90168f1417c6e0806fb7c5d7 (patch)
tree536ad50878f0ac6f6815db91f8bcb4819bc092ae /lib/plugins
parent6fdd11e032b654dd27de346f7e54231ee043d7ef (diff)
parentdfaf5f6c54597f81b1a8b777f55b89c93f87a345 (diff)
downloadrpg-8491e52805a9aaef90168f1417c6e0806fb7c5d7.tar.gz
rpg-8491e52805a9aaef90168f1417c6e0806fb7c5d7.tar.bz2
Merge remote-tracking branch 'origin/master' into extension_manager
Diffstat (limited to 'lib/plugins')
-rw-r--r--lib/plugins/acl/action.php88
-rw-r--r--lib/plugins/acl/admin.php10
-rw-r--r--lib/plugins/acl/ajax.php57
-rw-r--r--lib/plugins/acl/lang/ar/lang.php4
-rw-r--r--lib/plugins/acl/lang/bg/lang.php4
-rw-r--r--lib/plugins/acl/lang/cs/lang.php4
-rw-r--r--lib/plugins/acl/lang/da/lang.php4
-rw-r--r--lib/plugins/acl/lang/de-informal/lang.php5
-rw-r--r--lib/plugins/acl/lang/eo/lang.php5
-rw-r--r--lib/plugins/acl/lang/fa/lang.php5
-rw-r--r--lib/plugins/acl/lang/fi/lang.php5
-rw-r--r--lib/plugins/acl/lang/he/lang.php4
-rw-r--r--lib/plugins/acl/lang/hu/lang.php5
-rw-r--r--lib/plugins/acl/lang/id/lang.php4
-rw-r--r--lib/plugins/acl/lang/ja/lang.php4
-rw-r--r--lib/plugins/acl/lang/ko/help.txt2
-rw-r--r--lib/plugins/acl/lang/ko/lang.php9
-rw-r--r--lib/plugins/acl/lang/ne/lang.php5
-rw-r--r--lib/plugins/acl/lang/nl/lang.php6
-rw-r--r--lib/plugins/acl/lang/no/lang.php6
-rw-r--r--lib/plugins/acl/lang/pl/lang.php4
-rw-r--r--lib/plugins/acl/lang/pt-br/lang.php4
-rw-r--r--lib/plugins/acl/lang/pt/lang.php4
-rw-r--r--lib/plugins/acl/lang/ru/help.txt9
-rw-r--r--lib/plugins/acl/lang/ru/lang.php2
-rw-r--r--lib/plugins/acl/lang/sk/lang.php4
-rw-r--r--lib/plugins/acl/lang/sl/lang.php5
-rw-r--r--lib/plugins/acl/lang/tr/lang.php4
-rw-r--r--lib/plugins/acl/lang/vi/lang.php71
-rw-r--r--lib/plugins/acl/remote.php8
-rw-r--r--lib/plugins/acl/script.js9
-rw-r--r--lib/plugins/acl/style.css2
-rw-r--r--lib/plugins/action.php10
-rw-r--r--lib/plugins/authad/adLDAP/adLDAP.php1900
-rw-r--r--lib/plugins/authad/adLDAP/classes/adLDAPComputers.php304
-rw-r--r--lib/plugins/authad/adLDAP/classes/adLDAPContacts.php588
-rw-r--r--lib/plugins/authad/adLDAP/classes/adLDAPExchange.php778
-rw-r--r--lib/plugins/authad/adLDAP/classes/adLDAPFolders.php356
-rw-r--r--lib/plugins/authad/adLDAP/classes/adLDAPGroups.php1262
-rw-r--r--lib/plugins/authad/adLDAP/classes/adLDAPUsers.php1364
-rw-r--r--lib/plugins/authad/adLDAP/classes/adLDAPUtils.php526
-rw-r--r--lib/plugins/authad/adLDAP/collections/adLDAPCollection.php274
-rw-r--r--lib/plugins/authad/adLDAP/collections/adLDAPComputerCollection.php92
-rw-r--r--lib/plugins/authad/adLDAP/collections/adLDAPContactCollection.php92
-rw-r--r--lib/plugins/authad/adLDAP/collections/adLDAPGroupCollection.php92
-rw-r--r--lib/plugins/authad/adLDAP/collections/adLDAPUserCollection.php92
-rw-r--r--lib/plugins/authad/auth.php26
-rw-r--r--lib/plugins/authad/conf/default.php1
-rw-r--r--lib/plugins/authad/conf/metadata.php1
-rw-r--r--lib/plugins/authad/lang/ar/settings.php12
-rw-r--r--lib/plugins/authad/lang/bg/settings.php29
-rw-r--r--lib/plugins/authad/lang/cs/settings.php5
-rw-r--r--lib/plugins/authad/lang/da/settings.php20
-rw-r--r--lib/plugins/authad/lang/de-informal/settings.php5
-rw-r--r--lib/plugins/authad/lang/de/settings.php3
-rw-r--r--lib/plugins/authad/lang/el/settings.php8
-rw-r--r--lib/plugins/authad/lang/en/settings.php3
-rw-r--r--lib/plugins/authad/lang/eo/settings.php7
-rw-r--r--lib/plugins/authad/lang/es/settings.php15
-rw-r--r--lib/plugins/authad/lang/fi/settings.php7
-rw-r--r--lib/plugins/authad/lang/hu/settings.php5
-rw-r--r--lib/plugins/authad/lang/ja/settings.php18
-rw-r--r--lib/plugins/authad/lang/ko/settings.php9
-rw-r--r--lib/plugins/authad/lang/nl/settings.php13
-rw-r--r--lib/plugins/authad/lang/pl/settings.php7
-rw-r--r--lib/plugins/authad/lang/pt-br/settings.php7
-rw-r--r--lib/plugins/authad/lang/pt/settings.php12
-rw-r--r--lib/plugins/authad/lang/ru/settings.php11
-rw-r--r--lib/plugins/authad/lang/sk/settings.php20
-rw-r--r--lib/plugins/authldap/auth.php6
-rw-r--r--lib/plugins/authldap/lang/ar/settings.php13
-rw-r--r--lib/plugins/authldap/lang/bg/settings.php7
-rw-r--r--lib/plugins/authldap/lang/cs/settings.php7
-rw-r--r--lib/plugins/authldap/lang/da/settings.php15
-rw-r--r--lib/plugins/authldap/lang/de-informal/settings.php4
-rw-r--r--lib/plugins/authldap/lang/de/settings.php6
-rw-r--r--lib/plugins/authldap/lang/eo/settings.php11
-rw-r--r--lib/plugins/authldap/lang/es/settings.php13
-rw-r--r--lib/plugins/authldap/lang/fi/settings.php9
-rw-r--r--lib/plugins/authldap/lang/fr/settings.php6
-rw-r--r--lib/plugins/authldap/lang/he/settings.php8
-rw-r--r--lib/plugins/authldap/lang/hu/settings.php5
-rw-r--r--lib/plugins/authldap/lang/it/settings.php4
-rw-r--r--lib/plugins/authldap/lang/ja/settings.php22
-rw-r--r--lib/plugins/authldap/lang/ko/settings.php17
-rw-r--r--lib/plugins/authldap/lang/nl/settings.php11
-rw-r--r--lib/plugins/authldap/lang/pl/settings.php5
-rw-r--r--lib/plugins/authldap/lang/pt-br/settings.php5
-rw-r--r--lib/plugins/authldap/lang/pt/settings.php18
-rw-r--r--lib/plugins/authldap/lang/ru/settings.php7
-rw-r--r--lib/plugins/authldap/lang/sk/settings.php27
-rw-r--r--lib/plugins/authldap/lang/zh-tw/settings.php6
-rw-r--r--lib/plugins/authldap/lang/zh/settings.php4
-rw-r--r--lib/plugins/authmysql/lang/bg/settings.php16
-rw-r--r--lib/plugins/authmysql/lang/cs/settings.php5
-rw-r--r--lib/plugins/authmysql/lang/da/settings.php27
-rw-r--r--lib/plugins/authmysql/lang/de-informal/settings.php4
-rw-r--r--lib/plugins/authmysql/lang/en/settings.php4
-rw-r--r--lib/plugins/authmysql/lang/eo/settings.php5
-rw-r--r--lib/plugins/authmysql/lang/es/settings.php12
-rw-r--r--lib/plugins/authmysql/lang/hu/settings.php5
-rw-r--r--lib/plugins/authmysql/lang/it/settings.php7
-rw-r--r--lib/plugins/authmysql/lang/ja/settings.php7
-rw-r--r--lib/plugins/authmysql/lang/ko/settings.php14
-rw-r--r--lib/plugins/authmysql/lang/nl/settings.php41
-rw-r--r--lib/plugins/authmysql/lang/pl/settings.php5
-rw-r--r--lib/plugins/authmysql/lang/pt-br/settings.php5
-rw-r--r--lib/plugins/authmysql/lang/pt/settings.php23
-rw-r--r--lib/plugins/authmysql/lang/ru/settings.php5
-rw-r--r--lib/plugins/authmysql/lang/sk/settings.php42
-rw-r--r--lib/plugins/authmysql/lang/sl/settings.php11
-rw-r--r--lib/plugins/authpgsql/lang/bg/settings.php7
-rw-r--r--lib/plugins/authpgsql/lang/cs/settings.php5
-rw-r--r--lib/plugins/authpgsql/lang/da/settings.php22
-rw-r--r--lib/plugins/authpgsql/lang/de-informal/settings.php4
-rw-r--r--lib/plugins/authpgsql/lang/en/settings.php2
-rw-r--r--lib/plugins/authpgsql/lang/eo/settings.php5
-rw-r--r--lib/plugins/authpgsql/lang/hu/settings.php5
-rw-r--r--lib/plugins/authpgsql/lang/ja/settings.php7
-rw-r--r--lib/plugins/authpgsql/lang/ko/settings.php14
-rw-r--r--lib/plugins/authpgsql/lang/nl/settings.php37
-rw-r--r--lib/plugins/authpgsql/lang/pt-br/settings.php5
-rw-r--r--lib/plugins/authpgsql/lang/pt/settings.php22
-rw-r--r--lib/plugins/authpgsql/lang/ru/settings.php30
-rw-r--r--lib/plugins/authpgsql/lang/sk/settings.php38
-rw-r--r--lib/plugins/authpgsql/lang/sl/settings.php8
-rw-r--r--lib/plugins/config/admin.php488
-rw-r--r--lib/plugins/config/lang/de-informal/lang.php1
-rw-r--r--lib/plugins/config/lang/de/lang.php1
-rw-r--r--lib/plugins/config/lang/en/lang.php6
-rw-r--r--lib/plugins/config/lang/ko/intro.txt8
-rw-r--r--lib/plugins/config/lang/ko/lang.php34
-rw-r--r--lib/plugins/config/lang/pt-br/lang.php1
-rw-r--r--lib/plugins/config/settings/config.class.php1521
-rw-r--r--lib/plugins/config/settings/config.metadata.php1
-rw-r--r--lib/plugins/config/settings/extra.class.php270
-rw-r--r--lib/plugins/info/syntax.php45
-rw-r--r--lib/plugins/plugin/admin.php5
-rw-r--r--lib/plugins/plugin/classes/ap_download.class.php2
-rw-r--r--lib/plugins/plugin/classes/ap_info.class.php3
-rw-r--r--lib/plugins/plugin/classes/ap_manage.class.php2
-rw-r--r--lib/plugins/plugin/lang/ar/lang.php5
-rw-r--r--lib/plugins/plugin/lang/bg/lang.php4
-rw-r--r--lib/plugins/plugin/lang/cs/lang.php6
-rw-r--r--lib/plugins/plugin/lang/da/lang.php7
-rw-r--r--lib/plugins/plugin/lang/de-informal/lang.php5
-rw-r--r--lib/plugins/plugin/lang/eo/lang.php5
-rw-r--r--lib/plugins/plugin/lang/fa/lang.php5
-rw-r--r--lib/plugins/plugin/lang/fi/lang.php5
-rw-r--r--lib/plugins/plugin/lang/he/lang.php4
-rw-r--r--lib/plugins/plugin/lang/hi/lang.php5
-rw-r--r--lib/plugins/plugin/lang/hu/lang.php5
-rw-r--r--lib/plugins/plugin/lang/id/lang.php5
-rw-r--r--lib/plugins/plugin/lang/ja/lang.php4
-rw-r--r--lib/plugins/plugin/lang/ko/admin_plugin.txt2
-rw-r--r--lib/plugins/plugin/lang/ko/lang.php21
-rw-r--r--lib/plugins/plugin/lang/ne/lang.php5
-rw-r--r--lib/plugins/plugin/lang/nl/lang.php7
-rw-r--r--lib/plugins/plugin/lang/no/lang.php7
-rw-r--r--lib/plugins/plugin/lang/pl/lang.php4
-rw-r--r--lib/plugins/plugin/lang/pt-br/lang.php5
-rw-r--r--lib/plugins/plugin/lang/pt/lang.php5
-rw-r--r--lib/plugins/plugin/lang/ru/lang.php8
-rw-r--r--lib/plugins/plugin/lang/sk/lang.php5
-rw-r--r--lib/plugins/plugin/lang/sl/lang.php5
-rw-r--r--lib/plugins/plugin/lang/tr/lang.php5
-rw-r--r--lib/plugins/plugin/lang/zh/lang.php3
-rw-r--r--lib/plugins/popularity/action.php1
-rw-r--r--lib/plugins/popularity/admin.php4
-rw-r--r--lib/plugins/popularity/helper.php22
-rw-r--r--lib/plugins/popularity/lang/ar/lang.php5
-rw-r--r--lib/plugins/popularity/lang/bg/lang.php5
-rw-r--r--lib/plugins/popularity/lang/cs/lang.php5
-rw-r--r--lib/plugins/popularity/lang/da/lang.php5
-rw-r--r--lib/plugins/popularity/lang/da/submitted.txt2
-rw-r--r--lib/plugins/popularity/lang/de-informal/lang.php5
-rw-r--r--lib/plugins/popularity/lang/eo/lang.php5
-rw-r--r--lib/plugins/popularity/lang/fa/lang.php5
-rw-r--r--lib/plugins/popularity/lang/fi/lang.php5
-rw-r--r--lib/plugins/popularity/lang/he/lang.php5
-rw-r--r--lib/plugins/popularity/lang/hi/lang.php5
-rw-r--r--lib/plugins/popularity/lang/hu/lang.php5
-rw-r--r--lib/plugins/popularity/lang/ja/lang.php5
-rw-r--r--lib/plugins/popularity/lang/ko/intro.txt4
-rw-r--r--lib/plugins/popularity/lang/ko/lang.php8
-rw-r--r--lib/plugins/popularity/lang/ne/lang.php5
-rw-r--r--lib/plugins/popularity/lang/nl/lang.php5
-rw-r--r--lib/plugins/popularity/lang/no/lang.php7
-rw-r--r--lib/plugins/popularity/lang/pl/lang.php5
-rw-r--r--lib/plugins/popularity/lang/pt-br/lang.php5
-rw-r--r--lib/plugins/popularity/lang/pt/lang.php5
-rw-r--r--lib/plugins/popularity/lang/ru/intro.txt2
-rw-r--r--lib/plugins/popularity/lang/ru/submitted.txt3
-rw-r--r--lib/plugins/popularity/lang/sk/lang.php5
-rw-r--r--lib/plugins/popularity/lang/sl/lang.php5
-rw-r--r--lib/plugins/popularity/lang/tr/lang.php5
-rw-r--r--lib/plugins/revert/admin.php3
-rw-r--r--lib/plugins/revert/lang/ar/lang.php7
-rw-r--r--lib/plugins/revert/lang/bg/lang.php4
-rw-r--r--lib/plugins/revert/lang/cs/lang.php7
-rw-r--r--lib/plugins/revert/lang/da/lang.php5
-rw-r--r--lib/plugins/revert/lang/de-informal/lang.php5
-rw-r--r--lib/plugins/revert/lang/eo/lang.php5
-rw-r--r--lib/plugins/revert/lang/fa/lang.php5
-rw-r--r--lib/plugins/revert/lang/fi/lang.php5
-rw-r--r--lib/plugins/revert/lang/he/lang.php5
-rw-r--r--lib/plugins/revert/lang/hu/lang.php5
-rw-r--r--lib/plugins/revert/lang/ja/lang.php4
-rw-r--r--lib/plugins/revert/lang/ko/intro.txt2
-rw-r--r--lib/plugins/revert/lang/ko/lang.php11
-rw-r--r--lib/plugins/revert/lang/ne/lang.php5
-rw-r--r--lib/plugins/revert/lang/nl/lang.php3
-rw-r--r--lib/plugins/revert/lang/no/lang.php9
-rw-r--r--lib/plugins/revert/lang/pl/lang.php4
-rw-r--r--lib/plugins/revert/lang/pt-br/lang.php5
-rw-r--r--lib/plugins/revert/lang/pt/lang.php5
-rw-r--r--lib/plugins/revert/lang/ru/lang.php2
-rw-r--r--lib/plugins/revert/lang/sk/intro.txt3
-rw-r--r--lib/plugins/revert/lang/sk/lang.php7
-rw-r--r--lib/plugins/revert/lang/sl/lang.php5
-rw-r--r--lib/plugins/revert/lang/sv/lang.php1
-rw-r--r--lib/plugins/revert/lang/tr/lang.php5
-rw-r--r--lib/plugins/safefnrecode/action.php2
-rw-r--r--lib/plugins/syntax.php44
-rw-r--r--lib/plugins/usermanager/_test/csv_export.test.php59
-rw-r--r--lib/plugins/usermanager/_test/csv_import.test.php185
-rw-r--r--lib/plugins/usermanager/_test/mocks.class.php58
-rw-r--r--lib/plugins/usermanager/admin.php547
-rw-r--r--lib/plugins/usermanager/lang/ar/lang.php5
-rw-r--r--lib/plugins/usermanager/lang/bg/lang.php5
-rw-r--r--lib/plugins/usermanager/lang/cs/import.txt9
-rw-r--r--lib/plugins/usermanager/lang/cs/lang.php23
-rw-r--r--lib/plugins/usermanager/lang/da/lang.php23
-rw-r--r--lib/plugins/usermanager/lang/de-informal/import.txt7
-rw-r--r--lib/plugins/usermanager/lang/de-informal/lang.php21
-rw-r--r--lib/plugins/usermanager/lang/de/import.txt8
-rw-r--r--lib/plugins/usermanager/lang/de/lang.php7
-rw-r--r--lib/plugins/usermanager/lang/en/lang.php5
-rw-r--r--lib/plugins/usermanager/lang/eo/import.txt9
-rw-r--r--lib/plugins/usermanager/lang/eo/lang.php24
-rw-r--r--lib/plugins/usermanager/lang/fa/lang.php5
-rw-r--r--lib/plugins/usermanager/lang/fi/lang.php5
-rw-r--r--lib/plugins/usermanager/lang/fr/import.txt11
-rw-r--r--lib/plugins/usermanager/lang/fr/lang.php21
-rw-r--r--lib/plugins/usermanager/lang/he/lang.php5
-rw-r--r--lib/plugins/usermanager/lang/hu/import.txt9
-rw-r--r--lib/plugins/usermanager/lang/hu/lang.php24
-rw-r--r--lib/plugins/usermanager/lang/id/lang.php5
-rw-r--r--lib/plugins/usermanager/lang/it/lang.php3
-rw-r--r--lib/plugins/usermanager/lang/ja/import.txt10
-rw-r--r--lib/plugins/usermanager/lang/ja/lang.php26
-rw-r--r--lib/plugins/usermanager/lang/ko/import.txt9
-rw-r--r--lib/plugins/usermanager/lang/ko/lang.php39
-rw-r--r--lib/plugins/usermanager/lang/ne/lang.php5
-rw-r--r--lib/plugins/usermanager/lang/nl/import.txt2
-rw-r--r--lib/plugins/usermanager/lang/nl/lang.php6
-rw-r--r--lib/plugins/usermanager/lang/no/lang.php7
-rw-r--r--lib/plugins/usermanager/lang/pl/lang.php5
-rw-r--r--lib/plugins/usermanager/lang/pt-br/lang.php26
-rw-r--r--lib/plugins/usermanager/lang/pt/import.txt9
-rw-r--r--lib/plugins/usermanager/lang/pt/lang.php17
-rw-r--r--lib/plugins/usermanager/lang/ru/import.txt6
-rw-r--r--lib/plugins/usermanager/lang/ru/lang.php4
-rw-r--r--lib/plugins/usermanager/lang/sk/import.txt9
-rw-r--r--lib/plugins/usermanager/lang/sk/lang.php23
-rw-r--r--lib/plugins/usermanager/lang/sl/lang.php17
-rw-r--r--lib/plugins/usermanager/lang/tr/lang.php5
-rw-r--r--lib/plugins/usermanager/lang/zh-tw/import.txt9
-rw-r--r--lib/plugins/usermanager/lang/zh-tw/lang.php32
-rw-r--r--lib/plugins/usermanager/lang/zh/import.txt7
-rw-r--r--lib/plugins/usermanager/lang/zh/lang.php11
-rw-r--r--lib/plugins/usermanager/style.css6
272 files changed, 7375 insertions, 5880 deletions
diff --git a/lib/plugins/acl/action.php b/lib/plugins/acl/action.php
new file mode 100644
index 000000000..a7226f598
--- /dev/null
+++ b/lib/plugins/acl/action.php
@@ -0,0 +1,88 @@
+<?php
+/**
+ * AJAX call handler for ACL plugin
+ *
+ * @license GPL 2 (http://www.gnu.org/licenses/gpl.html)
+ * @author Andreas Gohr <andi@splitbrain.org>
+ */
+
+// must be run within Dokuwiki
+if(!defined('DOKU_INC')) die();
+
+/**
+ * Register handler
+ */
+class action_plugin_acl extends DokuWiki_Action_Plugin {
+
+ /**
+ * Registers a callback function for a given event
+ *
+ * @param Doku_Event_Handler $controller DokuWiki's event controller object
+ * @return void
+ */
+ public function register(Doku_Event_Handler $controller) {
+
+ $controller->register_hook('AJAX_CALL_UNKNOWN', 'BEFORE', $this, 'handle_ajax_call_acl');
+
+ }
+
+ /**
+ * AJAX call handler for ACL plugin
+ *
+ * @param Doku_Event $event event object by reference
+ * @param mixed $param empty
+ * @return void
+ */
+
+ public function handle_ajax_call_acl(Doku_Event &$event, $param) {
+ if($event->data !== 'plugin_acl') {
+ return;
+ }
+ $event->stopPropagation();
+ $event->preventDefault();
+
+ global $ID;
+ global $INPUT;
+
+ if(!auth_isadmin()) {
+ echo 'for admins only';
+ return;
+ }
+ if(!checkSecurityToken()) {
+ echo 'CRSF Attack';
+ return;
+ }
+
+ $ID = getID();
+
+ /** @var $acl admin_plugin_acl */
+ $acl = plugin_load('admin', 'acl');
+ $acl->handle();
+
+ $ajax = $INPUT->str('ajax');
+ header('Content-Type: text/html; charset=utf-8');
+
+ if($ajax == 'info') {
+ $acl->_html_info();
+ } elseif($ajax == 'tree') {
+
+ $ns = $INPUT->str('ns');
+ if($ns == '*') {
+ $ns = '';
+ }
+ $ns = cleanID($ns);
+ $lvl = count(explode(':', $ns));
+ $ns = utf8_encodeFN(str_replace(':', '/', $ns));
+
+ $data = $acl->_get_tree($ns, $ns);
+
+ foreach(array_keys($data) as $item) {
+ $data[$item]['level'] = $lvl + 1;
+ }
+ echo html_buildlist(
+ $data, 'acl', array($acl, '_html_list_acl'),
+ array($acl, '_html_li_acl')
+ );
+ }
+ }
+}
diff --git a/lib/plugins/acl/admin.php b/lib/plugins/acl/admin.php
index 50377da81..6c7c28ff6 100644
--- a/lib/plugins/acl/admin.php
+++ b/lib/plugins/acl/admin.php
@@ -61,7 +61,6 @@ class admin_plugin_acl extends DokuWiki_Admin_Plugin {
// fresh 1:1 copy without replacements
$AUTH_ACL = file($config_cascade['acl']['default']);
-
// namespace given?
if($INPUT->str('ns') == '*'){
$this->ns = '*';
@@ -346,7 +345,7 @@ class admin_plugin_acl extends DokuWiki_Admin_Plugin {
}
/**
- * Print infos and editor
+ * Print info and editor
*/
function _html_info(){
global $ID;
@@ -386,7 +385,6 @@ class admin_plugin_acl extends DokuWiki_Admin_Plugin {
echo '<legend>'.$this->getLang('acl_mod').'</legend>';
}
-
echo $this->_html_checkboxes($current,empty($this->ns),'acl');
if(is_null($current)){
@@ -556,7 +554,7 @@ class admin_plugin_acl extends DokuWiki_Admin_Plugin {
$line = trim(preg_replace('/#.*$/','',$line)); //ignore comments
if(!$line) continue;
- $acl = preg_split('/\s+/',$line);
+ $acl = preg_split('/[ \t]+/',$line);
//0 is pagename, 1 is user, 2 is acl
$acl[1] = rawurldecode($acl[1]);
@@ -686,7 +684,6 @@ class admin_plugin_acl extends DokuWiki_Admin_Plugin {
if($acl_level > AUTH_EDIT) $acl_level = AUTH_EDIT;
}
-
$new_acl = "$acl_scope\t$acl_user\t$acl_level\n";
$new_config = $acl_config.$new_acl;
@@ -704,7 +701,7 @@ class admin_plugin_acl extends DokuWiki_Admin_Plugin {
$acl_config = file($config_cascade['acl']['default']);
$acl_user = auth_nameencode($acl_user,true);
- $acl_pattern = '^'.preg_quote($acl_scope,'/').'\s+'.$acl_user.'\s+[0-8].*$';
+ $acl_pattern = '^'.preg_quote($acl_scope,'/').'[ \t]+'.$acl_user.'[ \t]+[0-8].*$';
// save all non!-matching
$new_config = preg_grep("/$acl_pattern/", $acl_config, PREG_GREP_INVERT);
@@ -775,7 +772,6 @@ class admin_plugin_acl extends DokuWiki_Admin_Plugin {
$inlist = true;
}
-
echo '<select name="acl_t" class="edit">'.NL;
echo ' <option value="__g__" class="aclgroup"'.$gsel.'>'.$this->getLang('acl_group').':</option>'.NL;
echo ' <option value="__u__" class="acluser"'.$usel.'>'.$this->getLang('acl_user').':</option>'.NL;
diff --git a/lib/plugins/acl/ajax.php b/lib/plugins/acl/ajax.php
deleted file mode 100644
index 10e18af97..000000000
--- a/lib/plugins/acl/ajax.php
+++ /dev/null
@@ -1,57 +0,0 @@
-<?php
-/**
- * AJAX call handler for ACL plugin
- *
- * @license GPL 2 (http://www.gnu.org/licenses/gpl.html)
- * @author Andreas Gohr <andi@splitbrain.org>
- */
-
-if(!defined('DOKU_INC')) define('DOKU_INC',dirname(__FILE__).'/../../../');
-require_once(DOKU_INC.'inc/init.php');
-//close session
-session_write_close();
-
-global $conf;
-global $ID;
-global $INPUT;
-
-//fix for Opera XMLHttpRequests
-$postData = http_get_raw_post_data();
-if(!count($_POST) && !empty($postData)){
- parse_str($postData, $_POST);
-}
-
-if(!auth_isadmin()) die('for admins only');
-if(!checkSecurityToken()) die('CRSF Attack');
-
-$ID = getID();
-
-/** @var $acl admin_plugin_acl */
-$acl = plugin_load('admin','acl');
-$acl->handle();
-
-$ajax = $INPUT->str('ajax');
-header('Content-Type: text/html; charset=utf-8');
-
-if($ajax == 'info'){
- $acl->_html_info();
-}elseif($ajax == 'tree'){
-
- $dir = $conf['datadir'];
- $ns = $INPUT->str('ns');
- if($ns == '*'){
- $ns ='';
- }
- $ns = cleanID($ns);
- $lvl = count(explode(':',$ns));
- $ns = utf8_encodeFN(str_replace(':','/',$ns));
-
- $data = $acl->_get_tree($ns,$ns);
-
- foreach(array_keys($data) as $item){
- $data[$item]['level'] = $lvl+1;
- }
- echo html_buildlist($data, 'acl', array($acl, '_html_list_acl'),
- array($acl, '_html_li_acl'));
-}
-
diff --git a/lib/plugins/acl/lang/ar/lang.php b/lib/plugins/acl/lang/ar/lang.php
index 7c05b721c..4e44dab5f 100644
--- a/lib/plugins/acl/lang/ar/lang.php
+++ b/lib/plugins/acl/lang/ar/lang.php
@@ -1,8 +1,8 @@
<?php
+
/**
- * Arabic language file
- *
* @license GPL 2 (http://www.gnu.org/licenses/gpl.html)
+ *
* @author Mostafa Hussein <mostafa@gmail.com>
* @author Yaman Hokan <always.smile.yh@hotmail.com>
* @author Usama Akkad <uahello@gmail.com>
diff --git a/lib/plugins/acl/lang/bg/lang.php b/lib/plugins/acl/lang/bg/lang.php
index 95201750e..14e7d311c 100644
--- a/lib/plugins/acl/lang/bg/lang.php
+++ b/lib/plugins/acl/lang/bg/lang.php
@@ -1,8 +1,8 @@
<?php
+
/**
- * bulgarian language file
- *
* @license GPL 2 (http://www.gnu.org/licenses/gpl.html)
+ *
* @author Nikolay Vladimirov <nikolay@vladimiroff.com>
* @author Viktor Usunov <usun0v@mail.bg>
* @author Kiril <neohidra@gmail.com>
diff --git a/lib/plugins/acl/lang/cs/lang.php b/lib/plugins/acl/lang/cs/lang.php
index a4e59287a..8031612f7 100644
--- a/lib/plugins/acl/lang/cs/lang.php
+++ b/lib/plugins/acl/lang/cs/lang.php
@@ -1,8 +1,8 @@
<?php
+
/**
- * Czech language file
- *
* @license GPL 2 (http://www.gnu.org/licenses/gpl.html)
+ *
* @author Bohumir Zamecnik <bohumir@zamecnik.org>
* @author Zbynek Krivka <zbynek.krivka@seznam.cz>
* @author tomas@valenta.cz
diff --git a/lib/plugins/acl/lang/da/lang.php b/lib/plugins/acl/lang/da/lang.php
index 4a9d11448..2558795fd 100644
--- a/lib/plugins/acl/lang/da/lang.php
+++ b/lib/plugins/acl/lang/da/lang.php
@@ -1,8 +1,8 @@
<?php
+
/**
- * Danish language file
- *
* @license GPL 2 (http://www.gnu.org/licenses/gpl.html)
+ *
* @author koeppe <koeppe@kazur.dk>
* @author Jon Bendtsen <bendtsen@diku.dk>
* @author Lars Næsbye Christensen <larsnaesbye@stud.ku.dk>
diff --git a/lib/plugins/acl/lang/de-informal/lang.php b/lib/plugins/acl/lang/de-informal/lang.php
index 3487f4257..35df13dc0 100644
--- a/lib/plugins/acl/lang/de-informal/lang.php
+++ b/lib/plugins/acl/lang/de-informal/lang.php
@@ -1,7 +1,8 @@
<?php
+
/**
- * German (informal) language file
- *
+ * @license GPL 2 (http://www.gnu.org/licenses/gpl.html)
+ *
* @author Alexander Fischer <tbanus@os-forge.net>
* @author Juergen Schwarzer <jschwarzer@freenet.de>
* @author Marcel Metz <marcel_metz@gmx.de>
diff --git a/lib/plugins/acl/lang/eo/lang.php b/lib/plugins/acl/lang/eo/lang.php
index de75c2dd7..a5f607341 100644
--- a/lib/plugins/acl/lang/eo/lang.php
+++ b/lib/plugins/acl/lang/eo/lang.php
@@ -1,7 +1,8 @@
<?php
+
/**
- * Esperanto language file
- *
+ * @license GPL 2 (http://www.gnu.org/licenses/gpl.html)
+ *
* @author Felipe Castro <fefcas@uol.com.br>
* @author Felipo Kastro <fefcas@gmail.com>
* @author Felipe Castro <fefcas@gmail.com>
diff --git a/lib/plugins/acl/lang/fa/lang.php b/lib/plugins/acl/lang/fa/lang.php
index 7fe0f2c43..24bebaeaf 100644
--- a/lib/plugins/acl/lang/fa/lang.php
+++ b/lib/plugins/acl/lang/fa/lang.php
@@ -1,7 +1,8 @@
<?php
+
/**
- * Persian language file
- *
+ * @license GPL 2 (http://www.gnu.org/licenses/gpl.html)
+ *
* @author behrad eslamifar <behrad_es@yahoo.com)
* @author Mohsen Firoozmandan <info@mambolearn.com>
* @author omidmr@gmail.com
diff --git a/lib/plugins/acl/lang/fi/lang.php b/lib/plugins/acl/lang/fi/lang.php
index 4f145e0f6..50224dfb4 100644
--- a/lib/plugins/acl/lang/fi/lang.php
+++ b/lib/plugins/acl/lang/fi/lang.php
@@ -1,7 +1,8 @@
<?php
+
/**
- * Finnish language file
- *
+ * @license GPL 2 (http://www.gnu.org/licenses/gpl.html)
+ *
* @author otto@valjakko.net
* @author Otto Vainio <otto@valjakko.net>
* @author Teemu Mattila <ghcsystems@gmail.com>
diff --git a/lib/plugins/acl/lang/he/lang.php b/lib/plugins/acl/lang/he/lang.php
index 91025f4b8..6716081eb 100644
--- a/lib/plugins/acl/lang/he/lang.php
+++ b/lib/plugins/acl/lang/he/lang.php
@@ -1,8 +1,8 @@
<?php
+
/**
- * hebrew language file
- *
* @license GPL 2 (http://www.gnu.org/licenses/gpl.html)
+ *
* @author DoK <kamberd@yahoo.com>
* @author Dotan Kamber <kamberd@yahoo.com>
* @author Moshe Kaplan <mokplan@gmail.com>
diff --git a/lib/plugins/acl/lang/hu/lang.php b/lib/plugins/acl/lang/hu/lang.php
index 9565eddc3..cc35243e1 100644
--- a/lib/plugins/acl/lang/hu/lang.php
+++ b/lib/plugins/acl/lang/hu/lang.php
@@ -1,7 +1,8 @@
<?php
+
/**
- * Hungarian language file
- *
+ * @license GPL 2 (http://www.gnu.org/licenses/gpl.html)
+ *
* @author Sandor TIHANYI <stihanyi+dw@gmail.com>
* @author Siaynoq Mage <siaynoqmage@gmail.com>
* @author schilling.janos@gmail.com
diff --git a/lib/plugins/acl/lang/id/lang.php b/lib/plugins/acl/lang/id/lang.php
index 650637635..6f619c5ec 100644
--- a/lib/plugins/acl/lang/id/lang.php
+++ b/lib/plugins/acl/lang/id/lang.php
@@ -1,8 +1,8 @@
<?php
+
/**
- * Indonesian language file
- *
* @license GPL 2 (http://www.gnu.org/licenses/gpl.html)
+ *
* @author mubaidillah <mubaidillah@gmail.com>
* @author Yustinus Waruwu <juswaruwu@gmail.com>
*/
diff --git a/lib/plugins/acl/lang/ja/lang.php b/lib/plugins/acl/lang/ja/lang.php
index 0dd4d09c6..61fc1ea86 100644
--- a/lib/plugins/acl/lang/ja/lang.php
+++ b/lib/plugins/acl/lang/ja/lang.php
@@ -1,8 +1,8 @@
<?php
+
/**
- * japanese language file
- *
* @license GPL 2 (http://www.gnu.org/licenses/gpl.html)
+ *
* @author Davilin(Yuji Takenaka) <webmaster@davilin.com>
* @author Yuji Takenaka <webmaster@davilin.com>
* @author Ikuo Obataya <i.obataya@gmail.com>
diff --git a/lib/plugins/acl/lang/ko/help.txt b/lib/plugins/acl/lang/ko/help.txt
index ba3dd6d9f..9baeedbb9 100644
--- a/lib/plugins/acl/lang/ko/help.txt
+++ b/lib/plugins/acl/lang/ko/help.txt
@@ -5,4 +5,4 @@
* 위쪽 입력 양식에서 선택된 사용자와 그룹의 접근 권한을 보거나 바꿀 수 있습니다.
* 아래 테이블에서 현재 설정된 모든 접근 제어 규칙을 볼 수 있으며, 즉시 여러 규칙을 삭제하거나 바꿀 수 있습니다.
-DokuWiki에서 접근 제어가 어떻게 동작되는지 알아보려면 [[doku>ko:acl|ACL 공식 문서]]를 읽어보시기 바랍니다. \ No newline at end of file
+도쿠위키에서 접근 제어가 어떻게 동작되는지 알아보려면 [[doku>ko:acl|ACL 공식 문서]]를 읽어보시기 바랍니다. \ No newline at end of file
diff --git a/lib/plugins/acl/lang/ko/lang.php b/lib/plugins/acl/lang/ko/lang.php
index 7c1e9a43d..34b93a9f4 100644
--- a/lib/plugins/acl/lang/ko/lang.php
+++ b/lib/plugins/acl/lang/ko/lang.php
@@ -1,8 +1,8 @@
<?php
+
/**
- * Korean language file
- *
- * @license GPL 2 (http://www.gnu.org/licenses/gpl.html)
+ * @license GPL 2 (http://www.gnu.org/licenses/gpl.html)
+ *
* @author Andreas Gohr <andi@splitbrain.org>
* @author Anika Henke <anika@selfthinker.org>
* @author Matthias Grimm <matthiasgrimm@users.sourceforge.net>
@@ -12,6 +12,7 @@
* @author Seung-Chul Yoo <dryoo@live.com>
* @author erial2@gmail.com
* @author Myeongjin <aranet100@gmail.com>
+ * @author Garam <rowain8@gmail.com>
*/
$lang['admin_acl'] = '접근 제어 목록 관리';
$lang['acl_group'] = '그룹';
@@ -27,7 +28,7 @@ $lang['p_group_ns'] = '<b class="aclgroup">%s</b> 그룹 구성원은
$lang['p_choose_id'] = '<b class="aclpage">%s</b> 문서 접근 권한을 보거나 바꾸려면 <b>사용자</b>나 <b>그룹</b>을 위 양식에 입력하세요.';
$lang['p_choose_ns'] = '<b class="aclns">%s</b> 이름공간 접근 권한을 보거나 바꾸려면 <b>사용자</b>나 <b>그룹</b>을 위 양식에 입력하세요.';
$lang['p_inherited'] = '참고: 권한이 명시적으로 설정되지 않았으므로 다른 그룹이나 상위 이름공간으로부터 가져왔습니다.';
-$lang['p_isadmin'] = '참고: 슈퍼유저로 설정되어 있으므로 선택된 그룹이나 사용자는 언제나 모든 접근 권한을 가집니다.';
+$lang['p_isadmin'] = '참고: 슈퍼 사용자로 설정되어 있으므로 선택된 그룹이나 사용자는 언제나 모든 접근 권한을 가집니다.';
$lang['p_include'] = '더 높은 접근 권한은 하위를 포함합니다. 문서가 아닌 이름공간에는 만들기, 올리기, 삭제 권한만 적용됩니다.';
$lang['current'] = '현재 ACL 규칙';
$lang['where'] = '문서/이름공간';
diff --git a/lib/plugins/acl/lang/ne/lang.php b/lib/plugins/acl/lang/ne/lang.php
index 6a29a9fa8..5e6196a30 100644
--- a/lib/plugins/acl/lang/ne/lang.php
+++ b/lib/plugins/acl/lang/ne/lang.php
@@ -1,7 +1,8 @@
<?php
+
/**
- * Nepali language file
- *
+ * @license GPL 2 (http://www.gnu.org/licenses/gpl.html)
+ *
* @author Saroj Kumar Dhakal <lotusnagarkot@gmail.com>
* @author SarojKumar Dhakal <lotusnagarkot@yahoo.com>
* @author Saroj Dhakal<lotusnagarkot@yahoo.com>
diff --git a/lib/plugins/acl/lang/nl/lang.php b/lib/plugins/acl/lang/nl/lang.php
index e3a95e779..abb81ae06 100644
--- a/lib/plugins/acl/lang/nl/lang.php
+++ b/lib/plugins/acl/lang/nl/lang.php
@@ -19,6 +19,8 @@
* @author Jeroen
* @author Ricardo Guijt <ricardoguijt@gmail.com>
* @author Gerrit <klapinklapin@gmail.com>
+ * @author Gerrit Uitslag <klapinklapin@gmail.com>
+ * @author Remon <no@email.local>
*/
$lang['admin_acl'] = 'Toegangsrechten';
$lang['acl_group'] = 'Groep';
@@ -30,14 +32,14 @@ $lang['btn_select'] = 'Selecteer';
$lang['p_user_id'] = 'Gebruiker <b class="acluser">%s</b> heeft momenteel de volgende bevoegdheden op pagina <b class="aclpage">%s</b>: <i>%s</i>.';
$lang['p_user_ns'] = 'Gebruiker <b class="acluser">%s</b> heeft momenteel de volgende bevoegdheden op namespace <b class="aclns">%s</b>: <i>%s</i>.';
$lang['p_group_id'] = 'Leden van groep <b class="aclgroup">%s</b> hebben momenteel de volgende bevoegdheden op pagina <b class="aclpage">%s</b>: <i>%s</i>.';
-$lang['p_group_ns'] = 'Leden van groep <b class="aclgroup">%s</b>hebben momenteel de volgende bevoegdheden op namespace <b class="aclns">%s</b>: <i>%s</i>.';
+$lang['p_group_ns'] = 'Leden van groep <b class="aclgroup">%s</b> hebben momenteel de volgende bevoegdheden in namespace <b class="aclns">%s</b>: <i>%s</i>.';
$lang['p_choose_id'] = 'Vul een <b>gebruiker of groep</b> in in het bovenstaande formulier om de bevoegdheden te bekijken of te bewerken voor de pagina <b class="aclpage">%s</b>.';
$lang['p_choose_ns'] = 'Vul een <b>gebruiker of groep</b> in in het bovenstaande formulier om de bevoegdheden te bekijken of te bewerken voor de namespace <b class="aclns">%s</b>.';
$lang['p_inherited'] = 'Let op: Deze permissies zijn niet expliciet ingesteld maar overerfd van andere groepen of hogere namespaces.';
$lang['p_isadmin'] = 'Let op: De geselecteerde groep of gebruiker heeft altijd volledige toegangsrechten omdat hij als superuser geconfigureerd is.';
$lang['p_include'] = 'Hogere permissies bevatten ook de lagere. Aanmaken, uploaden en verwijderen gelden alleen voor namespaces, niet voor pagina\'s.';
$lang['current'] = 'Huidige ACL regels';
-$lang['where'] = 'Pagina/namespace';
+$lang['where'] = 'Pagina/Namespace';
$lang['who'] = 'Gebruiker/Groep';
$lang['perm'] = 'Bevoegdheden';
$lang['acl_perm0'] = 'Geen';
diff --git a/lib/plugins/acl/lang/no/lang.php b/lib/plugins/acl/lang/no/lang.php
index 09d71937a..82cdd5eef 100644
--- a/lib/plugins/acl/lang/no/lang.php
+++ b/lib/plugins/acl/lang/no/lang.php
@@ -1,8 +1,8 @@
<?php
+
/**
- * Norwegian language file
- *
* @license GPL 2 (http://www.gnu.org/licenses/gpl.html)
+ *
* @author Reidar Mosvold <Reidar.Mosvold@hit.no>
* @author Jorge Barrera Grandon <jorge@digitalwolves.org>
* @author Thomas Nygreen <nygreen@gmail.com>
@@ -10,7 +10,7 @@
* @author Torkill Bruland <torkar-b@online.no>
* @author Rune M. Andersen <rune.andersen@gmail.com>
* @author Jakob Vad Nielsen (me@jakobnielsen.net)
- * @author Kjell Tore Næsgaard <kjell.t.nasgaard@ntnu.no>
+ * @author Kjell Tore Næsgaard <kjell.t.nasgaard@ntnu.no>
* @author Knut Staring <knutst@gmail.com>
* @author Lisa Ditlefsen <lisa@vervesearch.com>
* @author Erik Pedersen <erik.pedersen@shaw.ca>
diff --git a/lib/plugins/acl/lang/pl/lang.php b/lib/plugins/acl/lang/pl/lang.php
index bef2d2615..42ce7fdaf 100644
--- a/lib/plugins/acl/lang/pl/lang.php
+++ b/lib/plugins/acl/lang/pl/lang.php
@@ -1,8 +1,8 @@
<?php
+
/**
- * polish language file
- *
* @license GPL 2 (http://www.gnu.org/licenses/gpl.html)
+ *
* @author Grzegorz Żur <grzegorz.zur@gmail.com>
* @author Mariusz Kujawski <marinespl@gmail.com>
* @author Maciej Kurczewski <pipijajko@gmail.com>
diff --git a/lib/plugins/acl/lang/pt-br/lang.php b/lib/plugins/acl/lang/pt-br/lang.php
index c49b430f8..ef0ae6c8b 100644
--- a/lib/plugins/acl/lang/pt-br/lang.php
+++ b/lib/plugins/acl/lang/pt-br/lang.php
@@ -1,8 +1,8 @@
<?php
+
/**
- * Brazilian Portuguese language file
- *
* @license GPL 2 (http://www.gnu.org/licenses/gpl.html)
+ *
* @author Luis Fernando Enciso <lfenciso@certto.com.br>
* @author Alauton/Loug
* @author Frederico Gonçalves Guimarães <frederico@teia.bio.br>
diff --git a/lib/plugins/acl/lang/pt/lang.php b/lib/plugins/acl/lang/pt/lang.php
index d90bab624..4c2114d67 100644
--- a/lib/plugins/acl/lang/pt/lang.php
+++ b/lib/plugins/acl/lang/pt/lang.php
@@ -1,8 +1,8 @@
<?php
+
/**
- * Portuguese language file
- *
* @license GPL 2 (http://www.gnu.org/licenses/gpl.html)
+ *
* @author José Carlos Monteiro <jose.c.monteiro@netcabo.pt>
* @author José Monteiro <Jose.Monteiro@DoWeDo-IT.com>
* @author Enrico Nicoletto <liverig@gmail.com>
diff --git a/lib/plugins/acl/lang/ru/help.txt b/lib/plugins/acl/lang/ru/help.txt
index 7807105a8..ecb2fe3d0 100644
--- a/lib/plugins/acl/lang/ru/help.txt
+++ b/lib/plugins/acl/lang/ru/help.txt
@@ -1,7 +1,8 @@
=== Краткая справка ===
-На этой странице вы можете добавить или удалить права доступа к пространствам имён и страницам своей вики.\\
-На панели слева отображены доступные пространства имён и страницы.\\
-Форма выше позволяет вам просмотреть и изменить права доступа для выбранного пользователя или группы.\\
-Текущие права доступа отображены в таблице ниже. Вы можете использовать её для быстрого удаления или изменения правил.\\
+На этой странице вы можете добавить или удалить права доступа к пространствам имён и страницам своей вики.
+ * На панели слева отображены доступные пространства имён и страницы.
+ * Форма выше позволяет вам просмотреть и изменить права доступа для выбранного пользователя или группы.
+ * Текущие права доступа отображены в таблице ниже. Вы можете использовать её для быстрого удаления или изменения правил.
+
Прочтение [[doku>acl|официальной документации по ACL]] может помочь вам в полном понимании работы управления правами доступа в «ДокуВики».
diff --git a/lib/plugins/acl/lang/ru/lang.php b/lib/plugins/acl/lang/ru/lang.php
index f042ab724..ff4740676 100644
--- a/lib/plugins/acl/lang/ru/lang.php
+++ b/lib/plugins/acl/lang/ru/lang.php
@@ -28,7 +28,7 @@ $lang['btn_select'] = 'Выбрать';
$lang['p_user_id'] = 'Сейчас пользователь <b class="acluser">%s</b> имеет следующие права на доступ к странице <b class="aclpage">%s</b>: <i>%s</i>.';
$lang['p_user_ns'] = 'Сейчас пользователь <b class="acluser">%s</b> имеет следующие права на доступ к пространству имён <b class="aclns">%s</b>: <i>%s</i>.';
$lang['p_group_id'] = 'Сейчас члены группы <b class="aclgroup">%s</b> имеют следующие права на доступ к странице <b class="aclpage">%s</b>: <i>%s</i>.';
-$lang['p_group_ns'] = 'Сейчас члены группы <b class="aclgroup">%s</b> cимеют следующие права на доступ к пространству имён <b class="aclns">%s</b>: <i>%s</i>.';
+$lang['p_group_ns'] = 'Сейчас члены группы <b class="aclgroup">%s</b> имеют следующие права на доступ к пространству имён <b class="aclns">%s</b>: <i>%s</i>.';
$lang['p_choose_id'] = 'Пожалуйста, <b>введите пользователя или группу</b> в форме выше, чтобы просмотреть или отредактировать права на доступ к странице <b class="aclpage">%s</b>.';
$lang['p_choose_ns'] = 'Пожалуйста, <b>введите пользователя или группу</b> в форме выше, чтобы просмотреть или отредактировать права на доступ к пространству имён <b class="aclns">%s</b>.';
$lang['p_inherited'] = 'Замечание: эти права доступа не были заданы явно, а были унаследованы от других групп или пространств имён более высокого порядка.';
diff --git a/lib/plugins/acl/lang/sk/lang.php b/lib/plugins/acl/lang/sk/lang.php
index 398f8c63d..51837d4b4 100644
--- a/lib/plugins/acl/lang/sk/lang.php
+++ b/lib/plugins/acl/lang/sk/lang.php
@@ -1,8 +1,8 @@
<?php
+
/**
- * Slovak language file
- *
* @license GPL 2 (http://www.gnu.org/licenses/gpl.html)
+ *
* @author Ondrej Vegh <ov@vsieti.sk>
* @author Michal Mesko <michal.mesko@gmail.com>
* @author exusik@gmail.com
diff --git a/lib/plugins/acl/lang/sl/lang.php b/lib/plugins/acl/lang/sl/lang.php
index 44e45e491..303b18cff 100644
--- a/lib/plugins/acl/lang/sl/lang.php
+++ b/lib/plugins/acl/lang/sl/lang.php
@@ -1,7 +1,8 @@
<?php
+
/**
- * Slovenian language file
- *
+ * @license GPL 2 (http://www.gnu.org/licenses/gpl.html)
+ *
* @author Dejan Levec <webphp@gmail.com>
* @author Boštjan Seničar <senicar@gmail.com>
* @author Gregor Skumavc (grega.skumavc@gmail.com)
diff --git a/lib/plugins/acl/lang/tr/lang.php b/lib/plugins/acl/lang/tr/lang.php
index 629ca546b..a9699a5f9 100644
--- a/lib/plugins/acl/lang/tr/lang.php
+++ b/lib/plugins/acl/lang/tr/lang.php
@@ -1,8 +1,8 @@
<?php
+
/**
- * turkish language file
- *
* @license GPL 2 (http://www.gnu.org/licenses/gpl.html)
+ *
* @author Selim Farsakoğlu <farsakogluselim@yahoo.de>
* @author Aydın Coşkuner <aydinweb@gmail.com>
* @author Cihan Kahveci <kahvecicihan@gmail.com>
diff --git a/lib/plugins/acl/lang/vi/lang.php b/lib/plugins/acl/lang/vi/lang.php
index ddf764dca..4fc3388ff 100644
--- a/lib/plugins/acl/lang/vi/lang.php
+++ b/lib/plugins/acl/lang/vi/lang.php
@@ -1,44 +1,35 @@
<?php
+
/**
- * vietnamese language file
- *
* @license GPL 2 (http://www.gnu.org/licenses/gpl.html)
- * @author NukeViet <admin@nukeviet.vn>
+ *
+ * @author NukeViet <admin@nukeviet.vn>
*/
-
-$lang['admin_acl'] = 'Quản lý danh sách quyền truy cập';
-$lang['acl_group'] = 'Nhóm';
-$lang['acl_user'] = 'Thành viên';
-$lang['acl_perms'] = 'Cấp phép cho';
-$lang['page'] = 'Trang';
-$lang['namespace'] = 'Thư mục';
-
-$lang['btn_select'] = 'Chọn';
-
-$lang['p_user_id'] = 'Thành viên <b class="acluser">%s</b> hiện tại được cấp phép cho trang <b class="aclpage">%s</b>: <i>%s</i>.';
-$lang['p_user_ns'] = 'Thành viên <b class="acluser">%s</b> hiện tại được cấp phép cho thư mục <b class="aclns">%s</b>: <i>%s</i>.';
-$lang['p_group_id'] = 'Thành viên trong nhóm <b class="aclgroup">%s</b> hiện tại được cấp phép cho trang <b class="aclpage">%s</b>: <i>%s</i>.';
-$lang['p_group_ns'] = 'Thành viên trong nhóm <b class="aclgroup">%s</b> hiện tại được cấp phép cho thư mục <b class="aclns">%s</b>: <i>%s</i>.';
-
-$lang['p_choose_id'] = 'Hãy <b>nhập tên thành viên hoặc nhóm</b> vào ô trên đây để xem hoặc sửa quyền đã thiết đặt cho trang <b class="aclpage">%s</b>.';
-$lang['p_choose_ns'] = 'Hãy <b>nhập tên thành viên hoặc nhóm</b> vào ô trên đây để xem hoặc sửa quyền đã thiết đặt cho thư mục <b class="aclns">%s</b>.';
-
-
-$lang['p_inherited'] = 'Ghi chú: Có những quyền không được thể hiện ở đây nhưng nó được cấp phép từ những nhóm hoặc thư mục cấp cao.';
-$lang['p_isadmin'] = 'Ghi chú: Nhóm hoặc thành viên này luôn được cấp đủ quyền vì họ là Quản trị tối cao';
-$lang['p_include'] = 'Một số quyền thấp được thể hiện ở mức cao hơn. Quyền tạo, tải lên và xóa chỉ dành cho thư mục, không dành cho trang.';
-
-$lang['current'] = 'Danh sách quyền truy cập hiện tại';
-$lang['where'] = 'Trang/Thư mục';
-$lang['who'] = 'Thành viên/Nhóm';
-$lang['perm'] = 'Quyền';
-
-$lang['acl_perm0'] = 'Không';
-$lang['acl_perm1'] = 'Đọc';
-$lang['acl_perm2'] = 'Sửa';
-$lang['acl_perm4'] = 'Tạo';
-$lang['acl_perm8'] = 'Tải lên';
-$lang['acl_perm16'] = 'Xóa';
-$lang['acl_new'] = 'Thêm mục mới';
-$lang['acl_mod'] = 'Sửa';
-//Setup VIM: ex: et ts=2 :
+$lang['admin_acl'] = 'Quản lý danh sách quyền truy cập';
+$lang['acl_group'] = 'Nhóm';
+$lang['acl_user'] = 'Thành viên';
+$lang['acl_perms'] = 'Cấp phép cho';
+$lang['page'] = 'Trang';
+$lang['namespace'] = 'Thư mục';
+$lang['btn_select'] = 'Chọn';
+$lang['p_user_id'] = 'Thành viên <b class="acluser">%s</b> hiện tại được cấp phép cho trang <b class="aclpage">%s</b>: <i>%s</i>.';
+$lang['p_user_ns'] = 'Thành viên <b class="acluser">%s</b> hiện tại được cấp phép cho thư mục <b class="aclns">%s</b>: <i>%s</i>.';
+$lang['p_group_id'] = 'Thành viên trong nhóm <b class="aclgroup">%s</b> hiện tại được cấp phép cho trang <b class="aclpage">%s</b>: <i>%s</i>.';
+$lang['p_group_ns'] = 'Thành viên trong nhóm <b class="aclgroup">%s</b> hiện tại được cấp phép cho thư mục <b class="aclns">%s</b>: <i>%s</i>.';
+$lang['p_choose_id'] = 'Hãy <b>nhập tên thành viên hoặc nhóm</b> vào ô trên đây để xem hoặc sửa quyền đã thiết đặt cho trang <b class="aclpage">%s</b>.';
+$lang['p_choose_ns'] = 'Hãy <b>nhập tên thành viên hoặc nhóm</b> vào ô trên đây để xem hoặc sửa quyền đã thiết đặt cho thư mục <b class="aclns">%s</b>.';
+$lang['p_inherited'] = 'Ghi chú: Có những quyền không được thể hiện ở đây nhưng nó được cấp phép từ những nhóm hoặc thư mục cấp cao.';
+$lang['p_isadmin'] = 'Ghi chú: Nhóm hoặc thành viên này luôn được cấp đủ quyền vì họ là Quản trị tối cao';
+$lang['p_include'] = 'Một số quyền thấp được thể hiện ở mức cao hơn. Quyền tạo, tải lên và xóa chỉ dành cho thư mục, không dành cho trang.';
+$lang['current'] = 'Danh sách quyền truy cập hiện tại';
+$lang['where'] = 'Trang/Thư mục';
+$lang['who'] = 'Thành viên/Nhóm';
+$lang['perm'] = 'Quyền';
+$lang['acl_perm0'] = 'Không';
+$lang['acl_perm1'] = 'Đọc';
+$lang['acl_perm2'] = 'Sửa';
+$lang['acl_perm4'] = 'Tạo';
+$lang['acl_perm8'] = 'Tải lên';
+$lang['acl_perm16'] = 'Xóa';
+$lang['acl_new'] = 'Thêm mục mới';
+$lang['acl_mod'] = 'Sửa';
diff --git a/lib/plugins/acl/remote.php b/lib/plugins/acl/remote.php
index 8f6dfbcd9..6d5201cf6 100644
--- a/lib/plugins/acl/remote.php
+++ b/lib/plugins/acl/remote.php
@@ -16,14 +16,14 @@ class remote_plugin_acl extends DokuWiki_Remote_Plugin {
),
);
}
-
+
function addAcl($scope, $user, $level){
- $apa = plugin_load('admin', 'acl');
+ $apa = plugin_load('admin', 'acl');
return $apa->_acl_add($scope, $user, $level);
}
-
+
function delAcl($scope, $user){
- $apa = plugin_load('admin', 'acl');
+ $apa = plugin_load('admin', 'acl');
return $apa->_acl_del($scope, $user);
}
}
diff --git a/lib/plugins/acl/script.js b/lib/plugins/acl/script.js
index 0abb80d67..58598b1e0 100644
--- a/lib/plugins/acl/script.js
+++ b/lib/plugins/acl/script.js
@@ -25,9 +25,10 @@ var dw_acl = {
var $frm = jQuery('#acl__detail form');
jQuery.post(
- DOKU_BASE + 'lib/plugins/acl/ajax.php',
+ DOKU_BASE + 'lib/exe/ajax.php',
jQuery.extend(dw_acl.parseatt($clicky.parent().find('a')[0].search),
- {ajax: 'tree',
+ {call: 'plugin_acl',
+ ajax: 'tree',
current_ns: $frm.find('input[name=ns]').val(),
current_id: $frm.find('input[name=id]').val()}),
show_sublist,
@@ -64,8 +65,8 @@ var dw_acl = {
.attr('role', 'alert')
.html('<img src="'+DOKU_BASE+'lib/images/throbber.gif" alt="..." />')
.load(
- DOKU_BASE + 'lib/plugins/acl/ajax.php',
- jQuery('#acl__detail form').serialize() + '&ajax=info'
+ DOKU_BASE + 'lib/exe/ajax.php',
+ jQuery('#acl__detail form').serialize() + '&call=plugin_acl&ajax=info'
);
return false;
},
diff --git a/lib/plugins/acl/style.css b/lib/plugins/acl/style.css
index d8f0b53f3..a53a03450 100644
--- a/lib/plugins/acl/style.css
+++ b/lib/plugins/acl/style.css
@@ -1,4 +1,3 @@
-
#acl__tree {
font-size: 90%;
width: 25%;
@@ -138,4 +137,3 @@
#acl_manager table tr:hover {
background-color: __background_alt__;
}
-
diff --git a/lib/plugins/action.php b/lib/plugins/action.php
index a2ad969d7..4b5eef60a 100644
--- a/lib/plugins/action.php
+++ b/lib/plugins/action.php
@@ -14,10 +14,10 @@ if(!defined('DOKU_INC')) die();
*/
class DokuWiki_Action_Plugin extends DokuWiki_Plugin {
- /**
- * Registers a callback function for a given event
- */
- function register(Doku_Event_Handler $controller) {
+ /**
+ * Registers a callback function for a given event
+ */
+ public function register(Doku_Event_Handler $controller) {
trigger_error('register() not implemented in '.get_class($this), E_USER_WARNING);
- }
+ }
}
diff --git a/lib/plugins/authad/adLDAP/adLDAP.php b/lib/plugins/authad/adLDAP/adLDAP.php
index a8f33b47e..c1f92abe2 100644
--- a/lib/plugins/authad/adLDAP/adLDAP.php
+++ b/lib/plugins/authad/adLDAP/adLDAP.php
@@ -1,951 +1,951 @@
-<?php
-/**
- * PHP LDAP CLASS FOR MANIPULATING ACTIVE DIRECTORY
- * Version 4.0.4
- *
- * PHP Version 5 with SSL and LDAP support
- *
- * Written by Scott Barnett, Richard Hyland
- * email: scott@wiggumworld.com, adldap@richardhyland.com
- * http://adldap.sourceforge.net/
- *
- * Copyright (c) 2006-2012 Scott Barnett, Richard Hyland
- *
- * We'd appreciate any improvements or additions to be submitted back
- * to benefit the entire community :)
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * @category ToolsAndUtilities
- * @package adLDAP
- * @author Scott Barnett, Richard Hyland
- * @copyright (c) 2006-2012 Scott Barnett, Richard Hyland
- * @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html LGPLv2.1
- * @revision $Revision: 169 $
- * @version 4.0.4
- * @link http://adldap.sourceforge.net/
- */
-
-/**
-* Main adLDAP class
-*
-* Can be initialised using $adldap = new adLDAP();
-*
-* Something to keep in mind is that Active Directory is a permissions
-* based directory. If you bind as a domain user, you can't fetch as
-* much information on other users as you could as a domain admin.
-*
-* Before asking questions, please read the Documentation at
-* http://adldap.sourceforge.net/wiki/doku.php?id=api
-*/
-require_once(dirname(__FILE__) . '/collections/adLDAPCollection.php');
-require_once(dirname(__FILE__) . '/classes/adLDAPGroups.php');
-require_once(dirname(__FILE__) . '/classes/adLDAPUsers.php');
-require_once(dirname(__FILE__) . '/classes/adLDAPFolders.php');
-require_once(dirname(__FILE__) . '/classes/adLDAPUtils.php');
-require_once(dirname(__FILE__) . '/classes/adLDAPContacts.php');
-require_once(dirname(__FILE__) . '/classes/adLDAPExchange.php');
-require_once(dirname(__FILE__) . '/classes/adLDAPComputers.php');
-
-class adLDAP {
-
- /**
- * Define the different types of account in AD
- */
- const ADLDAP_NORMAL_ACCOUNT = 805306368;
- const ADLDAP_WORKSTATION_TRUST = 805306369;
- const ADLDAP_INTERDOMAIN_TRUST = 805306370;
- const ADLDAP_SECURITY_GLOBAL_GROUP = 268435456;
- const ADLDAP_DISTRIBUTION_GROUP = 268435457;
- const ADLDAP_SECURITY_LOCAL_GROUP = 536870912;
- const ADLDAP_DISTRIBUTION_LOCAL_GROUP = 536870913;
- const ADLDAP_FOLDER = 'OU';
- const ADLDAP_CONTAINER = 'CN';
-
- /**
- * The default port for LDAP non-SSL connections
- */
- const ADLDAP_LDAP_PORT = '389';
- /**
- * The default port for LDAPS SSL connections
- */
- const ADLDAP_LDAPS_PORT = '636';
-
- /**
- * The account suffix for your domain, can be set when the class is invoked
- *
- * @var string
- */
- protected $accountSuffix = "@mydomain.local";
-
- /**
- * The base dn for your domain
- *
- * If this is set to null then adLDAP will attempt to obtain this automatically from the rootDSE
- *
- * @var string
- */
- protected $baseDn = "DC=mydomain,DC=local";
-
- /**
- * Port used to talk to the domain controllers.
- *
- * @var int
- */
- protected $adPort = self::ADLDAP_LDAP_PORT;
-
- /**
- * Array of domain controllers. Specifiy multiple controllers if you
- * would like the class to balance the LDAP queries amongst multiple servers
- *
- * @var array
- */
- protected $domainControllers = array("dc01.mydomain.local");
-
- /**
- * Optional account with higher privileges for searching
- * This should be set to a domain admin account
- *
- * @var string
- * @var string
- */
- protected $adminUsername = NULL;
- protected $adminPassword = NULL;
-
- /**
- * AD does not return the primary group. http://support.microsoft.com/?kbid=321360
- * This tweak will resolve the real primary group.
- * Setting to false will fudge "Domain Users" and is much faster. Keep in mind though that if
- * someone's primary group is NOT domain users, this is obviously going to mess up the results
- *
- * @var bool
- */
- protected $realPrimaryGroup = true;
-
- /**
- * Use SSL (LDAPS), your server needs to be setup, please see
- * http://adldap.sourceforge.net/wiki/doku.php?id=ldap_over_ssl
- *
- * @var bool
- */
- protected $useSSL = false;
-
- /**
- * Use TLS
- * If you wish to use TLS you should ensure that $useSSL is set to false and vice-versa
- *
- * @var bool
- */
- protected $useTLS = false;
-
- /**
- * Use SSO
- * To indicate to adLDAP to reuse password set by the brower through NTLM or Kerberos
- *
- * @var bool
- */
- protected $useSSO = false;
-
- /**
- * When querying group memberships, do it recursively
- * eg. User Fred is a member of Group A, which is a member of Group B, which is a member of Group C
- * user_ingroup("Fred","C") will returns true with this option turned on, false if turned off
- *
- * @var bool
- */
- protected $recursiveGroups = true;
-
- // You should not need to edit anything below this line
- //******************************************************************************************
-
- /**
- * Connection and bind default variables
- *
- * @var mixed
- * @var mixed
- */
- protected $ldapConnection;
- protected $ldapBind;
-
- /**
- * Get the active LDAP Connection
- *
- * @return resource
- */
- public function getLdapConnection() {
- if ($this->ldapConnection) {
- return $this->ldapConnection;
- }
- return false;
- }
-
- /**
- * Get the bind status
- *
- * @return bool
- */
- public function getLdapBind() {
- return $this->ldapBind;
- }
-
- /**
- * Get the current base DN
- *
- * @return string
- */
- public function getBaseDn() {
- return $this->baseDn;
- }
-
- /**
- * The group class
- *
- * @var adLDAPGroups
- */
- protected $groupClass;
-
- /**
- * Get the group class interface
- *
- * @return adLDAPGroups
- */
- public function group() {
- if (!$this->groupClass) {
- $this->groupClass = new adLDAPGroups($this);
- }
- return $this->groupClass;
- }
-
- /**
- * The user class
- *
- * @var adLDAPUsers
- */
- protected $userClass;
-
- /**
- * Get the userclass interface
- *
- * @return adLDAPUsers
- */
- public function user() {
- if (!$this->userClass) {
- $this->userClass = new adLDAPUsers($this);
- }
- return $this->userClass;
- }
-
- /**
- * The folders class
- *
- * @var adLDAPFolders
- */
- protected $folderClass;
-
- /**
- * Get the folder class interface
- *
- * @return adLDAPFolders
- */
- public function folder() {
- if (!$this->folderClass) {
- $this->folderClass = new adLDAPFolders($this);
- }
- return $this->folderClass;
- }
-
- /**
- * The utils class
- *
- * @var adLDAPUtils
- */
- protected $utilClass;
-
- /**
- * Get the utils class interface
- *
- * @return adLDAPUtils
- */
- public function utilities() {
- if (!$this->utilClass) {
- $this->utilClass = new adLDAPUtils($this);
- }
- return $this->utilClass;
- }
-
- /**
- * The contacts class
- *
- * @var adLDAPContacts
- */
- protected $contactClass;
-
- /**
- * Get the contacts class interface
- *
- * @return adLDAPContacts
- */
- public function contact() {
- if (!$this->contactClass) {
- $this->contactClass = new adLDAPContacts($this);
- }
- return $this->contactClass;
- }
-
- /**
- * The exchange class
- *
- * @var adLDAPExchange
- */
- protected $exchangeClass;
-
- /**
- * Get the exchange class interface
- *
- * @return adLDAPExchange
- */
- public function exchange() {
- if (!$this->exchangeClass) {
- $this->exchangeClass = new adLDAPExchange($this);
- }
- return $this->exchangeClass;
- }
-
- /**
- * The computers class
- *
- * @var adLDAPComputers
- */
- protected $computersClass;
-
- /**
- * Get the computers class interface
- *
- * @return adLDAPComputers
- */
- public function computer() {
- if (!$this->computerClass) {
- $this->computerClass = new adLDAPComputers($this);
- }
- return $this->computerClass;
- }
-
- /**
- * Getters and Setters
- */
-
- /**
- * Set the account suffix
- *
- * @param string $accountSuffix
- * @return void
- */
- public function setAccountSuffix($accountSuffix)
- {
- $this->accountSuffix = $accountSuffix;
- }
-
- /**
- * Get the account suffix
- *
- * @return string
- */
- public function getAccountSuffix()
- {
- return $this->accountSuffix;
- }
-
- /**
- * Set the domain controllers array
- *
- * @param array $domainControllers
- * @return void
- */
- public function setDomainControllers(array $domainControllers)
- {
- $this->domainControllers = $domainControllers;
- }
-
- /**
- * Get the list of domain controllers
- *
- * @return void
- */
- public function getDomainControllers()
- {
- return $this->domainControllers;
- }
-
- /**
- * Sets the port number your domain controller communicates over
- *
- * @param int $adPort
- */
- public function setPort($adPort)
- {
- $this->adPort = $adPort;
- }
-
- /**
- * Gets the port number your domain controller communicates over
- *
- * @return int
- */
- public function getPort()
- {
- return $this->adPort;
- }
-
- /**
- * Set the username of an account with higher priviledges
- *
- * @param string $adminUsername
- * @return void
- */
- public function setAdminUsername($adminUsername)
- {
- $this->adminUsername = $adminUsername;
- }
-
- /**
- * Get the username of the account with higher priviledges
- *
- * This will throw an exception for security reasons
- */
- public function getAdminUsername()
- {
- throw new adLDAPException('For security reasons you cannot access the domain administrator account details');
- }
-
- /**
- * Set the password of an account with higher priviledges
- *
- * @param string $adminPassword
- * @return void
- */
- public function setAdminPassword($adminPassword)
- {
- $this->adminPassword = $adminPassword;
- }
-
- /**
- * Get the password of the account with higher priviledges
- *
- * This will throw an exception for security reasons
- */
- public function getAdminPassword()
- {
- throw new adLDAPException('For security reasons you cannot access the domain administrator account details');
- }
-
- /**
- * Set whether to detect the true primary group
- *
- * @param bool $realPrimaryGroup
- * @return void
- */
- public function setRealPrimaryGroup($realPrimaryGroup)
- {
- $this->realPrimaryGroup = $realPrimaryGroup;
- }
-
- /**
- * Get the real primary group setting
- *
- * @return bool
- */
- public function getRealPrimaryGroup()
- {
- return $this->realPrimaryGroup;
- }
-
- /**
- * Set whether to use SSL
- *
- * @param bool $useSSL
- * @return void
- */
- public function setUseSSL($useSSL)
- {
- $this->useSSL = $useSSL;
- // Set the default port correctly
- if($this->useSSL) {
- $this->setPort(self::ADLDAP_LDAPS_PORT);
- }
- else {
- $this->setPort(self::ADLDAP_LDAP_PORT);
- }
- }
-
- /**
- * Get the SSL setting
- *
- * @return bool
- */
- public function getUseSSL()
- {
- return $this->useSSL;
- }
-
- /**
- * Set whether to use TLS
- *
- * @param bool $useTLS
- * @return void
- */
- public function setUseTLS($useTLS)
- {
- $this->useTLS = $useTLS;
- }
-
- /**
- * Get the TLS setting
- *
- * @return bool
- */
- public function getUseTLS()
- {
- return $this->useTLS;
- }
-
- /**
- * Set whether to use SSO
- * Requires ldap_sasl_bind support. Be sure --with-ldap-sasl is used when configuring PHP otherwise this function will be undefined.
- *
- * @param bool $useSSO
- * @return void
- */
- public function setUseSSO($useSSO)
- {
- if ($useSSO === true && !$this->ldapSaslSupported()) {
- throw new adLDAPException('No LDAP SASL support for PHP. See: http://www.php.net/ldap_sasl_bind');
- }
- $this->useSSO = $useSSO;
- }
-
- /**
- * Get the SSO setting
- *
- * @return bool
- */
- public function getUseSSO()
- {
- return $this->useSSO;
- }
-
- /**
- * Set whether to lookup recursive groups
- *
- * @param bool $recursiveGroups
- * @return void
- */
- public function setRecursiveGroups($recursiveGroups)
- {
- $this->recursiveGroups = $recursiveGroups;
- }
-
- /**
- * Get the recursive groups setting
- *
- * @return bool
- */
- public function getRecursiveGroups()
- {
- return $this->recursiveGroups;
- }
-
- /**
- * Default Constructor
- *
- * Tries to bind to the AD domain over LDAP or LDAPs
- *
- * @param array $options Array of options to pass to the constructor
- * @throws Exception - if unable to bind to Domain Controller
- * @return bool
- */
- function __construct($options = array()) {
- // You can specifically overide any of the default configuration options setup above
- if (count($options) > 0) {
- if (array_key_exists("account_suffix",$options)){ $this->accountSuffix = $options["account_suffix"]; }
- if (array_key_exists("base_dn",$options)){ $this->baseDn = $options["base_dn"]; }
- if (array_key_exists("domain_controllers",$options)){
- if (!is_array($options["domain_controllers"])) {
- throw new adLDAPException('[domain_controllers] option must be an array');
- }
- $this->domainControllers = $options["domain_controllers"];
- }
- if (array_key_exists("admin_username",$options)){ $this->adminUsername = $options["admin_username"]; }
- if (array_key_exists("admin_password",$options)){ $this->adminPassword = $options["admin_password"]; }
- if (array_key_exists("real_primarygroup",$options)){ $this->realPrimaryGroup = $options["real_primarygroup"]; }
- if (array_key_exists("use_ssl",$options)){ $this->setUseSSL($options["use_ssl"]); }
- if (array_key_exists("use_tls",$options)){ $this->useTLS = $options["use_tls"]; }
- if (array_key_exists("recursive_groups",$options)){ $this->recursiveGroups = $options["recursive_groups"]; }
- if (array_key_exists("ad_port",$options)){ $this->setPort($options["ad_port"]); }
- if (array_key_exists("sso",$options)) {
- $this->setUseSSO($options["sso"]);
- if (!$this->ldapSaslSupported()) {
- $this->setUseSSO(false);
- }
- }
- }
-
- if ($this->ldapSupported() === false) {
- throw new adLDAPException('No LDAP support for PHP. See: http://www.php.net/ldap');
- }
-
- return $this->connect();
- }
-
- /**
- * Default Destructor
- *
- * Closes the LDAP connection
- *
- * @return void
- */
- function __destruct() {
- $this->close();
- }
-
- /**
- * Connects and Binds to the Domain Controller
- *
- * @return bool
- */
- public function connect()
- {
- // Connect to the AD/LDAP server as the username/password
- $domainController = $this->randomController();
- if ($this->useSSL) {
- $this->ldapConnection = ldap_connect("ldaps://" . $domainController, $this->adPort);
- } else {
- $this->ldapConnection = ldap_connect($domainController, $this->adPort);
- }
-
- // Set some ldap options for talking to AD
- ldap_set_option($this->ldapConnection, LDAP_OPT_PROTOCOL_VERSION, 3);
- ldap_set_option($this->ldapConnection, LDAP_OPT_REFERRALS, 0);
-
- if ($this->useTLS) {
- ldap_start_tls($this->ldapConnection);
- }
-
- // Bind as a domain admin if they've set it up
- if ($this->adminUsername !== NULL && $this->adminPassword !== NULL) {
- $this->ldapBind = @ldap_bind($this->ldapConnection, $this->adminUsername . $this->accountSuffix, $this->adminPassword);
- if (!$this->ldapBind) {
- if ($this->useSSL && !$this->useTLS) {
- // If you have problems troubleshooting, remove the @ character from the ldapldapBind command above to get the actual error message
- throw new adLDAPException('Bind to Active Directory failed. Either the LDAPs connection failed or the login credentials are incorrect. AD said: ' . $this->getLastError());
- }
- else {
- throw new adLDAPException('Bind to Active Directory failed. Check the login credentials and/or server details. AD said: ' . $this->getLastError());
- }
- }
- }
- if ($this->useSSO && $_SERVER['REMOTE_USER'] && $this->adminUsername === null && $_SERVER['KRB5CCNAME']) {
- putenv("KRB5CCNAME=" . $_SERVER['KRB5CCNAME']);
- $this->ldapBind = @ldap_sasl_bind($this->ldapConnection, NULL, NULL, "GSSAPI");
- if (!$this->ldapBind){
- throw new adLDAPException('Rebind to Active Directory failed. AD said: ' . $this->getLastError());
- }
- else {
- return true;
- }
- }
-
-
- if ($this->baseDn == NULL) {
- $this->baseDn = $this->findBaseDn();
- }
-
- return true;
- }
-
- /**
- * Closes the LDAP connection
- *
- * @return void
- */
- public function close() {
- if ($this->ldapConnection) {
- @ldap_close($this->ldapConnection);
- }
- }
-
- /**
- * Validate a user's login credentials
- *
- * @param string $username A user's AD username
- * @param string $password A user's AD password
- * @param bool optional $preventRebind
- * @return bool
- */
- public function authenticate($username, $password, $preventRebind = false) {
- // Prevent null binding
- if ($username === NULL || $password === NULL) { return false; }
- if (empty($username) || empty($password)) { return false; }
-
- // Allow binding over SSO for Kerberos
- if ($this->useSSO && $_SERVER['REMOTE_USER'] && $_SERVER['REMOTE_USER'] == $username && $this->adminUsername === NULL && $_SERVER['KRB5CCNAME']) {
- putenv("KRB5CCNAME=" . $_SERVER['KRB5CCNAME']);
- $this->ldapBind = @ldap_sasl_bind($this->ldapConnection, NULL, NULL, "GSSAPI");
- if (!$this->ldapBind) {
- throw new adLDAPException('Rebind to Active Directory failed. AD said: ' . $this->getLastError());
- }
- else {
- return true;
- }
- }
-
- // Bind as the user
- $ret = true;
- $this->ldapBind = @ldap_bind($this->ldapConnection, $username . $this->accountSuffix, $password);
- if (!$this->ldapBind){
- $ret = false;
- }
-
- // Cnce we've checked their details, kick back into admin mode if we have it
- if ($this->adminUsername !== NULL && !$preventRebind) {
- $this->ldapBind = @ldap_bind($this->ldapConnection, $this->adminUsername . $this->accountSuffix , $this->adminPassword);
- if (!$this->ldapBind){
- // This should never happen in theory
- throw new adLDAPException('Rebind to Active Directory failed. AD said: ' . $this->getLastError());
- }
- }
-
- return $ret;
- }
-
- /**
- * Find the Base DN of your domain controller
- *
- * @return string
- */
- public function findBaseDn()
- {
- $namingContext = $this->getRootDse(array('defaultnamingcontext'));
- return $namingContext[0]['defaultnamingcontext'][0];
- }
-
- /**
- * Get the RootDSE properties from a domain controller
- *
- * @param array $attributes The attributes you wish to query e.g. defaultnamingcontext
- * @return array
- */
- public function getRootDse($attributes = array("*", "+")) {
- if (!$this->ldapBind){ return (false); }
-
- $sr = @ldap_read($this->ldapConnection, NULL, 'objectClass=*', $attributes);
- $entries = @ldap_get_entries($this->ldapConnection, $sr);
- return $entries;
- }
-
- /**
- * Get last error from Active Directory
- *
- * This function gets the last message from Active Directory
- * This may indeed be a 'Success' message but if you get an unknown error
- * it might be worth calling this function to see what errors were raised
- *
- * return string
- */
- public function getLastError() {
- return @ldap_error($this->ldapConnection);
- }
-
- /**
- * Detect LDAP support in php
- *
- * @return bool
- */
- protected function ldapSupported()
- {
- if (!function_exists('ldap_connect')) {
- return false;
- }
- return true;
- }
-
- /**
- * Detect ldap_sasl_bind support in PHP
- *
- * @return bool
- */
- protected function ldapSaslSupported()
- {
- if (!function_exists('ldap_sasl_bind')) {
- return false;
- }
- return true;
- }
-
- /**
- * Schema
- *
- * @param array $attributes Attributes to be queried
- * @return array
- */
- public function adldap_schema($attributes){
-
- // LDAP doesn't like NULL attributes, only set them if they have values
- // If you wish to remove an attribute you should set it to a space
- // TO DO: Adapt user_modify to use ldap_mod_delete to remove a NULL attribute
- $mod=array();
-
- // Check every attribute to see if it contains 8bit characters and then UTF8 encode them
- array_walk($attributes, array($this, 'encode8bit'));
-
- if ($attributes["address_city"]){ $mod["l"][0]=$attributes["address_city"]; }
- if ($attributes["address_code"]){ $mod["postalCode"][0]=$attributes["address_code"]; }
- //if ($attributes["address_country"]){ $mod["countryCode"][0]=$attributes["address_country"]; } // use country codes?
- if ($attributes["address_country"]){ $mod["c"][0]=$attributes["address_country"]; }
- if ($attributes["address_pobox"]){ $mod["postOfficeBox"][0]=$attributes["address_pobox"]; }
- if ($attributes["address_state"]){ $mod["st"][0]=$attributes["address_state"]; }
- if ($attributes["address_street"]){ $mod["streetAddress"][0]=$attributes["address_street"]; }
- if ($attributes["company"]){ $mod["company"][0]=$attributes["company"]; }
- if ($attributes["change_password"]){ $mod["pwdLastSet"][0]=0; }
- if ($attributes["department"]){ $mod["department"][0]=$attributes["department"]; }
- if ($attributes["description"]){ $mod["description"][0]=$attributes["description"]; }
- if ($attributes["display_name"]){ $mod["displayName"][0]=$attributes["display_name"]; }
- if ($attributes["email"]){ $mod["mail"][0]=$attributes["email"]; }
- if ($attributes["expires"]){ $mod["accountExpires"][0]=$attributes["expires"]; } //unix epoch format?
- if ($attributes["firstname"]){ $mod["givenName"][0]=$attributes["firstname"]; }
- if ($attributes["home_directory"]){ $mod["homeDirectory"][0]=$attributes["home_directory"]; }
- if ($attributes["home_drive"]){ $mod["homeDrive"][0]=$attributes["home_drive"]; }
- if ($attributes["initials"]){ $mod["initials"][0]=$attributes["initials"]; }
- if ($attributes["logon_name"]){ $mod["userPrincipalName"][0]=$attributes["logon_name"]; }
- if ($attributes["manager"]){ $mod["manager"][0]=$attributes["manager"]; } //UNTESTED ***Use DistinguishedName***
- if ($attributes["office"]){ $mod["physicalDeliveryOfficeName"][0]=$attributes["office"]; }
- if ($attributes["password"]){ $mod["unicodePwd"][0]=$this->user()->encodePassword($attributes["password"]); }
- if ($attributes["profile_path"]){ $mod["profilepath"][0]=$attributes["profile_path"]; }
- if ($attributes["script_path"]){ $mod["scriptPath"][0]=$attributes["script_path"]; }
- if ($attributes["surname"]){ $mod["sn"][0]=$attributes["surname"]; }
- if ($attributes["title"]){ $mod["title"][0]=$attributes["title"]; }
- if ($attributes["telephone"]){ $mod["telephoneNumber"][0]=$attributes["telephone"]; }
- if ($attributes["mobile"]){ $mod["mobile"][0]=$attributes["mobile"]; }
- if ($attributes["pager"]){ $mod["pager"][0]=$attributes["pager"]; }
- if ($attributes["ipphone"]){ $mod["ipphone"][0]=$attributes["ipphone"]; }
- if ($attributes["web_page"]){ $mod["wWWHomePage"][0]=$attributes["web_page"]; }
- if ($attributes["fax"]){ $mod["facsimileTelephoneNumber"][0]=$attributes["fax"]; }
- if ($attributes["enabled"]){ $mod["userAccountControl"][0]=$attributes["enabled"]; }
- if ($attributes["homephone"]){ $mod["homephone"][0]=$attributes["homephone"]; }
-
- // Distribution List specific schema
- if ($attributes["group_sendpermission"]){ $mod["dlMemSubmitPerms"][0]=$attributes["group_sendpermission"]; }
- if ($attributes["group_rejectpermission"]){ $mod["dlMemRejectPerms"][0]=$attributes["group_rejectpermission"]; }
-
- // Exchange Schema
- if ($attributes["exchange_homemdb"]){ $mod["homeMDB"][0]=$attributes["exchange_homemdb"]; }
- if ($attributes["exchange_mailnickname"]){ $mod["mailNickname"][0]=$attributes["exchange_mailnickname"]; }
- if ($attributes["exchange_proxyaddress"]){ $mod["proxyAddresses"][0]=$attributes["exchange_proxyaddress"]; }
- if ($attributes["exchange_usedefaults"]){ $mod["mDBUseDefaults"][0]=$attributes["exchange_usedefaults"]; }
- if ($attributes["exchange_policyexclude"]){ $mod["msExchPoliciesExcluded"][0]=$attributes["exchange_policyexclude"]; }
- if ($attributes["exchange_policyinclude"]){ $mod["msExchPoliciesIncluded"][0]=$attributes["exchange_policyinclude"]; }
- if ($attributes["exchange_addressbook"]){ $mod["showInAddressBook"][0]=$attributes["exchange_addressbook"]; }
- if ($attributes["exchange_altrecipient"]){ $mod["altRecipient"][0]=$attributes["exchange_altrecipient"]; }
- if ($attributes["exchange_deliverandredirect"]){ $mod["deliverAndRedirect"][0]=$attributes["exchange_deliverandredirect"]; }
-
- // This schema is designed for contacts
- if ($attributes["exchange_hidefromlists"]){ $mod["msExchHideFromAddressLists"][0]=$attributes["exchange_hidefromlists"]; }
- if ($attributes["contact_email"]){ $mod["targetAddress"][0]=$attributes["contact_email"]; }
-
- //echo ("<pre>"); print_r($mod);
- /*
- // modifying a name is a bit fiddly
- if ($attributes["firstname"] && $attributes["surname"]){
- $mod["cn"][0]=$attributes["firstname"]." ".$attributes["surname"];
- $mod["displayname"][0]=$attributes["firstname"]." ".$attributes["surname"];
- $mod["name"][0]=$attributes["firstname"]." ".$attributes["surname"];
- }
- */
-
- if (count($mod)==0){ return (false); }
- return ($mod);
- }
-
- /**
- * Convert 8bit characters e.g. accented characters to UTF8 encoded characters
- */
- protected function encode8Bit(&$item, $key) {
- $encode = false;
- if (is_string($item)) {
- for ($i=0; $i<strlen($item); $i++) {
- if (ord($item[$i]) >> 7) {
- $encode = true;
- }
- }
- }
- if ($encode === true && $key != 'password') {
- $item = utf8_encode($item);
- }
- }
-
- /**
- * Select a random domain controller from your domain controller array
- *
- * @return string
- */
- protected function randomController()
- {
- mt_srand(doubleval(microtime()) * 100000000); // For older PHP versions
- /*if (sizeof($this->domainControllers) > 1) {
- $adController = $this->domainControllers[array_rand($this->domainControllers)];
- // Test if the controller is responding to pings
- $ping = $this->pingController($adController);
- if ($ping === false) {
- // Find the current key in the domain controllers array
- $key = array_search($adController, $this->domainControllers);
- // Remove it so that we don't end up in a recursive loop
- unset($this->domainControllers[$key]);
- // Select a new controller
- return $this->randomController();
- }
- else {
- return ($adController);
- }
- } */
- return $this->domainControllers[array_rand($this->domainControllers)];
- }
-
- /**
- * Test basic connectivity to controller
- *
- * @return bool
- */
- protected function pingController($host) {
- $port = $this->adPort;
- fsockopen($host, $port, $errno, $errstr, 10);
- if ($errno > 0) {
- return false;
- }
- return true;
- }
-
-}
-
-/**
-* adLDAP Exception Handler
-*
-* Exceptions of this type are thrown on bind failure or when SSL is required but not configured
-* Example:
-* try {
-* $adldap = new adLDAP();
-* }
-* catch (adLDAPException $e) {
-* echo $e;
-* exit();
-* }
-*/
-class adLDAPException extends Exception {}
-
+<?php
+/**
+ * PHP LDAP CLASS FOR MANIPULATING ACTIVE DIRECTORY
+ * Version 4.0.4
+ *
+ * PHP Version 5 with SSL and LDAP support
+ *
+ * Written by Scott Barnett, Richard Hyland
+ * email: scott@wiggumworld.com, adldap@richardhyland.com
+ * http://adldap.sourceforge.net/
+ *
+ * Copyright (c) 2006-2012 Scott Barnett, Richard Hyland
+ *
+ * We'd appreciate any improvements or additions to be submitted back
+ * to benefit the entire community :)
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * @category ToolsAndUtilities
+ * @package adLDAP
+ * @author Scott Barnett, Richard Hyland
+ * @copyright (c) 2006-2012 Scott Barnett, Richard Hyland
+ * @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html LGPLv2.1
+ * @revision $Revision: 169 $
+ * @version 4.0.4
+ * @link http://adldap.sourceforge.net/
+ */
+
+/**
+* Main adLDAP class
+*
+* Can be initialised using $adldap = new adLDAP();
+*
+* Something to keep in mind is that Active Directory is a permissions
+* based directory. If you bind as a domain user, you can't fetch as
+* much information on other users as you could as a domain admin.
+*
+* Before asking questions, please read the Documentation at
+* http://adldap.sourceforge.net/wiki/doku.php?id=api
+*/
+require_once(dirname(__FILE__) . '/collections/adLDAPCollection.php');
+require_once(dirname(__FILE__) . '/classes/adLDAPGroups.php');
+require_once(dirname(__FILE__) . '/classes/adLDAPUsers.php');
+require_once(dirname(__FILE__) . '/classes/adLDAPFolders.php');
+require_once(dirname(__FILE__) . '/classes/adLDAPUtils.php');
+require_once(dirname(__FILE__) . '/classes/adLDAPContacts.php');
+require_once(dirname(__FILE__) . '/classes/adLDAPExchange.php');
+require_once(dirname(__FILE__) . '/classes/adLDAPComputers.php');
+
+class adLDAP {
+
+ /**
+ * Define the different types of account in AD
+ */
+ const ADLDAP_NORMAL_ACCOUNT = 805306368;
+ const ADLDAP_WORKSTATION_TRUST = 805306369;
+ const ADLDAP_INTERDOMAIN_TRUST = 805306370;
+ const ADLDAP_SECURITY_GLOBAL_GROUP = 268435456;
+ const ADLDAP_DISTRIBUTION_GROUP = 268435457;
+ const ADLDAP_SECURITY_LOCAL_GROUP = 536870912;
+ const ADLDAP_DISTRIBUTION_LOCAL_GROUP = 536870913;
+ const ADLDAP_FOLDER = 'OU';
+ const ADLDAP_CONTAINER = 'CN';
+
+ /**
+ * The default port for LDAP non-SSL connections
+ */
+ const ADLDAP_LDAP_PORT = '389';
+ /**
+ * The default port for LDAPS SSL connections
+ */
+ const ADLDAP_LDAPS_PORT = '636';
+
+ /**
+ * The account suffix for your domain, can be set when the class is invoked
+ *
+ * @var string
+ */
+ protected $accountSuffix = "@mydomain.local";
+
+ /**
+ * The base dn for your domain
+ *
+ * If this is set to null then adLDAP will attempt to obtain this automatically from the rootDSE
+ *
+ * @var string
+ */
+ protected $baseDn = "DC=mydomain,DC=local";
+
+ /**
+ * Port used to talk to the domain controllers.
+ *
+ * @var int
+ */
+ protected $adPort = self::ADLDAP_LDAP_PORT;
+
+ /**
+ * Array of domain controllers. Specifiy multiple controllers if you
+ * would like the class to balance the LDAP queries amongst multiple servers
+ *
+ * @var array
+ */
+ protected $domainControllers = array("dc01.mydomain.local");
+
+ /**
+ * Optional account with higher privileges for searching
+ * This should be set to a domain admin account
+ *
+ * @var string
+ * @var string
+ */
+ protected $adminUsername = NULL;
+ protected $adminPassword = NULL;
+
+ /**
+ * AD does not return the primary group. http://support.microsoft.com/?kbid=321360
+ * This tweak will resolve the real primary group.
+ * Setting to false will fudge "Domain Users" and is much faster. Keep in mind though that if
+ * someone's primary group is NOT domain users, this is obviously going to mess up the results
+ *
+ * @var bool
+ */
+ protected $realPrimaryGroup = true;
+
+ /**
+ * Use SSL (LDAPS), your server needs to be setup, please see
+ * http://adldap.sourceforge.net/wiki/doku.php?id=ldap_over_ssl
+ *
+ * @var bool
+ */
+ protected $useSSL = false;
+
+ /**
+ * Use TLS
+ * If you wish to use TLS you should ensure that $useSSL is set to false and vice-versa
+ *
+ * @var bool
+ */
+ protected $useTLS = false;
+
+ /**
+ * Use SSO
+ * To indicate to adLDAP to reuse password set by the brower through NTLM or Kerberos
+ *
+ * @var bool
+ */
+ protected $useSSO = false;
+
+ /**
+ * When querying group memberships, do it recursively
+ * eg. User Fred is a member of Group A, which is a member of Group B, which is a member of Group C
+ * user_ingroup("Fred","C") will returns true with this option turned on, false if turned off
+ *
+ * @var bool
+ */
+ protected $recursiveGroups = true;
+
+ // You should not need to edit anything below this line
+ //******************************************************************************************
+
+ /**
+ * Connection and bind default variables
+ *
+ * @var mixed
+ * @var mixed
+ */
+ protected $ldapConnection;
+ protected $ldapBind;
+
+ /**
+ * Get the active LDAP Connection
+ *
+ * @return resource
+ */
+ public function getLdapConnection() {
+ if ($this->ldapConnection) {
+ return $this->ldapConnection;
+ }
+ return false;
+ }
+
+ /**
+ * Get the bind status
+ *
+ * @return bool
+ */
+ public function getLdapBind() {
+ return $this->ldapBind;
+ }
+
+ /**
+ * Get the current base DN
+ *
+ * @return string
+ */
+ public function getBaseDn() {
+ return $this->baseDn;
+ }
+
+ /**
+ * The group class
+ *
+ * @var adLDAPGroups
+ */
+ protected $groupClass;
+
+ /**
+ * Get the group class interface
+ *
+ * @return adLDAPGroups
+ */
+ public function group() {
+ if (!$this->groupClass) {
+ $this->groupClass = new adLDAPGroups($this);
+ }
+ return $this->groupClass;
+ }
+
+ /**
+ * The user class
+ *
+ * @var adLDAPUsers
+ */
+ protected $userClass;
+
+ /**
+ * Get the userclass interface
+ *
+ * @return adLDAPUsers
+ */
+ public function user() {
+ if (!$this->userClass) {
+ $this->userClass = new adLDAPUsers($this);
+ }
+ return $this->userClass;
+ }
+
+ /**
+ * The folders class
+ *
+ * @var adLDAPFolders
+ */
+ protected $folderClass;
+
+ /**
+ * Get the folder class interface
+ *
+ * @return adLDAPFolders
+ */
+ public function folder() {
+ if (!$this->folderClass) {
+ $this->folderClass = new adLDAPFolders($this);
+ }
+ return $this->folderClass;
+ }
+
+ /**
+ * The utils class
+ *
+ * @var adLDAPUtils
+ */
+ protected $utilClass;
+
+ /**
+ * Get the utils class interface
+ *
+ * @return adLDAPUtils
+ */
+ public function utilities() {
+ if (!$this->utilClass) {
+ $this->utilClass = new adLDAPUtils($this);
+ }
+ return $this->utilClass;
+ }
+
+ /**
+ * The contacts class
+ *
+ * @var adLDAPContacts
+ */
+ protected $contactClass;
+
+ /**
+ * Get the contacts class interface
+ *
+ * @return adLDAPContacts
+ */
+ public function contact() {
+ if (!$this->contactClass) {
+ $this->contactClass = new adLDAPContacts($this);
+ }
+ return $this->contactClass;
+ }
+
+ /**
+ * The exchange class
+ *
+ * @var adLDAPExchange
+ */
+ protected $exchangeClass;
+
+ /**
+ * Get the exchange class interface
+ *
+ * @return adLDAPExchange
+ */
+ public function exchange() {
+ if (!$this->exchangeClass) {
+ $this->exchangeClass = new adLDAPExchange($this);
+ }
+ return $this->exchangeClass;
+ }
+
+ /**
+ * The computers class
+ *
+ * @var adLDAPComputers
+ */
+ protected $computersClass;
+
+ /**
+ * Get the computers class interface
+ *
+ * @return adLDAPComputers
+ */
+ public function computer() {
+ if (!$this->computerClass) {
+ $this->computerClass = new adLDAPComputers($this);
+ }
+ return $this->computerClass;
+ }
+
+ /**
+ * Getters and Setters
+ */
+
+ /**
+ * Set the account suffix
+ *
+ * @param string $accountSuffix
+ * @return void
+ */
+ public function setAccountSuffix($accountSuffix)
+ {
+ $this->accountSuffix = $accountSuffix;
+ }
+
+ /**
+ * Get the account suffix
+ *
+ * @return string
+ */
+ public function getAccountSuffix()
+ {
+ return $this->accountSuffix;
+ }
+
+ /**
+ * Set the domain controllers array
+ *
+ * @param array $domainControllers
+ * @return void
+ */
+ public function setDomainControllers(array $domainControllers)
+ {
+ $this->domainControllers = $domainControllers;
+ }
+
+ /**
+ * Get the list of domain controllers
+ *
+ * @return void
+ */
+ public function getDomainControllers()
+ {
+ return $this->domainControllers;
+ }
+
+ /**
+ * Sets the port number your domain controller communicates over
+ *
+ * @param int $adPort
+ */
+ public function setPort($adPort)
+ {
+ $this->adPort = $adPort;
+ }
+
+ /**
+ * Gets the port number your domain controller communicates over
+ *
+ * @return int
+ */
+ public function getPort()
+ {
+ return $this->adPort;
+ }
+
+ /**
+ * Set the username of an account with higher priviledges
+ *
+ * @param string $adminUsername
+ * @return void
+ */
+ public function setAdminUsername($adminUsername)
+ {
+ $this->adminUsername = $adminUsername;
+ }
+
+ /**
+ * Get the username of the account with higher priviledges
+ *
+ * This will throw an exception for security reasons
+ */
+ public function getAdminUsername()
+ {
+ throw new adLDAPException('For security reasons you cannot access the domain administrator account details');
+ }
+
+ /**
+ * Set the password of an account with higher priviledges
+ *
+ * @param string $adminPassword
+ * @return void
+ */
+ public function setAdminPassword($adminPassword)
+ {
+ $this->adminPassword = $adminPassword;
+ }
+
+ /**
+ * Get the password of the account with higher priviledges
+ *
+ * This will throw an exception for security reasons
+ */
+ public function getAdminPassword()
+ {
+ throw new adLDAPException('For security reasons you cannot access the domain administrator account details');
+ }
+
+ /**
+ * Set whether to detect the true primary group
+ *
+ * @param bool $realPrimaryGroup
+ * @return void
+ */
+ public function setRealPrimaryGroup($realPrimaryGroup)
+ {
+ $this->realPrimaryGroup = $realPrimaryGroup;
+ }
+
+ /**
+ * Get the real primary group setting
+ *
+ * @return bool
+ */
+ public function getRealPrimaryGroup()
+ {
+ return $this->realPrimaryGroup;
+ }
+
+ /**
+ * Set whether to use SSL
+ *
+ * @param bool $useSSL
+ * @return void
+ */
+ public function setUseSSL($useSSL)
+ {
+ $this->useSSL = $useSSL;
+ // Set the default port correctly
+ if($this->useSSL) {
+ $this->setPort(self::ADLDAP_LDAPS_PORT);
+ }
+ else {
+ $this->setPort(self::ADLDAP_LDAP_PORT);
+ }
+ }
+
+ /**
+ * Get the SSL setting
+ *
+ * @return bool
+ */
+ public function getUseSSL()
+ {
+ return $this->useSSL;
+ }
+
+ /**
+ * Set whether to use TLS
+ *
+ * @param bool $useTLS
+ * @return void
+ */
+ public function setUseTLS($useTLS)
+ {
+ $this->useTLS = $useTLS;
+ }
+
+ /**
+ * Get the TLS setting
+ *
+ * @return bool
+ */
+ public function getUseTLS()
+ {
+ return $this->useTLS;
+ }
+
+ /**
+ * Set whether to use SSO
+ * Requires ldap_sasl_bind support. Be sure --with-ldap-sasl is used when configuring PHP otherwise this function will be undefined.
+ *
+ * @param bool $useSSO
+ * @return void
+ */
+ public function setUseSSO($useSSO)
+ {
+ if ($useSSO === true && !$this->ldapSaslSupported()) {
+ throw new adLDAPException('No LDAP SASL support for PHP. See: http://www.php.net/ldap_sasl_bind');
+ }
+ $this->useSSO = $useSSO;
+ }
+
+ /**
+ * Get the SSO setting
+ *
+ * @return bool
+ */
+ public function getUseSSO()
+ {
+ return $this->useSSO;
+ }
+
+ /**
+ * Set whether to lookup recursive groups
+ *
+ * @param bool $recursiveGroups
+ * @return void
+ */
+ public function setRecursiveGroups($recursiveGroups)
+ {
+ $this->recursiveGroups = $recursiveGroups;
+ }
+
+ /**
+ * Get the recursive groups setting
+ *
+ * @return bool
+ */
+ public function getRecursiveGroups()
+ {
+ return $this->recursiveGroups;
+ }
+
+ /**
+ * Default Constructor
+ *
+ * Tries to bind to the AD domain over LDAP or LDAPs
+ *
+ * @param array $options Array of options to pass to the constructor
+ * @throws Exception - if unable to bind to Domain Controller
+ * @return bool
+ */
+ function __construct($options = array()) {
+ // You can specifically overide any of the default configuration options setup above
+ if (count($options) > 0) {
+ if (array_key_exists("account_suffix",$options)){ $this->accountSuffix = $options["account_suffix"]; }
+ if (array_key_exists("base_dn",$options)){ $this->baseDn = $options["base_dn"]; }
+ if (array_key_exists("domain_controllers",$options)){
+ if (!is_array($options["domain_controllers"])) {
+ throw new adLDAPException('[domain_controllers] option must be an array');
+ }
+ $this->domainControllers = $options["domain_controllers"];
+ }
+ if (array_key_exists("admin_username",$options)){ $this->adminUsername = $options["admin_username"]; }
+ if (array_key_exists("admin_password",$options)){ $this->adminPassword = $options["admin_password"]; }
+ if (array_key_exists("real_primarygroup",$options)){ $this->realPrimaryGroup = $options["real_primarygroup"]; }
+ if (array_key_exists("use_ssl",$options)){ $this->setUseSSL($options["use_ssl"]); }
+ if (array_key_exists("use_tls",$options)){ $this->useTLS = $options["use_tls"]; }
+ if (array_key_exists("recursive_groups",$options)){ $this->recursiveGroups = $options["recursive_groups"]; }
+ if (array_key_exists("ad_port",$options)){ $this->setPort($options["ad_port"]); }
+ if (array_key_exists("sso",$options)) {
+ $this->setUseSSO($options["sso"]);
+ if (!$this->ldapSaslSupported()) {
+ $this->setUseSSO(false);
+ }
+ }
+ }
+
+ if ($this->ldapSupported() === false) {
+ throw new adLDAPException('No LDAP support for PHP. See: http://www.php.net/ldap');
+ }
+
+ return $this->connect();
+ }
+
+ /**
+ * Default Destructor
+ *
+ * Closes the LDAP connection
+ *
+ * @return void
+ */
+ function __destruct() {
+ $this->close();
+ }
+
+ /**
+ * Connects and Binds to the Domain Controller
+ *
+ * @return bool
+ */
+ public function connect()
+ {
+ // Connect to the AD/LDAP server as the username/password
+ $domainController = $this->randomController();
+ if ($this->useSSL) {
+ $this->ldapConnection = ldap_connect("ldaps://" . $domainController, $this->adPort);
+ } else {
+ $this->ldapConnection = ldap_connect($domainController, $this->adPort);
+ }
+
+ // Set some ldap options for talking to AD
+ ldap_set_option($this->ldapConnection, LDAP_OPT_PROTOCOL_VERSION, 3);
+ ldap_set_option($this->ldapConnection, LDAP_OPT_REFERRALS, 0);
+
+ if ($this->useTLS) {
+ ldap_start_tls($this->ldapConnection);
+ }
+
+ // Bind as a domain admin if they've set it up
+ if ($this->adminUsername !== NULL && $this->adminPassword !== NULL) {
+ $this->ldapBind = @ldap_bind($this->ldapConnection, $this->adminUsername . $this->accountSuffix, $this->adminPassword);
+ if (!$this->ldapBind) {
+ if ($this->useSSL && !$this->useTLS) {
+ // If you have problems troubleshooting, remove the @ character from the ldapldapBind command above to get the actual error message
+ throw new adLDAPException('Bind to Active Directory failed. Either the LDAPs connection failed or the login credentials are incorrect. AD said: ' . $this->getLastError());
+ }
+ else {
+ throw new adLDAPException('Bind to Active Directory failed. Check the login credentials and/or server details. AD said: ' . $this->getLastError());
+ }
+ }
+ }
+ if ($this->useSSO && $_SERVER['REMOTE_USER'] && $this->adminUsername === null && $_SERVER['KRB5CCNAME']) {
+ putenv("KRB5CCNAME=" . $_SERVER['KRB5CCNAME']);
+ $this->ldapBind = @ldap_sasl_bind($this->ldapConnection, NULL, NULL, "GSSAPI");
+ if (!$this->ldapBind){
+ throw new adLDAPException('Rebind to Active Directory failed. AD said: ' . $this->getLastError());
+ }
+ else {
+ return true;
+ }
+ }
+
+
+ if ($this->baseDn == NULL) {
+ $this->baseDn = $this->findBaseDn();
+ }
+
+ return true;
+ }
+
+ /**
+ * Closes the LDAP connection
+ *
+ * @return void
+ */
+ public function close() {
+ if ($this->ldapConnection) {
+ @ldap_close($this->ldapConnection);
+ }
+ }
+
+ /**
+ * Validate a user's login credentials
+ *
+ * @param string $username A user's AD username
+ * @param string $password A user's AD password
+ * @param bool optional $preventRebind
+ * @return bool
+ */
+ public function authenticate($username, $password, $preventRebind = false) {
+ // Prevent null binding
+ if ($username === NULL || $password === NULL) { return false; }
+ if (empty($username) || empty($password)) { return false; }
+
+ // Allow binding over SSO for Kerberos
+ if ($this->useSSO && $_SERVER['REMOTE_USER'] && $_SERVER['REMOTE_USER'] == $username && $this->adminUsername === NULL && $_SERVER['KRB5CCNAME']) {
+ putenv("KRB5CCNAME=" . $_SERVER['KRB5CCNAME']);
+ $this->ldapBind = @ldap_sasl_bind($this->ldapConnection, NULL, NULL, "GSSAPI");
+ if (!$this->ldapBind) {
+ throw new adLDAPException('Rebind to Active Directory failed. AD said: ' . $this->getLastError());
+ }
+ else {
+ return true;
+ }
+ }
+
+ // Bind as the user
+ $ret = true;
+ $this->ldapBind = @ldap_bind($this->ldapConnection, $username . $this->accountSuffix, $password);
+ if (!$this->ldapBind){
+ $ret = false;
+ }
+
+ // Cnce we've checked their details, kick back into admin mode if we have it
+ if ($this->adminUsername !== NULL && !$preventRebind) {
+ $this->ldapBind = @ldap_bind($this->ldapConnection, $this->adminUsername . $this->accountSuffix , $this->adminPassword);
+ if (!$this->ldapBind){
+ // This should never happen in theory
+ throw new adLDAPException('Rebind to Active Directory failed. AD said: ' . $this->getLastError());
+ }
+ }
+
+ return $ret;
+ }
+
+ /**
+ * Find the Base DN of your domain controller
+ *
+ * @return string
+ */
+ public function findBaseDn()
+ {
+ $namingContext = $this->getRootDse(array('defaultnamingcontext'));
+ return $namingContext[0]['defaultnamingcontext'][0];
+ }
+
+ /**
+ * Get the RootDSE properties from a domain controller
+ *
+ * @param array $attributes The attributes you wish to query e.g. defaultnamingcontext
+ * @return array
+ */
+ public function getRootDse($attributes = array("*", "+")) {
+ if (!$this->ldapBind){ return (false); }
+
+ $sr = @ldap_read($this->ldapConnection, NULL, 'objectClass=*', $attributes);
+ $entries = @ldap_get_entries($this->ldapConnection, $sr);
+ return $entries;
+ }
+
+ /**
+ * Get last error from Active Directory
+ *
+ * This function gets the last message from Active Directory
+ * This may indeed be a 'Success' message but if you get an unknown error
+ * it might be worth calling this function to see what errors were raised
+ *
+ * return string
+ */
+ public function getLastError() {
+ return @ldap_error($this->ldapConnection);
+ }
+
+ /**
+ * Detect LDAP support in php
+ *
+ * @return bool
+ */
+ protected function ldapSupported()
+ {
+ if (!function_exists('ldap_connect')) {
+ return false;
+ }
+ return true;
+ }
+
+ /**
+ * Detect ldap_sasl_bind support in PHP
+ *
+ * @return bool
+ */
+ protected function ldapSaslSupported()
+ {
+ if (!function_exists('ldap_sasl_bind')) {
+ return false;
+ }
+ return true;
+ }
+
+ /**
+ * Schema
+ *
+ * @param array $attributes Attributes to be queried
+ * @return array
+ */
+ public function adldap_schema($attributes){
+
+ // LDAP doesn't like NULL attributes, only set them if they have values
+ // If you wish to remove an attribute you should set it to a space
+ // TO DO: Adapt user_modify to use ldap_mod_delete to remove a NULL attribute
+ $mod=array();
+
+ // Check every attribute to see if it contains 8bit characters and then UTF8 encode them
+ array_walk($attributes, array($this, 'encode8bit'));
+
+ if ($attributes["address_city"]){ $mod["l"][0]=$attributes["address_city"]; }
+ if ($attributes["address_code"]){ $mod["postalCode"][0]=$attributes["address_code"]; }
+ //if ($attributes["address_country"]){ $mod["countryCode"][0]=$attributes["address_country"]; } // use country codes?
+ if ($attributes["address_country"]){ $mod["c"][0]=$attributes["address_country"]; }
+ if ($attributes["address_pobox"]){ $mod["postOfficeBox"][0]=$attributes["address_pobox"]; }
+ if ($attributes["address_state"]){ $mod["st"][0]=$attributes["address_state"]; }
+ if ($attributes["address_street"]){ $mod["streetAddress"][0]=$attributes["address_street"]; }
+ if ($attributes["company"]){ $mod["company"][0]=$attributes["company"]; }
+ if ($attributes["change_password"]){ $mod["pwdLastSet"][0]=0; }
+ if ($attributes["department"]){ $mod["department"][0]=$attributes["department"]; }
+ if ($attributes["description"]){ $mod["description"][0]=$attributes["description"]; }
+ if ($attributes["display_name"]){ $mod["displayName"][0]=$attributes["display_name"]; }
+ if ($attributes["email"]){ $mod["mail"][0]=$attributes["email"]; }
+ if ($attributes["expires"]){ $mod["accountExpires"][0]=$attributes["expires"]; } //unix epoch format?
+ if ($attributes["firstname"]){ $mod["givenName"][0]=$attributes["firstname"]; }
+ if ($attributes["home_directory"]){ $mod["homeDirectory"][0]=$attributes["home_directory"]; }
+ if ($attributes["home_drive"]){ $mod["homeDrive"][0]=$attributes["home_drive"]; }
+ if ($attributes["initials"]){ $mod["initials"][0]=$attributes["initials"]; }
+ if ($attributes["logon_name"]){ $mod["userPrincipalName"][0]=$attributes["logon_name"]; }
+ if ($attributes["manager"]){ $mod["manager"][0]=$attributes["manager"]; } //UNTESTED ***Use DistinguishedName***
+ if ($attributes["office"]){ $mod["physicalDeliveryOfficeName"][0]=$attributes["office"]; }
+ if ($attributes["password"]){ $mod["unicodePwd"][0]=$this->user()->encodePassword($attributes["password"]); }
+ if ($attributes["profile_path"]){ $mod["profilepath"][0]=$attributes["profile_path"]; }
+ if ($attributes["script_path"]){ $mod["scriptPath"][0]=$attributes["script_path"]; }
+ if ($attributes["surname"]){ $mod["sn"][0]=$attributes["surname"]; }
+ if ($attributes["title"]){ $mod["title"][0]=$attributes["title"]; }
+ if ($attributes["telephone"]){ $mod["telephoneNumber"][0]=$attributes["telephone"]; }
+ if ($attributes["mobile"]){ $mod["mobile"][0]=$attributes["mobile"]; }
+ if ($attributes["pager"]){ $mod["pager"][0]=$attributes["pager"]; }
+ if ($attributes["ipphone"]){ $mod["ipphone"][0]=$attributes["ipphone"]; }
+ if ($attributes["web_page"]){ $mod["wWWHomePage"][0]=$attributes["web_page"]; }
+ if ($attributes["fax"]){ $mod["facsimileTelephoneNumber"][0]=$attributes["fax"]; }
+ if ($attributes["enabled"]){ $mod["userAccountControl"][0]=$attributes["enabled"]; }
+ if ($attributes["homephone"]){ $mod["homephone"][0]=$attributes["homephone"]; }
+
+ // Distribution List specific schema
+ if ($attributes["group_sendpermission"]){ $mod["dlMemSubmitPerms"][0]=$attributes["group_sendpermission"]; }
+ if ($attributes["group_rejectpermission"]){ $mod["dlMemRejectPerms"][0]=$attributes["group_rejectpermission"]; }
+
+ // Exchange Schema
+ if ($attributes["exchange_homemdb"]){ $mod["homeMDB"][0]=$attributes["exchange_homemdb"]; }
+ if ($attributes["exchange_mailnickname"]){ $mod["mailNickname"][0]=$attributes["exchange_mailnickname"]; }
+ if ($attributes["exchange_proxyaddress"]){ $mod["proxyAddresses"][0]=$attributes["exchange_proxyaddress"]; }
+ if ($attributes["exchange_usedefaults"]){ $mod["mDBUseDefaults"][0]=$attributes["exchange_usedefaults"]; }
+ if ($attributes["exchange_policyexclude"]){ $mod["msExchPoliciesExcluded"][0]=$attributes["exchange_policyexclude"]; }
+ if ($attributes["exchange_policyinclude"]){ $mod["msExchPoliciesIncluded"][0]=$attributes["exchange_policyinclude"]; }
+ if ($attributes["exchange_addressbook"]){ $mod["showInAddressBook"][0]=$attributes["exchange_addressbook"]; }
+ if ($attributes["exchange_altrecipient"]){ $mod["altRecipient"][0]=$attributes["exchange_altrecipient"]; }
+ if ($attributes["exchange_deliverandredirect"]){ $mod["deliverAndRedirect"][0]=$attributes["exchange_deliverandredirect"]; }
+
+ // This schema is designed for contacts
+ if ($attributes["exchange_hidefromlists"]){ $mod["msExchHideFromAddressLists"][0]=$attributes["exchange_hidefromlists"]; }
+ if ($attributes["contact_email"]){ $mod["targetAddress"][0]=$attributes["contact_email"]; }
+
+ //echo ("<pre>"); print_r($mod);
+ /*
+ // modifying a name is a bit fiddly
+ if ($attributes["firstname"] && $attributes["surname"]){
+ $mod["cn"][0]=$attributes["firstname"]." ".$attributes["surname"];
+ $mod["displayname"][0]=$attributes["firstname"]." ".$attributes["surname"];
+ $mod["name"][0]=$attributes["firstname"]." ".$attributes["surname"];
+ }
+ */
+
+ if (count($mod)==0){ return (false); }
+ return ($mod);
+ }
+
+ /**
+ * Convert 8bit characters e.g. accented characters to UTF8 encoded characters
+ */
+ protected function encode8Bit(&$item, $key) {
+ $encode = false;
+ if (is_string($item)) {
+ for ($i=0; $i<strlen($item); $i++) {
+ if (ord($item[$i]) >> 7) {
+ $encode = true;
+ }
+ }
+ }
+ if ($encode === true && $key != 'password') {
+ $item = utf8_encode($item);
+ }
+ }
+
+ /**
+ * Select a random domain controller from your domain controller array
+ *
+ * @return string
+ */
+ protected function randomController()
+ {
+ mt_srand(doubleval(microtime()) * 100000000); // For older PHP versions
+ /*if (sizeof($this->domainControllers) > 1) {
+ $adController = $this->domainControllers[array_rand($this->domainControllers)];
+ // Test if the controller is responding to pings
+ $ping = $this->pingController($adController);
+ if ($ping === false) {
+ // Find the current key in the domain controllers array
+ $key = array_search($adController, $this->domainControllers);
+ // Remove it so that we don't end up in a recursive loop
+ unset($this->domainControllers[$key]);
+ // Select a new controller
+ return $this->randomController();
+ }
+ else {
+ return ($adController);
+ }
+ } */
+ return $this->domainControllers[array_rand($this->domainControllers)];
+ }
+
+ /**
+ * Test basic connectivity to controller
+ *
+ * @return bool
+ */
+ protected function pingController($host) {
+ $port = $this->adPort;
+ fsockopen($host, $port, $errno, $errstr, 10);
+ if ($errno > 0) {
+ return false;
+ }
+ return true;
+ }
+
+}
+
+/**
+* adLDAP Exception Handler
+*
+* Exceptions of this type are thrown on bind failure or when SSL is required but not configured
+* Example:
+* try {
+* $adldap = new adLDAP();
+* }
+* catch (adLDAPException $e) {
+* echo $e;
+* exit();
+* }
+*/
+class adLDAPException extends Exception {}
+
?> \ No newline at end of file
diff --git a/lib/plugins/authad/adLDAP/classes/adLDAPComputers.php b/lib/plugins/authad/adLDAP/classes/adLDAPComputers.php
index 71b24a04f..aabd88fa5 100644
--- a/lib/plugins/authad/adLDAP/classes/adLDAPComputers.php
+++ b/lib/plugins/authad/adLDAP/classes/adLDAPComputers.php
@@ -1,153 +1,153 @@
-<?php
-/**
- * PHP LDAP CLASS FOR MANIPULATING ACTIVE DIRECTORY
- * Version 4.0.4
- *
- * PHP Version 5 with SSL and LDAP support
- *
- * Written by Scott Barnett, Richard Hyland
- * email: scott@wiggumworld.com, adldap@richardhyland.com
- * http://adldap.sourceforge.net/
- *
- * Copyright (c) 2006-2012 Scott Barnett, Richard Hyland
- *
- * We'd appreciate any improvements or additions to be submitted back
- * to benefit the entire community :)
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * @category ToolsAndUtilities
- * @package adLDAP
- * @subpackage Computers
- * @author Scott Barnett, Richard Hyland
- * @copyright (c) 2006-2012 Scott Barnett, Richard Hyland
- * @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html LGPLv2.1
- * @revision $Revision: 97 $
- * @version 4.0.4
- * @link http://adldap.sourceforge.net/
- */
-require_once(dirname(__FILE__) . '/../adLDAP.php');
-require_once(dirname(__FILE__) . '/../collections/adLDAPComputerCollection.php');
-
-/**
-* COMPUTER MANAGEMENT FUNCTIONS
-*/
-class adLDAPComputers {
-
- /**
- * The current adLDAP connection via dependency injection
- *
- * @var adLDAP
- */
- protected $adldap;
-
- public function __construct(adLDAP $adldap) {
- $this->adldap = $adldap;
- }
-
- /**
- * Get information about a specific computer. Returned in a raw array format from AD
- *
- * @param string $computerName The name of the computer
- * @param array $fields Attributes to return
- * @return array
- */
- public function info($computerName, $fields = NULL)
- {
- if ($computerName === NULL) { return false; }
- if (!$this->adldap->getLdapBind()) { return false; }
-
- $filter = "(&(objectClass=computer)(cn=" . $computerName . "))";
- if ($fields === NULL) {
- $fields = array("memberof","cn","displayname","dnshostname","distinguishedname","objectcategory","operatingsystem","operatingsystemservicepack","operatingsystemversion");
- }
- $sr = ldap_search($this->adldap->getLdapConnection(), $this->adldap->getBaseDn(), $filter, $fields);
- $entries = ldap_get_entries($this->adldap->getLdapConnection(), $sr);
-
- return $entries;
- }
-
- /**
- * Find information about the computers. Returned in a raw array format from AD
- *
- * @param string $computerName The name of the computer
- * @param array $fields Array of parameters to query
- * @return mixed
- */
- public function infoCollection($computerName, $fields = NULL)
- {
- if ($computerName === NULL) { return false; }
- if (!$this->adldap->getLdapBind()) { return false; }
-
- $info = $this->info($computerName, $fields);
-
- if ($info !== false) {
- $collection = new adLDAPComputerCollection($info, $this->adldap);
- return $collection;
- }
- return false;
- }
-
- /**
- * Check if a computer is in a group
- *
- * @param string $computerName The name of the computer
- * @param string $group The group to check
- * @param bool $recursive Whether to check recursively
- * @return array
- */
- public function inGroup($computerName, $group, $recursive = NULL)
- {
- if ($computerName === NULL) { return false; }
- if ($group === NULL) { return false; }
- if (!$this->adldap->getLdapBind()) { return false; }
- if ($recursive === NULL) { $recursive = $this->adldap->getRecursiveGroups(); } // use the default option if they haven't set it
-
- //get a list of the groups
- $groups = $this->groups($computerName, array("memberof"), $recursive);
-
- //return true if the specified group is in the group list
- if (in_array($group, $groups)){
- return true;
- }
-
- return false;
- }
-
- /**
- * Get the groups a computer is in
- *
- * @param string $computerName The name of the computer
- * @param bool $recursive Whether to check recursively
- * @return array
- */
- public function groups($computerName, $recursive = NULL)
- {
- if ($computerName === NULL) { return false; }
- if ($recursive === NULL) { $recursive = $this->adldap->getRecursiveGroups(); } //use the default option if they haven't set it
- if (!$this->adldap->getLdapBind()){ return false; }
-
- //search the directory for their information
- $info = @$this->info($computerName, array("memberof", "primarygroupid"));
- $groups = $this->adldap->utilities()->niceNames($info[0]["memberof"]); //presuming the entry returned is our guy (unique usernames)
-
- if ($recursive === true) {
- foreach ($groups as $id => $groupName){
- $extraGroups = $this->adldap->group()->recursiveGroups($groupName);
- $groups = array_merge($groups, $extraGroups);
- }
- }
-
- return $groups;
- }
-
-}
+<?php
+/**
+ * PHP LDAP CLASS FOR MANIPULATING ACTIVE DIRECTORY
+ * Version 4.0.4
+ *
+ * PHP Version 5 with SSL and LDAP support
+ *
+ * Written by Scott Barnett, Richard Hyland
+ * email: scott@wiggumworld.com, adldap@richardhyland.com
+ * http://adldap.sourceforge.net/
+ *
+ * Copyright (c) 2006-2012 Scott Barnett, Richard Hyland
+ *
+ * We'd appreciate any improvements or additions to be submitted back
+ * to benefit the entire community :)
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * @category ToolsAndUtilities
+ * @package adLDAP
+ * @subpackage Computers
+ * @author Scott Barnett, Richard Hyland
+ * @copyright (c) 2006-2012 Scott Barnett, Richard Hyland
+ * @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html LGPLv2.1
+ * @revision $Revision: 97 $
+ * @version 4.0.4
+ * @link http://adldap.sourceforge.net/
+ */
+require_once(dirname(__FILE__) . '/../adLDAP.php');
+require_once(dirname(__FILE__) . '/../collections/adLDAPComputerCollection.php');
+
+/**
+* COMPUTER MANAGEMENT FUNCTIONS
+*/
+class adLDAPComputers {
+
+ /**
+ * The current adLDAP connection via dependency injection
+ *
+ * @var adLDAP
+ */
+ protected $adldap;
+
+ public function __construct(adLDAP $adldap) {
+ $this->adldap = $adldap;
+ }
+
+ /**
+ * Get information about a specific computer. Returned in a raw array format from AD
+ *
+ * @param string $computerName The name of the computer
+ * @param array $fields Attributes to return
+ * @return array
+ */
+ public function info($computerName, $fields = NULL)
+ {
+ if ($computerName === NULL) { return false; }
+ if (!$this->adldap->getLdapBind()) { return false; }
+
+ $filter = "(&(objectClass=computer)(cn=" . $computerName . "))";
+ if ($fields === NULL) {
+ $fields = array("memberof","cn","displayname","dnshostname","distinguishedname","objectcategory","operatingsystem","operatingsystemservicepack","operatingsystemversion");
+ }
+ $sr = ldap_search($this->adldap->getLdapConnection(), $this->adldap->getBaseDn(), $filter, $fields);
+ $entries = ldap_get_entries($this->adldap->getLdapConnection(), $sr);
+
+ return $entries;
+ }
+
+ /**
+ * Find information about the computers. Returned in a raw array format from AD
+ *
+ * @param string $computerName The name of the computer
+ * @param array $fields Array of parameters to query
+ * @return mixed
+ */
+ public function infoCollection($computerName, $fields = NULL)
+ {
+ if ($computerName === NULL) { return false; }
+ if (!$this->adldap->getLdapBind()) { return false; }
+
+ $info = $this->info($computerName, $fields);
+
+ if ($info !== false) {
+ $collection = new adLDAPComputerCollection($info, $this->adldap);
+ return $collection;
+ }
+ return false;
+ }
+
+ /**
+ * Check if a computer is in a group
+ *
+ * @param string $computerName The name of the computer
+ * @param string $group The group to check
+ * @param bool $recursive Whether to check recursively
+ * @return array
+ */
+ public function inGroup($computerName, $group, $recursive = NULL)
+ {
+ if ($computerName === NULL) { return false; }
+ if ($group === NULL) { return false; }
+ if (!$this->adldap->getLdapBind()) { return false; }
+ if ($recursive === NULL) { $recursive = $this->adldap->getRecursiveGroups(); } // use the default option if they haven't set it
+
+ //get a list of the groups
+ $groups = $this->groups($computerName, array("memberof"), $recursive);
+
+ //return true if the specified group is in the group list
+ if (in_array($group, $groups)){
+ return true;
+ }
+
+ return false;
+ }
+
+ /**
+ * Get the groups a computer is in
+ *
+ * @param string $computerName The name of the computer
+ * @param bool $recursive Whether to check recursively
+ * @return array
+ */
+ public function groups($computerName, $recursive = NULL)
+ {
+ if ($computerName === NULL) { return false; }
+ if ($recursive === NULL) { $recursive = $this->adldap->getRecursiveGroups(); } //use the default option if they haven't set it
+ if (!$this->adldap->getLdapBind()){ return false; }
+
+ //search the directory for their information
+ $info = @$this->info($computerName, array("memberof", "primarygroupid"));
+ $groups = $this->adldap->utilities()->niceNames($info[0]["memberof"]); //presuming the entry returned is our guy (unique usernames)
+
+ if ($recursive === true) {
+ foreach ($groups as $id => $groupName){
+ $extraGroups = $this->adldap->group()->recursiveGroups($groupName);
+ $groups = array_merge($groups, $extraGroups);
+ }
+ }
+
+ return $groups;
+ }
+
+}
?> \ No newline at end of file
diff --git a/lib/plugins/authad/adLDAP/classes/adLDAPContacts.php b/lib/plugins/authad/adLDAP/classes/adLDAPContacts.php
index addd3e5f0..42a0d756b 100644
--- a/lib/plugins/authad/adLDAP/classes/adLDAPContacts.php
+++ b/lib/plugins/authad/adLDAP/classes/adLDAPContacts.php
@@ -1,294 +1,294 @@
-<?php
-/**
- * PHP LDAP CLASS FOR MANIPULATING ACTIVE DIRECTORY
- * Version 4.0.4
- *
- * PHP Version 5 with SSL and LDAP support
- *
- * Written by Scott Barnett, Richard Hyland
- * email: scott@wiggumworld.com, adldap@richardhyland.com
- * http://adldap.sourceforge.net/
- *
- * Copyright (c) 2006-2012 Scott Barnett, Richard Hyland
- *
- * We'd appreciate any improvements or additions to be submitted back
- * to benefit the entire community :)
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * @category ToolsAndUtilities
- * @package adLDAP
- * @subpackage Contacts
- * @author Scott Barnett, Richard Hyland
- * @copyright (c) 2006-2012 Scott Barnett, Richard Hyland
- * @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html LGPLv2.1
- * @revision $Revision: 97 $
- * @version 4.0.4
- * @link http://adldap.sourceforge.net/
- */
-
-require_once(dirname(__FILE__) . '/../adLDAP.php');
-require_once(dirname(__FILE__) . '/../collections/adLDAPContactCollection.php');
-
-class adLDAPContacts {
- /**
- * The current adLDAP connection via dependency injection
- *
- * @var adLDAP
- */
- protected $adldap;
-
- public function __construct(adLDAP $adldap) {
- $this->adldap = $adldap;
- }
-
- //*****************************************************************************************************************
- // CONTACT FUNCTIONS
- // * Still work to do in this area, and new functions to write
-
- /**
- * Create a contact
- *
- * @param array $attributes The attributes to set to the contact
- * @return bool
- */
- public function create($attributes)
- {
- // Check for compulsory fields
- if (!array_key_exists("display_name", $attributes)) { return "Missing compulsory field [display_name]"; }
- if (!array_key_exists("email", $attributes)) { return "Missing compulsory field [email]"; }
- if (!array_key_exists("container", $attributes)) { return "Missing compulsory field [container]"; }
- if (!is_array($attributes["container"])) { return "Container attribute must be an array."; }
-
- // Translate the schema
- $add = $this->adldap->adldap_schema($attributes);
-
- // Additional stuff only used for adding contacts
- $add["cn"][0] = $attributes["display_name"];
- $add["objectclass"][0] = "top";
- $add["objectclass"][1] = "person";
- $add["objectclass"][2] = "organizationalPerson";
- $add["objectclass"][3] = "contact";
- if (!isset($attributes['exchange_hidefromlists'])) {
- $add["msExchHideFromAddressLists"][0] = "TRUE";
- }
-
- // Determine the container
- $attributes["container"] = array_reverse($attributes["container"]);
- $container= "OU=" . implode(",OU=", $attributes["container"]);
-
- // Add the entry
- $result = @ldap_add($this->adldap->getLdapConnection(), "CN=" . $this->adldap->utilities()->escapeCharacters($add["cn"][0]) . ", " . $container . "," . $this->adldap->getBaseDn(), $add);
- if ($result != true) {
- return false;
- }
-
- return true;
- }
-
- /**
- * Determine the list of groups a contact is a member of
- *
- * @param string $distinguisedname The full DN of a contact
- * @param bool $recursive Recursively check groups
- * @return array
- */
- public function groups($distinguishedName, $recursive = NULL)
- {
- if ($distinguishedName === NULL) { return false; }
- if ($recursive === NULL) { $recursive = $this->adldap->getRecursiveGroups(); } //use the default option if they haven't set it
- if (!$this->adldap->getLdapBind()){ return false; }
-
- // Search the directory for their information
- $info = @$this->info($distinguishedName, array("memberof", "primarygroupid"));
- $groups = $this->adldap->utilities()->niceNames($info[0]["memberof"]); //presuming the entry returned is our contact
-
- if ($recursive === true){
- foreach ($groups as $id => $groupName){
- $extraGroups = $this->adldap->group()->recursiveGroups($groupName);
- $groups = array_merge($groups, $extraGroups);
- }
- }
-
- return $groups;
- }
-
- /**
- * Get contact information. Returned in a raw array format from AD
- *
- * @param string $distinguisedname The full DN of a contact
- * @param array $fields Attributes to be returned
- * @return array
- */
- public function info($distinguishedName, $fields = NULL)
- {
- if ($distinguishedName === NULL) { return false; }
- if (!$this->adldap->getLdapBind()) { return false; }
-
- $filter = "distinguishedName=" . $distinguishedName;
- if ($fields === NULL) {
- $fields = array("distinguishedname", "mail", "memberof", "department", "displayname", "telephonenumber", "primarygroupid", "objectsid");
- }
- $sr = ldap_search($this->adldap->getLdapConnection(), $this->adldap->getBaseDn(), $filter, $fields);
- $entries = ldap_get_entries($this->adldap->getLdapConnection(), $sr);
-
- if ($entries[0]['count'] >= 1) {
- // AD does not return the primary group in the ldap query, we may need to fudge it
- if ($this->adldap->getRealPrimaryGroup() && isset($entries[0]["primarygroupid"][0]) && isset($entries[0]["primarygroupid"][0])){
- //$entries[0]["memberof"][]=$this->group_cn($entries[0]["primarygroupid"][0]);
- $entries[0]["memberof"][] = $this->adldap->group()->getPrimaryGroup($entries[0]["primarygroupid"][0], $entries[0]["objectsid"][0]);
- } else {
- $entries[0]["memberof"][] = "CN=Domain Users,CN=Users," . $this->adldap->getBaseDn();
- }
- }
-
- $entries[0]["memberof"]["count"]++;
- return $entries;
- }
-
- /**
- * Find information about the contacts. Returned in a raw array format from AD
- *
- * @param string $distinguishedName The full DN of a contact
- * @param array $fields Array of parameters to query
- * @return mixed
- */
- public function infoCollection($distinguishedName, $fields = NULL)
- {
- if ($distinguishedName === NULL) { return false; }
- if (!$this->adldap->getLdapBind()) { return false; }
-
- $info = $this->info($distinguishedName, $fields);
-
- if ($info !== false) {
- $collection = new adLDAPContactCollection($info, $this->adldap);
- return $collection;
- }
- return false;
- }
-
- /**
- * Determine if a contact is a member of a group
- *
- * @param string $distinguisedName The full DN of a contact
- * @param string $group The group name to query
- * @param bool $recursive Recursively check groups
- * @return bool
- */
- public function inGroup($distinguisedName, $group, $recursive = NULL)
- {
- if ($distinguisedName === NULL) { return false; }
- if ($group === NULL) { return false; }
- if (!$this->adldap->getLdapBind()) { return false; }
- if ($recursive === NULL) { $recursive = $this->adldap->getRecursiveGroups(); } //use the default option if they haven't set it
-
- // Get a list of the groups
- $groups = $this->groups($distinguisedName, array("memberof"), $recursive);
-
- // Return true if the specified group is in the group list
- if (in_array($group, $groups)){
- return true;
- }
-
- return false;
- }
-
- /**
- * Modify a contact
- *
- * @param string $distinguishedName The contact to query
- * @param array $attributes The attributes to modify. Note if you set the enabled attribute you must not specify any other attributes
- * @return bool
- */
- public function modify($distinguishedName, $attributes) {
- if ($distinguishedName === NULL) { return "Missing compulsory field [distinguishedname]"; }
-
- // Translate the update to the LDAP schema
- $mod = $this->adldap->adldap_schema($attributes);
-
- // Check to see if this is an enabled status update
- if (!$mod) {
- return false;
- }
-
- // Do the update
- $result = ldap_modify($this->adldap->getLdapConnection(), $distinguishedName, $mod);
- if ($result == false) {
- return false;
- }
-
- return true;
- }
-
- /**
- * Delete a contact
- *
- * @param string $distinguishedName The contact dn to delete (please be careful here!)
- * @return array
- */
- public function delete($distinguishedName)
- {
- $result = $this->folder()->delete($distinguishedName);
- if ($result != true) {
- return false;
- }
- return true;
- }
-
- /**
- * Return a list of all contacts
- *
- * @param bool $includeDescription Include a description of a contact
- * @param string $search The search parameters
- * @param bool $sorted Whether to sort the results
- * @return array
- */
- public function all($includeDescription = false, $search = "*", $sorted = true) {
- if (!$this->adldap->getLdapBind()) { return false; }
-
- // Perform the search and grab all their details
- $filter = "(&(objectClass=contact)(cn=" . $search . "))";
- $fields = array("displayname","distinguishedname");
- $sr = ldap_search($this->adldap->getLdapConnection(), $this->adldap->getBaseDn(), $filter, $fields);
- $entries = ldap_get_entries($this->adldap->getLdapConnection(), $sr);
-
- $usersArray = array();
- for ($i=0; $i<$entries["count"]; $i++){
- if ($includeDescription && strlen($entries[$i]["displayname"][0])>0){
- $usersArray[$entries[$i]["distinguishedname"][0]] = $entries[$i]["displayname"][0];
- } elseif ($includeDescription){
- $usersArray[$entries[$i]["distinguishedname"][0]] = $entries[$i]["distinguishedname"][0];
- } else {
- array_push($usersArray, $entries[$i]["distinguishedname"][0]);
- }
- }
- if ($sorted) {
- asort($usersArray);
- }
- return $usersArray;
- }
-
- /**
- * Mail enable a contact
- * Allows email to be sent to them through Exchange
- *
- * @param string $distinguishedname The contact to mail enable
- * @param string $emailaddress The email address to allow emails to be sent through
- * @param string $mailnickname The mailnickname for the contact in Exchange. If NULL this will be set to the display name
- * @return bool
- */
- public function contactMailEnable($distinguishedName, $emailAddress, $mailNickname = NULL){
- return $this->adldap->exchange()->contactMailEnable($distinguishedName, $emailAddress, $mailNickname);
- }
-
-
-}
-?>
+<?php
+/**
+ * PHP LDAP CLASS FOR MANIPULATING ACTIVE DIRECTORY
+ * Version 4.0.4
+ *
+ * PHP Version 5 with SSL and LDAP support
+ *
+ * Written by Scott Barnett, Richard Hyland
+ * email: scott@wiggumworld.com, adldap@richardhyland.com
+ * http://adldap.sourceforge.net/
+ *
+ * Copyright (c) 2006-2012 Scott Barnett, Richard Hyland
+ *
+ * We'd appreciate any improvements or additions to be submitted back
+ * to benefit the entire community :)
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * @category ToolsAndUtilities
+ * @package adLDAP
+ * @subpackage Contacts
+ * @author Scott Barnett, Richard Hyland
+ * @copyright (c) 2006-2012 Scott Barnett, Richard Hyland
+ * @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html LGPLv2.1
+ * @revision $Revision: 97 $
+ * @version 4.0.4
+ * @link http://adldap.sourceforge.net/
+ */
+
+require_once(dirname(__FILE__) . '/../adLDAP.php');
+require_once(dirname(__FILE__) . '/../collections/adLDAPContactCollection.php');
+
+class adLDAPContacts {
+ /**
+ * The current adLDAP connection via dependency injection
+ *
+ * @var adLDAP
+ */
+ protected $adldap;
+
+ public function __construct(adLDAP $adldap) {
+ $this->adldap = $adldap;
+ }
+
+ //*****************************************************************************************************************
+ // CONTACT FUNCTIONS
+ // * Still work to do in this area, and new functions to write
+
+ /**
+ * Create a contact
+ *
+ * @param array $attributes The attributes to set to the contact
+ * @return bool
+ */
+ public function create($attributes)
+ {
+ // Check for compulsory fields
+ if (!array_key_exists("display_name", $attributes)) { return "Missing compulsory field [display_name]"; }
+ if (!array_key_exists("email", $attributes)) { return "Missing compulsory field [email]"; }
+ if (!array_key_exists("container", $attributes)) { return "Missing compulsory field [container]"; }
+ if (!is_array($attributes["container"])) { return "Container attribute must be an array."; }
+
+ // Translate the schema
+ $add = $this->adldap->adldap_schema($attributes);
+
+ // Additional stuff only used for adding contacts
+ $add["cn"][0] = $attributes["display_name"];
+ $add["objectclass"][0] = "top";
+ $add["objectclass"][1] = "person";
+ $add["objectclass"][2] = "organizationalPerson";
+ $add["objectclass"][3] = "contact";
+ if (!isset($attributes['exchange_hidefromlists'])) {
+ $add["msExchHideFromAddressLists"][0] = "TRUE";
+ }
+
+ // Determine the container
+ $attributes["container"] = array_reverse($attributes["container"]);
+ $container= "OU=" . implode(",OU=", $attributes["container"]);
+
+ // Add the entry
+ $result = @ldap_add($this->adldap->getLdapConnection(), "CN=" . $this->adldap->utilities()->escapeCharacters($add["cn"][0]) . ", " . $container . "," . $this->adldap->getBaseDn(), $add);
+ if ($result != true) {
+ return false;
+ }
+
+ return true;
+ }
+
+ /**
+ * Determine the list of groups a contact is a member of
+ *
+ * @param string $distinguisedname The full DN of a contact
+ * @param bool $recursive Recursively check groups
+ * @return array
+ */
+ public function groups($distinguishedName, $recursive = NULL)
+ {
+ if ($distinguishedName === NULL) { return false; }
+ if ($recursive === NULL) { $recursive = $this->adldap->getRecursiveGroups(); } //use the default option if they haven't set it
+ if (!$this->adldap->getLdapBind()){ return false; }
+
+ // Search the directory for their information
+ $info = @$this->info($distinguishedName, array("memberof", "primarygroupid"));
+ $groups = $this->adldap->utilities()->niceNames($info[0]["memberof"]); //presuming the entry returned is our contact
+
+ if ($recursive === true){
+ foreach ($groups as $id => $groupName){
+ $extraGroups = $this->adldap->group()->recursiveGroups($groupName);
+ $groups = array_merge($groups, $extraGroups);
+ }
+ }
+
+ return $groups;
+ }
+
+ /**
+ * Get contact information. Returned in a raw array format from AD
+ *
+ * @param string $distinguisedname The full DN of a contact
+ * @param array $fields Attributes to be returned
+ * @return array
+ */
+ public function info($distinguishedName, $fields = NULL)
+ {
+ if ($distinguishedName === NULL) { return false; }
+ if (!$this->adldap->getLdapBind()) { return false; }
+
+ $filter = "distinguishedName=" . $distinguishedName;
+ if ($fields === NULL) {
+ $fields = array("distinguishedname", "mail", "memberof", "department", "displayname", "telephonenumber", "primarygroupid", "objectsid");
+ }
+ $sr = ldap_search($this->adldap->getLdapConnection(), $this->adldap->getBaseDn(), $filter, $fields);
+ $entries = ldap_get_entries($this->adldap->getLdapConnection(), $sr);
+
+ if ($entries[0]['count'] >= 1) {
+ // AD does not return the primary group in the ldap query, we may need to fudge it
+ if ($this->adldap->getRealPrimaryGroup() && isset($entries[0]["primarygroupid"][0]) && isset($entries[0]["primarygroupid"][0])){
+ //$entries[0]["memberof"][]=$this->group_cn($entries[0]["primarygroupid"][0]);
+ $entries[0]["memberof"][] = $this->adldap->group()->getPrimaryGroup($entries[0]["primarygroupid"][0], $entries[0]["objectsid"][0]);
+ } else {
+ $entries[0]["memberof"][] = "CN=Domain Users,CN=Users," . $this->adldap->getBaseDn();
+ }
+ }
+
+ $entries[0]["memberof"]["count"]++;
+ return $entries;
+ }
+
+ /**
+ * Find information about the contacts. Returned in a raw array format from AD
+ *
+ * @param string $distinguishedName The full DN of a contact
+ * @param array $fields Array of parameters to query
+ * @return mixed
+ */
+ public function infoCollection($distinguishedName, $fields = NULL)
+ {
+ if ($distinguishedName === NULL) { return false; }
+ if (!$this->adldap->getLdapBind()) { return false; }
+
+ $info = $this->info($distinguishedName, $fields);
+
+ if ($info !== false) {
+ $collection = new adLDAPContactCollection($info, $this->adldap);
+ return $collection;
+ }
+ return false;
+ }
+
+ /**
+ * Determine if a contact is a member of a group
+ *
+ * @param string $distinguisedName The full DN of a contact
+ * @param string $group The group name to query
+ * @param bool $recursive Recursively check groups
+ * @return bool
+ */
+ public function inGroup($distinguisedName, $group, $recursive = NULL)
+ {
+ if ($distinguisedName === NULL) { return false; }
+ if ($group === NULL) { return false; }
+ if (!$this->adldap->getLdapBind()) { return false; }
+ if ($recursive === NULL) { $recursive = $this->adldap->getRecursiveGroups(); } //use the default option if they haven't set it
+
+ // Get a list of the groups
+ $groups = $this->groups($distinguisedName, array("memberof"), $recursive);
+
+ // Return true if the specified group is in the group list
+ if (in_array($group, $groups)){
+ return true;
+ }
+
+ return false;
+ }
+
+ /**
+ * Modify a contact
+ *
+ * @param string $distinguishedName The contact to query
+ * @param array $attributes The attributes to modify. Note if you set the enabled attribute you must not specify any other attributes
+ * @return bool
+ */
+ public function modify($distinguishedName, $attributes) {
+ if ($distinguishedName === NULL) { return "Missing compulsory field [distinguishedname]"; }
+
+ // Translate the update to the LDAP schema
+ $mod = $this->adldap->adldap_schema($attributes);
+
+ // Check to see if this is an enabled status update
+ if (!$mod) {
+ return false;
+ }
+
+ // Do the update
+ $result = ldap_modify($this->adldap->getLdapConnection(), $distinguishedName, $mod);
+ if ($result == false) {
+ return false;
+ }
+
+ return true;
+ }
+
+ /**
+ * Delete a contact
+ *
+ * @param string $distinguishedName The contact dn to delete (please be careful here!)
+ * @return array
+ */
+ public function delete($distinguishedName)
+ {
+ $result = $this->folder()->delete($distinguishedName);
+ if ($result != true) {
+ return false;
+ }
+ return true;
+ }
+
+ /**
+ * Return a list of all contacts
+ *
+ * @param bool $includeDescription Include a description of a contact
+ * @param string $search The search parameters
+ * @param bool $sorted Whether to sort the results
+ * @return array
+ */
+ public function all($includeDescription = false, $search = "*", $sorted = true) {
+ if (!$this->adldap->getLdapBind()) { return false; }
+
+ // Perform the search and grab all their details
+ $filter = "(&(objectClass=contact)(cn=" . $search . "))";
+ $fields = array("displayname","distinguishedname");
+ $sr = ldap_search($this->adldap->getLdapConnection(), $this->adldap->getBaseDn(), $filter, $fields);
+ $entries = ldap_get_entries($this->adldap->getLdapConnection(), $sr);
+
+ $usersArray = array();
+ for ($i=0; $i<$entries["count"]; $i++){
+ if ($includeDescription && strlen($entries[$i]["displayname"][0])>0){
+ $usersArray[$entries[$i]["distinguishedname"][0]] = $entries[$i]["displayname"][0];
+ } elseif ($includeDescription){
+ $usersArray[$entries[$i]["distinguishedname"][0]] = $entries[$i]["distinguishedname"][0];
+ } else {
+ array_push($usersArray, $entries[$i]["distinguishedname"][0]);
+ }
+ }
+ if ($sorted) {
+ asort($usersArray);
+ }
+ return $usersArray;
+ }
+
+ /**
+ * Mail enable a contact
+ * Allows email to be sent to them through Exchange
+ *
+ * @param string $distinguishedname The contact to mail enable
+ * @param string $emailaddress The email address to allow emails to be sent through
+ * @param string $mailnickname The mailnickname for the contact in Exchange. If NULL this will be set to the display name
+ * @return bool
+ */
+ public function contactMailEnable($distinguishedName, $emailAddress, $mailNickname = NULL){
+ return $this->adldap->exchange()->contactMailEnable($distinguishedName, $emailAddress, $mailNickname);
+ }
+
+
+}
+?>
diff --git a/lib/plugins/authad/adLDAP/classes/adLDAPExchange.php b/lib/plugins/authad/adLDAP/classes/adLDAPExchange.php
index dd0c6de05..d70aac779 100644
--- a/lib/plugins/authad/adLDAP/classes/adLDAPExchange.php
+++ b/lib/plugins/authad/adLDAP/classes/adLDAPExchange.php
@@ -1,390 +1,390 @@
-<?php
-/**
- * PHP LDAP CLASS FOR MANIPULATING ACTIVE DIRECTORY
- * Version 4.0.4
- *
- * PHP Version 5 with SSL and LDAP support
- *
- * Written by Scott Barnett, Richard Hyland
- * email: scott@wiggumworld.com, adldap@richardhyland.com
- * http://adldap.sourceforge.net/
- *
- * Copyright (c) 2006-2012 Scott Barnett, Richard Hyland
- *
- * We'd appreciate any improvements or additions to be submitted back
- * to benefit the entire community :)
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * @category ToolsAndUtilities
- * @package adLDAP
- * @subpackage Exchange
- * @author Scott Barnett, Richard Hyland
- * @copyright (c) 2006-2012 Scott Barnett, Richard Hyland
- * @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html LGPLv2.1
- * @revision $Revision: 97 $
- * @version 4.0.4
- * @link http://adldap.sourceforge.net/
- */
-require_once(dirname(__FILE__) . '/../adLDAP.php');
-
-/**
-* MICROSOFT EXCHANGE FUNCTIONS
-*/
-class adLDAPExchange {
- /**
- * The current adLDAP connection via dependency injection
- *
- * @var adLDAP
- */
- protected $adldap;
-
- public function __construct(adLDAP $adldap) {
- $this->adldap = $adldap;
- }
-
- /**
- * Create an Exchange account
- *
- * @param string $username The username of the user to add the Exchange account to
- * @param array $storageGroup The mailbox, Exchange Storage Group, for the user account, this must be a full CN
- * If the storage group has a different base_dn to the adLDAP configuration, set it using $base_dn
- * @param string $emailAddress The primary email address to add to this user
- * @param string $mailNickname The mail nick name. If mail nickname is blank, the username will be used
- * @param bool $mdbUseDefaults Indicates whether the store should use the default quota, rather than the per-mailbox quota.
- * @param string $baseDn Specify an alternative base_dn for the Exchange storage group
- * @param bool $isGUID Is the username passed a GUID or a samAccountName
- * @return bool
- */
- public function createMailbox($username, $storageGroup, $emailAddress, $mailNickname=NULL, $useDefaults=TRUE, $baseDn=NULL, $isGUID=false)
- {
- if ($username === NULL){ return "Missing compulsory field [username]"; }
- if ($storageGroup === NULL) { return "Missing compulsory array [storagegroup]"; }
- if (!is_array($storageGroup)) { return "[storagegroup] must be an array"; }
- if ($emailAddress === NULL) { return "Missing compulsory field [emailAddress]"; }
-
- if ($baseDn === NULL) {
- $baseDn = $this->adldap->getBaseDn();
- }
-
- $container = "CN=" . implode(",CN=", $storageGroup);
-
- if ($mailNickname === NULL) {
- $mailNickname = $username;
- }
- $mdbUseDefaults = $this->adldap->utilities()->boolToString($useDefaults);
-
- $attributes = array(
- 'exchange_homemdb'=>$container.",".$baseDn,
- 'exchange_proxyaddress'=>'SMTP:' . $emailAddress,
- 'exchange_mailnickname'=>$mailNickname,
- 'exchange_usedefaults'=>$mdbUseDefaults
- );
- $result = $this->adldap->user()->modify($username, $attributes, $isGUID);
- if ($result == false) {
- return false;
- }
- return true;
- }
-
- /**
- * Add an X400 address to Exchange
- * See http://tools.ietf.org/html/rfc1685 for more information.
- * An X400 Address looks similar to this X400:c=US;a= ;p=Domain;o=Organization;s=Doe;g=John;
- *
- * @param string $username The username of the user to add the X400 to to
- * @param string $country Country
- * @param string $admd Administration Management Domain
- * @param string $pdmd Private Management Domain (often your AD domain)
- * @param string $org Organization
- * @param string $surname Surname
- * @param string $givenName Given name
- * @param bool $isGUID Is the username passed a GUID or a samAccountName
- * @return bool
- */
- public function addX400($username, $country, $admd, $pdmd, $org, $surname, $givenName, $isGUID=false)
- {
- if ($username === NULL){ return "Missing compulsory field [username]"; }
-
- $proxyValue = 'X400:';
-
- // Find the dn of the user
- $user = $this->adldap->user()->info($username, array("cn","proxyaddresses"), $isGUID);
- if ($user[0]["dn"] === NULL) { return false; }
- $userDn = $user[0]["dn"];
-
- // We do not have to demote an email address from the default so we can just add the new proxy address
- $attributes['exchange_proxyaddress'] = $proxyValue . 'c=' . $country . ';a=' . $admd . ';p=' . $pdmd . ';o=' . $org . ';s=' . $surname . ';g=' . $givenName . ';';
-
- // Translate the update to the LDAP schema
- $add = $this->adldap->adldap_schema($attributes);
-
- if (!$add) { return false; }
-
- // Do the update
- // Take out the @ to see any errors, usually this error might occur because the address already
- // exists in the list of proxyAddresses
- $result = @ldap_mod_add($this->adldap->getLdapConnection(), $userDn, $add);
- if ($result == false) {
- return false;
- }
-
- return true;
- }
-
- /**
- * Add an address to Exchange
- *
- * @param string $username The username of the user to add the Exchange account to
- * @param string $emailAddress The email address to add to this user
- * @param bool $default Make this email address the default address, this is a bit more intensive as we have to demote any existing default addresses
- * @param bool $isGUID Is the username passed a GUID or a samAccountName
- * @return bool
- */
- public function addAddress($username, $emailAddress, $default = FALSE, $isGUID = false)
- {
- if ($username === NULL) { return "Missing compulsory field [username]"; }
- if ($emailAddress === NULL) { return "Missing compulsory fields [emailAddress]"; }
-
- $proxyValue = 'smtp:';
- if ($default === true) {
- $proxyValue = 'SMTP:';
- }
-
- // Find the dn of the user
- $user = $this->adldap->user()->info($username, array("cn","proxyaddresses"), $isGUID);
- if ($user[0]["dn"] === NULL){ return false; }
- $userDn = $user[0]["dn"];
-
- // We need to scan existing proxy addresses and demote the default one
- if (is_array($user[0]["proxyaddresses"]) && $default === true) {
- $modAddresses = array();
- for ($i=0;$i<sizeof($user[0]['proxyaddresses']);$i++) {
- if (strstr($user[0]['proxyaddresses'][$i], 'SMTP:') !== false) {
- $user[0]['proxyaddresses'][$i] = str_replace('SMTP:', 'smtp:', $user[0]['proxyaddresses'][$i]);
- }
- if ($user[0]['proxyaddresses'][$i] != '') {
- $modAddresses['proxyAddresses'][$i] = $user[0]['proxyaddresses'][$i];
- }
- }
- $modAddresses['proxyAddresses'][(sizeof($user[0]['proxyaddresses'])-1)] = 'SMTP:' . $emailAddress;
-
- $result = @ldap_mod_replace($this->adldap->getLdapConnection(), $userDn, $modAddresses);
- if ($result == false) {
- return false;
- }
-
- return true;
- }
- else {
- // We do not have to demote an email address from the default so we can just add the new proxy address
- $attributes['exchange_proxyaddress'] = $proxyValue . $emailAddress;
-
- // Translate the update to the LDAP schema
- $add = $this->adldap->adldap_schema($attributes);
-
- if (!$add) {
- return false;
- }
-
- // Do the update
- // Take out the @ to see any errors, usually this error might occur because the address already
- // exists in the list of proxyAddresses
- $result = @ldap_mod_add($this->adldap->getLdapConnection(), $userDn,$add);
- if ($result == false) {
- return false;
- }
-
- return true;
- }
- }
-
- /**
- * Remove an address to Exchange
- * If you remove a default address the account will no longer have a default,
- * we recommend changing the default address first
- *
- * @param string $username The username of the user to add the Exchange account to
- * @param string $emailAddress The email address to add to this user
- * @param bool $isGUID Is the username passed a GUID or a samAccountName
- * @return bool
- */
- public function deleteAddress($username, $emailAddress, $isGUID=false)
- {
- if ($username === NULL) { return "Missing compulsory field [username]"; }
- if ($emailAddress === NULL) { return "Missing compulsory fields [emailAddress]"; }
-
- // Find the dn of the user
- $user = $this->adldap->user()->info($username, array("cn","proxyaddresses"), $isGUID);
- if ($user[0]["dn"] === NULL) { return false; }
- $userDn = $user[0]["dn"];
-
- if (is_array($user[0]["proxyaddresses"])) {
- $mod = array();
- for ($i=0;$i<sizeof($user[0]['proxyaddresses']);$i++) {
- if (strstr($user[0]['proxyaddresses'][$i], 'SMTP:') !== false && $user[0]['proxyaddresses'][$i] == 'SMTP:' . $emailAddress) {
- $mod['proxyAddresses'][0] = 'SMTP:' . $emailAddress;
- }
- elseif (strstr($user[0]['proxyaddresses'][$i], 'smtp:') !== false && $user[0]['proxyaddresses'][$i] == 'smtp:' . $emailAddress) {
- $mod['proxyAddresses'][0] = 'smtp:' . $emailAddress;
- }
- }
-
- $result = @ldap_mod_del($this->adldap->getLdapConnection(), $userDn,$mod);
- if ($result == false) {
- return false;
- }
-
- return true;
- }
- else {
- return false;
- }
- }
- /**
- * Change the default address
- *
- * @param string $username The username of the user to add the Exchange account to
- * @param string $emailAddress The email address to make default
- * @param bool $isGUID Is the username passed a GUID or a samAccountName
- * @return bool
- */
- public function primaryAddress($username, $emailAddress, $isGUID = false)
- {
- if ($username === NULL) { return "Missing compulsory field [username]"; }
- if ($emailAddress === NULL) { return "Missing compulsory fields [emailAddress]"; }
-
- // Find the dn of the user
- $user = $this->adldap->user()->info($username, array("cn","proxyaddresses"), $isGUID);
- if ($user[0]["dn"] === NULL){ return false; }
- $userDn = $user[0]["dn"];
-
- if (is_array($user[0]["proxyaddresses"])) {
- $modAddresses = array();
- for ($i=0;$i<sizeof($user[0]['proxyaddresses']);$i++) {
- if (strstr($user[0]['proxyaddresses'][$i], 'SMTP:') !== false) {
- $user[0]['proxyaddresses'][$i] = str_replace('SMTP:', 'smtp:', $user[0]['proxyaddresses'][$i]);
- }
- if ($user[0]['proxyaddresses'][$i] == 'smtp:' . $emailAddress) {
- $user[0]['proxyaddresses'][$i] = str_replace('smtp:', 'SMTP:', $user[0]['proxyaddresses'][$i]);
- }
- if ($user[0]['proxyaddresses'][$i] != '') {
- $modAddresses['proxyAddresses'][$i] = $user[0]['proxyaddresses'][$i];
- }
- }
-
- $result = @ldap_mod_replace($this->adldap->getLdapConnection(), $userDn, $modAddresses);
- if ($result == false) {
- return false;
- }
-
- return true;
- }
-
- }
-
- /**
- * Mail enable a contact
- * Allows email to be sent to them through Exchange
- *
- * @param string $distinguishedName The contact to mail enable
- * @param string $emailAddress The email address to allow emails to be sent through
- * @param string $mailNickname The mailnickname for the contact in Exchange. If NULL this will be set to the display name
- * @return bool
- */
- public function contactMailEnable($distinguishedName, $emailAddress, $mailNickname = NULL)
- {
- if ($distinguishedName === NULL) { return "Missing compulsory field [distinguishedName]"; }
- if ($emailAddress === NULL) { return "Missing compulsory field [emailAddress]"; }
-
- if ($mailNickname !== NULL) {
- // Find the dn of the user
- $user = $this->adldap->contact()->info($distinguishedName, array("cn","displayname"));
- if ($user[0]["displayname"] === NULL) { return false; }
- $mailNickname = $user[0]['displayname'][0];
- }
-
- $attributes = array("email"=>$emailAddress,"contact_email"=>"SMTP:" . $emailAddress,"exchange_proxyaddress"=>"SMTP:" . $emailAddress,"exchange_mailnickname" => $mailNickname);
-
- // Translate the update to the LDAP schema
- $mod = $this->adldap->adldap_schema($attributes);
-
- // Check to see if this is an enabled status update
- if (!$mod) { return false; }
-
- // Do the update
- $result = ldap_modify($this->adldap->getLdapConnection(), $distinguishedName, $mod);
- if ($result == false) { return false; }
-
- return true;
- }
-
- /**
- * Returns a list of Exchange Servers in the ConfigurationNamingContext of the domain
- *
- * @param array $attributes An array of the AD attributes you wish to return
- * @return array
- */
- public function servers($attributes = array('cn','distinguishedname','serialnumber'))
- {
- if (!$this->adldap->getLdapBind()){ return false; }
-
- $configurationNamingContext = $this->adldap->getRootDse(array('configurationnamingcontext'));
- $sr = @ldap_search($this->adldap->getLdapConnection(), $configurationNamingContext[0]['configurationnamingcontext'][0],'(&(objectCategory=msExchExchangeServer))', $attributes);
- $entries = @ldap_get_entries($this->adldap->getLdapConnection(), $sr);
- return $entries;
- }
-
- /**
- * Returns a list of Storage Groups in Exchange for a given mail server
- *
- * @param string $exchangeServer The full DN of an Exchange server. You can use exchange_servers() to find the DN for your server
- * @param array $attributes An array of the AD attributes you wish to return
- * @param bool $recursive If enabled this will automatically query the databases within a storage group
- * @return array
- */
- public function storageGroups($exchangeServer, $attributes = array('cn','distinguishedname'), $recursive = NULL)
- {
- if (!$this->adldap->getLdapBind()){ return false; }
- if ($exchangeServer === NULL) { return "Missing compulsory field [exchangeServer]"; }
- if ($recursive === NULL) { $recursive = $this->adldap->getRecursiveGroups(); }
-
- $filter = '(&(objectCategory=msExchStorageGroup))';
- $sr = @ldap_search($this->adldap->getLdapConnection(), $exchangeServer, $filter, $attributes);
- $entries = @ldap_get_entries($this->adldap->getLdapConnection(), $sr);
-
- if ($recursive === true) {
- for ($i=0; $i<$entries['count']; $i++) {
- $entries[$i]['msexchprivatemdb'] = $this->storageDatabases($entries[$i]['distinguishedname'][0]);
- }
- }
-
- return $entries;
- }
-
- /**
- * Returns a list of Databases within any given storage group in Exchange for a given mail server
- *
- * @param string $storageGroup The full DN of an Storage Group. You can use exchange_storage_groups() to find the DN
- * @param array $attributes An array of the AD attributes you wish to return
- * @return array
- */
- public function storageDatabases($storageGroup, $attributes = array('cn','distinguishedname','displayname')) {
- if (!$this->adldap->getLdapBind()){ return false; }
- if ($storageGroup === NULL) { return "Missing compulsory field [storageGroup]"; }
-
- $filter = '(&(objectCategory=msExchPrivateMDB))';
- $sr = @ldap_search($this->adldap->getLdapConnection(), $storageGroup, $filter, $attributes);
- $entries = @ldap_get_entries($this->adldap->getLdapConnection(), $sr);
- return $entries;
- }
-}
+<?php
+/**
+ * PHP LDAP CLASS FOR MANIPULATING ACTIVE DIRECTORY
+ * Version 4.0.4
+ *
+ * PHP Version 5 with SSL and LDAP support
+ *
+ * Written by Scott Barnett, Richard Hyland
+ * email: scott@wiggumworld.com, adldap@richardhyland.com
+ * http://adldap.sourceforge.net/
+ *
+ * Copyright (c) 2006-2012 Scott Barnett, Richard Hyland
+ *
+ * We'd appreciate any improvements or additions to be submitted back
+ * to benefit the entire community :)
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * @category ToolsAndUtilities
+ * @package adLDAP
+ * @subpackage Exchange
+ * @author Scott Barnett, Richard Hyland
+ * @copyright (c) 2006-2012 Scott Barnett, Richard Hyland
+ * @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html LGPLv2.1
+ * @revision $Revision: 97 $
+ * @version 4.0.4
+ * @link http://adldap.sourceforge.net/
+ */
+require_once(dirname(__FILE__) . '/../adLDAP.php');
+
+/**
+* MICROSOFT EXCHANGE FUNCTIONS
+*/
+class adLDAPExchange {
+ /**
+ * The current adLDAP connection via dependency injection
+ *
+ * @var adLDAP
+ */
+ protected $adldap;
+
+ public function __construct(adLDAP $adldap) {
+ $this->adldap = $adldap;
+ }
+
+ /**
+ * Create an Exchange account
+ *
+ * @param string $username The username of the user to add the Exchange account to
+ * @param array $storageGroup The mailbox, Exchange Storage Group, for the user account, this must be a full CN
+ * If the storage group has a different base_dn to the adLDAP configuration, set it using $base_dn
+ * @param string $emailAddress The primary email address to add to this user
+ * @param string $mailNickname The mail nick name. If mail nickname is blank, the username will be used
+ * @param bool $mdbUseDefaults Indicates whether the store should use the default quota, rather than the per-mailbox quota.
+ * @param string $baseDn Specify an alternative base_dn for the Exchange storage group
+ * @param bool $isGUID Is the username passed a GUID or a samAccountName
+ * @return bool
+ */
+ public function createMailbox($username, $storageGroup, $emailAddress, $mailNickname=NULL, $useDefaults=TRUE, $baseDn=NULL, $isGUID=false)
+ {
+ if ($username === NULL){ return "Missing compulsory field [username]"; }
+ if ($storageGroup === NULL) { return "Missing compulsory array [storagegroup]"; }
+ if (!is_array($storageGroup)) { return "[storagegroup] must be an array"; }
+ if ($emailAddress === NULL) { return "Missing compulsory field [emailAddress]"; }
+
+ if ($baseDn === NULL) {
+ $baseDn = $this->adldap->getBaseDn();
+ }
+
+ $container = "CN=" . implode(",CN=", $storageGroup);
+
+ if ($mailNickname === NULL) {
+ $mailNickname = $username;
+ }
+ $mdbUseDefaults = $this->adldap->utilities()->boolToString($useDefaults);
+
+ $attributes = array(
+ 'exchange_homemdb'=>$container.",".$baseDn,
+ 'exchange_proxyaddress'=>'SMTP:' . $emailAddress,
+ 'exchange_mailnickname'=>$mailNickname,
+ 'exchange_usedefaults'=>$mdbUseDefaults
+ );
+ $result = $this->adldap->user()->modify($username, $attributes, $isGUID);
+ if ($result == false) {
+ return false;
+ }
+ return true;
+ }
+
+ /**
+ * Add an X400 address to Exchange
+ * See http://tools.ietf.org/html/rfc1685 for more information.
+ * An X400 Address looks similar to this X400:c=US;a= ;p=Domain;o=Organization;s=Doe;g=John;
+ *
+ * @param string $username The username of the user to add the X400 to to
+ * @param string $country Country
+ * @param string $admd Administration Management Domain
+ * @param string $pdmd Private Management Domain (often your AD domain)
+ * @param string $org Organization
+ * @param string $surname Surname
+ * @param string $givenName Given name
+ * @param bool $isGUID Is the username passed a GUID or a samAccountName
+ * @return bool
+ */
+ public function addX400($username, $country, $admd, $pdmd, $org, $surname, $givenName, $isGUID=false)
+ {
+ if ($username === NULL){ return "Missing compulsory field [username]"; }
+
+ $proxyValue = 'X400:';
+
+ // Find the dn of the user
+ $user = $this->adldap->user()->info($username, array("cn","proxyaddresses"), $isGUID);
+ if ($user[0]["dn"] === NULL) { return false; }
+ $userDn = $user[0]["dn"];
+
+ // We do not have to demote an email address from the default so we can just add the new proxy address
+ $attributes['exchange_proxyaddress'] = $proxyValue . 'c=' . $country . ';a=' . $admd . ';p=' . $pdmd . ';o=' . $org . ';s=' . $surname . ';g=' . $givenName . ';';
+
+ // Translate the update to the LDAP schema
+ $add = $this->adldap->adldap_schema($attributes);
+
+ if (!$add) { return false; }
+
+ // Do the update
+ // Take out the @ to see any errors, usually this error might occur because the address already
+ // exists in the list of proxyAddresses
+ $result = @ldap_mod_add($this->adldap->getLdapConnection(), $userDn, $add);
+ if ($result == false) {
+ return false;
+ }
+
+ return true;
+ }
+
+ /**
+ * Add an address to Exchange
+ *
+ * @param string $username The username of the user to add the Exchange account to
+ * @param string $emailAddress The email address to add to this user
+ * @param bool $default Make this email address the default address, this is a bit more intensive as we have to demote any existing default addresses
+ * @param bool $isGUID Is the username passed a GUID or a samAccountName
+ * @return bool
+ */
+ public function addAddress($username, $emailAddress, $default = FALSE, $isGUID = false)
+ {
+ if ($username === NULL) { return "Missing compulsory field [username]"; }
+ if ($emailAddress === NULL) { return "Missing compulsory fields [emailAddress]"; }
+
+ $proxyValue = 'smtp:';
+ if ($default === true) {
+ $proxyValue = 'SMTP:';
+ }
+
+ // Find the dn of the user
+ $user = $this->adldap->user()->info($username, array("cn","proxyaddresses"), $isGUID);
+ if ($user[0]["dn"] === NULL){ return false; }
+ $userDn = $user[0]["dn"];
+
+ // We need to scan existing proxy addresses and demote the default one
+ if (is_array($user[0]["proxyaddresses"]) && $default === true) {
+ $modAddresses = array();
+ for ($i=0;$i<sizeof($user[0]['proxyaddresses']);$i++) {
+ if (strstr($user[0]['proxyaddresses'][$i], 'SMTP:') !== false) {
+ $user[0]['proxyaddresses'][$i] = str_replace('SMTP:', 'smtp:', $user[0]['proxyaddresses'][$i]);
+ }
+ if ($user[0]['proxyaddresses'][$i] != '') {
+ $modAddresses['proxyAddresses'][$i] = $user[0]['proxyaddresses'][$i];
+ }
+ }
+ $modAddresses['proxyAddresses'][(sizeof($user[0]['proxyaddresses'])-1)] = 'SMTP:' . $emailAddress;
+
+ $result = @ldap_mod_replace($this->adldap->getLdapConnection(), $userDn, $modAddresses);
+ if ($result == false) {
+ return false;
+ }
+
+ return true;
+ }
+ else {
+ // We do not have to demote an email address from the default so we can just add the new proxy address
+ $attributes['exchange_proxyaddress'] = $proxyValue . $emailAddress;
+
+ // Translate the update to the LDAP schema
+ $add = $this->adldap->adldap_schema($attributes);
+
+ if (!$add) {
+ return false;
+ }
+
+ // Do the update
+ // Take out the @ to see any errors, usually this error might occur because the address already
+ // exists in the list of proxyAddresses
+ $result = @ldap_mod_add($this->adldap->getLdapConnection(), $userDn,$add);
+ if ($result == false) {
+ return false;
+ }
+
+ return true;
+ }
+ }
+
+ /**
+ * Remove an address to Exchange
+ * If you remove a default address the account will no longer have a default,
+ * we recommend changing the default address first
+ *
+ * @param string $username The username of the user to add the Exchange account to
+ * @param string $emailAddress The email address to add to this user
+ * @param bool $isGUID Is the username passed a GUID or a samAccountName
+ * @return bool
+ */
+ public function deleteAddress($username, $emailAddress, $isGUID=false)
+ {
+ if ($username === NULL) { return "Missing compulsory field [username]"; }
+ if ($emailAddress === NULL) { return "Missing compulsory fields [emailAddress]"; }
+
+ // Find the dn of the user
+ $user = $this->adldap->user()->info($username, array("cn","proxyaddresses"), $isGUID);
+ if ($user[0]["dn"] === NULL) { return false; }
+ $userDn = $user[0]["dn"];
+
+ if (is_array($user[0]["proxyaddresses"])) {
+ $mod = array();
+ for ($i=0;$i<sizeof($user[0]['proxyaddresses']);$i++) {
+ if (strstr($user[0]['proxyaddresses'][$i], 'SMTP:') !== false && $user[0]['proxyaddresses'][$i] == 'SMTP:' . $emailAddress) {
+ $mod['proxyAddresses'][0] = 'SMTP:' . $emailAddress;
+ }
+ elseif (strstr($user[0]['proxyaddresses'][$i], 'smtp:') !== false && $user[0]['proxyaddresses'][$i] == 'smtp:' . $emailAddress) {
+ $mod['proxyAddresses'][0] = 'smtp:' . $emailAddress;
+ }
+ }
+
+ $result = @ldap_mod_del($this->adldap->getLdapConnection(), $userDn,$mod);
+ if ($result == false) {
+ return false;
+ }
+
+ return true;
+ }
+ else {
+ return false;
+ }
+ }
+ /**
+ * Change the default address
+ *
+ * @param string $username The username of the user to add the Exchange account to
+ * @param string $emailAddress The email address to make default
+ * @param bool $isGUID Is the username passed a GUID or a samAccountName
+ * @return bool
+ */
+ public function primaryAddress($username, $emailAddress, $isGUID = false)
+ {
+ if ($username === NULL) { return "Missing compulsory field [username]"; }
+ if ($emailAddress === NULL) { return "Missing compulsory fields [emailAddress]"; }
+
+ // Find the dn of the user
+ $user = $this->adldap->user()->info($username, array("cn","proxyaddresses"), $isGUID);
+ if ($user[0]["dn"] === NULL){ return false; }
+ $userDn = $user[0]["dn"];
+
+ if (is_array($user[0]["proxyaddresses"])) {
+ $modAddresses = array();
+ for ($i=0;$i<sizeof($user[0]['proxyaddresses']);$i++) {
+ if (strstr($user[0]['proxyaddresses'][$i], 'SMTP:') !== false) {
+ $user[0]['proxyaddresses'][$i] = str_replace('SMTP:', 'smtp:', $user[0]['proxyaddresses'][$i]);
+ }
+ if ($user[0]['proxyaddresses'][$i] == 'smtp:' . $emailAddress) {
+ $user[0]['proxyaddresses'][$i] = str_replace('smtp:', 'SMTP:', $user[0]['proxyaddresses'][$i]);
+ }
+ if ($user[0]['proxyaddresses'][$i] != '') {
+ $modAddresses['proxyAddresses'][$i] = $user[0]['proxyaddresses'][$i];
+ }
+ }
+
+ $result = @ldap_mod_replace($this->adldap->getLdapConnection(), $userDn, $modAddresses);
+ if ($result == false) {
+ return false;
+ }
+
+ return true;
+ }
+
+ }
+
+ /**
+ * Mail enable a contact
+ * Allows email to be sent to them through Exchange
+ *
+ * @param string $distinguishedName The contact to mail enable
+ * @param string $emailAddress The email address to allow emails to be sent through
+ * @param string $mailNickname The mailnickname for the contact in Exchange. If NULL this will be set to the display name
+ * @return bool
+ */
+ public function contactMailEnable($distinguishedName, $emailAddress, $mailNickname = NULL)
+ {
+ if ($distinguishedName === NULL) { return "Missing compulsory field [distinguishedName]"; }
+ if ($emailAddress === NULL) { return "Missing compulsory field [emailAddress]"; }
+
+ if ($mailNickname !== NULL) {
+ // Find the dn of the user
+ $user = $this->adldap->contact()->info($distinguishedName, array("cn","displayname"));
+ if ($user[0]["displayname"] === NULL) { return false; }
+ $mailNickname = $user[0]['displayname'][0];
+ }
+
+ $attributes = array("email"=>$emailAddress,"contact_email"=>"SMTP:" . $emailAddress,"exchange_proxyaddress"=>"SMTP:" . $emailAddress,"exchange_mailnickname" => $mailNickname);
+
+ // Translate the update to the LDAP schema
+ $mod = $this->adldap->adldap_schema($attributes);
+
+ // Check to see if this is an enabled status update
+ if (!$mod) { return false; }
+
+ // Do the update
+ $result = ldap_modify($this->adldap->getLdapConnection(), $distinguishedName, $mod);
+ if ($result == false) { return false; }
+
+ return true;
+ }
+
+ /**
+ * Returns a list of Exchange Servers in the ConfigurationNamingContext of the domain
+ *
+ * @param array $attributes An array of the AD attributes you wish to return
+ * @return array
+ */
+ public function servers($attributes = array('cn','distinguishedname','serialnumber'))
+ {
+ if (!$this->adldap->getLdapBind()){ return false; }
+
+ $configurationNamingContext = $this->adldap->getRootDse(array('configurationnamingcontext'));
+ $sr = @ldap_search($this->adldap->getLdapConnection(), $configurationNamingContext[0]['configurationnamingcontext'][0],'(&(objectCategory=msExchExchangeServer))', $attributes);
+ $entries = @ldap_get_entries($this->adldap->getLdapConnection(), $sr);
+ return $entries;
+ }
+
+ /**
+ * Returns a list of Storage Groups in Exchange for a given mail server
+ *
+ * @param string $exchangeServer The full DN of an Exchange server. You can use exchange_servers() to find the DN for your server
+ * @param array $attributes An array of the AD attributes you wish to return
+ * @param bool $recursive If enabled this will automatically query the databases within a storage group
+ * @return array
+ */
+ public function storageGroups($exchangeServer, $attributes = array('cn','distinguishedname'), $recursive = NULL)
+ {
+ if (!$this->adldap->getLdapBind()){ return false; }
+ if ($exchangeServer === NULL) { return "Missing compulsory field [exchangeServer]"; }
+ if ($recursive === NULL) { $recursive = $this->adldap->getRecursiveGroups(); }
+
+ $filter = '(&(objectCategory=msExchStorageGroup))';
+ $sr = @ldap_search($this->adldap->getLdapConnection(), $exchangeServer, $filter, $attributes);
+ $entries = @ldap_get_entries($this->adldap->getLdapConnection(), $sr);
+
+ if ($recursive === true) {
+ for ($i=0; $i<$entries['count']; $i++) {
+ $entries[$i]['msexchprivatemdb'] = $this->storageDatabases($entries[$i]['distinguishedname'][0]);
+ }
+ }
+
+ return $entries;
+ }
+
+ /**
+ * Returns a list of Databases within any given storage group in Exchange for a given mail server
+ *
+ * @param string $storageGroup The full DN of an Storage Group. You can use exchange_storage_groups() to find the DN
+ * @param array $attributes An array of the AD attributes you wish to return
+ * @return array
+ */
+ public function storageDatabases($storageGroup, $attributes = array('cn','distinguishedname','displayname')) {
+ if (!$this->adldap->getLdapBind()){ return false; }
+ if ($storageGroup === NULL) { return "Missing compulsory field [storageGroup]"; }
+
+ $filter = '(&(objectCategory=msExchPrivateMDB))';
+ $sr = @ldap_search($this->adldap->getLdapConnection(), $storageGroup, $filter, $attributes);
+ $entries = @ldap_get_entries($this->adldap->getLdapConnection(), $sr);
+ return $entries;
+ }
+}
?> \ No newline at end of file
diff --git a/lib/plugins/authad/adLDAP/classes/adLDAPFolders.php b/lib/plugins/authad/adLDAP/classes/adLDAPFolders.php
index 55120152d..67b1474db 100644
--- a/lib/plugins/authad/adLDAP/classes/adLDAPFolders.php
+++ b/lib/plugins/authad/adLDAP/classes/adLDAPFolders.php
@@ -1,179 +1,179 @@
-<?php
-/**
- * PHP LDAP CLASS FOR MANIPULATING ACTIVE DIRECTORY
- * Version 4.0.4
- *
- * PHP Version 5 with SSL and LDAP support
- *
- * Written by Scott Barnett, Richard Hyland
- * email: scott@wiggumworld.com, adldap@richardhyland.com
- * http://adldap.sourceforge.net/
- *
- * Copyright (c) 2006-2012 Scott Barnett, Richard Hyland
- *
- * We'd appreciate any improvements or additions to be submitted back
- * to benefit the entire community :)
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * @category ToolsAndUtilities
- * @package adLDAP
- * @subpackage Folders
- * @author Scott Barnett, Richard Hyland
- * @copyright (c) 2006-2012 Scott Barnett, Richard Hyland
- * @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html LGPLv2.1
- * @revision $Revision: 97 $
- * @version 4.0.4
- * @link http://adldap.sourceforge.net/
- */
-require_once(dirname(__FILE__) . '/../adLDAP.php');
-
-/**
-* FOLDER / OU MANAGEMENT FUNCTIONS
-*/
-class adLDAPFolders {
- /**
- * The current adLDAP connection via dependency injection
- *
- * @var adLDAP
- */
- protected $adldap;
-
- public function __construct(adLDAP $adldap) {
- $this->adldap = $adldap;
- }
-
- /**
- * Delete a distinguished name from Active Directory
- * You should never need to call this yourself, just use the wrapper functions user_delete and contact_delete
- *
- * @param string $dn The distinguished name to delete
- * @return bool
- */
- public function delete($dn){
- $result = ldap_delete($this->adldap->getLdapConnection(), $dn);
- if ($result != true) {
- return false;
- }
- return true;
- }
-
- /**
- * Returns a folder listing for a specific OU
- * See http://adldap.sourceforge.net/wiki/doku.php?id=api_folder_functions
- *
- * @param array $folderName An array to the OU you wish to list.
- * If set to NULL will list the root, strongly recommended to set
- * $recursive to false in that instance!
- * @param string $dnType The type of record to list. This can be ADLDAP_FOLDER or ADLDAP_CONTAINER.
- * @param bool $recursive Recursively search sub folders
- * @param bool $type Specify a type of object to search for
- * @return array
- */
- public function listing($folderName = NULL, $dnType = adLDAP::ADLDAP_FOLDER, $recursive = NULL, $type = NULL)
- {
- if ($recursive === NULL) { $recursive = $this->adldap->getRecursiveGroups(); } //use the default option if they haven't set it
- if (!$this->adldap->getLdapBind()) { return false; }
-
- $filter = '(&';
- if ($type !== NULL) {
- switch ($type) {
- case 'contact':
- $filter .= '(objectClass=contact)';
- break;
- case 'computer':
- $filter .= '(objectClass=computer)';
- break;
- case 'group':
- $filter .= '(objectClass=group)';
- break;
- case 'folder':
- $filter .= '(objectClass=organizationalUnit)';
- break;
- case 'container':
- $filter .= '(objectClass=container)';
- break;
- case 'domain':
- $filter .= '(objectClass=builtinDomain)';
- break;
- default:
- $filter .= '(objectClass=user)';
- break;
- }
- }
- else {
- $filter .= '(objectClass=*)';
- }
- // If the folder name is null then we will search the root level of AD
- // This requires us to not have an OU= part, just the base_dn
- $searchOu = $this->adldap->getBaseDn();
- if (is_array($folderName)) {
- $ou = $dnType . "=" . implode("," . $dnType . "=", $folderName);
- $filter .= '(!(distinguishedname=' . $ou . ',' . $this->adldap->getBaseDn() . ')))';
- $searchOu = $ou . ',' . $this->adldap->getBaseDn();
- }
- else {
- $filter .= '(!(distinguishedname=' . $this->adldap->getBaseDn() . ')))';
- }
-
- if ($recursive === true) {
- $sr = ldap_search($this->adldap->getLdapConnection(), $searchOu, $filter, array('objectclass', 'distinguishedname', 'samaccountname'));
- $entries = @ldap_get_entries($this->adldap->getLdapConnection(), $sr);
- if (is_array($entries)) {
- return $entries;
- }
- }
- else {
- $sr = ldap_list($this->adldap->getLdapConnection(), $searchOu, $filter, array('objectclass', 'distinguishedname', 'samaccountname'));
- $entries = @ldap_get_entries($this->adldap->getLdapConnection(), $sr);
- if (is_array($entries)) {
- return $entries;
- }
- }
-
- return false;
- }
-
- /**
- * Create an organizational unit
- *
- * @param array $attributes Default attributes of the ou
- * @return bool
- */
- public function create($attributes)
- {
- if (!is_array($attributes)){ return "Attributes must be an array"; }
- if (!is_array($attributes["container"])) { return "Container attribute must be an array."; }
- if (!array_key_exists("ou_name",$attributes)) { return "Missing compulsory field [ou_name]"; }
- if (!array_key_exists("container",$attributes)) { return "Missing compulsory field [container]"; }
-
- $attributes["container"] = array_reverse($attributes["container"]);
-
- $add=array();
- $add["objectClass"] = "organizationalUnit";
- $add["OU"] = $attributes['ou_name'];
- $containers = "";
- if (count($attributes['container']) > 0) {
- $containers = "OU=" . implode(",OU=", $attributes["container"]) . ",";
- }
-
- $containers = "OU=" . implode(",OU=", $attributes["container"]);
- $result = ldap_add($this->adldap->getLdapConnection(), "OU=" . $add["OU"] . ", " . $containers . $this->adldap->getBaseDn(), $add);
- if ($result != true) {
- return false;
- }
-
- return true;
- }
-
-}
-
+<?php
+/**
+ * PHP LDAP CLASS FOR MANIPULATING ACTIVE DIRECTORY
+ * Version 4.0.4
+ *
+ * PHP Version 5 with SSL and LDAP support
+ *
+ * Written by Scott Barnett, Richard Hyland
+ * email: scott@wiggumworld.com, adldap@richardhyland.com
+ * http://adldap.sourceforge.net/
+ *
+ * Copyright (c) 2006-2012 Scott Barnett, Richard Hyland
+ *
+ * We'd appreciate any improvements or additions to be submitted back
+ * to benefit the entire community :)
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * @category ToolsAndUtilities
+ * @package adLDAP
+ * @subpackage Folders
+ * @author Scott Barnett, Richard Hyland
+ * @copyright (c) 2006-2012 Scott Barnett, Richard Hyland
+ * @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html LGPLv2.1
+ * @revision $Revision: 97 $
+ * @version 4.0.4
+ * @link http://adldap.sourceforge.net/
+ */
+require_once(dirname(__FILE__) . '/../adLDAP.php');
+
+/**
+* FOLDER / OU MANAGEMENT FUNCTIONS
+*/
+class adLDAPFolders {
+ /**
+ * The current adLDAP connection via dependency injection
+ *
+ * @var adLDAP
+ */
+ protected $adldap;
+
+ public function __construct(adLDAP $adldap) {
+ $this->adldap = $adldap;
+ }
+
+ /**
+ * Delete a distinguished name from Active Directory
+ * You should never need to call this yourself, just use the wrapper functions user_delete and contact_delete
+ *
+ * @param string $dn The distinguished name to delete
+ * @return bool
+ */
+ public function delete($dn){
+ $result = ldap_delete($this->adldap->getLdapConnection(), $dn);
+ if ($result != true) {
+ return false;
+ }
+ return true;
+ }
+
+ /**
+ * Returns a folder listing for a specific OU
+ * See http://adldap.sourceforge.net/wiki/doku.php?id=api_folder_functions
+ *
+ * @param array $folderName An array to the OU you wish to list.
+ * If set to NULL will list the root, strongly recommended to set
+ * $recursive to false in that instance!
+ * @param string $dnType The type of record to list. This can be ADLDAP_FOLDER or ADLDAP_CONTAINER.
+ * @param bool $recursive Recursively search sub folders
+ * @param bool $type Specify a type of object to search for
+ * @return array
+ */
+ public function listing($folderName = NULL, $dnType = adLDAP::ADLDAP_FOLDER, $recursive = NULL, $type = NULL)
+ {
+ if ($recursive === NULL) { $recursive = $this->adldap->getRecursiveGroups(); } //use the default option if they haven't set it
+ if (!$this->adldap->getLdapBind()) { return false; }
+
+ $filter = '(&';
+ if ($type !== NULL) {
+ switch ($type) {
+ case 'contact':
+ $filter .= '(objectClass=contact)';
+ break;
+ case 'computer':
+ $filter .= '(objectClass=computer)';
+ break;
+ case 'group':
+ $filter .= '(objectClass=group)';
+ break;
+ case 'folder':
+ $filter .= '(objectClass=organizationalUnit)';
+ break;
+ case 'container':
+ $filter .= '(objectClass=container)';
+ break;
+ case 'domain':
+ $filter .= '(objectClass=builtinDomain)';
+ break;
+ default:
+ $filter .= '(objectClass=user)';
+ break;
+ }
+ }
+ else {
+ $filter .= '(objectClass=*)';
+ }
+ // If the folder name is null then we will search the root level of AD
+ // This requires us to not have an OU= part, just the base_dn
+ $searchOu = $this->adldap->getBaseDn();
+ if (is_array($folderName)) {
+ $ou = $dnType . "=" . implode("," . $dnType . "=", $folderName);
+ $filter .= '(!(distinguishedname=' . $ou . ',' . $this->adldap->getBaseDn() . ')))';
+ $searchOu = $ou . ',' . $this->adldap->getBaseDn();
+ }
+ else {
+ $filter .= '(!(distinguishedname=' . $this->adldap->getBaseDn() . ')))';
+ }
+
+ if ($recursive === true) {
+ $sr = ldap_search($this->adldap->getLdapConnection(), $searchOu, $filter, array('objectclass', 'distinguishedname', 'samaccountname'));
+ $entries = @ldap_get_entries($this->adldap->getLdapConnection(), $sr);
+ if (is_array($entries)) {
+ return $entries;
+ }
+ }
+ else {
+ $sr = ldap_list($this->adldap->getLdapConnection(), $searchOu, $filter, array('objectclass', 'distinguishedname', 'samaccountname'));
+ $entries = @ldap_get_entries($this->adldap->getLdapConnection(), $sr);
+ if (is_array($entries)) {
+ return $entries;
+ }
+ }
+
+ return false;
+ }
+
+ /**
+ * Create an organizational unit
+ *
+ * @param array $attributes Default attributes of the ou
+ * @return bool
+ */
+ public function create($attributes)
+ {
+ if (!is_array($attributes)){ return "Attributes must be an array"; }
+ if (!is_array($attributes["container"])) { return "Container attribute must be an array."; }
+ if (!array_key_exists("ou_name",$attributes)) { return "Missing compulsory field [ou_name]"; }
+ if (!array_key_exists("container",$attributes)) { return "Missing compulsory field [container]"; }
+
+ $attributes["container"] = array_reverse($attributes["container"]);
+
+ $add=array();
+ $add["objectClass"] = "organizationalUnit";
+ $add["OU"] = $attributes['ou_name'];
+ $containers = "";
+ if (count($attributes['container']) > 0) {
+ $containers = "OU=" . implode(",OU=", $attributes["container"]) . ",";
+ }
+
+ $containers = "OU=" . implode(",OU=", $attributes["container"]);
+ $result = ldap_add($this->adldap->getLdapConnection(), "OU=" . $add["OU"] . ", " . $containers . $this->adldap->getBaseDn(), $add);
+ if ($result != true) {
+ return false;
+ }
+
+ return true;
+ }
+
+}
+
?> \ No newline at end of file
diff --git a/lib/plugins/authad/adLDAP/classes/adLDAPGroups.php b/lib/plugins/authad/adLDAP/classes/adLDAPGroups.php
index 05e4cc93b..94bc04853 100644
--- a/lib/plugins/authad/adLDAP/classes/adLDAPGroups.php
+++ b/lib/plugins/authad/adLDAP/classes/adLDAPGroups.php
@@ -1,631 +1,631 @@
-<?php
-/**
- * PHP LDAP CLASS FOR MANIPULATING ACTIVE DIRECTORY
- * Version 4.0.4
- *
- * PHP Version 5 with SSL and LDAP support
- *
- * Written by Scott Barnett, Richard Hyland
- * email: scott@wiggumworld.com, adldap@richardhyland.com
- * http://adldap.sourceforge.net/
- *
- * Copyright (c) 2006-2012 Scott Barnett, Richard Hyland
- *
- * We'd appreciate any improvements or additions to be submitted back
- * to benefit the entire community :)
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * @category ToolsAndUtilities
- * @package adLDAP
- * @subpackage Groups
- * @author Scott Barnett, Richard Hyland
- * @copyright (c) 2006-2012 Scott Barnett, Richard Hyland
- * @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html LGPLv2.1
- * @revision $Revision: 97 $
- * @version 4.0.4
- * @link http://adldap.sourceforge.net/
- */
-require_once(dirname(__FILE__) . '/../adLDAP.php');
-require_once(dirname(__FILE__) . '/../collections/adLDAPGroupCollection.php');
-
-/**
-* GROUP FUNCTIONS
-*/
-class adLDAPGroups {
- /**
- * The current adLDAP connection via dependency injection
- *
- * @var adLDAP
- */
- protected $adldap;
-
- public function __construct(adLDAP $adldap) {
- $this->adldap = $adldap;
- }
-
- /**
- * Add a group to a group
- *
- * @param string $parent The parent group name
- * @param string $child The child group name
- * @return bool
- */
- public function addGroup($parent,$child){
-
- // Find the parent group's dn
- $parentGroup = $this->ginfo($parent, array("cn"));
- if ($parentGroup[0]["dn"] === NULL){
- return false;
- }
- $parentDn = $parentGroup[0]["dn"];
-
- // Find the child group's dn
- $childGroup = $this->info($child, array("cn"));
- if ($childGroup[0]["dn"] === NULL){
- return false;
- }
- $childDn = $childGroup[0]["dn"];
-
- $add = array();
- $add["member"] = $childDn;
-
- $result = @ldap_mod_add($this->adldap->getLdapConnection(), $parentDn, $add);
- if ($result == false) {
- return false;
- }
- return true;
- }
-
- /**
- * Add a user to a group
- *
- * @param string $group The group to add the user to
- * @param string $user The user to add to the group
- * @param bool $isGUID Is the username passed a GUID or a samAccountName
- * @return bool
- */
- public function addUser($group, $user, $isGUID = false)
- {
- // Adding a user is a bit fiddly, we need to get the full DN of the user
- // and add it using the full DN of the group
-
- // Find the user's dn
- $userDn = $this->adldap->user()->dn($user, $isGUID);
- if ($userDn === false) {
- return false;
- }
-
- // Find the group's dn
- $groupInfo = $this->info($group, array("cn"));
- if ($groupInfo[0]["dn"] === NULL) {
- return false;
- }
- $groupDn = $groupInfo[0]["dn"];
-
- $add = array();
- $add["member"] = $userDn;
-
- $result = @ldap_mod_add($this->adldap->getLdapConnection(), $groupDn, $add);
- if ($result == false) {
- return false;
- }
- return true;
- }
-
- /**
- * Add a contact to a group
- *
- * @param string $group The group to add the contact to
- * @param string $contactDn The DN of the contact to add
- * @return bool
- */
- public function addContact($group, $contactDn)
- {
- // To add a contact we take the contact's DN
- // and add it using the full DN of the group
-
- // Find the group's dn
- $groupInfo = $this->info($group, array("cn"));
- if ($groupInfo[0]["dn"] === NULL) {
- return false;
- }
- $groupDn = $groupInfo[0]["dn"];
-
- $add = array();
- $add["member"] = $contactDn;
-
- $result = @ldap_mod_add($this->adldap->getLdapConnection(), $groupDn, $add);
- if ($result == false) {
- return false;
- }
- return true;
- }
-
- /**
- * Create a group
- *
- * @param array $attributes Default attributes of the group
- * @return bool
- */
- public function create($attributes)
- {
- if (!is_array($attributes)){ return "Attributes must be an array"; }
- if (!array_key_exists("group_name", $attributes)){ return "Missing compulsory field [group_name]"; }
- if (!array_key_exists("container", $attributes)){ return "Missing compulsory field [container]"; }
- if (!array_key_exists("description", $attributes)){ return "Missing compulsory field [description]"; }
- if (!is_array($attributes["container"])){ return "Container attribute must be an array."; }
- $attributes["container"] = array_reverse($attributes["container"]);
-
- //$member_array = array();
- //$member_array[0] = "cn=user1,cn=Users,dc=yourdomain,dc=com";
- //$member_array[1] = "cn=administrator,cn=Users,dc=yourdomain,dc=com";
-
- $add = array();
- $add["cn"] = $attributes["group_name"];
- $add["samaccountname"] = $attributes["group_name"];
- $add["objectClass"] = "Group";
- $add["description"] = $attributes["description"];
- //$add["member"] = $member_array; UNTESTED
-
- $container = "OU=" . implode(",OU=", $attributes["container"]);
- $result = ldap_add($this->adldap->getLdapConnection(), "CN=" . $add["cn"] . ", " . $container . "," . $this->adldap->getBaseDn(), $add);
- if ($result != true) {
- return false;
- }
- return true;
- }
-
- /**
- * Delete a group account
- *
- * @param string $group The group to delete (please be careful here!)
- *
- * @return array
- */
- public function delete($group) {
- if (!$this->adldap->getLdapBind()){ return false; }
- if ($group === null){ return "Missing compulsory field [group]"; }
-
- $groupInfo = $this->info($group, array("*"));
- $dn = $groupInfo[0]['distinguishedname'][0];
- $result = $this->adldap->folder()->delete($dn);
- if ($result !== true) {
- return false;
- } return true;
- }
-
- /**
- * Remove a group from a group
- *
- * @param string $parent The parent group name
- * @param string $child The child group name
- * @return bool
- */
- public function removeGroup($parent , $child)
- {
-
- // Find the parent dn
- $parentGroup = $this->info($parent, array("cn"));
- if ($parentGroup[0]["dn"] === NULL) {
- return false;
- }
- $parentDn = $parentGroup[0]["dn"];
-
- // Find the child dn
- $childGroup = $this->info($child, array("cn"));
- if ($childGroup[0]["dn"] === NULL) {
- return false;
- }
- $childDn = $childGroup[0]["dn"];
-
- $del = array();
- $del["member"] = $childDn;
-
- $result = @ldap_mod_del($this->adldap->getLdapConnection(), $parentDn, $del);
- if ($result == false) {
- return false;
- }
- return true;
- }
-
- /**
- * Remove a user from a group
- *
- * @param string $group The group to remove a user from
- * @param string $user The AD user to remove from the group
- * @param bool $isGUID Is the username passed a GUID or a samAccountName
- * @return bool
- */
- public function removeUser($group, $user, $isGUID = false)
- {
-
- // Find the parent dn
- $groupInfo = $this->info($group, array("cn"));
- if ($groupInfo[0]["dn"] === NULL){
- return false;
- }
- $groupDn = $groupInfo[0]["dn"];
-
- // Find the users dn
- $userDn = $this->adldap->user()->dn($user, $isGUID);
- if ($userDn === false) {
- return false;
- }
-
- $del = array();
- $del["member"] = $userDn;
-
- $result = @ldap_mod_del($this->adldap->getLdapConnection(), $groupDn, $del);
- if ($result == false) {
- return false;
- }
- return true;
- }
-
- /**
- * Remove a contact from a group
- *
- * @param string $group The group to remove a user from
- * @param string $contactDn The DN of a contact to remove from the group
- * @return bool
- */
- public function removeContact($group, $contactDn)
- {
-
- // Find the parent dn
- $groupInfo = $this->info($group, array("cn"));
- if ($groupInfo[0]["dn"] === NULL) {
- return false;
- }
- $groupDn = $groupInfo[0]["dn"];
-
- $del = array();
- $del["member"] = $contactDn;
-
- $result = @ldap_mod_del($this->adldap->getLdapConnection(), $groupDn, $del);
- if ($result == false) {
- return false;
- }
- return true;
- }
-
- /**
- * Return a list of groups in a group
- *
- * @param string $group The group to query
- * @param bool $recursive Recursively get groups
- * @return array
- */
- public function inGroup($group, $recursive = NULL)
- {
- if (!$this->adldap->getLdapBind()){ return false; }
- if ($recursive === NULL){ $recursive = $this->adldap->getRecursiveGroups(); } // Use the default option if they haven't set it
-
- // Search the directory for the members of a group
- $info = $this->info($group, array("member","cn"));
- $groups = $info[0]["member"];
- if (!is_array($groups)) {
- return false;
- }
-
- $groupArray = array();
-
- for ($i=0; $i<$groups["count"]; $i++){
- $filter = "(&(objectCategory=group)(distinguishedName=" . $this->adldap->utilities()->ldapSlashes($groups[$i]) . "))";
- $fields = array("samaccountname", "distinguishedname", "objectClass");
- $sr = ldap_search($this->adldap->getLdapConnection(), $this->adldap->getBaseDn(), $filter, $fields);
- $entries = ldap_get_entries($this->adldap->getLdapConnection(), $sr);
-
- // not a person, look for a group
- if ($entries['count'] == 0 && $recursive == true) {
- $filter = "(&(objectCategory=group)(distinguishedName=" . $this->adldap->utilities()->ldapSlashes($groups[$i]) . "))";
- $fields = array("distinguishedname");
- $sr = ldap_search($this->adldap->getLdapConnection(), $this->adldap->getBaseDn(), $filter, $fields);
- $entries = ldap_get_entries($this->adldap->getLdapConnection(), $sr);
- if (!isset($entries[0]['distinguishedname'][0])) {
- continue;
- }
- $subGroups = $this->inGroup($entries[0]['distinguishedname'][0], $recursive);
- if (is_array($subGroups)) {
- $groupArray = array_merge($groupArray, $subGroups);
- $groupArray = array_unique($groupArray);
- }
- continue;
- }
-
- $groupArray[] = $entries[0]['distinguishedname'][0];
- }
- return $groupArray;
- }
-
- /**
- * Return a list of members in a group
- *
- * @param string $group The group to query
- * @param bool $recursive Recursively get group members
- * @return array
- */
- public function members($group, $recursive = NULL)
- {
- if (!$this->adldap->getLdapBind()){ return false; }
- if ($recursive === NULL){ $recursive = $this->adldap->getRecursiveGroups(); } // Use the default option if they haven't set it
- // Search the directory for the members of a group
- $info = $this->info($group, array("member","cn"));
- $users = $info[0]["member"];
- if (!is_array($users)) {
- return false;
- }
-
- $userArray = array();
-
- for ($i=0; $i<$users["count"]; $i++){
- $filter = "(&(objectCategory=person)(distinguishedName=" . $this->adldap->utilities()->ldapSlashes($users[$i]) . "))";
- $fields = array("samaccountname", "distinguishedname", "objectClass");
- $sr = ldap_search($this->adldap->getLdapConnection(), $this->adldap->getBaseDn(), $filter, $fields);
- $entries = ldap_get_entries($this->adldap->getLdapConnection(), $sr);
-
- // not a person, look for a group
- if ($entries['count'] == 0 && $recursive == true) {
- $filter = "(&(objectCategory=group)(distinguishedName=" . $this->adldap->utilities()->ldapSlashes($users[$i]) . "))";
- $fields = array("samaccountname");
- $sr = ldap_search($this->adldap->getLdapConnection(), $this->adldap->getBaseDn(), $filter, $fields);
- $entries = ldap_get_entries($this->adldap->getLdapConnection(), $sr);
- if (!isset($entries[0]['samaccountname'][0])) {
- continue;
- }
- $subUsers = $this->members($entries[0]['samaccountname'][0], $recursive);
- if (is_array($subUsers)) {
- $userArray = array_merge($userArray, $subUsers);
- $userArray = array_unique($userArray);
- }
- continue;
- }
- else if ($entries['count'] == 0) {
- continue;
- }
-
- if ((!isset($entries[0]['samaccountname'][0]) || $entries[0]['samaccountname'][0] === NULL) && $entries[0]['distinguishedname'][0] !== NULL) {
- $userArray[] = $entries[0]['distinguishedname'][0];
- }
- else if ($entries[0]['samaccountname'][0] !== NULL) {
- $userArray[] = $entries[0]['samaccountname'][0];
- }
- }
- return $userArray;
- }
-
- /**
- * Group Information. Returns an array of raw information about a group.
- * The group name is case sensitive
- *
- * @param string $groupName The group name to retrieve info about
- * @param array $fields Fields to retrieve
- * @return array
- */
- public function info($groupName, $fields = NULL)
- {
- if ($groupName === NULL) { return false; }
- if (!$this->adldap->getLdapBind()) { return false; }
-
- if (stristr($groupName, '+')) {
- $groupName = stripslashes($groupName);
- }
-
- $filter = "(&(objectCategory=group)(name=" . $this->adldap->utilities()->ldapSlashes($groupName) . "))";
- if ($fields === NULL) {
- $fields = array("member","memberof","cn","description","distinguishedname","objectcategory","samaccountname");
- }
- $sr = ldap_search($this->adldap->getLdapConnection(), $this->adldap->getBaseDn(), $filter, $fields);
- $entries = ldap_get_entries($this->adldap->getLdapConnection(), $sr);
-
- return $entries;
- }
-
- /**
- * Group Information. Returns an collection
- * The group name is case sensitive
- *
- * @param string $groupName The group name to retrieve info about
- * @param array $fields Fields to retrieve
- * @return adLDAPGroupCollection
- */
- public function infoCollection($groupName, $fields = NULL)
- {
- if ($groupName === NULL) { return false; }
- if (!$this->adldap->getLdapBind()) { return false; }
-
- $info = $this->info($groupName, $fields);
- if ($info !== false) {
- $collection = new adLDAPGroupCollection($info, $this->adldap);
- return $collection;
- }
- return false;
- }
-
- /**
- * Return a complete list of "groups in groups"
- *
- * @param string $group The group to get the list from
- * @return array
- */
- public function recursiveGroups($group)
- {
- if ($group === NULL) { return false; }
-
- $stack = array();
- $processed = array();
- $retGroups = array();
-
- array_push($stack, $group); // Initial Group to Start with
- while (count($stack) > 0) {
- $parent = array_pop($stack);
- array_push($processed, $parent);
-
- $info = $this->info($parent, array("memberof"));
-
- if (isset($info[0]["memberof"]) && is_array($info[0]["memberof"])) {
- $groups = $info[0]["memberof"];
- if ($groups) {
- $groupNames = $this->adldap->utilities()->niceNames($groups);
- $retGroups = array_merge($retGroups, $groupNames); //final groups to return
- foreach ($groupNames as $id => $groupName) {
- if (!in_array($groupName, $processed)) {
- array_push($stack, $groupName);
- }
- }
- }
- }
- }
-
- return $retGroups;
- }
-
- /**
- * Returns a complete list of the groups in AD based on a SAM Account Type
- *
- * @param string $sAMAaccountType The account type to return
- * @param bool $includeDescription Whether to return a description
- * @param string $search Search parameters
- * @param bool $sorted Whether to sort the results
- * @return array
- */
- public function search($sAMAaccountType = adLDAP::ADLDAP_SECURITY_GLOBAL_GROUP, $includeDescription = false, $search = "*", $sorted = true) {
- if (!$this->adldap->getLdapBind()) { return false; }
-
- $filter = '(&(objectCategory=group)';
- if ($sAMAaccountType !== null) {
- $filter .= '(samaccounttype='. $sAMAaccountType .')';
- }
- $filter .= '(cn=' . $search . '))';
- // Perform the search and grab all their details
- $fields = array("samaccountname", "description");
- $sr = ldap_search($this->adldap->getLdapConnection(), $this->adldap->getBaseDn(), $filter, $fields);
- $entries = ldap_get_entries($this->adldap->getLdapConnection(), $sr);
-
- $groupsArray = array();
- for ($i=0; $i<$entries["count"]; $i++){
- if ($includeDescription && strlen($entries[$i]["description"][0]) > 0 ) {
- $groupsArray[$entries[$i]["samaccountname"][0]] = $entries[$i]["description"][0];
- }
- else if ($includeDescription){
- $groupsArray[$entries[$i]["samaccountname"][0]] = $entries[$i]["samaccountname"][0];
- }
- else {
- array_push($groupsArray, $entries[$i]["samaccountname"][0]);
- }
- }
- if ($sorted) {
- asort($groupsArray);
- }
- return $groupsArray;
- }
-
- /**
- * Returns a complete list of all groups in AD
- *
- * @param bool $includeDescription Whether to return a description
- * @param string $search Search parameters
- * @param bool $sorted Whether to sort the results
- * @return array
- */
- public function all($includeDescription = false, $search = "*", $sorted = true){
- $groupsArray = $this->search(null, $includeDescription, $search, $sorted);
- return $groupsArray;
- }
-
- /**
- * Returns a complete list of security groups in AD
- *
- * @param bool $includeDescription Whether to return a description
- * @param string $search Search parameters
- * @param bool $sorted Whether to sort the results
- * @return array
- */
- public function allSecurity($includeDescription = false, $search = "*", $sorted = true){
- $groupsArray = $this->search(adLDAP::ADLDAP_SECURITY_GLOBAL_GROUP, $includeDescription, $search, $sorted);
- return $groupsArray;
- }
-
- /**
- * Returns a complete list of distribution lists in AD
- *
- * @param bool $includeDescription Whether to return a description
- * @param string $search Search parameters
- * @param bool $sorted Whether to sort the results
- * @return array
- */
- public function allDistribution($includeDescription = false, $search = "*", $sorted = true){
- $groupsArray = $this->search(adLDAP::ADLDAP_DISTRIBUTION_GROUP, $includeDescription, $search, $sorted);
- return $groupsArray;
- }
-
- /**
- * Coping with AD not returning the primary group
- * http://support.microsoft.com/?kbid=321360
- *
- * This is a re-write based on code submitted by Bruce which prevents the
- * need to search each security group to find the true primary group
- *
- * @param string $gid Group ID
- * @param string $usersid User's Object SID
- * @return mixed
- */
- public function getPrimaryGroup($gid, $usersid)
- {
- if ($gid === NULL || $usersid === NULL) { return false; }
- $sr = false;
-
- $gsid = substr_replace($usersid, pack('V',$gid), strlen($usersid)-4,4);
- $filter = '(objectsid=' . $this->adldap->utilities()->getTextSID($gsid).')';
- $fields = array("samaccountname","distinguishedname");
- $sr = ldap_search($this->adldap->getLdapConnection(), $this->adldap->getBaseDn(), $filter, $fields);
- $entries = ldap_get_entries($this->adldap->getLdapConnection(), $sr);
-
- if (isset($entries[0]['distinguishedname'][0])) {
- return $entries[0]['distinguishedname'][0];
- }
- return false;
- }
-
- /**
- * Coping with AD not returning the primary group
- * http://support.microsoft.com/?kbid=321360
- *
- * For some reason it's not possible to search on primarygrouptoken=XXX
- * If someone can show otherwise, I'd like to know about it :)
- * this way is resource intensive and generally a pain in the @#%^
- *
- * @deprecated deprecated since version 3.1, see get get_primary_group
- * @param string $gid Group ID
- * @return string
- */
- public function cn($gid){
- if ($gid === NULL) { return false; }
- $sr = false;
- $r = '';
-
- $filter = "(&(objectCategory=group)(samaccounttype=" . adLDAP::ADLDAP_SECURITY_GLOBAL_GROUP . "))";
- $fields = array("primarygrouptoken", "samaccountname", "distinguishedname");
- $sr = ldap_search($this->adldap->getLdapConnection(), $this->adldap->getBaseDn(), $filter, $fields);
- $entries = ldap_get_entries($this->adldap->getLdapConnection(), $sr);
-
- for ($i=0; $i<$entries["count"]; $i++){
- if ($entries[$i]["primarygrouptoken"][0] == $gid) {
- $r = $entries[$i]["distinguishedname"][0];
- $i = $entries["count"];
- }
- }
-
- return $r;
- }
-}
-?>
+<?php
+/**
+ * PHP LDAP CLASS FOR MANIPULATING ACTIVE DIRECTORY
+ * Version 4.0.4
+ *
+ * PHP Version 5 with SSL and LDAP support
+ *
+ * Written by Scott Barnett, Richard Hyland
+ * email: scott@wiggumworld.com, adldap@richardhyland.com
+ * http://adldap.sourceforge.net/
+ *
+ * Copyright (c) 2006-2012 Scott Barnett, Richard Hyland
+ *
+ * We'd appreciate any improvements or additions to be submitted back
+ * to benefit the entire community :)
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * @category ToolsAndUtilities
+ * @package adLDAP
+ * @subpackage Groups
+ * @author Scott Barnett, Richard Hyland
+ * @copyright (c) 2006-2012 Scott Barnett, Richard Hyland
+ * @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html LGPLv2.1
+ * @revision $Revision: 97 $
+ * @version 4.0.4
+ * @link http://adldap.sourceforge.net/
+ */
+require_once(dirname(__FILE__) . '/../adLDAP.php');
+require_once(dirname(__FILE__) . '/../collections/adLDAPGroupCollection.php');
+
+/**
+* GROUP FUNCTIONS
+*/
+class adLDAPGroups {
+ /**
+ * The current adLDAP connection via dependency injection
+ *
+ * @var adLDAP
+ */
+ protected $adldap;
+
+ public function __construct(adLDAP $adldap) {
+ $this->adldap = $adldap;
+ }
+
+ /**
+ * Add a group to a group
+ *
+ * @param string $parent The parent group name
+ * @param string $child The child group name
+ * @return bool
+ */
+ public function addGroup($parent,$child){
+
+ // Find the parent group's dn
+ $parentGroup = $this->ginfo($parent, array("cn"));
+ if ($parentGroup[0]["dn"] === NULL){
+ return false;
+ }
+ $parentDn = $parentGroup[0]["dn"];
+
+ // Find the child group's dn
+ $childGroup = $this->info($child, array("cn"));
+ if ($childGroup[0]["dn"] === NULL){
+ return false;
+ }
+ $childDn = $childGroup[0]["dn"];
+
+ $add = array();
+ $add["member"] = $childDn;
+
+ $result = @ldap_mod_add($this->adldap->getLdapConnection(), $parentDn, $add);
+ if ($result == false) {
+ return false;
+ }
+ return true;
+ }
+
+ /**
+ * Add a user to a group
+ *
+ * @param string $group The group to add the user to
+ * @param string $user The user to add to the group
+ * @param bool $isGUID Is the username passed a GUID or a samAccountName
+ * @return bool
+ */
+ public function addUser($group, $user, $isGUID = false)
+ {
+ // Adding a user is a bit fiddly, we need to get the full DN of the user
+ // and add it using the full DN of the group
+
+ // Find the user's dn
+ $userDn = $this->adldap->user()->dn($user, $isGUID);
+ if ($userDn === false) {
+ return false;
+ }
+
+ // Find the group's dn
+ $groupInfo = $this->info($group, array("cn"));
+ if ($groupInfo[0]["dn"] === NULL) {
+ return false;
+ }
+ $groupDn = $groupInfo[0]["dn"];
+
+ $add = array();
+ $add["member"] = $userDn;
+
+ $result = @ldap_mod_add($this->adldap->getLdapConnection(), $groupDn, $add);
+ if ($result == false) {
+ return false;
+ }
+ return true;
+ }
+
+ /**
+ * Add a contact to a group
+ *
+ * @param string $group The group to add the contact to
+ * @param string $contactDn The DN of the contact to add
+ * @return bool
+ */
+ public function addContact($group, $contactDn)
+ {
+ // To add a contact we take the contact's DN
+ // and add it using the full DN of the group
+
+ // Find the group's dn
+ $groupInfo = $this->info($group, array("cn"));
+ if ($groupInfo[0]["dn"] === NULL) {
+ return false;
+ }
+ $groupDn = $groupInfo[0]["dn"];
+
+ $add = array();
+ $add["member"] = $contactDn;
+
+ $result = @ldap_mod_add($this->adldap->getLdapConnection(), $groupDn, $add);
+ if ($result == false) {
+ return false;
+ }
+ return true;
+ }
+
+ /**
+ * Create a group
+ *
+ * @param array $attributes Default attributes of the group
+ * @return bool
+ */
+ public function create($attributes)
+ {
+ if (!is_array($attributes)){ return "Attributes must be an array"; }
+ if (!array_key_exists("group_name", $attributes)){ return "Missing compulsory field [group_name]"; }
+ if (!array_key_exists("container", $attributes)){ return "Missing compulsory field [container]"; }
+ if (!array_key_exists("description", $attributes)){ return "Missing compulsory field [description]"; }
+ if (!is_array($attributes["container"])){ return "Container attribute must be an array."; }
+ $attributes["container"] = array_reverse($attributes["container"]);
+
+ //$member_array = array();
+ //$member_array[0] = "cn=user1,cn=Users,dc=yourdomain,dc=com";
+ //$member_array[1] = "cn=administrator,cn=Users,dc=yourdomain,dc=com";
+
+ $add = array();
+ $add["cn"] = $attributes["group_name"];
+ $add["samaccountname"] = $attributes["group_name"];
+ $add["objectClass"] = "Group";
+ $add["description"] = $attributes["description"];
+ //$add["member"] = $member_array; UNTESTED
+
+ $container = "OU=" . implode(",OU=", $attributes["container"]);
+ $result = ldap_add($this->adldap->getLdapConnection(), "CN=" . $add["cn"] . ", " . $container . "," . $this->adldap->getBaseDn(), $add);
+ if ($result != true) {
+ return false;
+ }
+ return true;
+ }
+
+ /**
+ * Delete a group account
+ *
+ * @param string $group The group to delete (please be careful here!)
+ *
+ * @return array
+ */
+ public function delete($group) {
+ if (!$this->adldap->getLdapBind()){ return false; }
+ if ($group === null){ return "Missing compulsory field [group]"; }
+
+ $groupInfo = $this->info($group, array("*"));
+ $dn = $groupInfo[0]['distinguishedname'][0];
+ $result = $this->adldap->folder()->delete($dn);
+ if ($result !== true) {
+ return false;
+ } return true;
+ }
+
+ /**
+ * Remove a group from a group
+ *
+ * @param string $parent The parent group name
+ * @param string $child The child group name
+ * @return bool
+ */
+ public function removeGroup($parent , $child)
+ {
+
+ // Find the parent dn
+ $parentGroup = $this->info($parent, array("cn"));
+ if ($parentGroup[0]["dn"] === NULL) {
+ return false;
+ }
+ $parentDn = $parentGroup[0]["dn"];
+
+ // Find the child dn
+ $childGroup = $this->info($child, array("cn"));
+ if ($childGroup[0]["dn"] === NULL) {
+ return false;
+ }
+ $childDn = $childGroup[0]["dn"];
+
+ $del = array();
+ $del["member"] = $childDn;
+
+ $result = @ldap_mod_del($this->adldap->getLdapConnection(), $parentDn, $del);
+ if ($result == false) {
+ return false;
+ }
+ return true;
+ }
+
+ /**
+ * Remove a user from a group
+ *
+ * @param string $group The group to remove a user from
+ * @param string $user The AD user to remove from the group
+ * @param bool $isGUID Is the username passed a GUID or a samAccountName
+ * @return bool
+ */
+ public function removeUser($group, $user, $isGUID = false)
+ {
+
+ // Find the parent dn
+ $groupInfo = $this->info($group, array("cn"));
+ if ($groupInfo[0]["dn"] === NULL){
+ return false;
+ }
+ $groupDn = $groupInfo[0]["dn"];
+
+ // Find the users dn
+ $userDn = $this->adldap->user()->dn($user, $isGUID);
+ if ($userDn === false) {
+ return false;
+ }
+
+ $del = array();
+ $del["member"] = $userDn;
+
+ $result = @ldap_mod_del($this->adldap->getLdapConnection(), $groupDn, $del);
+ if ($result == false) {
+ return false;
+ }
+ return true;
+ }
+
+ /**
+ * Remove a contact from a group
+ *
+ * @param string $group The group to remove a user from
+ * @param string $contactDn The DN of a contact to remove from the group
+ * @return bool
+ */
+ public function removeContact($group, $contactDn)
+ {
+
+ // Find the parent dn
+ $groupInfo = $this->info($group, array("cn"));
+ if ($groupInfo[0]["dn"] === NULL) {
+ return false;
+ }
+ $groupDn = $groupInfo[0]["dn"];
+
+ $del = array();
+ $del["member"] = $contactDn;
+
+ $result = @ldap_mod_del($this->adldap->getLdapConnection(), $groupDn, $del);
+ if ($result == false) {
+ return false;
+ }
+ return true;
+ }
+
+ /**
+ * Return a list of groups in a group
+ *
+ * @param string $group The group to query
+ * @param bool $recursive Recursively get groups
+ * @return array
+ */
+ public function inGroup($group, $recursive = NULL)
+ {
+ if (!$this->adldap->getLdapBind()){ return false; }
+ if ($recursive === NULL){ $recursive = $this->adldap->getRecursiveGroups(); } // Use the default option if they haven't set it
+
+ // Search the directory for the members of a group
+ $info = $this->info($group, array("member","cn"));
+ $groups = $info[0]["member"];
+ if (!is_array($groups)) {
+ return false;
+ }
+
+ $groupArray = array();
+
+ for ($i=0; $i<$groups["count"]; $i++){
+ $filter = "(&(objectCategory=group)(distinguishedName=" . $this->adldap->utilities()->ldapSlashes($groups[$i]) . "))";
+ $fields = array("samaccountname", "distinguishedname", "objectClass");
+ $sr = ldap_search($this->adldap->getLdapConnection(), $this->adldap->getBaseDn(), $filter, $fields);
+ $entries = ldap_get_entries($this->adldap->getLdapConnection(), $sr);
+
+ // not a person, look for a group
+ if ($entries['count'] == 0 && $recursive == true) {
+ $filter = "(&(objectCategory=group)(distinguishedName=" . $this->adldap->utilities()->ldapSlashes($groups[$i]) . "))";
+ $fields = array("distinguishedname");
+ $sr = ldap_search($this->adldap->getLdapConnection(), $this->adldap->getBaseDn(), $filter, $fields);
+ $entries = ldap_get_entries($this->adldap->getLdapConnection(), $sr);
+ if (!isset($entries[0]['distinguishedname'][0])) {
+ continue;
+ }
+ $subGroups = $this->inGroup($entries[0]['distinguishedname'][0], $recursive);
+ if (is_array($subGroups)) {
+ $groupArray = array_merge($groupArray, $subGroups);
+ $groupArray = array_unique($groupArray);
+ }
+ continue;
+ }
+
+ $groupArray[] = $entries[0]['distinguishedname'][0];
+ }
+ return $groupArray;
+ }
+
+ /**
+ * Return a list of members in a group
+ *
+ * @param string $group The group to query
+ * @param bool $recursive Recursively get group members
+ * @return array
+ */
+ public function members($group, $recursive = NULL)
+ {
+ if (!$this->adldap->getLdapBind()){ return false; }
+ if ($recursive === NULL){ $recursive = $this->adldap->getRecursiveGroups(); } // Use the default option if they haven't set it
+ // Search the directory for the members of a group
+ $info = $this->info($group, array("member","cn"));
+ $users = $info[0]["member"];
+ if (!is_array($users)) {
+ return false;
+ }
+
+ $userArray = array();
+
+ for ($i=0; $i<$users["count"]; $i++){
+ $filter = "(&(objectCategory=person)(distinguishedName=" . $this->adldap->utilities()->ldapSlashes($users[$i]) . "))";
+ $fields = array("samaccountname", "distinguishedname", "objectClass");
+ $sr = ldap_search($this->adldap->getLdapConnection(), $this->adldap->getBaseDn(), $filter, $fields);
+ $entries = ldap_get_entries($this->adldap->getLdapConnection(), $sr);
+
+ // not a person, look for a group
+ if ($entries['count'] == 0 && $recursive == true) {
+ $filter = "(&(objectCategory=group)(distinguishedName=" . $this->adldap->utilities()->ldapSlashes($users[$i]) . "))";
+ $fields = array("samaccountname");
+ $sr = ldap_search($this->adldap->getLdapConnection(), $this->adldap->getBaseDn(), $filter, $fields);
+ $entries = ldap_get_entries($this->adldap->getLdapConnection(), $sr);
+ if (!isset($entries[0]['samaccountname'][0])) {
+ continue;
+ }
+ $subUsers = $this->members($entries[0]['samaccountname'][0], $recursive);
+ if (is_array($subUsers)) {
+ $userArray = array_merge($userArray, $subUsers);
+ $userArray = array_unique($userArray);
+ }
+ continue;
+ }
+ else if ($entries['count'] == 0) {
+ continue;
+ }
+
+ if ((!isset($entries[0]['samaccountname'][0]) || $entries[0]['samaccountname'][0] === NULL) && $entries[0]['distinguishedname'][0] !== NULL) {
+ $userArray[] = $entries[0]['distinguishedname'][0];
+ }
+ else if ($entries[0]['samaccountname'][0] !== NULL) {
+ $userArray[] = $entries[0]['samaccountname'][0];
+ }
+ }
+ return $userArray;
+ }
+
+ /**
+ * Group Information. Returns an array of raw information about a group.
+ * The group name is case sensitive
+ *
+ * @param string $groupName The group name to retrieve info about
+ * @param array $fields Fields to retrieve
+ * @return array
+ */
+ public function info($groupName, $fields = NULL)
+ {
+ if ($groupName === NULL) { return false; }
+ if (!$this->adldap->getLdapBind()) { return false; }
+
+ if (stristr($groupName, '+')) {
+ $groupName = stripslashes($groupName);
+ }
+
+ $filter = "(&(objectCategory=group)(name=" . $this->adldap->utilities()->ldapSlashes($groupName) . "))";
+ if ($fields === NULL) {
+ $fields = array("member","memberof","cn","description","distinguishedname","objectcategory","samaccountname");
+ }
+ $sr = ldap_search($this->adldap->getLdapConnection(), $this->adldap->getBaseDn(), $filter, $fields);
+ $entries = ldap_get_entries($this->adldap->getLdapConnection(), $sr);
+
+ return $entries;
+ }
+
+ /**
+ * Group Information. Returns an collection
+ * The group name is case sensitive
+ *
+ * @param string $groupName The group name to retrieve info about
+ * @param array $fields Fields to retrieve
+ * @return adLDAPGroupCollection
+ */
+ public function infoCollection($groupName, $fields = NULL)
+ {
+ if ($groupName === NULL) { return false; }
+ if (!$this->adldap->getLdapBind()) { return false; }
+
+ $info = $this->info($groupName, $fields);
+ if ($info !== false) {
+ $collection = new adLDAPGroupCollection($info, $this->adldap);
+ return $collection;
+ }
+ return false;
+ }
+
+ /**
+ * Return a complete list of "groups in groups"
+ *
+ * @param string $group The group to get the list from
+ * @return array
+ */
+ public function recursiveGroups($group)
+ {
+ if ($group === NULL) { return false; }
+
+ $stack = array();
+ $processed = array();
+ $retGroups = array();
+
+ array_push($stack, $group); // Initial Group to Start with
+ while (count($stack) > 0) {
+ $parent = array_pop($stack);
+ array_push($processed, $parent);
+
+ $info = $this->info($parent, array("memberof"));
+
+ if (isset($info[0]["memberof"]) && is_array($info[0]["memberof"])) {
+ $groups = $info[0]["memberof"];
+ if ($groups) {
+ $groupNames = $this->adldap->utilities()->niceNames($groups);
+ $retGroups = array_merge($retGroups, $groupNames); //final groups to return
+ foreach ($groupNames as $id => $groupName) {
+ if (!in_array($groupName, $processed)) {
+ array_push($stack, $groupName);
+ }
+ }
+ }
+ }
+ }
+
+ return $retGroups;
+ }
+
+ /**
+ * Returns a complete list of the groups in AD based on a SAM Account Type
+ *
+ * @param string $sAMAaccountType The account type to return
+ * @param bool $includeDescription Whether to return a description
+ * @param string $search Search parameters
+ * @param bool $sorted Whether to sort the results
+ * @return array
+ */
+ public function search($sAMAaccountType = adLDAP::ADLDAP_SECURITY_GLOBAL_GROUP, $includeDescription = false, $search = "*", $sorted = true) {
+ if (!$this->adldap->getLdapBind()) { return false; }
+
+ $filter = '(&(objectCategory=group)';
+ if ($sAMAaccountType !== null) {
+ $filter .= '(samaccounttype='. $sAMAaccountType .')';
+ }
+ $filter .= '(cn=' . $search . '))';
+ // Perform the search and grab all their details
+ $fields = array("samaccountname", "description");
+ $sr = ldap_search($this->adldap->getLdapConnection(), $this->adldap->getBaseDn(), $filter, $fields);
+ $entries = ldap_get_entries($this->adldap->getLdapConnection(), $sr);
+
+ $groupsArray = array();
+ for ($i=0; $i<$entries["count"]; $i++){
+ if ($includeDescription && strlen($entries[$i]["description"][0]) > 0 ) {
+ $groupsArray[$entries[$i]["samaccountname"][0]] = $entries[$i]["description"][0];
+ }
+ else if ($includeDescription){
+ $groupsArray[$entries[$i]["samaccountname"][0]] = $entries[$i]["samaccountname"][0];
+ }
+ else {
+ array_push($groupsArray, $entries[$i]["samaccountname"][0]);
+ }
+ }
+ if ($sorted) {
+ asort($groupsArray);
+ }
+ return $groupsArray;
+ }
+
+ /**
+ * Returns a complete list of all groups in AD
+ *
+ * @param bool $includeDescription Whether to return a description
+ * @param string $search Search parameters
+ * @param bool $sorted Whether to sort the results
+ * @return array
+ */
+ public function all($includeDescription = false, $search = "*", $sorted = true){
+ $groupsArray = $this->search(null, $includeDescription, $search, $sorted);
+ return $groupsArray;
+ }
+
+ /**
+ * Returns a complete list of security groups in AD
+ *
+ * @param bool $includeDescription Whether to return a description
+ * @param string $search Search parameters
+ * @param bool $sorted Whether to sort the results
+ * @return array
+ */
+ public function allSecurity($includeDescription = false, $search = "*", $sorted = true){
+ $groupsArray = $this->search(adLDAP::ADLDAP_SECURITY_GLOBAL_GROUP, $includeDescription, $search, $sorted);
+ return $groupsArray;
+ }
+
+ /**
+ * Returns a complete list of distribution lists in AD
+ *
+ * @param bool $includeDescription Whether to return a description
+ * @param string $search Search parameters
+ * @param bool $sorted Whether to sort the results
+ * @return array
+ */
+ public function allDistribution($includeDescription = false, $search = "*", $sorted = true){
+ $groupsArray = $this->search(adLDAP::ADLDAP_DISTRIBUTION_GROUP, $includeDescription, $search, $sorted);
+ return $groupsArray;
+ }
+
+ /**
+ * Coping with AD not returning the primary group
+ * http://support.microsoft.com/?kbid=321360
+ *
+ * This is a re-write based on code submitted by Bruce which prevents the
+ * need to search each security group to find the true primary group
+ *
+ * @param string $gid Group ID
+ * @param string $usersid User's Object SID
+ * @return mixed
+ */
+ public function getPrimaryGroup($gid, $usersid)
+ {
+ if ($gid === NULL || $usersid === NULL) { return false; }
+ $sr = false;
+
+ $gsid = substr_replace($usersid, pack('V',$gid), strlen($usersid)-4,4);
+ $filter = '(objectsid=' . $this->adldap->utilities()->getTextSID($gsid).')';
+ $fields = array("samaccountname","distinguishedname");
+ $sr = ldap_search($this->adldap->getLdapConnection(), $this->adldap->getBaseDn(), $filter, $fields);
+ $entries = ldap_get_entries($this->adldap->getLdapConnection(), $sr);
+
+ if (isset($entries[0]['distinguishedname'][0])) {
+ return $entries[0]['distinguishedname'][0];
+ }
+ return false;
+ }
+
+ /**
+ * Coping with AD not returning the primary group
+ * http://support.microsoft.com/?kbid=321360
+ *
+ * For some reason it's not possible to search on primarygrouptoken=XXX
+ * If someone can show otherwise, I'd like to know about it :)
+ * this way is resource intensive and generally a pain in the @#%^
+ *
+ * @deprecated deprecated since version 3.1, see get get_primary_group
+ * @param string $gid Group ID
+ * @return string
+ */
+ public function cn($gid){
+ if ($gid === NULL) { return false; }
+ $sr = false;
+ $r = '';
+
+ $filter = "(&(objectCategory=group)(samaccounttype=" . adLDAP::ADLDAP_SECURITY_GLOBAL_GROUP . "))";
+ $fields = array("primarygrouptoken", "samaccountname", "distinguishedname");
+ $sr = ldap_search($this->adldap->getLdapConnection(), $this->adldap->getBaseDn(), $filter, $fields);
+ $entries = ldap_get_entries($this->adldap->getLdapConnection(), $sr);
+
+ for ($i=0; $i<$entries["count"]; $i++){
+ if ($entries[$i]["primarygrouptoken"][0] == $gid) {
+ $r = $entries[$i]["distinguishedname"][0];
+ $i = $entries["count"];
+ }
+ }
+
+ return $r;
+ }
+}
+?>
diff --git a/lib/plugins/authad/adLDAP/classes/adLDAPUsers.php b/lib/plugins/authad/adLDAP/classes/adLDAPUsers.php
index 96a93b512..839fd592d 100644
--- a/lib/plugins/authad/adLDAP/classes/adLDAPUsers.php
+++ b/lib/plugins/authad/adLDAP/classes/adLDAPUsers.php
@@ -1,682 +1,682 @@
-<?php
-/**
- * PHP LDAP CLASS FOR MANIPULATING ACTIVE DIRECTORY
- * Version 4.0.4
- *
- * PHP Version 5 with SSL and LDAP support
- *
- * Written by Scott Barnett, Richard Hyland
- * email: scott@wiggumworld.com, adldap@richardhyland.com
- * http://adldap.sourceforge.net/
- *
- * Copyright (c) 2006-2012 Scott Barnett, Richard Hyland
- *
- * We'd appreciate any improvements or additions to be submitted back
- * to benefit the entire community :)
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * @category ToolsAndUtilities
- * @package adLDAP
- * @subpackage User
- * @author Scott Barnett, Richard Hyland
- * @copyright (c) 2006-2012 Scott Barnett, Richard Hyland
- * @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html LGPLv2.1
- * @revision $Revision: 97 $
- * @version 4.0.4
- * @link http://adldap.sourceforge.net/
- */
-require_once(dirname(__FILE__) . '/../adLDAP.php');
-require_once(dirname(__FILE__) . '/../collections/adLDAPUserCollection.php');
-
-/**
-* USER FUNCTIONS
-*/
-class adLDAPUsers {
- /**
- * The current adLDAP connection via dependency injection
- *
- * @var adLDAP
- */
- protected $adldap;
-
- public function __construct(adLDAP $adldap) {
- $this->adldap = $adldap;
- }
-
- /**
- * Validate a user's login credentials
- *
- * @param string $username A user's AD username
- * @param string $password A user's AD password
- * @param bool optional $prevent_rebind
- * @return bool
- */
- public function authenticate($username, $password, $preventRebind = false) {
- return $this->adldap->authenticate($username, $password, $preventRebind);
- }
-
- /**
- * Create a user
- *
- * If you specify a password here, this can only be performed over SSL
- *
- * @param array $attributes The attributes to set to the user account
- * @return bool
- */
- public function create($attributes)
- {
- // Check for compulsory fields
- if (!array_key_exists("username", $attributes)){ return "Missing compulsory field [username]"; }
- if (!array_key_exists("firstname", $attributes)){ return "Missing compulsory field [firstname]"; }
- if (!array_key_exists("surname", $attributes)){ return "Missing compulsory field [surname]"; }
- if (!array_key_exists("email", $attributes)){ return "Missing compulsory field [email]"; }
- if (!array_key_exists("container", $attributes)){ return "Missing compulsory field [container]"; }
- if (!is_array($attributes["container"])){ return "Container attribute must be an array."; }
-
- if (array_key_exists("password",$attributes) && (!$this->adldap->getUseSSL() && !$this->adldap->getUseTLS())){
- throw new adLDAPException('SSL must be configured on your webserver and enabled in the class to set passwords.');
- }
-
- if (!array_key_exists("display_name", $attributes)) {
- $attributes["display_name"] = $attributes["firstname"] . " " . $attributes["surname"];
- }
-
- // Translate the schema
- $add = $this->adldap->adldap_schema($attributes);
-
- // Additional stuff only used for adding accounts
- $add["cn"][0] = $attributes["display_name"];
- $add["samaccountname"][0] = $attributes["username"];
- $add["objectclass"][0] = "top";
- $add["objectclass"][1] = "person";
- $add["objectclass"][2] = "organizationalPerson";
- $add["objectclass"][3] = "user"; //person?
- //$add["name"][0]=$attributes["firstname"]." ".$attributes["surname"];
-
- // Set the account control attribute
- $control_options = array("NORMAL_ACCOUNT");
- if (!$attributes["enabled"]) {
- $control_options[] = "ACCOUNTDISABLE";
- }
- $add["userAccountControl"][0] = $this->accountControl($control_options);
-
- // Determine the container
- $attributes["container"] = array_reverse($attributes["container"]);
- $container = "OU=" . implode(", OU=",$attributes["container"]);
-
- // Add the entry
- $result = @ldap_add($this->adldap->getLdapConnection(), "CN=" . $add["cn"][0] . ", " . $container . "," . $this->adldap->getBaseDn(), $add);
- if ($result != true) {
- return false;
- }
-
- return true;
- }
-
- /**
- * Account control options
- *
- * @param array $options The options to convert to int
- * @return int
- */
- protected function accountControl($options)
- {
- $val=0;
-
- if (is_array($options)) {
- if (in_array("SCRIPT",$options)){ $val=$val+1; }
- if (in_array("ACCOUNTDISABLE",$options)){ $val=$val+2; }
- if (in_array("HOMEDIR_REQUIRED",$options)){ $val=$val+8; }
- if (in_array("LOCKOUT",$options)){ $val=$val+16; }
- if (in_array("PASSWD_NOTREQD",$options)){ $val=$val+32; }
- //PASSWD_CANT_CHANGE Note You cannot assign this permission by directly modifying the UserAccountControl attribute.
- //For information about how to set the permission programmatically, see the "Property flag descriptions" section.
- if (in_array("ENCRYPTED_TEXT_PWD_ALLOWED",$options)){ $val=$val+128; }
- if (in_array("TEMP_DUPLICATE_ACCOUNT",$options)){ $val=$val+256; }
- if (in_array("NORMAL_ACCOUNT",$options)){ $val=$val+512; }
- if (in_array("INTERDOMAIN_TRUST_ACCOUNT",$options)){ $val=$val+2048; }
- if (in_array("WORKSTATION_TRUST_ACCOUNT",$options)){ $val=$val+4096; }
- if (in_array("SERVER_TRUST_ACCOUNT",$options)){ $val=$val+8192; }
- if (in_array("DONT_EXPIRE_PASSWORD",$options)){ $val=$val+65536; }
- if (in_array("MNS_LOGON_ACCOUNT",$options)){ $val=$val+131072; }
- if (in_array("SMARTCARD_REQUIRED",$options)){ $val=$val+262144; }
- if (in_array("TRUSTED_FOR_DELEGATION",$options)){ $val=$val+524288; }
- if (in_array("NOT_DELEGATED",$options)){ $val=$val+1048576; }
- if (in_array("USE_DES_KEY_ONLY",$options)){ $val=$val+2097152; }
- if (in_array("DONT_REQ_PREAUTH",$options)){ $val=$val+4194304; }
- if (in_array("PASSWORD_EXPIRED",$options)){ $val=$val+8388608; }
- if (in_array("TRUSTED_TO_AUTH_FOR_DELEGATION",$options)){ $val=$val+16777216; }
- }
- return $val;
- }
-
- /**
- * Delete a user account
- *
- * @param string $username The username to delete (please be careful here!)
- * @param bool $isGUID Is the username a GUID or a samAccountName
- * @return array
- */
- public function delete($username, $isGUID = false)
- {
- $userinfo = $this->info($username, array("*"), $isGUID);
- $dn = $userinfo[0]['distinguishedname'][0];
- $result = $this->adldap->folder()->delete($dn);
- if ($result != true) {
- return false;
- }
- return true;
- }
-
- /**
- * Groups the user is a member of
- *
- * @param string $username The username to query
- * @param bool $recursive Recursive list of groups
- * @param bool $isGUID Is the username passed a GUID or a samAccountName
- * @return array
- */
- public function groups($username, $recursive = NULL, $isGUID = false)
- {
- if ($username === NULL) { return false; }
- if ($recursive === NULL) { $recursive = $this->adldap->getRecursiveGroups(); } // Use the default option if they haven't set it
- if (!$this->adldap->getLdapBind()) { return false; }
-
- // Search the directory for their information
- $info = @$this->info($username, array("memberof", "primarygroupid"), $isGUID);
- $groups = $this->adldap->utilities()->niceNames($info[0]["memberof"]); // Presuming the entry returned is our guy (unique usernames)
-
- if ($recursive === true){
- foreach ($groups as $id => $groupName){
- $extraGroups = $this->adldap->group()->recursiveGroups($groupName);
- $groups = array_merge($groups, $extraGroups);
- }
- }
-
- return $groups;
- }
-
- /**
- * Find information about the users. Returned in a raw array format from AD
- *
- * @param string $username The username to query
- * @param array $fields Array of parameters to query
- * @param bool $isGUID Is the username passed a GUID or a samAccountName
- * @return array
- */
- public function info($username, $fields = NULL, $isGUID = false)
- {
- if ($username === NULL) { return false; }
- if (!$this->adldap->getLdapBind()) { return false; }
-
- if ($isGUID === true) {
- $username = $this->adldap->utilities()->strGuidToHex($username);
- $filter = "objectguid=" . $username;
- }
- else if (strstr($username, "@")) {
- $filter = "userPrincipalName=" . $username;
- }
- else {
- $filter = "samaccountname=" . $username;
- }
- $filter = "(&(objectCategory=person)({$filter}))";
- if ($fields === NULL) {
- $fields = array("samaccountname","mail","memberof","department","displayname","telephonenumber","primarygroupid","objectsid");
- }
- if (!in_array("objectsid", $fields)) {
- $fields[] = "objectsid";
- }
- $sr = ldap_search($this->adldap->getLdapConnection(), $this->adldap->getBaseDn(), $filter, $fields);
- $entries = ldap_get_entries($this->adldap->getLdapConnection(), $sr);
-
- if (isset($entries[0])) {
- if ($entries[0]['count'] >= 1) {
- if (in_array("memberof", $fields)) {
- // AD does not return the primary group in the ldap query, we may need to fudge it
- if ($this->adldap->getRealPrimaryGroup() && isset($entries[0]["primarygroupid"][0]) && isset($entries[0]["objectsid"][0])){
- //$entries[0]["memberof"][]=$this->group_cn($entries[0]["primarygroupid"][0]);
- $entries[0]["memberof"][] = $this->adldap->group()->getPrimaryGroup($entries[0]["primarygroupid"][0], $entries[0]["objectsid"][0]);
- } else {
- $entries[0]["memberof"][] = "CN=Domain Users,CN=Users," . $this->adldap->getBaseDn();
- }
- if (!isset($entries[0]["memberof"]["count"])) {
- $entries[0]["memberof"]["count"] = 0;
- }
- $entries[0]["memberof"]["count"]++;
- }
- }
-
- return $entries;
- }
- return false;
- }
-
- /**
- * Find information about the users. Returned in a raw array format from AD
- *
- * @param string $username The username to query
- * @param array $fields Array of parameters to query
- * @param bool $isGUID Is the username passed a GUID or a samAccountName
- * @return mixed
- */
- public function infoCollection($username, $fields = NULL, $isGUID = false)
- {
- if ($username === NULL) { return false; }
- if (!$this->adldap->getLdapBind()) { return false; }
-
- $info = $this->info($username, $fields, $isGUID);
-
- if ($info !== false) {
- $collection = new adLDAPUserCollection($info, $this->adldap);
- return $collection;
- }
- return false;
- }
-
- /**
- * Determine if a user is in a specific group
- *
- * @param string $username The username to query
- * @param string $group The name of the group to check against
- * @param bool $recursive Check groups recursively
- * @param bool $isGUID Is the username passed a GUID or a samAccountName
- * @return bool
- */
- public function inGroup($username, $group, $recursive = NULL, $isGUID = false)
- {
- if ($username === NULL) { return false; }
- if ($group === NULL) { return false; }
- if (!$this->adldap->getLdapBind()) { return false; }
- if ($recursive === NULL) { $recursive = $this->adldap->getRecursiveGroups(); } // Use the default option if they haven't set it
-
- // Get a list of the groups
- $groups = $this->groups($username, $recursive, $isGUID);
-
- // Return true if the specified group is in the group list
- if (in_array($group, $groups)) {
- return true;
- }
-
- return false;
- }
-
- /**
- * Determine a user's password expiry date
- *
- * @param string $username The username to query
- * @param book $isGUID Is the username passed a GUID or a samAccountName
- * @requires bcmath http://www.php.net/manual/en/book.bc.php
- * @return array
- */
- public function passwordExpiry($username, $isGUID = false)
- {
- if ($username === NULL) { return "Missing compulsory field [username]"; }
- if (!$this->adldap->getLdapBind()) { return false; }
- if (!function_exists('bcmod')) { throw new adLDAPException("Missing function support [bcmod] http://www.php.net/manual/en/book.bc.php"); };
-
- $userInfo = $this->info($username, array("pwdlastset", "useraccountcontrol"), $isGUID);
- $pwdLastSet = $userInfo[0]['pwdlastset'][0];
- $status = array();
-
- if ($userInfo[0]['useraccountcontrol'][0] == '66048') {
- // Password does not expire
- return "Does not expire";
- }
- if ($pwdLastSet === '0') {
- // Password has already expired
- return "Password has expired";
- }
-
- // Password expiry in AD can be calculated from TWO values:
- // - User's own pwdLastSet attribute: stores the last time the password was changed
- // - Domain's maxPwdAge attribute: how long passwords last in the domain
- //
- // Although Microsoft chose to use a different base and unit for time measurements.
- // This function will convert them to Unix timestamps
- $sr = ldap_read($this->adldap->getLdapConnection(), $this->adldap->getBaseDn(), 'objectclass=*', array('maxPwdAge'));
- if (!$sr) {
- return false;
- }
- $info = ldap_get_entries($this->adldap->getLdapConnection(), $sr);
- $maxPwdAge = $info[0]['maxpwdage'][0];
-
-
- // See MSDN: http://msdn.microsoft.com/en-us/library/ms974598.aspx
- //
- // pwdLastSet contains the number of 100 nanosecond intervals since January 1, 1601 (UTC),
- // stored in a 64 bit integer.
- //
- // The number of seconds between this date and Unix epoch is 11644473600.
- //
- // maxPwdAge is stored as a large integer that represents the number of 100 nanosecond
- // intervals from the time the password was set before the password expires.
- //
- // We also need to scale this to seconds but also this value is a _negative_ quantity!
- //
- // If the low 32 bits of maxPwdAge are equal to 0 passwords do not expire
- //
- // Unfortunately the maths involved are too big for PHP integers, so I've had to require
- // BCMath functions to work with arbitrary precision numbers.
- if (bcmod($maxPwdAge, 4294967296) === '0') {
- return "Domain does not expire passwords";
- }
-
- // Add maxpwdage and pwdlastset and we get password expiration time in Microsoft's
- // time units. Because maxpwd age is negative we need to subtract it.
- $pwdExpire = bcsub($pwdLastSet, $maxPwdAge);
-
- // Convert MS's time to Unix time
- $status['expiryts'] = bcsub(bcdiv($pwdExpire, '10000000'), '11644473600');
- $status['expiryformat'] = date('Y-m-d H:i:s', bcsub(bcdiv($pwdExpire, '10000000'), '11644473600'));
-
- return $status;
- }
-
- /**
- * Modify a user
- *
- * @param string $username The username to query
- * @param array $attributes The attributes to modify. Note if you set the enabled attribute you must not specify any other attributes
- * @param bool $isGUID Is the username passed a GUID or a samAccountName
- * @return bool
- */
- public function modify($username, $attributes, $isGUID = false)
- {
- if ($username === NULL) { return "Missing compulsory field [username]"; }
- if (array_key_exists("password", $attributes) && !$this->adldap->getUseSSL() && !$this->adldap->getUseTLS()) {
- throw new adLDAPException('SSL/TLS must be configured on your webserver and enabled in the class to set passwords.');
- }
-
- // Find the dn of the user
- $userDn = $this->dn($username, $isGUID);
- if ($userDn === false) {
- return false;
- }
-
- // Translate the update to the LDAP schema
- $mod = $this->adldap->adldap_schema($attributes);
-
- // Check to see if this is an enabled status update
- if (!$mod && !array_key_exists("enabled", $attributes)){
- return false;
- }
-
- // Set the account control attribute (only if specified)
- if (array_key_exists("enabled", $attributes)){
- if ($attributes["enabled"]){
- $controlOptions = array("NORMAL_ACCOUNT");
- }
- else {
- $controlOptions = array("NORMAL_ACCOUNT", "ACCOUNTDISABLE");
- }
- $mod["userAccountControl"][0] = $this->accountControl($controlOptions);
- }
-
- // Do the update
- $result = @ldap_modify($this->adldap->getLdapConnection(), $userDn, $mod);
- if ($result == false) {
- return false;
- }
-
- return true;
- }
-
- /**
- * Disable a user account
- *
- * @param string $username The username to disable
- * @param bool $isGUID Is the username passed a GUID or a samAccountName
- * @return bool
- */
- public function disable($username, $isGUID = false)
- {
- if ($username === NULL) { return "Missing compulsory field [username]"; }
- $attributes = array("enabled" => 0);
- $result = $this->modify($username, $attributes, $isGUID);
- if ($result == false) { return false; }
-
- return true;
- }
-
- /**
- * Enable a user account
- *
- * @param string $username The username to enable
- * @param bool $isGUID Is the username passed a GUID or a samAccountName
- * @return bool
- */
- public function enable($username, $isGUID = false)
- {
- if ($username === NULL) { return "Missing compulsory field [username]"; }
- $attributes = array("enabled" => 1);
- $result = $this->modify($username, $attributes, $isGUID);
- if ($result == false) { return false; }
-
- return true;
- }
-
- /**
- * Set the password of a user - This must be performed over SSL
- *
- * @param string $username The username to modify
- * @param string $password The new password
- * @param bool $isGUID Is the username passed a GUID or a samAccountName
- * @return bool
- */
- public function password($username, $password, $isGUID = false)
- {
- if ($username === NULL) { return false; }
- if ($password === NULL) { return false; }
- if (!$this->adldap->getLdapBind()) { return false; }
- if (!$this->adldap->getUseSSL() && !$this->adldap->getUseTLS()) {
- throw new adLDAPException('SSL must be configured on your webserver and enabled in the class to set passwords.');
- }
-
- $userDn = $this->dn($username, $isGUID);
- if ($userDn === false) {
- return false;
- }
-
- $add=array();
- $add["unicodePwd"][0] = $this->encodePassword($password);
-
- $result = @ldap_mod_replace($this->adldap->getLdapConnection(), $userDn, $add);
- if ($result === false){
- $err = ldap_errno($this->adldap->getLdapConnection());
- if ($err) {
- $msg = 'Error ' . $err . ': ' . ldap_err2str($err) . '.';
- if($err == 53) {
- $msg .= ' Your password might not match the password policy.';
- }
- throw new adLDAPException($msg);
- }
- else {
- return false;
- }
- }
-
- return true;
- }
-
- /**
- * Encode a password for transmission over LDAP
- *
- * @param string $password The password to encode
- * @return string
- */
- public function encodePassword($password)
- {
- $password="\"".$password."\"";
- $encoded="";
- for ($i=0; $i <strlen($password); $i++){ $encoded.="{$password{$i}}\000"; }
- return $encoded;
- }
-
- /**
- * Obtain the user's distinguished name based on their userid
- *
- *
- * @param string $username The username
- * @param bool $isGUID Is the username passed a GUID or a samAccountName
- * @return string
- */
- public function dn($username, $isGUID=false)
- {
- $user = $this->info($username, array("cn"), $isGUID);
- if ($user[0]["dn"] === NULL) {
- return false;
- }
- $userDn = $user[0]["dn"];
- return $userDn;
- }
-
- /**
- * Return a list of all users in AD
- *
- * @param bool $includeDescription Return a description of the user
- * @param string $search Search parameter
- * @param bool $sorted Sort the user accounts
- * @return array
- */
- public function all($includeDescription = false, $search = "*", $sorted = true)
- {
- if (!$this->adldap->getLdapBind()) { return false; }
-
- // Perform the search and grab all their details
- $filter = "(&(objectClass=user)(samaccounttype=" . adLDAP::ADLDAP_NORMAL_ACCOUNT .")(objectCategory=person)(cn=" . $search . "))";
- $fields = array("samaccountname","displayname");
- $sr = ldap_search($this->adldap->getLdapConnection(), $this->adldap->getBaseDn(), $filter, $fields);
- $entries = ldap_get_entries($this->adldap->getLdapConnection(), $sr);
-
- $usersArray = array();
- for ($i=0; $i<$entries["count"]; $i++){
- if ($includeDescription && strlen($entries[$i]["displayname"][0])>0){
- $usersArray[$entries[$i]["samaccountname"][0]] = $entries[$i]["displayname"][0];
- } elseif ($includeDescription){
- $usersArray[$entries[$i]["samaccountname"][0]] = $entries[$i]["samaccountname"][0];
- } else {
- array_push($usersArray, $entries[$i]["samaccountname"][0]);
- }
- }
- if ($sorted) {
- asort($usersArray);
- }
- return $usersArray;
- }
-
- /**
- * Converts a username (samAccountName) to a GUID
- *
- * @param string $username The username to query
- * @return string
- */
- public function usernameToGuid($username)
- {
- if (!$this->adldap->getLdapBind()){ return false; }
- if ($username === null){ return "Missing compulsory field [username]"; }
-
- $filter = "samaccountname=" . $username;
- $fields = array("objectGUID");
- $sr = @ldap_search($this->adldap->getLdapConnection(), $this->adldap->getBaseDn(), $filter, $fields);
- if (ldap_count_entries($this->adldap->getLdapConnection(), $sr) > 0) {
- $entry = @ldap_first_entry($this->adldap->getLdapConnection(), $sr);
- $guid = @ldap_get_values_len($this->adldap->getLdapConnection(), $entry, 'objectGUID');
- $strGUID = $this->adldap->utilities()->binaryToText($guid[0]);
- return $strGUID;
- }
- return false;
- }
-
- /**
- * Return a list of all users in AD that have a specific value in a field
- *
- * @param bool $includeDescription Return a description of the user
- * @param string $searchField Field to search search for
- * @param string $searchFilter Value to search for in the specified field
- * @param bool $sorted Sort the user accounts
- * @return array
- */
- public function find($includeDescription = false, $searchField = false, $searchFilter = false, $sorted = true){
- if (!$this->adldap->getLdapBind()){ return false; }
-
- // Perform the search and grab all their details
- $searchParams = "";
- if ($searchField) {
- $searchParams = "(" . $searchField . "=" . $searchFilter . ")";
- }
- $filter = "(&(objectClass=user)(samaccounttype=" . adLDAP::ADLDAP_NORMAL_ACCOUNT .")(objectCategory=person)" . $searchParams . ")";
- $fields = array("samaccountname","displayname");
- $sr = ldap_search($this->adldap->getLdapConnection(), $this->adldap->getBaseDn(), $filter, $fields);
- $entries = ldap_get_entries($this->adldap->getLdapConnection(), $sr);
-
- $usersArray = array();
- for ($i=0; $i < $entries["count"]; $i++) {
- if ($includeDescription && strlen($entries[$i]["displayname"][0]) > 0) {
- $usersArray[$entries[$i]["samaccountname"][0]] = $entries[$i]["displayname"][0];
- }
- else if ($includeDescription) {
- $usersArray[$entries[$i]["samaccountname"][0]] = $entries[$i]["samaccountname"][0];
- }
- else {
- array_push($usersArray, $entries[$i]["samaccountname"][0]);
- }
- }
- if ($sorted){
- asort($usersArray);
- }
- return ($usersArray);
- }
-
- /**
- * Move a user account to a different OU
- *
- * @param string $username The username to move (please be careful here!)
- * @param array $container The container or containers to move the user to (please be careful here!).
- * accepts containers in 1. parent 2. child order
- * @return array
- */
- public function move($username, $container)
- {
- if (!$this->adldap->getLdapBind()) { return false; }
- if ($username === null) { return "Missing compulsory field [username]"; }
- if ($container === null) { return "Missing compulsory field [container]"; }
- if (!is_array($container)) { return "Container must be an array"; }
-
- $userInfo = $this->info($username, array("*"));
- $dn = $userInfo[0]['distinguishedname'][0];
- $newRDn = "cn=" . $username;
- $container = array_reverse($container);
- $newContainer = "ou=" . implode(",ou=",$container);
- $newBaseDn = strtolower($newContainer) . "," . $this->adldap->getBaseDn();
- $result = @ldap_rename($this->adldap->getLdapConnection(), $dn, $newRDn, $newBaseDn, true);
- if ($result !== true) {
- return false;
- }
- return true;
- }
-
- /**
- * Get the last logon time of any user as a Unix timestamp
- *
- * @param string $username
- * @return long $unixTimestamp
- */
- public function getLastLogon($username) {
- if (!$this->adldap->getLdapBind()) { return false; }
- if ($username === null) { return "Missing compulsory field [username]"; }
- $userInfo = $this->info($username, array("lastLogonTimestamp"));
- $lastLogon = adLDAPUtils::convertWindowsTimeToUnixTime($userInfo[0]['lastLogonTimestamp'][0]);
- return $lastLogon;
- }
-
-}
-?>
+<?php
+/**
+ * PHP LDAP CLASS FOR MANIPULATING ACTIVE DIRECTORY
+ * Version 4.0.4
+ *
+ * PHP Version 5 with SSL and LDAP support
+ *
+ * Written by Scott Barnett, Richard Hyland
+ * email: scott@wiggumworld.com, adldap@richardhyland.com
+ * http://adldap.sourceforge.net/
+ *
+ * Copyright (c) 2006-2012 Scott Barnett, Richard Hyland
+ *
+ * We'd appreciate any improvements or additions to be submitted back
+ * to benefit the entire community :)
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * @category ToolsAndUtilities
+ * @package adLDAP
+ * @subpackage User
+ * @author Scott Barnett, Richard Hyland
+ * @copyright (c) 2006-2012 Scott Barnett, Richard Hyland
+ * @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html LGPLv2.1
+ * @revision $Revision: 97 $
+ * @version 4.0.4
+ * @link http://adldap.sourceforge.net/
+ */
+require_once(dirname(__FILE__) . '/../adLDAP.php');
+require_once(dirname(__FILE__) . '/../collections/adLDAPUserCollection.php');
+
+/**
+* USER FUNCTIONS
+*/
+class adLDAPUsers {
+ /**
+ * The current adLDAP connection via dependency injection
+ *
+ * @var adLDAP
+ */
+ protected $adldap;
+
+ public function __construct(adLDAP $adldap) {
+ $this->adldap = $adldap;
+ }
+
+ /**
+ * Validate a user's login credentials
+ *
+ * @param string $username A user's AD username
+ * @param string $password A user's AD password
+ * @param bool optional $prevent_rebind
+ * @return bool
+ */
+ public function authenticate($username, $password, $preventRebind = false) {
+ return $this->adldap->authenticate($username, $password, $preventRebind);
+ }
+
+ /**
+ * Create a user
+ *
+ * If you specify a password here, this can only be performed over SSL
+ *
+ * @param array $attributes The attributes to set to the user account
+ * @return bool
+ */
+ public function create($attributes)
+ {
+ // Check for compulsory fields
+ if (!array_key_exists("username", $attributes)){ return "Missing compulsory field [username]"; }
+ if (!array_key_exists("firstname", $attributes)){ return "Missing compulsory field [firstname]"; }
+ if (!array_key_exists("surname", $attributes)){ return "Missing compulsory field [surname]"; }
+ if (!array_key_exists("email", $attributes)){ return "Missing compulsory field [email]"; }
+ if (!array_key_exists("container", $attributes)){ return "Missing compulsory field [container]"; }
+ if (!is_array($attributes["container"])){ return "Container attribute must be an array."; }
+
+ if (array_key_exists("password",$attributes) && (!$this->adldap->getUseSSL() && !$this->adldap->getUseTLS())){
+ throw new adLDAPException('SSL must be configured on your webserver and enabled in the class to set passwords.');
+ }
+
+ if (!array_key_exists("display_name", $attributes)) {
+ $attributes["display_name"] = $attributes["firstname"] . " " . $attributes["surname"];
+ }
+
+ // Translate the schema
+ $add = $this->adldap->adldap_schema($attributes);
+
+ // Additional stuff only used for adding accounts
+ $add["cn"][0] = $attributes["display_name"];
+ $add["samaccountname"][0] = $attributes["username"];
+ $add["objectclass"][0] = "top";
+ $add["objectclass"][1] = "person";
+ $add["objectclass"][2] = "organizationalPerson";
+ $add["objectclass"][3] = "user"; //person?
+ //$add["name"][0]=$attributes["firstname"]." ".$attributes["surname"];
+
+ // Set the account control attribute
+ $control_options = array("NORMAL_ACCOUNT");
+ if (!$attributes["enabled"]) {
+ $control_options[] = "ACCOUNTDISABLE";
+ }
+ $add["userAccountControl"][0] = $this->accountControl($control_options);
+
+ // Determine the container
+ $attributes["container"] = array_reverse($attributes["container"]);
+ $container = "OU=" . implode(", OU=",$attributes["container"]);
+
+ // Add the entry
+ $result = @ldap_add($this->adldap->getLdapConnection(), "CN=" . $add["cn"][0] . ", " . $container . "," . $this->adldap->getBaseDn(), $add);
+ if ($result != true) {
+ return false;
+ }
+
+ return true;
+ }
+
+ /**
+ * Account control options
+ *
+ * @param array $options The options to convert to int
+ * @return int
+ */
+ protected function accountControl($options)
+ {
+ $val=0;
+
+ if (is_array($options)) {
+ if (in_array("SCRIPT",$options)){ $val=$val+1; }
+ if (in_array("ACCOUNTDISABLE",$options)){ $val=$val+2; }
+ if (in_array("HOMEDIR_REQUIRED",$options)){ $val=$val+8; }
+ if (in_array("LOCKOUT",$options)){ $val=$val+16; }
+ if (in_array("PASSWD_NOTREQD",$options)){ $val=$val+32; }
+ //PASSWD_CANT_CHANGE Note You cannot assign this permission by directly modifying the UserAccountControl attribute.
+ //For information about how to set the permission programmatically, see the "Property flag descriptions" section.
+ if (in_array("ENCRYPTED_TEXT_PWD_ALLOWED",$options)){ $val=$val+128; }
+ if (in_array("TEMP_DUPLICATE_ACCOUNT",$options)){ $val=$val+256; }
+ if (in_array("NORMAL_ACCOUNT",$options)){ $val=$val+512; }
+ if (in_array("INTERDOMAIN_TRUST_ACCOUNT",$options)){ $val=$val+2048; }
+ if (in_array("WORKSTATION_TRUST_ACCOUNT",$options)){ $val=$val+4096; }
+ if (in_array("SERVER_TRUST_ACCOUNT",$options)){ $val=$val+8192; }
+ if (in_array("DONT_EXPIRE_PASSWORD",$options)){ $val=$val+65536; }
+ if (in_array("MNS_LOGON_ACCOUNT",$options)){ $val=$val+131072; }
+ if (in_array("SMARTCARD_REQUIRED",$options)){ $val=$val+262144; }
+ if (in_array("TRUSTED_FOR_DELEGATION",$options)){ $val=$val+524288; }
+ if (in_array("NOT_DELEGATED",$options)){ $val=$val+1048576; }
+ if (in_array("USE_DES_KEY_ONLY",$options)){ $val=$val+2097152; }
+ if (in_array("DONT_REQ_PREAUTH",$options)){ $val=$val+4194304; }
+ if (in_array("PASSWORD_EXPIRED",$options)){ $val=$val+8388608; }
+ if (in_array("TRUSTED_TO_AUTH_FOR_DELEGATION",$options)){ $val=$val+16777216; }
+ }
+ return $val;
+ }
+
+ /**
+ * Delete a user account
+ *
+ * @param string $username The username to delete (please be careful here!)
+ * @param bool $isGUID Is the username a GUID or a samAccountName
+ * @return array
+ */
+ public function delete($username, $isGUID = false)
+ {
+ $userinfo = $this->info($username, array("*"), $isGUID);
+ $dn = $userinfo[0]['distinguishedname'][0];
+ $result = $this->adldap->folder()->delete($dn);
+ if ($result != true) {
+ return false;
+ }
+ return true;
+ }
+
+ /**
+ * Groups the user is a member of
+ *
+ * @param string $username The username to query
+ * @param bool $recursive Recursive list of groups
+ * @param bool $isGUID Is the username passed a GUID or a samAccountName
+ * @return array
+ */
+ public function groups($username, $recursive = NULL, $isGUID = false)
+ {
+ if ($username === NULL) { return false; }
+ if ($recursive === NULL) { $recursive = $this->adldap->getRecursiveGroups(); } // Use the default option if they haven't set it
+ if (!$this->adldap->getLdapBind()) { return false; }
+
+ // Search the directory for their information
+ $info = @$this->info($username, array("memberof", "primarygroupid"), $isGUID);
+ $groups = $this->adldap->utilities()->niceNames($info[0]["memberof"]); // Presuming the entry returned is our guy (unique usernames)
+
+ if ($recursive === true){
+ foreach ($groups as $id => $groupName){
+ $extraGroups = $this->adldap->group()->recursiveGroups($groupName);
+ $groups = array_merge($groups, $extraGroups);
+ }
+ }
+
+ return $groups;
+ }
+
+ /**
+ * Find information about the users. Returned in a raw array format from AD
+ *
+ * @param string $username The username to query
+ * @param array $fields Array of parameters to query
+ * @param bool $isGUID Is the username passed a GUID or a samAccountName
+ * @return array
+ */
+ public function info($username, $fields = NULL, $isGUID = false)
+ {
+ if ($username === NULL) { return false; }
+ if (!$this->adldap->getLdapBind()) { return false; }
+
+ if ($isGUID === true) {
+ $username = $this->adldap->utilities()->strGuidToHex($username);
+ $filter = "objectguid=" . $username;
+ }
+ else if (strstr($username, "@")) {
+ $filter = "userPrincipalName=" . $username;
+ }
+ else {
+ $filter = "samaccountname=" . $username;
+ }
+ $filter = "(&(objectCategory=person)({$filter}))";
+ if ($fields === NULL) {
+ $fields = array("samaccountname","mail","memberof","department","displayname","telephonenumber","primarygroupid","objectsid");
+ }
+ if (!in_array("objectsid", $fields)) {
+ $fields[] = "objectsid";
+ }
+ $sr = ldap_search($this->adldap->getLdapConnection(), $this->adldap->getBaseDn(), $filter, $fields);
+ $entries = ldap_get_entries($this->adldap->getLdapConnection(), $sr);
+
+ if (isset($entries[0])) {
+ if ($entries[0]['count'] >= 1) {
+ if (in_array("memberof", $fields)) {
+ // AD does not return the primary group in the ldap query, we may need to fudge it
+ if ($this->adldap->getRealPrimaryGroup() && isset($entries[0]["primarygroupid"][0]) && isset($entries[0]["objectsid"][0])){
+ //$entries[0]["memberof"][]=$this->group_cn($entries[0]["primarygroupid"][0]);
+ $entries[0]["memberof"][] = $this->adldap->group()->getPrimaryGroup($entries[0]["primarygroupid"][0], $entries[0]["objectsid"][0]);
+ } else {
+ $entries[0]["memberof"][] = "CN=Domain Users,CN=Users," . $this->adldap->getBaseDn();
+ }
+ if (!isset($entries[0]["memberof"]["count"])) {
+ $entries[0]["memberof"]["count"] = 0;
+ }
+ $entries[0]["memberof"]["count"]++;
+ }
+ }
+
+ return $entries;
+ }
+ return false;
+ }
+
+ /**
+ * Find information about the users. Returned in a raw array format from AD
+ *
+ * @param string $username The username to query
+ * @param array $fields Array of parameters to query
+ * @param bool $isGUID Is the username passed a GUID or a samAccountName
+ * @return mixed
+ */
+ public function infoCollection($username, $fields = NULL, $isGUID = false)
+ {
+ if ($username === NULL) { return false; }
+ if (!$this->adldap->getLdapBind()) { return false; }
+
+ $info = $this->info($username, $fields, $isGUID);
+
+ if ($info !== false) {
+ $collection = new adLDAPUserCollection($info, $this->adldap);
+ return $collection;
+ }
+ return false;
+ }
+
+ /**
+ * Determine if a user is in a specific group
+ *
+ * @param string $username The username to query
+ * @param string $group The name of the group to check against
+ * @param bool $recursive Check groups recursively
+ * @param bool $isGUID Is the username passed a GUID or a samAccountName
+ * @return bool
+ */
+ public function inGroup($username, $group, $recursive = NULL, $isGUID = false)
+ {
+ if ($username === NULL) { return false; }
+ if ($group === NULL) { return false; }
+ if (!$this->adldap->getLdapBind()) { return false; }
+ if ($recursive === NULL) { $recursive = $this->adldap->getRecursiveGroups(); } // Use the default option if they haven't set it
+
+ // Get a list of the groups
+ $groups = $this->groups($username, $recursive, $isGUID);
+
+ // Return true if the specified group is in the group list
+ if (in_array($group, $groups)) {
+ return true;
+ }
+
+ return false;
+ }
+
+ /**
+ * Determine a user's password expiry date
+ *
+ * @param string $username The username to query
+ * @param book $isGUID Is the username passed a GUID or a samAccountName
+ * @requires bcmath http://www.php.net/manual/en/book.bc.php
+ * @return array
+ */
+ public function passwordExpiry($username, $isGUID = false)
+ {
+ if ($username === NULL) { return "Missing compulsory field [username]"; }
+ if (!$this->adldap->getLdapBind()) { return false; }
+ if (!function_exists('bcmod')) { throw new adLDAPException("Missing function support [bcmod] http://www.php.net/manual/en/book.bc.php"); };
+
+ $userInfo = $this->info($username, array("pwdlastset", "useraccountcontrol"), $isGUID);
+ $pwdLastSet = $userInfo[0]['pwdlastset'][0];
+ $status = array();
+
+ if ($userInfo[0]['useraccountcontrol'][0] == '66048') {
+ // Password does not expire
+ return "Does not expire";
+ }
+ if ($pwdLastSet === '0') {
+ // Password has already expired
+ return "Password has expired";
+ }
+
+ // Password expiry in AD can be calculated from TWO values:
+ // - User's own pwdLastSet attribute: stores the last time the password was changed
+ // - Domain's maxPwdAge attribute: how long passwords last in the domain
+ //
+ // Although Microsoft chose to use a different base and unit for time measurements.
+ // This function will convert them to Unix timestamps
+ $sr = ldap_read($this->adldap->getLdapConnection(), $this->adldap->getBaseDn(), 'objectclass=*', array('maxPwdAge'));
+ if (!$sr) {
+ return false;
+ }
+ $info = ldap_get_entries($this->adldap->getLdapConnection(), $sr);
+ $maxPwdAge = $info[0]['maxpwdage'][0];
+
+
+ // See MSDN: http://msdn.microsoft.com/en-us/library/ms974598.aspx
+ //
+ // pwdLastSet contains the number of 100 nanosecond intervals since January 1, 1601 (UTC),
+ // stored in a 64 bit integer.
+ //
+ // The number of seconds between this date and Unix epoch is 11644473600.
+ //
+ // maxPwdAge is stored as a large integer that represents the number of 100 nanosecond
+ // intervals from the time the password was set before the password expires.
+ //
+ // We also need to scale this to seconds but also this value is a _negative_ quantity!
+ //
+ // If the low 32 bits of maxPwdAge are equal to 0 passwords do not expire
+ //
+ // Unfortunately the maths involved are too big for PHP integers, so I've had to require
+ // BCMath functions to work with arbitrary precision numbers.
+ if (bcmod($maxPwdAge, 4294967296) === '0') {
+ return "Domain does not expire passwords";
+ }
+
+ // Add maxpwdage and pwdlastset and we get password expiration time in Microsoft's
+ // time units. Because maxpwd age is negative we need to subtract it.
+ $pwdExpire = bcsub($pwdLastSet, $maxPwdAge);
+
+ // Convert MS's time to Unix time
+ $status['expiryts'] = bcsub(bcdiv($pwdExpire, '10000000'), '11644473600');
+ $status['expiryformat'] = date('Y-m-d H:i:s', bcsub(bcdiv($pwdExpire, '10000000'), '11644473600'));
+
+ return $status;
+ }
+
+ /**
+ * Modify a user
+ *
+ * @param string $username The username to query
+ * @param array $attributes The attributes to modify. Note if you set the enabled attribute you must not specify any other attributes
+ * @param bool $isGUID Is the username passed a GUID or a samAccountName
+ * @return bool
+ */
+ public function modify($username, $attributes, $isGUID = false)
+ {
+ if ($username === NULL) { return "Missing compulsory field [username]"; }
+ if (array_key_exists("password", $attributes) && !$this->adldap->getUseSSL() && !$this->adldap->getUseTLS()) {
+ throw new adLDAPException('SSL/TLS must be configured on your webserver and enabled in the class to set passwords.');
+ }
+
+ // Find the dn of the user
+ $userDn = $this->dn($username, $isGUID);
+ if ($userDn === false) {
+ return false;
+ }
+
+ // Translate the update to the LDAP schema
+ $mod = $this->adldap->adldap_schema($attributes);
+
+ // Check to see if this is an enabled status update
+ if (!$mod && !array_key_exists("enabled", $attributes)){
+ return false;
+ }
+
+ // Set the account control attribute (only if specified)
+ if (array_key_exists("enabled", $attributes)){
+ if ($attributes["enabled"]){
+ $controlOptions = array("NORMAL_ACCOUNT");
+ }
+ else {
+ $controlOptions = array("NORMAL_ACCOUNT", "ACCOUNTDISABLE");
+ }
+ $mod["userAccountControl"][0] = $this->accountControl($controlOptions);
+ }
+
+ // Do the update
+ $result = @ldap_modify($this->adldap->getLdapConnection(), $userDn, $mod);
+ if ($result == false) {
+ return false;
+ }
+
+ return true;
+ }
+
+ /**
+ * Disable a user account
+ *
+ * @param string $username The username to disable
+ * @param bool $isGUID Is the username passed a GUID or a samAccountName
+ * @return bool
+ */
+ public function disable($username, $isGUID = false)
+ {
+ if ($username === NULL) { return "Missing compulsory field [username]"; }
+ $attributes = array("enabled" => 0);
+ $result = $this->modify($username, $attributes, $isGUID);
+ if ($result == false) { return false; }
+
+ return true;
+ }
+
+ /**
+ * Enable a user account
+ *
+ * @param string $username The username to enable
+ * @param bool $isGUID Is the username passed a GUID or a samAccountName
+ * @return bool
+ */
+ public function enable($username, $isGUID = false)
+ {
+ if ($username === NULL) { return "Missing compulsory field [username]"; }
+ $attributes = array("enabled" => 1);
+ $result = $this->modify($username, $attributes, $isGUID);
+ if ($result == false) { return false; }
+
+ return true;
+ }
+
+ /**
+ * Set the password of a user - This must be performed over SSL
+ *
+ * @param string $username The username to modify
+ * @param string $password The new password
+ * @param bool $isGUID Is the username passed a GUID or a samAccountName
+ * @return bool
+ */
+ public function password($username, $password, $isGUID = false)
+ {
+ if ($username === NULL) { return false; }
+ if ($password === NULL) { return false; }
+ if (!$this->adldap->getLdapBind()) { return false; }
+ if (!$this->adldap->getUseSSL() && !$this->adldap->getUseTLS()) {
+ throw new adLDAPException('SSL must be configured on your webserver and enabled in the class to set passwords.');
+ }
+
+ $userDn = $this->dn($username, $isGUID);
+ if ($userDn === false) {
+ return false;
+ }
+
+ $add=array();
+ $add["unicodePwd"][0] = $this->encodePassword($password);
+
+ $result = @ldap_mod_replace($this->adldap->getLdapConnection(), $userDn, $add);
+ if ($result === false){
+ $err = ldap_errno($this->adldap->getLdapConnection());
+ if ($err) {
+ $msg = 'Error ' . $err . ': ' . ldap_err2str($err) . '.';
+ if($err == 53) {
+ $msg .= ' Your password might not match the password policy.';
+ }
+ throw new adLDAPException($msg);
+ }
+ else {
+ return false;
+ }
+ }
+
+ return true;
+ }
+
+ /**
+ * Encode a password for transmission over LDAP
+ *
+ * @param string $password The password to encode
+ * @return string
+ */
+ public function encodePassword($password)
+ {
+ $password="\"".$password."\"";
+ $encoded="";
+ for ($i=0; $i <strlen($password); $i++){ $encoded.="{$password{$i}}\000"; }
+ return $encoded;
+ }
+
+ /**
+ * Obtain the user's distinguished name based on their userid
+ *
+ *
+ * @param string $username The username
+ * @param bool $isGUID Is the username passed a GUID or a samAccountName
+ * @return string
+ */
+ public function dn($username, $isGUID=false)
+ {
+ $user = $this->info($username, array("cn"), $isGUID);
+ if ($user[0]["dn"] === NULL) {
+ return false;
+ }
+ $userDn = $user[0]["dn"];
+ return $userDn;
+ }
+
+ /**
+ * Return a list of all users in AD
+ *
+ * @param bool $includeDescription Return a description of the user
+ * @param string $search Search parameter
+ * @param bool $sorted Sort the user accounts
+ * @return array
+ */
+ public function all($includeDescription = false, $search = "*", $sorted = true)
+ {
+ if (!$this->adldap->getLdapBind()) { return false; }
+
+ // Perform the search and grab all their details
+ $filter = "(&(objectClass=user)(samaccounttype=" . adLDAP::ADLDAP_NORMAL_ACCOUNT .")(objectCategory=person)(cn=" . $search . "))";
+ $fields = array("samaccountname","displayname");
+ $sr = ldap_search($this->adldap->getLdapConnection(), $this->adldap->getBaseDn(), $filter, $fields);
+ $entries = ldap_get_entries($this->adldap->getLdapConnection(), $sr);
+
+ $usersArray = array();
+ for ($i=0; $i<$entries["count"]; $i++){
+ if ($includeDescription && strlen($entries[$i]["displayname"][0])>0){
+ $usersArray[$entries[$i]["samaccountname"][0]] = $entries[$i]["displayname"][0];
+ } elseif ($includeDescription){
+ $usersArray[$entries[$i]["samaccountname"][0]] = $entries[$i]["samaccountname"][0];
+ } else {
+ array_push($usersArray, $entries[$i]["samaccountname"][0]);
+ }
+ }
+ if ($sorted) {
+ asort($usersArray);
+ }
+ return $usersArray;
+ }
+
+ /**
+ * Converts a username (samAccountName) to a GUID
+ *
+ * @param string $username The username to query
+ * @return string
+ */
+ public function usernameToGuid($username)
+ {
+ if (!$this->adldap->getLdapBind()){ return false; }
+ if ($username === null){ return "Missing compulsory field [username]"; }
+
+ $filter = "samaccountname=" . $username;
+ $fields = array("objectGUID");
+ $sr = @ldap_search($this->adldap->getLdapConnection(), $this->adldap->getBaseDn(), $filter, $fields);
+ if (ldap_count_entries($this->adldap->getLdapConnection(), $sr) > 0) {
+ $entry = @ldap_first_entry($this->adldap->getLdapConnection(), $sr);
+ $guid = @ldap_get_values_len($this->adldap->getLdapConnection(), $entry, 'objectGUID');
+ $strGUID = $this->adldap->utilities()->binaryToText($guid[0]);
+ return $strGUID;
+ }
+ return false;
+ }
+
+ /**
+ * Return a list of all users in AD that have a specific value in a field
+ *
+ * @param bool $includeDescription Return a description of the user
+ * @param string $searchField Field to search search for
+ * @param string $searchFilter Value to search for in the specified field
+ * @param bool $sorted Sort the user accounts
+ * @return array
+ */
+ public function find($includeDescription = false, $searchField = false, $searchFilter = false, $sorted = true){
+ if (!$this->adldap->getLdapBind()){ return false; }
+
+ // Perform the search and grab all their details
+ $searchParams = "";
+ if ($searchField) {
+ $searchParams = "(" . $searchField . "=" . $searchFilter . ")";
+ }
+ $filter = "(&(objectClass=user)(samaccounttype=" . adLDAP::ADLDAP_NORMAL_ACCOUNT .")(objectCategory=person)" . $searchParams . ")";
+ $fields = array("samaccountname","displayname");
+ $sr = ldap_search($this->adldap->getLdapConnection(), $this->adldap->getBaseDn(), $filter, $fields);
+ $entries = ldap_get_entries($this->adldap->getLdapConnection(), $sr);
+
+ $usersArray = array();
+ for ($i=0; $i < $entries["count"]; $i++) {
+ if ($includeDescription && strlen($entries[$i]["displayname"][0]) > 0) {
+ $usersArray[$entries[$i]["samaccountname"][0]] = $entries[$i]["displayname"][0];
+ }
+ else if ($includeDescription) {
+ $usersArray[$entries[$i]["samaccountname"][0]] = $entries[$i]["samaccountname"][0];
+ }
+ else {
+ array_push($usersArray, $entries[$i]["samaccountname"][0]);
+ }
+ }
+ if ($sorted){
+ asort($usersArray);
+ }
+ return ($usersArray);
+ }
+
+ /**
+ * Move a user account to a different OU
+ *
+ * @param string $username The username to move (please be careful here!)
+ * @param array $container The container or containers to move the user to (please be careful here!).
+ * accepts containers in 1. parent 2. child order
+ * @return array
+ */
+ public function move($username, $container)
+ {
+ if (!$this->adldap->getLdapBind()) { return false; }
+ if ($username === null) { return "Missing compulsory field [username]"; }
+ if ($container === null) { return "Missing compulsory field [container]"; }
+ if (!is_array($container)) { return "Container must be an array"; }
+
+ $userInfo = $this->info($username, array("*"));
+ $dn = $userInfo[0]['distinguishedname'][0];
+ $newRDn = "cn=" . $username;
+ $container = array_reverse($container);
+ $newContainer = "ou=" . implode(",ou=",$container);
+ $newBaseDn = strtolower($newContainer) . "," . $this->adldap->getBaseDn();
+ $result = @ldap_rename($this->adldap->getLdapConnection(), $dn, $newRDn, $newBaseDn, true);
+ if ($result !== true) {
+ return false;
+ }
+ return true;
+ }
+
+ /**
+ * Get the last logon time of any user as a Unix timestamp
+ *
+ * @param string $username
+ * @return long $unixTimestamp
+ */
+ public function getLastLogon($username) {
+ if (!$this->adldap->getLdapBind()) { return false; }
+ if ($username === null) { return "Missing compulsory field [username]"; }
+ $userInfo = $this->info($username, array("lastLogonTimestamp"));
+ $lastLogon = adLDAPUtils::convertWindowsTimeToUnixTime($userInfo[0]['lastLogonTimestamp'][0]);
+ return $lastLogon;
+ }
+
+}
+?>
diff --git a/lib/plugins/authad/adLDAP/classes/adLDAPUtils.php b/lib/plugins/authad/adLDAP/classes/adLDAPUtils.php
index f039a4290..5e8644188 100644
--- a/lib/plugins/authad/adLDAP/classes/adLDAPUtils.php
+++ b/lib/plugins/authad/adLDAP/classes/adLDAPUtils.php
@@ -1,264 +1,264 @@
-<?php
-/**
- * PHP LDAP CLASS FOR MANIPULATING ACTIVE DIRECTORY
- * Version 4.0.4
- *
- * PHP Version 5 with SSL and LDAP support
- *
- * Written by Scott Barnett, Richard Hyland
- * email: scott@wiggumworld.com, adldap@richardhyland.com
- * http://adldap.sourceforge.net/
- *
- * Copyright (c) 2006-2012 Scott Barnett, Richard Hyland
- *
- * We'd appreciate any improvements or additions to be submitted back
- * to benefit the entire community :)
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * @category ToolsAndUtilities
- * @package adLDAP
- * @subpackage Utils
- * @author Scott Barnett, Richard Hyland
- * @copyright (c) 2006-2012 Scott Barnett, Richard Hyland
- * @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html LGPLv2.1
- * @revision $Revision: 97 $
- * @version 4.0.4
- * @link http://adldap.sourceforge.net/
- */
-require_once(dirname(__FILE__) . '/../adLDAP.php');
-
-/**
-* UTILITY FUNCTIONS
-*/
-class adLDAPUtils {
- const ADLDAP_VERSION = '4.0.4';
-
- /**
- * The current adLDAP connection via dependency injection
- *
- * @var adLDAP
- */
- protected $adldap;
-
- public function __construct(adLDAP $adldap) {
- $this->adldap = $adldap;
- }
-
-
- /**
- * Take an LDAP query and return the nice names, without all the LDAP prefixes (eg. CN, DN)
- *
- * @param array $groups
- * @return array
- */
- public function niceNames($groups)
- {
-
- $groupArray = array();
- for ($i=0; $i<$groups["count"]; $i++){ // For each group
- $line = $groups[$i];
-
- if (strlen($line)>0) {
- // More presumptions, they're all prefixed with CN=
- // so we ditch the first three characters and the group
- // name goes up to the first comma
- $bits=explode(",", $line);
- $groupArray[] = substr($bits[0], 3, (strlen($bits[0])-3));
- }
- }
- return $groupArray;
- }
-
- /**
- * Escape characters for use in an ldap_create function
- *
- * @param string $str
- * @return string
- */
- public function escapeCharacters($str) {
- $str = str_replace(",", "\,", $str);
- return $str;
- }
-
- /**
- * Escape strings for the use in LDAP filters
- *
- * DEVELOPERS SHOULD BE DOING PROPER FILTERING IF THEY'RE ACCEPTING USER INPUT
- * Ported from Perl's Net::LDAP::Util escape_filter_value
- *
- * @param string $str The string the parse
- * @author Port by Andreas Gohr <andi@splitbrain.org>
- * @return string
- */
- public function ldapSlashes($str){
- return preg_replace('/([\x00-\x1F\*\(\)\\\\])/e',
- '"\\\\\".join("",unpack("H2","$1"))',
- $str);
- }
-
- /**
- * Converts a string GUID to a hexdecimal value so it can be queried
- *
- * @param string $strGUID A string representation of a GUID
- * @return string
- */
- public function strGuidToHex($strGUID)
- {
- $strGUID = str_replace('-', '', $strGUID);
-
- $octet_str = '\\' . substr($strGUID, 6, 2);
- $octet_str .= '\\' . substr($strGUID, 4, 2);
- $octet_str .= '\\' . substr($strGUID, 2, 2);
- $octet_str .= '\\' . substr($strGUID, 0, 2);
- $octet_str .= '\\' . substr($strGUID, 10, 2);
- $octet_str .= '\\' . substr($strGUID, 8, 2);
- $octet_str .= '\\' . substr($strGUID, 14, 2);
- $octet_str .= '\\' . substr($strGUID, 12, 2);
- //$octet_str .= '\\' . substr($strGUID, 16, strlen($strGUID));
- for ($i=16; $i<=(strlen($strGUID)-2); $i++) {
- if (($i % 2) == 0) {
- $octet_str .= '\\' . substr($strGUID, $i, 2);
- }
- }
-
- return $octet_str;
- }
-
- /**
- * Convert a binary SID to a text SID
- *
- * @param string $binsid A Binary SID
- * @return string
- */
- public function getTextSID($binsid) {
- $hex_sid = bin2hex($binsid);
- $rev = hexdec(substr($hex_sid, 0, 2));
- $subcount = hexdec(substr($hex_sid, 2, 2));
- $auth = hexdec(substr($hex_sid, 4, 12));
- $result = "$rev-$auth";
-
- for ($x=0;$x < $subcount; $x++) {
- $subauth[$x] =
- hexdec($this->littleEndian(substr($hex_sid, 16 + ($x * 8), 8)));
- $result .= "-" . $subauth[$x];
- }
-
- // Cheat by tacking on the S-
- return 'S-' . $result;
- }
-
- /**
- * Converts a little-endian hex number to one that hexdec() can convert
- *
- * @param string $hex A hex code
- * @return string
- */
- public function littleEndian($hex)
- {
- $result = '';
- for ($x = strlen($hex) - 2; $x >= 0; $x = $x - 2) {
- $result .= substr($hex, $x, 2);
- }
- return $result;
- }
-
- /**
- * Converts a binary attribute to a string
- *
- * @param string $bin A binary LDAP attribute
- * @return string
- */
- public function binaryToText($bin)
- {
- $hex_guid = bin2hex($bin);
- $hex_guid_to_guid_str = '';
- for($k = 1; $k <= 4; ++$k) {
- $hex_guid_to_guid_str .= substr($hex_guid, 8 - 2 * $k, 2);
- }
- $hex_guid_to_guid_str .= '-';
- for($k = 1; $k <= 2; ++$k) {
- $hex_guid_to_guid_str .= substr($hex_guid, 12 - 2 * $k, 2);
- }
- $hex_guid_to_guid_str .= '-';
- for($k = 1; $k <= 2; ++$k) {
- $hex_guid_to_guid_str .= substr($hex_guid, 16 - 2 * $k, 2);
- }
- $hex_guid_to_guid_str .= '-' . substr($hex_guid, 16, 4);
- $hex_guid_to_guid_str .= '-' . substr($hex_guid, 20);
- return strtoupper($hex_guid_to_guid_str);
- }
-
- /**
- * Converts a binary GUID to a string GUID
- *
- * @param string $binaryGuid The binary GUID attribute to convert
- * @return string
- */
- public function decodeGuid($binaryGuid)
- {
- if ($binaryGuid === null){ return "Missing compulsory field [binaryGuid]"; }
-
- $strGUID = $this->binaryToText($binaryGuid);
- return $strGUID;
- }
-
- /**
- * Convert a boolean value to a string
- * You should never need to call this yourself
- *
- * @param bool $bool Boolean value
- * @return string
- */
- public function boolToStr($bool)
- {
- return ($bool) ? 'TRUE' : 'FALSE';
- }
-
- /**
- * Convert 8bit characters e.g. accented characters to UTF8 encoded characters
- */
- public function encode8Bit(&$item, $key) {
- $encode = false;
- if (is_string($item)) {
- for ($i=0; $i<strlen($item); $i++) {
- if (ord($item[$i]) >> 7) {
- $encode = true;
- }
- }
- }
- if ($encode === true && $key != 'password') {
- $item = utf8_encode($item);
- }
- }
-
- /**
- * Get the current class version number
- *
- * @return string
- */
- public function getVersion() {
- return self::ADLDAP_VERSION;
- }
-
- /**
- * Round a Windows timestamp down to seconds and remove the seconds between 1601-01-01 and 1970-01-01
- *
- * @param long $windowsTime
- * @return long $unixTime
- */
- public static function convertWindowsTimeToUnixTime($windowsTime) {
- $unixTime = round($windowsTime / 10000000) - 11644477200;
- return $unixTime;
- }
-}
-
+<?php
+/**
+ * PHP LDAP CLASS FOR MANIPULATING ACTIVE DIRECTORY
+ * Version 4.0.4
+ *
+ * PHP Version 5 with SSL and LDAP support
+ *
+ * Written by Scott Barnett, Richard Hyland
+ * email: scott@wiggumworld.com, adldap@richardhyland.com
+ * http://adldap.sourceforge.net/
+ *
+ * Copyright (c) 2006-2012 Scott Barnett, Richard Hyland
+ *
+ * We'd appreciate any improvements or additions to be submitted back
+ * to benefit the entire community :)
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * @category ToolsAndUtilities
+ * @package adLDAP
+ * @subpackage Utils
+ * @author Scott Barnett, Richard Hyland
+ * @copyright (c) 2006-2012 Scott Barnett, Richard Hyland
+ * @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html LGPLv2.1
+ * @revision $Revision: 97 $
+ * @version 4.0.4
+ * @link http://adldap.sourceforge.net/
+ */
+require_once(dirname(__FILE__) . '/../adLDAP.php');
+
+/**
+* UTILITY FUNCTIONS
+*/
+class adLDAPUtils {
+ const ADLDAP_VERSION = '4.0.4';
+
+ /**
+ * The current adLDAP connection via dependency injection
+ *
+ * @var adLDAP
+ */
+ protected $adldap;
+
+ public function __construct(adLDAP $adldap) {
+ $this->adldap = $adldap;
+ }
+
+
+ /**
+ * Take an LDAP query and return the nice names, without all the LDAP prefixes (eg. CN, DN)
+ *
+ * @param array $groups
+ * @return array
+ */
+ public function niceNames($groups)
+ {
+
+ $groupArray = array();
+ for ($i=0; $i<$groups["count"]; $i++){ // For each group
+ $line = $groups[$i];
+
+ if (strlen($line)>0) {
+ // More presumptions, they're all prefixed with CN=
+ // so we ditch the first three characters and the group
+ // name goes up to the first comma
+ $bits=explode(",", $line);
+ $groupArray[] = substr($bits[0], 3, (strlen($bits[0])-3));
+ }
+ }
+ return $groupArray;
+ }
+
+ /**
+ * Escape characters for use in an ldap_create function
+ *
+ * @param string $str
+ * @return string
+ */
+ public function escapeCharacters($str) {
+ $str = str_replace(",", "\,", $str);
+ return $str;
+ }
+
+ /**
+ * Escape strings for the use in LDAP filters
+ *
+ * DEVELOPERS SHOULD BE DOING PROPER FILTERING IF THEY'RE ACCEPTING USER INPUT
+ * Ported from Perl's Net::LDAP::Util escape_filter_value
+ *
+ * @param string $str The string the parse
+ * @author Port by Andreas Gohr <andi@splitbrain.org>
+ * @return string
+ */
+ public function ldapSlashes($str){
+ return preg_replace('/([\x00-\x1F\*\(\)\\\\])/e',
+ '"\\\\\".join("",unpack("H2","$1"))',
+ $str);
+ }
+
+ /**
+ * Converts a string GUID to a hexdecimal value so it can be queried
+ *
+ * @param string $strGUID A string representation of a GUID
+ * @return string
+ */
+ public function strGuidToHex($strGUID)
+ {
+ $strGUID = str_replace('-', '', $strGUID);
+
+ $octet_str = '\\' . substr($strGUID, 6, 2);
+ $octet_str .= '\\' . substr($strGUID, 4, 2);
+ $octet_str .= '\\' . substr($strGUID, 2, 2);
+ $octet_str .= '\\' . substr($strGUID, 0, 2);
+ $octet_str .= '\\' . substr($strGUID, 10, 2);
+ $octet_str .= '\\' . substr($strGUID, 8, 2);
+ $octet_str .= '\\' . substr($strGUID, 14, 2);
+ $octet_str .= '\\' . substr($strGUID, 12, 2);
+ //$octet_str .= '\\' . substr($strGUID, 16, strlen($strGUID));
+ for ($i=16; $i<=(strlen($strGUID)-2); $i++) {
+ if (($i % 2) == 0) {
+ $octet_str .= '\\' . substr($strGUID, $i, 2);
+ }
+ }
+
+ return $octet_str;
+ }
+
+ /**
+ * Convert a binary SID to a text SID
+ *
+ * @param string $binsid A Binary SID
+ * @return string
+ */
+ public function getTextSID($binsid) {
+ $hex_sid = bin2hex($binsid);
+ $rev = hexdec(substr($hex_sid, 0, 2));
+ $subcount = hexdec(substr($hex_sid, 2, 2));
+ $auth = hexdec(substr($hex_sid, 4, 12));
+ $result = "$rev-$auth";
+
+ for ($x=0;$x < $subcount; $x++) {
+ $subauth[$x] =
+ hexdec($this->littleEndian(substr($hex_sid, 16 + ($x * 8), 8)));
+ $result .= "-" . $subauth[$x];
+ }
+
+ // Cheat by tacking on the S-
+ return 'S-' . $result;
+ }
+
+ /**
+ * Converts a little-endian hex number to one that hexdec() can convert
+ *
+ * @param string $hex A hex code
+ * @return string
+ */
+ public function littleEndian($hex)
+ {
+ $result = '';
+ for ($x = strlen($hex) - 2; $x >= 0; $x = $x - 2) {
+ $result .= substr($hex, $x, 2);
+ }
+ return $result;
+ }
+
+ /**
+ * Converts a binary attribute to a string
+ *
+ * @param string $bin A binary LDAP attribute
+ * @return string
+ */
+ public function binaryToText($bin)
+ {
+ $hex_guid = bin2hex($bin);
+ $hex_guid_to_guid_str = '';
+ for($k = 1; $k <= 4; ++$k) {
+ $hex_guid_to_guid_str .= substr($hex_guid, 8 - 2 * $k, 2);
+ }
+ $hex_guid_to_guid_str .= '-';
+ for($k = 1; $k <= 2; ++$k) {
+ $hex_guid_to_guid_str .= substr($hex_guid, 12 - 2 * $k, 2);
+ }
+ $hex_guid_to_guid_str .= '-';
+ for($k = 1; $k <= 2; ++$k) {
+ $hex_guid_to_guid_str .= substr($hex_guid, 16 - 2 * $k, 2);
+ }
+ $hex_guid_to_guid_str .= '-' . substr($hex_guid, 16, 4);
+ $hex_guid_to_guid_str .= '-' . substr($hex_guid, 20);
+ return strtoupper($hex_guid_to_guid_str);
+ }
+
+ /**
+ * Converts a binary GUID to a string GUID
+ *
+ * @param string $binaryGuid The binary GUID attribute to convert
+ * @return string
+ */
+ public function decodeGuid($binaryGuid)
+ {
+ if ($binaryGuid === null){ return "Missing compulsory field [binaryGuid]"; }
+
+ $strGUID = $this->binaryToText($binaryGuid);
+ return $strGUID;
+ }
+
+ /**
+ * Convert a boolean value to a string
+ * You should never need to call this yourself
+ *
+ * @param bool $bool Boolean value
+ * @return string
+ */
+ public function boolToStr($bool)
+ {
+ return ($bool) ? 'TRUE' : 'FALSE';
+ }
+
+ /**
+ * Convert 8bit characters e.g. accented characters to UTF8 encoded characters
+ */
+ public function encode8Bit(&$item, $key) {
+ $encode = false;
+ if (is_string($item)) {
+ for ($i=0; $i<strlen($item); $i++) {
+ if (ord($item[$i]) >> 7) {
+ $encode = true;
+ }
+ }
+ }
+ if ($encode === true && $key != 'password') {
+ $item = utf8_encode($item);
+ }
+ }
+
+ /**
+ * Get the current class version number
+ *
+ * @return string
+ */
+ public function getVersion() {
+ return self::ADLDAP_VERSION;
+ }
+
+ /**
+ * Round a Windows timestamp down to seconds and remove the seconds between 1601-01-01 and 1970-01-01
+ *
+ * @param long $windowsTime
+ * @return long $unixTime
+ */
+ public static function convertWindowsTimeToUnixTime($windowsTime) {
+ $unixTime = round($windowsTime / 10000000) - 11644477200;
+ return $unixTime;
+ }
+}
+
?> \ No newline at end of file
diff --git a/lib/plugins/authad/adLDAP/collections/adLDAPCollection.php b/lib/plugins/authad/adLDAP/collections/adLDAPCollection.php
index c0a2eb2fa..433d39f18 100644
--- a/lib/plugins/authad/adLDAP/collections/adLDAPCollection.php
+++ b/lib/plugins/authad/adLDAP/collections/adLDAPCollection.php
@@ -1,137 +1,137 @@
-<?php
-/**
- * PHP LDAP CLASS FOR MANIPULATING ACTIVE DIRECTORY
- * Version 4.0.4
- *
- * PHP Version 5 with SSL and LDAP support
- *
- * Written by Scott Barnett, Richard Hyland
- * email: scott@wiggumworld.com, adldap@richardhyland.com
- * http://adldap.sourceforge.net/
- *
- * Copyright (c) 2006-2012 Scott Barnett, Richard Hyland
- *
- * We'd appreciate any improvements or additions to be submitted back
- * to benefit the entire community :)
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * @category ToolsAndUtilities
- * @package adLDAP
- * @subpackage Collection
- * @author Scott Barnett, Richard Hyland
- * @copyright (c) 2006-2012 Scott Barnett, Richard Hyland
- * @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html LGPLv2.1
- * @revision $Revision: 97 $
- * @version 4.0.4
- * @link http://adldap.sourceforge.net/
-*/
-
-abstract class adLDAPCollection
-{
- /**
- * The current adLDAP connection via dependency injection
- *
- * @var adLDAP
- */
- protected $adldap;
-
- /**
- * The current object being modifed / called
- *
- * @var mixed
- */
- protected $currentObject;
-
- /**
- * The raw info array from Active Directory
- *
- * @var array
- */
- protected $info;
-
- public function __construct($info, adLDAP $adldap)
- {
- $this->setInfo($info);
- $this->adldap = $adldap;
- }
-
- /**
- * Set the raw info array from Active Directory
- *
- * @param array $info
- */
- public function setInfo(array $info)
- {
- if ($this->info && sizeof($info) >= 1) {
- unset($this->info);
- }
- $this->info = $info;
- }
-
- /**
- * Magic get method to retrieve data from the raw array in a formatted way
- *
- * @param string $attribute
- * @return mixed
- */
- public function __get($attribute)
- {
- if (isset($this->info[0]) && is_array($this->info[0])) {
- foreach ($this->info[0] as $keyAttr => $valueAttr) {
- if (strtolower($keyAttr) == strtolower($attribute)) {
- if ($this->info[0][strtolower($attribute)]['count'] == 1) {
- return $this->info[0][strtolower($attribute)][0];
- }
- else {
- $array = array();
- foreach ($this->info[0][strtolower($attribute)] as $key => $value) {
- if ((string)$key != 'count') {
- $array[$key] = $value;
- }
- }
- return $array;
- }
- }
- }
- }
- else {
- return NULL;
- }
- }
-
- /**
- * Magic set method to update an attribute
- *
- * @param string $attribute
- * @param string $value
- * @return bool
- */
- abstract public function __set($attribute, $value);
-
- /**
- * Magic isset method to check for the existence of an attribute
- *
- * @param string $attribute
- * @return bool
- */
- public function __isset($attribute) {
- if (isset($this->info[0]) && is_array($this->info[0])) {
- foreach ($this->info[0] as $keyAttr => $valueAttr) {
- if (strtolower($keyAttr) == strtolower($attribute)) {
- return true;
- }
- }
- }
- return false;
- }
-}
-?>
+<?php
+/**
+ * PHP LDAP CLASS FOR MANIPULATING ACTIVE DIRECTORY
+ * Version 4.0.4
+ *
+ * PHP Version 5 with SSL and LDAP support
+ *
+ * Written by Scott Barnett, Richard Hyland
+ * email: scott@wiggumworld.com, adldap@richardhyland.com
+ * http://adldap.sourceforge.net/
+ *
+ * Copyright (c) 2006-2012 Scott Barnett, Richard Hyland
+ *
+ * We'd appreciate any improvements or additions to be submitted back
+ * to benefit the entire community :)
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * @category ToolsAndUtilities
+ * @package adLDAP
+ * @subpackage Collection
+ * @author Scott Barnett, Richard Hyland
+ * @copyright (c) 2006-2012 Scott Barnett, Richard Hyland
+ * @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html LGPLv2.1
+ * @revision $Revision: 97 $
+ * @version 4.0.4
+ * @link http://adldap.sourceforge.net/
+*/
+
+abstract class adLDAPCollection
+{
+ /**
+ * The current adLDAP connection via dependency injection
+ *
+ * @var adLDAP
+ */
+ protected $adldap;
+
+ /**
+ * The current object being modifed / called
+ *
+ * @var mixed
+ */
+ protected $currentObject;
+
+ /**
+ * The raw info array from Active Directory
+ *
+ * @var array
+ */
+ protected $info;
+
+ public function __construct($info, adLDAP $adldap)
+ {
+ $this->setInfo($info);
+ $this->adldap = $adldap;
+ }
+
+ /**
+ * Set the raw info array from Active Directory
+ *
+ * @param array $info
+ */
+ public function setInfo(array $info)
+ {
+ if ($this->info && sizeof($info) >= 1) {
+ unset($this->info);
+ }
+ $this->info = $info;
+ }
+
+ /**
+ * Magic get method to retrieve data from the raw array in a formatted way
+ *
+ * @param string $attribute
+ * @return mixed
+ */
+ public function __get($attribute)
+ {
+ if (isset($this->info[0]) && is_array($this->info[0])) {
+ foreach ($this->info[0] as $keyAttr => $valueAttr) {
+ if (strtolower($keyAttr) == strtolower($attribute)) {
+ if ($this->info[0][strtolower($attribute)]['count'] == 1) {
+ return $this->info[0][strtolower($attribute)][0];
+ }
+ else {
+ $array = array();
+ foreach ($this->info[0][strtolower($attribute)] as $key => $value) {
+ if ((string)$key != 'count') {
+ $array[$key] = $value;
+ }
+ }
+ return $array;
+ }
+ }
+ }
+ }
+ else {
+ return NULL;
+ }
+ }
+
+ /**
+ * Magic set method to update an attribute
+ *
+ * @param string $attribute
+ * @param string $value
+ * @return bool
+ */
+ abstract public function __set($attribute, $value);
+
+ /**
+ * Magic isset method to check for the existence of an attribute
+ *
+ * @param string $attribute
+ * @return bool
+ */
+ public function __isset($attribute) {
+ if (isset($this->info[0]) && is_array($this->info[0])) {
+ foreach ($this->info[0] as $keyAttr => $valueAttr) {
+ if (strtolower($keyAttr) == strtolower($attribute)) {
+ return true;
+ }
+ }
+ }
+ return false;
+ }
+}
+?>
diff --git a/lib/plugins/authad/adLDAP/collections/adLDAPComputerCollection.php b/lib/plugins/authad/adLDAP/collections/adLDAPComputerCollection.php
index 4f11d8f41..09f82cadc 100644
--- a/lib/plugins/authad/adLDAP/collections/adLDAPComputerCollection.php
+++ b/lib/plugins/authad/adLDAP/collections/adLDAPComputerCollection.php
@@ -1,46 +1,46 @@
-<?php
-/**
- * PHP LDAP CLASS FOR MANIPULATING ACTIVE DIRECTORY
- * Version 4.0.4
- *
- * PHP Version 5 with SSL and LDAP support
- *
- * Written by Scott Barnett, Richard Hyland
- * email: scott@wiggumworld.com, adldap@richardhyland.com
- * http://adldap.sourceforge.net/
- *
- * Copyright (c) 2006-2012 Scott Barnett, Richard Hyland
- *
- * We'd appreciate any improvements or additions to be submitted back
- * to benefit the entire community :)
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * @category ToolsAndUtilities
- * @package adLDAP
- * @subpackage ComputerCollection
- * @author Scott Barnett, Richard Hyland
- * @copyright (c) 2006-2012 Scott Barnett, Richard Hyland
- * @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html LGPLv2.1
- * @revision $Revision: 97 $
- * @version 4.0.4
- * @link http://adldap.sourceforge.net/
-*/
-
-class adLDAPComputerCollection extends adLDAPCollection
-{
-
- public function __set($attribute, $value)
- {
-
- }
-}
-?>
+<?php
+/**
+ * PHP LDAP CLASS FOR MANIPULATING ACTIVE DIRECTORY
+ * Version 4.0.4
+ *
+ * PHP Version 5 with SSL and LDAP support
+ *
+ * Written by Scott Barnett, Richard Hyland
+ * email: scott@wiggumworld.com, adldap@richardhyland.com
+ * http://adldap.sourceforge.net/
+ *
+ * Copyright (c) 2006-2012 Scott Barnett, Richard Hyland
+ *
+ * We'd appreciate any improvements or additions to be submitted back
+ * to benefit the entire community :)
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * @category ToolsAndUtilities
+ * @package adLDAP
+ * @subpackage ComputerCollection
+ * @author Scott Barnett, Richard Hyland
+ * @copyright (c) 2006-2012 Scott Barnett, Richard Hyland
+ * @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html LGPLv2.1
+ * @revision $Revision: 97 $
+ * @version 4.0.4
+ * @link http://adldap.sourceforge.net/
+*/
+
+class adLDAPComputerCollection extends adLDAPCollection
+{
+
+ public function __set($attribute, $value)
+ {
+
+ }
+}
+?>
diff --git a/lib/plugins/authad/adLDAP/collections/adLDAPContactCollection.php b/lib/plugins/authad/adLDAP/collections/adLDAPContactCollection.php
index d42fe6d4c..a9efad5a9 100644
--- a/lib/plugins/authad/adLDAP/collections/adLDAPContactCollection.php
+++ b/lib/plugins/authad/adLDAP/collections/adLDAPContactCollection.php
@@ -1,46 +1,46 @@
-<?php
-/**
- * PHP LDAP CLASS FOR MANIPULATING ACTIVE DIRECTORY
- * Version 4.0.4
- *
- * PHP Version 5 with SSL and LDAP support
- *
- * Written by Scott Barnett, Richard Hyland
- * email: scott@wiggumworld.com, adldap@richardhyland.com
- * http://adldap.sourceforge.net/
- *
- * Copyright (c) 2006-2012 Scott Barnett, Richard Hyland
- *
- * We'd appreciate any improvements or additions to be submitted back
- * to benefit the entire community :)
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * @category ToolsAndUtilities
- * @package adLDAP
- * @subpackage ContactCollection
- * @author Scott Barnett, Richard Hyland
- * @copyright (c) 2006-2012 Scott Barnett, Richard Hyland
- * @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html LGPLv2.1
- * @revision $Revision: 97 $
- * @version 4.0.4
- * @link http://adldap.sourceforge.net/
-*/
-
-class adLDAPContactCollection extends adLDAPCollection
-{
-
- public function __set($attribute, $value)
- {
-
- }
-}
-?>
+<?php
+/**
+ * PHP LDAP CLASS FOR MANIPULATING ACTIVE DIRECTORY
+ * Version 4.0.4
+ *
+ * PHP Version 5 with SSL and LDAP support
+ *
+ * Written by Scott Barnett, Richard Hyland
+ * email: scott@wiggumworld.com, adldap@richardhyland.com
+ * http://adldap.sourceforge.net/
+ *
+ * Copyright (c) 2006-2012 Scott Barnett, Richard Hyland
+ *
+ * We'd appreciate any improvements or additions to be submitted back
+ * to benefit the entire community :)
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * @category ToolsAndUtilities
+ * @package adLDAP
+ * @subpackage ContactCollection
+ * @author Scott Barnett, Richard Hyland
+ * @copyright (c) 2006-2012 Scott Barnett, Richard Hyland
+ * @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html LGPLv2.1
+ * @revision $Revision: 97 $
+ * @version 4.0.4
+ * @link http://adldap.sourceforge.net/
+*/
+
+class adLDAPContactCollection extends adLDAPCollection
+{
+
+ public function __set($attribute, $value)
+ {
+
+ }
+}
+?>
diff --git a/lib/plugins/authad/adLDAP/collections/adLDAPGroupCollection.php b/lib/plugins/authad/adLDAP/collections/adLDAPGroupCollection.php
index cff12fc20..ef4af8df2 100644
--- a/lib/plugins/authad/adLDAP/collections/adLDAPGroupCollection.php
+++ b/lib/plugins/authad/adLDAP/collections/adLDAPGroupCollection.php
@@ -1,46 +1,46 @@
-<?php
-/**
- * PHP LDAP CLASS FOR MANIPULATING ACTIVE DIRECTORY
- * Version 4.0.4
- *
- * PHP Version 5 with SSL and LDAP support
- *
- * Written by Scott Barnett, Richard Hyland
- * email: scott@wiggumworld.com, adldap@richardhyland.com
- * http://adldap.sourceforge.net/
- *
- * Copyright (c) 2006-2012 Scott Barnett, Richard Hyland
- *
- * We'd appreciate any improvements or additions to be submitted back
- * to benefit the entire community :)
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * @category ToolsAndUtilities
- * @package adLDAP
- * @subpackage GroupCollection
- * @author Scott Barnett, Richard Hyland
- * @copyright (c) 2006-2012 Scott Barnett, Richard Hyland
- * @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html LGPLv2.1
- * @revision $Revision: 97 $
- * @version 4.0.4
- * @link http://adldap.sourceforge.net/
-*/
-
-class adLDAPGroupCollection extends adLDAPCollection
-{
-
- public function __set($attribute, $value)
- {
-
- }
-}
-?>
+<?php
+/**
+ * PHP LDAP CLASS FOR MANIPULATING ACTIVE DIRECTORY
+ * Version 4.0.4
+ *
+ * PHP Version 5 with SSL and LDAP support
+ *
+ * Written by Scott Barnett, Richard Hyland
+ * email: scott@wiggumworld.com, adldap@richardhyland.com
+ * http://adldap.sourceforge.net/
+ *
+ * Copyright (c) 2006-2012 Scott Barnett, Richard Hyland
+ *
+ * We'd appreciate any improvements or additions to be submitted back
+ * to benefit the entire community :)
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * @category ToolsAndUtilities
+ * @package adLDAP
+ * @subpackage GroupCollection
+ * @author Scott Barnett, Richard Hyland
+ * @copyright (c) 2006-2012 Scott Barnett, Richard Hyland
+ * @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html LGPLv2.1
+ * @revision $Revision: 97 $
+ * @version 4.0.4
+ * @link http://adldap.sourceforge.net/
+*/
+
+class adLDAPGroupCollection extends adLDAPCollection
+{
+
+ public function __set($attribute, $value)
+ {
+
+ }
+}
+?>
diff --git a/lib/plugins/authad/adLDAP/collections/adLDAPUserCollection.php b/lib/plugins/authad/adLDAP/collections/adLDAPUserCollection.php
index 801d90296..63fce5f96 100644
--- a/lib/plugins/authad/adLDAP/collections/adLDAPUserCollection.php
+++ b/lib/plugins/authad/adLDAP/collections/adLDAPUserCollection.php
@@ -1,46 +1,46 @@
-<?php
-/**
- * PHP LDAP CLASS FOR MANIPULATING ACTIVE DIRECTORY
- * Version 4.0.4
- *
- * PHP Version 5 with SSL and LDAP support
- *
- * Written by Scott Barnett, Richard Hyland
- * email: scott@wiggumworld.com, adldap@richardhyland.com
- * http://adldap.sourceforge.net/
- *
- * Copyright (c) 2006-2012 Scott Barnett, Richard Hyland
- *
- * We'd appreciate any improvements or additions to be submitted back
- * to benefit the entire community :)
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * @category ToolsAndUtilities
- * @package adLDAP
- * @subpackage UserCollection
- * @author Scott Barnett, Richard Hyland
- * @copyright (c) 2006-2012 Scott Barnett, Richard Hyland
- * @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html LGPLv2.1
- * @revision $Revision: 97 $
- * @version 4.0.4
- * @link http://adldap.sourceforge.net/
-*/
-
-class adLDAPUserCollection extends adLDAPCollection
-{
-
- public function __set($attribute, $value)
- {
-
- }
-}
-?>
+<?php
+/**
+ * PHP LDAP CLASS FOR MANIPULATING ACTIVE DIRECTORY
+ * Version 4.0.4
+ *
+ * PHP Version 5 with SSL and LDAP support
+ *
+ * Written by Scott Barnett, Richard Hyland
+ * email: scott@wiggumworld.com, adldap@richardhyland.com
+ * http://adldap.sourceforge.net/
+ *
+ * Copyright (c) 2006-2012 Scott Barnett, Richard Hyland
+ *
+ * We'd appreciate any improvements or additions to be submitted back
+ * to benefit the entire community :)
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * @category ToolsAndUtilities
+ * @package adLDAP
+ * @subpackage UserCollection
+ * @author Scott Barnett, Richard Hyland
+ * @copyright (c) 2006-2012 Scott Barnett, Richard Hyland
+ * @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html LGPLv2.1
+ * @revision $Revision: 97 $
+ * @version 4.0.4
+ * @link http://adldap.sourceforge.net/
+*/
+
+class adLDAPUserCollection extends adLDAPCollection
+{
+
+ public function __set($attribute, $value)
+ {
+
+ }
+}
+?>
diff --git a/lib/plugins/authad/auth.php b/lib/plugins/authad/auth.php
index fcbd2eeef..e1d758fb8 100644
--- a/lib/plugins/authad/auth.php
+++ b/lib/plugins/authad/auth.php
@@ -92,16 +92,24 @@ class auth_plugin_authad extends DokuWiki_Auth_Plugin {
}
// Prepare SSO
- if(!utf8_check($_SERVER['REMOTE_USER'])) {
- $_SERVER['REMOTE_USER'] = utf8_encode($_SERVER['REMOTE_USER']);
- }
- if($_SERVER['REMOTE_USER'] && $this->conf['sso']) {
- $_SERVER['REMOTE_USER'] = $this->cleanUser($_SERVER['REMOTE_USER']);
+ if(!empty($_SERVER['REMOTE_USER'])) {
+
+ // make sure the right encoding is used
+ if($this->getConf('sso_charset')) {
+ $_SERVER['REMOTE_USER'] = iconv($this->getConf('sso_charset'), 'UTF-8', $_SERVER['REMOTE_USER']);
+ } elseif(!utf8_check($_SERVER['REMOTE_USER'])) {
+ $_SERVER['REMOTE_USER'] = utf8_encode($_SERVER['REMOTE_USER']);
+ }
- // we need to simulate a login
- if(empty($_COOKIE[DOKU_COOKIE])) {
- $INPUT->set('u', $_SERVER['REMOTE_USER']);
- $INPUT->set('p', 'sso_only');
+ // trust the incoming user
+ if($this->conf['sso']) {
+ $_SERVER['REMOTE_USER'] = $this->cleanUser($_SERVER['REMOTE_USER']);
+
+ // we need to simulate a login
+ if(empty($_COOKIE[DOKU_COOKIE])) {
+ $INPUT->set('u', $_SERVER['REMOTE_USER']);
+ $INPUT->set('p', 'sso_only');
+ }
}
}
diff --git a/lib/plugins/authad/conf/default.php b/lib/plugins/authad/conf/default.php
index f71202cfc..6fb4c9145 100644
--- a/lib/plugins/authad/conf/default.php
+++ b/lib/plugins/authad/conf/default.php
@@ -4,6 +4,7 @@ $conf['account_suffix'] = '';
$conf['base_dn'] = '';
$conf['domain_controllers'] = '';
$conf['sso'] = 0;
+$conf['sso_charset'] = '';
$conf['admin_username'] = '';
$conf['admin_password'] = '';
$conf['real_primarygroup'] = 0;
diff --git a/lib/plugins/authad/conf/metadata.php b/lib/plugins/authad/conf/metadata.php
index 7b4f895d0..560d25315 100644
--- a/lib/plugins/authad/conf/metadata.php
+++ b/lib/plugins/authad/conf/metadata.php
@@ -4,6 +4,7 @@ $meta['account_suffix'] = array('string','_caution' => 'danger');
$meta['base_dn'] = array('string','_caution' => 'danger');
$meta['domain_controllers'] = array('string','_caution' => 'danger');
$meta['sso'] = array('onoff','_caution' => 'danger');
+$meta['sso_charset'] = array('string','_caution' => 'danger');
$meta['admin_username'] = array('string','_caution' => 'danger');
$meta['admin_password'] = array('password','_caution' => 'danger');
$meta['real_primarygroup'] = array('onoff','_caution' => 'danger');
diff --git a/lib/plugins/authad/lang/ar/settings.php b/lib/plugins/authad/lang/ar/settings.php
new file mode 100644
index 000000000..d2a2e2a35
--- /dev/null
+++ b/lib/plugins/authad/lang/ar/settings.php
@@ -0,0 +1,12 @@
+<?php
+
+/**
+ * @license GPL 2 (http://www.gnu.org/licenses/gpl.html)
+ *
+ * @author alhajr <alhajr300@gmail.com>
+ */
+$lang['account_suffix'] = 'لاحقة الحساب الخاص بك. على سبيل المثال. <code>@my.domain.org</code>';
+$lang['domain_controllers'] = 'قائمة مفصولة بفواصل من وحدات التحكم بالمجال. على سبيل المثال. <code>srv1.domain.org,srv2.domain.org</code>';
+$lang['admin_password'] = 'كلمة المرور للمستخدم أعلاه.';
+$lang['real_primarygroup'] = 'ينبغي أن تحل المجموعة الأساسية الحقيقية بدلاً من افتراض "Domain Users" (أبطأ).';
+$lang['expirywarn'] = 'عدد الأيام المقدمة لتحذير المستخدم حول كلمة مرور منتهية الصلاحية. (0) للتعطيل.';
diff --git a/lib/plugins/authad/lang/bg/settings.php b/lib/plugins/authad/lang/bg/settings.php
index 877810c4e..bf7a2d8ce 100644
--- a/lib/plugins/authad/lang/bg/settings.php
+++ b/lib/plugins/authad/lang/bg/settings.php
@@ -1,18 +1,19 @@
<?php
+
/**
- * Bulgarian language file
- *
+ * @license GPL 2 (http://www.gnu.org/licenses/gpl.html)
+ *
* @author Kiril <neohidra@gmail.com>
*/
-$lang['account_suffix'] = 'Наставка на акаунта Ви. Например <code>@някакъв.домейн.org</code>';
-$lang['base_dn'] = 'Вашият основен DN. Например <code>DC=моят,DC=домейн,DC=org</code>';
-$lang['domain_controllers'] = 'Domain controller списък, разделете сървърите със запетая. Например <code>сървър1.домейн.org,сървър2.домейн.org</code>';
-$lang['admin_username'] = 'Привилегирован Active Directory потребител с достъп до данните на останалите потребители. Не е задължително, но е необходимо за някои функционалности като изпращането на имейл за абонаменти.';
-$lang['admin_password'] = 'Паролата на горния потребител.';
-$lang['sso'] = 'Да се ползва ли еднократно вписване чрез Kerberos или NTLM?';
-$lang['real_primarygroup'] = 'Да се извлича ли истинската група вместо да се предполага "Domain Users" (по-бавно)';
-$lang['use_ssl'] = 'Ползване на SSL свързаност? Не отбелязвайте TLS (по-долу) ако включите опцията.';
-$lang['use_tls'] = 'Ползване на TLS свързаност? Не отбелязвайте SSL (по-горе) ако включите опцията.';
-$lang['debug'] = 'Показване на допълнителна debug информация при грешка?';
-$lang['expirywarn'] = 'Предупреждаване на потребителите Х дни преди изтичане валидността на паролата им. Въведете 0 за изключване.';
-$lang['additional'] = 'Списък с допълнителни AD атрибути за извличане от потребителските данни (разделяйте ги със запетая). Ползва се от няколко приставки.'; \ No newline at end of file
+$lang['account_suffix'] = 'Наставка на акаунта Ви. Например <code>@някакъв.домейн.org</code>';
+$lang['base_dn'] = 'Вашият основен DN. Например <code>DC=моят,DC=домейн,DC=org</code>';
+$lang['domain_controllers'] = 'Domain controller списък, разделете сървърите със запетая. Например <code>сървър1.домейн.org,сървър2.домейн.org</code>';
+$lang['admin_username'] = 'Привилегирован Active Directory потребител с достъп до данните на останалите потребители. Не е задължително, но е необходимо за някои функционалности като изпращането на имейл за абонаменти.';
+$lang['admin_password'] = 'Паролата на горния потребител.';
+$lang['sso'] = 'Да се ползва ли еднократно вписване чрез Kerberos или NTLM?';
+$lang['real_primarygroup'] = 'Да се извлича ли истинската група вместо да се предполага "Domain Users" (по-бавно)';
+$lang['use_ssl'] = 'Ползване на SSL свързаност? Не отбелязвайте TLS (по-долу) ако включите опцията.';
+$lang['use_tls'] = 'Ползване на TLS свързаност? Не отбелязвайте SSL (по-горе) ако включите опцията.';
+$lang['debug'] = 'Показване на допълнителна debug информация при грешка?';
+$lang['expirywarn'] = 'Предупреждаване на потребителите Х дни преди изтичане валидността на паролата им. Въведете 0 за изключване.';
+$lang['additional'] = 'Списък с допълнителни AD атрибути за извличане от потребителските данни (разделяйте ги със запетая). Ползва се от няколко приставки.';
diff --git a/lib/plugins/authad/lang/cs/settings.php b/lib/plugins/authad/lang/cs/settings.php
index 71f83afda..28222d332 100644
--- a/lib/plugins/authad/lang/cs/settings.php
+++ b/lib/plugins/authad/lang/cs/settings.php
@@ -1,7 +1,8 @@
<?php
+
/**
- * Czech language file
- *
+ * @license GPL 2 (http://www.gnu.org/licenses/gpl.html)
+ *
* @author mkucera66@seznam.cz
*/
$lang['account_suffix'] = 'Přípona vašeho účtu, tj. <code>@moje.domena.org</code>';
diff --git a/lib/plugins/authad/lang/da/settings.php b/lib/plugins/authad/lang/da/settings.php
new file mode 100644
index 000000000..f50abf1ce
--- /dev/null
+++ b/lib/plugins/authad/lang/da/settings.php
@@ -0,0 +1,20 @@
+<?php
+
+/**
+ * @license GPL 2 (http://www.gnu.org/licenses/gpl.html)
+ *
+ * @author Soren Birk <soer9648@hotmail.com>
+ * @author Jens Hyllegaard <jens.hyllegaard@gmail.com>
+ */
+$lang['account_suffix'] = 'Dit konto suffiks. F.eks. <code>@mit.domæne.dk</code>';
+$lang['base_dn'] = 'Dit grund DN. F.eks. <code>DC=mit,DC=domæne,DC=dk</code>';
+$lang['domain_controllers'] = 'En kommasepareret liste over domænecontrollere. F.eks. <code>srv1.domain.org,srv2.domain.org</code>';
+$lang['admin_username'] = 'En privilegeret Active Directory bruger med adgang til alle andre brugeres data. Valgfri, men skal bruges til forskellige handlinger såsom at sende abonnement e-mails.';
+$lang['admin_password'] = 'Kodeordet til den ovenstående bruger.';
+$lang['sso'] = 'Bør Single-Sign-On via Kerberos eller NTLM bruges?';
+$lang['real_primarygroup'] = 'Bør den korrekte primære gruppe findes i stedet for at antage "Domain Users" (langsommere)';
+$lang['use_ssl'] = 'Benyt SSL forbindelse? hvis ja, vælg ikke TLS herunder.';
+$lang['use_tls'] = 'Benyt TLS forbindelse? hvis ja, vælg ikke SSL herover.';
+$lang['debug'] = 'Vis yderligere debug output ved fejl?';
+$lang['expirywarn'] = 'Dage før brugere skal advares om udløben adgangskode. 0 for at deaktivere.';
+$lang['additional'] = 'En kommasepareret liste over yderligere AD attributter der skal hentes fra brugerdata. Brug af nogen udvidelser.';
diff --git a/lib/plugins/authad/lang/de-informal/settings.php b/lib/plugins/authad/lang/de-informal/settings.php
index a458617b8..782cf7c0f 100644
--- a/lib/plugins/authad/lang/de-informal/settings.php
+++ b/lib/plugins/authad/lang/de-informal/settings.php
@@ -1,7 +1,8 @@
<?php
+
/**
- * German (informal) language file
- *
+ * @license GPL 2 (http://www.gnu.org/licenses/gpl.html)
+ *
* @author Frank Loizzi <contact@software.bacal.de>
* @author Matthias Schulte <dokuwiki@lupo49.de>
* @author Volker Bödker <volker@boedker.de>
diff --git a/lib/plugins/authad/lang/de/settings.php b/lib/plugins/authad/lang/de/settings.php
index fd624ad02..8105fb6f2 100644
--- a/lib/plugins/authad/lang/de/settings.php
+++ b/lib/plugins/authad/lang/de/settings.php
@@ -5,6 +5,8 @@
*
* @author Frank Loizzi <contact@software.bacal.de>
* @author Matthias Schulte <dokuwiki@lupo49.de>
+ * @author Ben Fey <benedikt.fey@beck-heun.de>
+ * @author Jonas Gröger <jonas.groeger@gmail.com>
*/
$lang['account_suffix'] = 'Ihr Account-Suffix. Z. B. <code>@my.domain.org</code>';
$lang['base_dn'] = 'Ihr Base-DN. Z. B. <code>DC=my,DC=domain,DC=org</code>';
@@ -12,6 +14,7 @@ $lang['domain_controllers'] = 'Eine Komma-separierte Liste von Domänen-Contr
$lang['admin_username'] = 'Ein priviligierter Active Directory-Benutzer mit Zugriff zu allen anderen Benutzerdaten. Optional, aber wird benötigt für Aktionen wie z. B. dass Senden von Benachrichtigungs-Mails.';
$lang['admin_password'] = 'Das Passwort des obigen Benutzers.';
$lang['sso'] = 'Soll Single-Sign-On via Kerberos oder NTLM benutzt werden?';
+$lang['sso_charset'] = 'Der Zeichensatz, mit dem der Server den Kerberos- oder NTLM-Benutzernamen versendet. Leer lassen für UTF-8 oder latin-1. Benötigt die iconv-Erweiterung.';
$lang['real_primarygroup'] = 'Soll die echte primäre Gruppe aufgelöst werden anstelle der Annahme "Domain Users" (langsamer)';
$lang['use_ssl'] = 'SSL-Verbindung benutzen? Falls ja, TLS unterhalb nicht aktivieren.';
$lang['use_tls'] = 'TLS-Verbindung benutzen? Falls ja, SSL oberhalb nicht aktivieren.';
diff --git a/lib/plugins/authad/lang/el/settings.php b/lib/plugins/authad/lang/el/settings.php
new file mode 100644
index 000000000..9bf23ea1c
--- /dev/null
+++ b/lib/plugins/authad/lang/el/settings.php
@@ -0,0 +1,8 @@
+<?php
+
+/**
+ * @license GPL 2 (http://www.gnu.org/licenses/gpl.html)
+ *
+ * @author chris taklis <ctaklis@gmail.com>
+ */
+$lang['admin_password'] = 'Ο κωδικός του παραπάνω χρήστη.';
diff --git a/lib/plugins/authad/lang/en/settings.php b/lib/plugins/authad/lang/en/settings.php
index aff49550b..92e9ac4e8 100644
--- a/lib/plugins/authad/lang/en/settings.php
+++ b/lib/plugins/authad/lang/en/settings.php
@@ -6,7 +6,8 @@ $lang['domain_controllers'] = 'A comma separated list of Domain controllers. Eg.
$lang['admin_username'] = 'A privileged Active Directory user with access to all other user\'s data. Optional, but needed for certain actions like sending subscription mails.';
$lang['admin_password'] = 'The password of the above user.';
$lang['sso'] = 'Should Single-Sign-On via Kerberos or NTLM be used?';
-$lang['real_primarygroup'] = 'Should the real primary group be resolved instead of assuming "Domain Users" (slower)';
+$lang['sso_charset'] = 'The charset your webserver will pass the Kerberos or NTLM username in. Empty for UTF-8 or latin-1. Requires the iconv extension.';
+$lang['real_primarygroup'] = 'Should the real primary group be resolved instead of assuming "Domain Users" (slower).';
$lang['use_ssl'] = 'Use SSL connection? If used, do not enable TLS below.';
$lang['use_tls'] = 'Use TLS connection? If used, do not enable SSL above.';
$lang['debug'] = 'Display additional debugging output on errors?';
diff --git a/lib/plugins/authad/lang/eo/settings.php b/lib/plugins/authad/lang/eo/settings.php
index 8bd34b439..11640ebb7 100644
--- a/lib/plugins/authad/lang/eo/settings.php
+++ b/lib/plugins/authad/lang/eo/settings.php
@@ -1,7 +1,9 @@
<?php
+
/**
- * Esperanto language file
- *
+ * @license GPL 2 (http://www.gnu.org/licenses/gpl.html)
+ *
+ * @author Robert Bogenschneider <bogi@uea.org>
*/
$lang['account_suffix'] = 'Via konto-aldonaĵo, ekz. <code>@mia.domajno.lando</code>';
$lang['base_dn'] = 'Via baza DN, ekz. <code>DC=mia,DC=domajno,DC=lando</code>';
@@ -9,6 +11,7 @@ $lang['domain_controllers'] = 'Komodisigita listo de domajno-serviloj, ekz. <
$lang['admin_username'] = 'Privilegiita Aktiv-Dosieruja uzanto kun aliro al ĉiuj uzantaj datumoj. Libervole, sed necesa por iuj agadoj kiel sendi abonan retpoŝton.';
$lang['admin_password'] = 'La pasvorto de tiu uzanto.';
$lang['sso'] = 'Ĉu uzi Sola Aliro tra Kerberos aŭ NTLM?';
+$lang['sso_charset'] = 'Per kiu karaktraro via retservilo pludonas uzantonomojn al Kerberos aŭ NTLM? Malplena por UTF-8 aŭ latin-1. Bezonas iconv-aldonaĵon.';
$lang['real_primarygroup'] = 'Ĉu trovi la veran ĉefan grupon anstataŭ supozi "Domajnuzantoj" (pli malrapida)?';
$lang['use_ssl'] = 'Ĉu uzi SSL-konekton? Se jes, ne aktivigu TLS sube.';
$lang['use_tls'] = 'Ĉu uzi TLS-konekton? Se jes, ne aktivigu SSL supre.';
diff --git a/lib/plugins/authad/lang/es/settings.php b/lib/plugins/authad/lang/es/settings.php
new file mode 100644
index 000000000..98b78056b
--- /dev/null
+++ b/lib/plugins/authad/lang/es/settings.php
@@ -0,0 +1,15 @@
+<?php
+
+/**
+ * @license GPL 2 (http://www.gnu.org/licenses/gpl.html)
+ *
+ * @author monica <may.dorado@gmail.com>
+ * @author Antonio Bueno <atnbueno@gmail.com>
+ */
+$lang['account_suffix'] = 'Su cuenta, sufijo. Ejem. <code> @ my.domain.org </ code>';
+$lang['base_dn'] = 'Su base DN. Ejem. <code>DC=my,DC=dominio,DC=org</code>';
+$lang['domain_controllers'] = 'Una lista separada por coma de los controladores de dominios. Ejem. <code>srv1.dominio.org,srv2.dominio.org</code>';
+$lang['admin_username'] = 'Un usuario con privilegios de Active Directory con acceso a los datos de cualquier otro usuario. Opcional, pero es necesario para determinadas acciones como el envío de suscripciones de correos electrónicos.';
+$lang['admin_password'] = 'La contraseña del usuario anterior.';
+$lang['sso'] = 'En caso de inicio de sesión usará ¿Kerberos o NTLM?';
+$lang['sso_charset'] = 'La codificación con que tu servidor web pasará el nombre de usuario Kerberos o NTLM. Si es UTF-8 o latin-1 dejar en blanco. Requiere la extensión iconv.';
diff --git a/lib/plugins/authad/lang/fi/settings.php b/lib/plugins/authad/lang/fi/settings.php
index d3aa13e07..e2f432f36 100644
--- a/lib/plugins/authad/lang/fi/settings.php
+++ b/lib/plugins/authad/lang/fi/settings.php
@@ -1,6 +1,9 @@
<?php
+
/**
- * Finnish language file
- *
+ * @license GPL 2 (http://www.gnu.org/licenses/gpl.html)
+ *
* @author Otto Vainio <otto@valjakko.net>
*/
+$lang['debug'] = 'Näytä lisää debug-koodia virheistä?';
+$lang['expirywarn'] = 'Montako päivää etukäteen varoitetaan salasanan vanhenemissta. 0 poistaa.';
diff --git a/lib/plugins/authad/lang/hu/settings.php b/lib/plugins/authad/lang/hu/settings.php
index c2cab410f..1510e1756 100644
--- a/lib/plugins/authad/lang/hu/settings.php
+++ b/lib/plugins/authad/lang/hu/settings.php
@@ -1,7 +1,8 @@
<?php
+
/**
- * Hungarian language file
- *
+ * @license GPL 2 (http://www.gnu.org/licenses/gpl.html)
+ *
* @author Marton Sebok <sebokmarton@gmail.com>
*/
$lang['account_suffix'] = 'Felhasználói azonosító végződése, pl. <code>@my.domain.org</code>.';
diff --git a/lib/plugins/authad/lang/ja/settings.php b/lib/plugins/authad/lang/ja/settings.php
index fdc6fc434..f308249ef 100644
--- a/lib/plugins/authad/lang/ja/settings.php
+++ b/lib/plugins/authad/lang/ja/settings.php
@@ -1,6 +1,20 @@
<?php
+
/**
- * Japanese language file
- *
+ * @license GPL 2 (http://www.gnu.org/licenses/gpl.html)
+ *
* @author Satoshi Sahara <sahara.satoshi@gmail.com>
+ * @author Hideaki SAWADA <chuno@live.jp>
*/
+$lang['account_suffix'] = 'アカウントの接尾語。例:<code>@my.domain.org</code>';
+$lang['base_dn'] = 'ベースDN。例:<code>DC=my,DC=domain,DC=org</code>';
+$lang['domain_controllers'] = 'ドメインコントローラのカンマ区切り一覧。例:<code>srv1.domain.org,srv2.domain.org</code>';
+$lang['admin_username'] = '全ユーザーデータへのアクセス権のある特権Active Directoryユーザー。任意ですが、メール通知の登録等の特定の動作に必要。';
+$lang['admin_password'] = '上記ユーザーのパスワード';
+$lang['sso'] = 'Kerberos か NTLM を使ったシングルサインオン(SSO)をしますか?';
+$lang['real_primarygroup'] = '"Domain Users" を仮定する代わりに本当のプライマリグループを解決する(低速)';
+$lang['use_ssl'] = 'SSL接続を使用しますか?使用した場合、下のSSLを有効にしないでください。';
+$lang['use_tls'] = 'TLS接続を使用しますか?使用した場合、上のSSLを有効にしないでください。';
+$lang['debug'] = 'エラー時に追加のデバッグ出力を表示する?';
+$lang['expirywarn'] = '何日前からパスワードの有効期限をユーザーに警告する。0 の場合は無効';
+$lang['additional'] = 'ユーザデータから取得する追加AD属性のカンマ区切り一覧。いくつかのプラグインが使用する。';
diff --git a/lib/plugins/authad/lang/ko/settings.php b/lib/plugins/authad/lang/ko/settings.php
index f2bf52681..b104371fe 100644
--- a/lib/plugins/authad/lang/ko/settings.php
+++ b/lib/plugins/authad/lang/ko/settings.php
@@ -1,8 +1,10 @@
<?php
+
/**
- * Korean language file
- *
+ * @license GPL 2 (http://www.gnu.org/licenses/gpl.html)
+ *
* @author Myeongjin <aranet100@gmail.com>
+ * @author Garam <rowain8@gmail.com>
*/
$lang['account_suffix'] = '계정 접미어. 예를 들어 <code>@my.domain.org</code>';
$lang['base_dn'] = '기본 DN. 예를 들어 <code>DC=my,DC=domain,DC=org</code>';
@@ -10,7 +12,8 @@ $lang['domain_controllers'] = '도메인 컨트롤러의 쉼표로 구분한
$lang['admin_username'] = '다른 모든 사용자의 데이터에 접근할 수 있는 권한이 있는 Active Directory 사용자. 선택적이지만 구독 메일을 보내는 등의 특정 작업에 필요합니다.';
$lang['admin_password'] = '위 사용자의 비밀번호.';
$lang['sso'] = 'Kerberos나 NTLM을 통해 Single-Sign-On을 사용해야 합니까?';
-$lang['real_primarygroup'] = '실제 기본 그룹은 "도메인 사용자"를 가정하는 대신 해결될 것입니다 (느림)';
+$lang['sso_charset'] = '당신의 웹서버의 문자집합은 Kerberos나 NTLM 사용자 이름으로 전달됩니다. UTF-8이나 라린-1이 비어 있습니다. icov 확장 기능이 필요합니다.';
+$lang['real_primarygroup'] = '실제 기본 그룹은 "도메인 사용자"를 가정하는 대신 해결될 것입니다. (느림)';
$lang['use_ssl'] = 'SSL 연결을 사용합니까? 사용한다면 아래 TLS을 활성화하지 마세요.';
$lang['use_tls'] = 'TLS 연결을 사용합니까? 사용한다면 위 SSL을 활성화하지 마세요.';
$lang['debug'] = '오류에 대한 추가적인 디버그 정보를 보이겠습니까?';
diff --git a/lib/plugins/authad/lang/nl/settings.php b/lib/plugins/authad/lang/nl/settings.php
index 8f5c84043..591d72941 100644
--- a/lib/plugins/authad/lang/nl/settings.php
+++ b/lib/plugins/authad/lang/nl/settings.php
@@ -3,16 +3,19 @@
/**
* @license GPL 2 (http://www.gnu.org/licenses/gpl.html)
*
+ * @author Remon <no@email.local>
+ * @author Gerrit Uitslag <klapinklapin@gmail.com>
*/
$lang['account_suffix'] = 'Je account domeinnaam. Bijv <code>@mijn.domein.org</code>';
$lang['base_dn'] = 'Je basis DN. Bijv. <code>DC=mijn,DC=domein,DC=org</code>';
-$lang['domain_controllers'] = 'Eeen commagesepareerde lijst van domeinservers. Bijv. <code>srv1.domein.org,srv2.domein.org</code>';
-$lang['admin_username'] = 'Een geprivilegeerde Active Directory gebruiker die bij alle gebruikersgegevens kan komen. Optioneel, maar kan nodig zijn voor bepaalde acties, zoals het versturen van abonnementsmailtjes.';
-$lang['admin_password'] = 'Het wachtwoord van bovernvermelde gebruiker.';
+$lang['domain_controllers'] = 'Eeen kommagescheiden lijst van domeinservers. Bijv. <code>srv1.domein.org,srv2.domein.org</code>';
+$lang['admin_username'] = 'Een geprivilegeerde Active Directory gebruiker die bij alle gebruikersgegevens kan komen. Dit is optioneel maar kan nodig zijn voor bepaalde acties, zoals het versturen van abonnementsmailtjes.';
+$lang['admin_password'] = 'Het wachtwoord van bovenstaande gebruiker.';
$lang['sso'] = 'Wordt voor Single-Sign-on Kerberos of NTLM gebruikt?';
+$lang['sso_charset'] = 'Het tekenset waarin je webserver de Kerberos of NTLM gebruikersnaam doorsturen. Leeglaten voor UTF-8 of latin-1. Vereist de iconv extensie.';
$lang['real_primarygroup'] = 'Moet de echte primaire groep worden opgezocht in plaats van het aannemen van "Domeingebruikers" (langzamer)';
-$lang['use_ssl'] = 'SSL verbinding gebruiken? Zo ja, gebruik dan TLS hieronder niet.';
+$lang['use_ssl'] = 'SSL verbinding gebruiken? Zo ja, activeer dan niet de TLS optie hieronder.';
$lang['use_tls'] = 'TLS verbinding gebruiken? Zo ja, activeer dan niet de SSL verbinding hierboven.';
$lang['debug'] = 'Aanvullende debug informatie tonen bij fouten?';
$lang['expirywarn'] = 'Waarschuwingstermijn voor vervallen wachtwoord. 0 om te deactiveren.';
-$lang['additional'] = 'Commagesepareerde lijst van aanvullend uit AD op te halen attributen. Gebruikt door sommige plugins.';
+$lang['additional'] = 'Een kommagescheiden lijst van extra AD attributen van de gebruiker. Wordt gebruikt door sommige plugins.';
diff --git a/lib/plugins/authad/lang/pl/settings.php b/lib/plugins/authad/lang/pl/settings.php
index 9113c0e51..ad051b0ac 100644
--- a/lib/plugins/authad/lang/pl/settings.php
+++ b/lib/plugins/authad/lang/pl/settings.php
@@ -1,9 +1,12 @@
<?php
+
/**
- * Polish language file
- *
+ * @license GPL 2 (http://www.gnu.org/licenses/gpl.html)
+ *
+ * @author Tomasz Bosak <bosak.tomasz@gmail.com>
*/
$lang['account_suffix'] = 'Przyrostek twojej nazwy konta np. <code>@my.domain.org</code>';
+$lang['base_dn'] = 'Twoje bazowe DN. Na przykład: <code>DC=my,DC=domain,DC=org</code>';
$lang['admin_password'] = 'Hasło dla powyższego użytkownika.';
$lang['use_ssl'] = 'Użyć połączenie SSL? Jeśli tak to nie aktywuj TLS poniżej.';
$lang['use_tls'] = 'Użyć połączenie TLS? Jeśli tak to nie aktywuj SSL powyżej.';
diff --git a/lib/plugins/authad/lang/pt-br/settings.php b/lib/plugins/authad/lang/pt-br/settings.php
index 56f37b75f..cdc748055 100644
--- a/lib/plugins/authad/lang/pt-br/settings.php
+++ b/lib/plugins/authad/lang/pt-br/settings.php
@@ -1,9 +1,11 @@
<?php
+
/**
- * Brazilian Portuguese language file
- *
+ * @license GPL 2 (http://www.gnu.org/licenses/gpl.html)
+ *
* @author Victor Westmann <victor.westmann@gmail.com>
* @author Frederico Guimarães <frederico@teia.bio.br>
+ * @author Juliano Marconi Lanigra <juliano.marconi@gmail.com>
*/
$lang['account_suffix'] = 'Sufixo de sua conta. Eg. <code>@meu.domínio.org</code>';
$lang['base_dn'] = 'Sua base DN. Eg. <code>DC=meu,DC=domínio,DC=org</code>';
@@ -11,6 +13,7 @@ $lang['domain_controllers'] = 'Uma lista de controles de domínios separada p
$lang['admin_username'] = 'Um usuário do Active Directory com privilégios para acessar os dados de todos os outros usuários. Opcional, mas necessário para realizar certas ações, tais como enviar mensagens de assinatura.';
$lang['admin_password'] = 'A senha do usuário acima.';
$lang['sso'] = 'Usar Single-Sign-On através do Kerberos ou NTLM?';
+$lang['sso_charset'] = 'A codificação de caracteres que seu servidor web passará o nome de usuário Kerberos ou NTLM. Vazio para UTF-8 ou latin-1. Requere a extensão iconv.';
$lang['real_primarygroup'] = 'O grupo primário real deve ser resolvido ao invés de assumirmos como "Usuários do Domínio" (mais lento)';
$lang['use_ssl'] = 'Usar conexão SSL? Se usar, não habilitar TLS abaixo.';
$lang['use_tls'] = 'Usar conexão TLS? se usar, não habilitar SSL acima.';
diff --git a/lib/plugins/authad/lang/pt/settings.php b/lib/plugins/authad/lang/pt/settings.php
new file mode 100644
index 000000000..45eff5e96
--- /dev/null
+++ b/lib/plugins/authad/lang/pt/settings.php
@@ -0,0 +1,12 @@
+<?php
+
+/**
+ * @license GPL 2 (http://www.gnu.org/licenses/gpl.html)
+ *
+ * @author André Neves <drakferion@gmail.com>
+ */
+$lang['admin_password'] = 'A senha para o utilizador acima.';
+$lang['sso'] = 'Deve ser usado o Single-Sign-On via Kerberos ou NTLM?';
+$lang['use_ssl'] = 'Usar ligação SSL? Se usada, não ative TLS abaixo.';
+$lang['use_tls'] = 'Usar ligação TLS? Se usada, não ative SSL abaixo.';
+$lang['expirywarn'] = 'Número de dias de avanço para avisar o utilizador da expiração da senha. 0 para desativar.';
diff --git a/lib/plugins/authad/lang/ru/settings.php b/lib/plugins/authad/lang/ru/settings.php
index 4c394080e..6854e0920 100644
--- a/lib/plugins/authad/lang/ru/settings.php
+++ b/lib/plugins/authad/lang/ru/settings.php
@@ -1,6 +1,13 @@
<?php
+
/**
- * Russian language file
- *
+ * @license GPL 2 (http://www.gnu.org/licenses/gpl.html)
+ *
* @author Ivan I. Udovichenko (sendtome@mymailbox.pp.ua)
+ * @author Aleksandr Selivanov <alexgearbox@gmail.com>
+ * @author Artur <ncuxxx@gmail.com>
*/
+$lang['admin_password'] = 'Пароль для указанного пользователя.';
+$lang['sso'] = 'Использовать SSO (Single-Sign-On) через Kerberos или NTLM?';
+$lang['use_ssl'] = 'Использовать SSL? Если да, то не включайте TLS.';
+$lang['use_tls'] = 'Использовать TLS? Если да, то не включайте SSL.';
diff --git a/lib/plugins/authad/lang/sk/settings.php b/lib/plugins/authad/lang/sk/settings.php
new file mode 100644
index 000000000..b7d822f7e
--- /dev/null
+++ b/lib/plugins/authad/lang/sk/settings.php
@@ -0,0 +1,20 @@
+<?php
+
+/**
+ * @license GPL 2 (http://www.gnu.org/licenses/gpl.html)
+ *
+ * @author Martin Michalek <michalek.dev@gmail.com>
+ */
+$lang['account_suffix'] = 'Prípona používateľského účtu. Napr. <code>@my.domain.org</code>';
+$lang['base_dn'] = 'Vaše base DN. Napr. <code>DC=my,DC=domain,DC=org</code>';
+$lang['domain_controllers'] = 'Zoznam doménových radičov oddelených čiarkou. Napr. <code>srv1.domain.org,srv2.domain.org</code>';
+$lang['admin_username'] = 'Privilegovaný používateľ Active Directory s prístupom ku všetkým dátam ostatných používateľov. Nepovinné nastavenie, ale potrebné pre určité akcie ako napríklad zasielanie mailov o zmenách.';
+$lang['admin_password'] = 'Heslo vyššie uvedeného používateľa.';
+$lang['sso'] = 'Použiť Single-Sign-On cez Kerberos alebo NTLM?';
+$lang['sso_charset'] = 'Znaková sada, v ktorej bude webserver prenášať meno Kerberos or NTLM používateľa. Prázne pole znamená UTF-8 alebo latin-1. Vyžaduje iconv rozšírenie.';
+$lang['real_primarygroup'] = 'Použiť skutočnú primárnu skupinu používateľa namiesto "Doménoví používatelia" (pomalšie).';
+$lang['use_ssl'] = 'Použiť SSL pripojenie? Ak áno, nepovoľte TLS nižšie.';
+$lang['use_tls'] = 'Použiť TLS pripojenie? Ak áno, nepovoľte SSL vyššie.';
+$lang['debug'] = 'Zobraziť doplňujúce ladiace informácie pri chybe?';
+$lang['expirywarn'] = 'Počet dní pred uplynutím platnosti hesla, počas ktorých používateľ dostáva upozornenie. 0 deaktivuje túto voľbu.';
+$lang['additional'] = 'Zoznam dodatočných AD atribútov oddelených čiarkou získaných z údajov používateľa. Používané niektorými pluginmi.';
diff --git a/lib/plugins/authldap/auth.php b/lib/plugins/authldap/auth.php
index 6a967a6d4..31e2c5135 100644
--- a/lib/plugins/authldap/auth.php
+++ b/lib/plugins/authldap/auth.php
@@ -166,7 +166,7 @@ class auth_plugin_authldap extends DokuWiki_Auth_Plugin {
// be accessible anonymously, so we try to rebind the current user here
list($loginuser, $loginsticky, $loginpass) = auth_getCookie();
if($loginuser && $loginpass) {
- $loginpass = PMA_blowfish_decrypt($loginpass, auth_cookiesalt(!$loginsticky));
+ $loginpass = auth_decrypt($loginpass, auth_cookiesalt(!$loginsticky, true));
$this->checkPass($loginuser, $loginpass);
}
}
@@ -208,8 +208,8 @@ class auth_plugin_authldap extends DokuWiki_Auth_Plugin {
if(is_array($key)) {
// use regexp to clean up user_result
list($key, $regexp) = each($key);
- if($user_result[$key]) foreach($user_result[$key] as $grp) {
- if(preg_match($regexp, $grp, $match)) {
+ if($user_result[$key]) foreach($user_result[$key] as $grpkey => $grp) {
+ if($grpkey !== 'count' && preg_match($regexp, $grp, $match)) {
if($localkey == 'grps') {
$info[$localkey][] = $match[1];
} else {
diff --git a/lib/plugins/authldap/lang/ar/settings.php b/lib/plugins/authldap/lang/ar/settings.php
new file mode 100644
index 000000000..aaef7763f
--- /dev/null
+++ b/lib/plugins/authldap/lang/ar/settings.php
@@ -0,0 +1,13 @@
+<?php
+
+/**
+ * @license GPL 2 (http://www.gnu.org/licenses/gpl.html)
+ *
+ * @author alhajr <alhajr300@gmail.com>
+ */
+$lang['port'] = 'LDAP المنفذ الملقم إذا لم يعط أي عنوان URL كامل أعلاه';
+$lang['version'] = 'إصدار نسخة البروتوكول الستخدامه. قد تحتاج لتعيين هذه القيمة إلى <code>3</code>';
+$lang['starttls'] = 'استخدام اتصالات TLS؟';
+$lang['referrals'] = 'يتبع الإحالات؟';
+$lang['deref'] = 'كيفية إلغاء مرجعية الأسماء المستعارة؟';
+$lang['bindpw'] = 'كلمة مرور المستخدم أعلاه';
diff --git a/lib/plugins/authldap/lang/bg/settings.php b/lib/plugins/authldap/lang/bg/settings.php
index 644672ca7..165216de8 100644
--- a/lib/plugins/authldap/lang/bg/settings.php
+++ b/lib/plugins/authldap/lang/bg/settings.php
@@ -1,7 +1,8 @@
<?php
+
/**
- * Bulgarian language file
- *
+ * @license GPL 2 (http://www.gnu.org/licenses/gpl.html)
+ *
* @author Kiril <neohidra@gmail.com>
*/
$lang['server'] = 'Вашият LDAP сървър. Име на хоста (<code>localhost</code>) или целият URL адрес (<code>ldap://сървър.tld:389</code>)';
@@ -16,4 +17,4 @@ $lang['referrals'] = 'Да бъдат ли следвани преп
$lang['bindpw'] = 'Парола за горния потребител';
$lang['userscope'] = 'Ограничаване на обхвата за търсене на потребители';
$lang['groupscope'] = 'Ограничаване на обхвата за търсене на потребителски групи';
-$lang['debug'] = 'Показване на допълнителна debug информация при грешка'; \ No newline at end of file
+$lang['debug'] = 'Показване на допълнителна debug информация при грешка';
diff --git a/lib/plugins/authldap/lang/cs/settings.php b/lib/plugins/authldap/lang/cs/settings.php
index 783d2a3ae..20491f1fb 100644
--- a/lib/plugins/authldap/lang/cs/settings.php
+++ b/lib/plugins/authldap/lang/cs/settings.php
@@ -1,7 +1,8 @@
<?php
+
/**
- * Czech language file
- *
+ * @license GPL 2 (http://www.gnu.org/licenses/gpl.html)
+ *
* @author mkucera66@seznam.cz
*/
$lang['server'] = 'Váš server LDAP. Buď jméno hosta (<code>localhost</code>) nebo plně kvalifikovaný popis URL (<code>ldap://server.tld:389</code>)';
@@ -9,7 +10,7 @@ $lang['port'] = 'Port serveru LDAP. Pokud není, bude využito
$lang['usertree'] = 'Kde najít uživatelské účty, tj. <code>ou=Lide, dc=server, dc=tld</code>';
$lang['grouptree'] = 'Kde najít uživatelské skupiny, tj. <code>ou=Skupina, dc=server, dc=tld</code>';
$lang['userfilter'] = 'Filter LDAPu pro vyhledávání uživatelských účtů, tj. <code>(&amp;(uid=%{user})(objectClass=posixAccount))</code>';
-$lang['groupfilter'] = 'Filter LDAPu pro vyhledávání uživatelských skupin, tj. <code>(&amp;(uid=%{user})(objectClass=posixAccount))</code>';
+$lang['groupfilter'] = 'Filter LDAPu pro vyhledávání uživatelských skupin, tj. <code>(&amp;(objectClass=posixGroup)(|(gidNumber=%{gid})(memberUID=%{user})))</code>';
$lang['version'] = 'Verze použitého protokolu. Můžete potřebovat jej nastavit na <code>3</code>';
$lang['starttls'] = 'Využít spojení TLS?';
$lang['referrals'] = 'Přeposílat odkazy?';
diff --git a/lib/plugins/authldap/lang/da/settings.php b/lib/plugins/authldap/lang/da/settings.php
new file mode 100644
index 000000000..b736504a5
--- /dev/null
+++ b/lib/plugins/authldap/lang/da/settings.php
@@ -0,0 +1,15 @@
+<?php
+
+/**
+ * @license GPL 2 (http://www.gnu.org/licenses/gpl.html)
+ *
+ * @author Jens Hyllegaard <jens.hyllegaard@gmail.com>
+ * @author soer9648 <soer9648@eucl.dk>
+ */
+$lang['server'] = 'Din LDAP server. Enten værtsnavn (<code>localhost</code>) eller fuld kvalificeret URL (<code>ldap://server.tld:389</code>)';
+$lang['port'] = 'LDAP server port, hvis der ikke er angivet en komplet URL ovenfor.';
+$lang['usertree'] = 'Hvor findes brugerkonti. F.eks. <code>ou=Personer, dc=server, dc=tld</code>';
+$lang['grouptree'] = 'Hvor findes brugergrupper. F.eks. <code>ou=Grupper, dc=server, dc=tld</code>';
+$lang['starttls'] = 'Benyt TLS forbindelser?';
+$lang['bindpw'] = 'Kodeord til ovenstående bruger';
+$lang['debug'] = 'Vis yderligere debug output ved fejl';
diff --git a/lib/plugins/authldap/lang/de-informal/settings.php b/lib/plugins/authldap/lang/de-informal/settings.php
index 15e4d8129..bdac7dd68 100644
--- a/lib/plugins/authldap/lang/de-informal/settings.php
+++ b/lib/plugins/authldap/lang/de-informal/settings.php
@@ -1,8 +1,8 @@
<?php
+
/**
- * German informal language file
- *
* @license GPL 2 (http://www.gnu.org/licenses/gpl.html)
+ *
* @author Matthias Schulte <dokuwiki@lupo49.de>
* @author Volker Bödker <volker@boedker.de>
*/
diff --git a/lib/plugins/authldap/lang/de/settings.php b/lib/plugins/authldap/lang/de/settings.php
index b24c792f9..d788da876 100644
--- a/lib/plugins/authldap/lang/de/settings.php
+++ b/lib/plugins/authldap/lang/de/settings.php
@@ -4,6 +4,7 @@
* @license GPL 2 (http://www.gnu.org/licenses/gpl.html)
*
* @author Matthias Schulte <dokuwiki@lupo49.de>
+ * @author christian studer <cstuder@existenz.ch>
*/
$lang['server'] = 'Adresse zum LDAP-Server. Entweder als Hostname (<code>localhost</code>) oder als FQDN (<code>ldap://server.tld:389</code>).';
$lang['port'] = 'Port des LDAP-Servers, falls kein Port angegeben wurde.';
@@ -14,9 +15,14 @@ $lang['groupfilter'] = 'LDAP-Filter, um die Benutzergruppen zu suchen.
$lang['version'] = 'Zu verwendende Protokollversion von LDAP.';
$lang['starttls'] = 'Verbindung über TLS aufbauen?';
$lang['referrals'] = 'Weiterverfolgen von LDAP-Referrals (Verweise)?';
+$lang['deref'] = 'Wie sollen Aliase aufgelöst werden?';
$lang['binddn'] = 'DN eines optionalen Benutzers, wenn der anonyme Zugriff nicht ausreichend ist. Zum Beispiel: <code>cn=admin, dc=my, dc=home</code>.';
$lang['bindpw'] = 'Passwort des angegebenen Benutzers.';
$lang['userscope'] = 'Die Suchweite nach Benutzeraccounts.';
$lang['groupscope'] = 'Die Suchweite nach Benutzergruppen.';
$lang['groupkey'] = 'Gruppieren der Benutzeraccounts anhand eines beliebigen Benutzerattributes z. B. Telefonnummer oder Abteilung, anstelle der Standard-Gruppen).';
$lang['debug'] = 'Debug-Informationen beim Auftreten von Fehlern anzeigen?';
+$lang['deref_o_0'] = 'LDAP_DEREF_NEVER';
+$lang['deref_o_1'] = 'LDAP_DEREF_SEARCHING';
+$lang['deref_o_2'] = 'LDAP_DEREF_FINDING';
+$lang['deref_o_3'] = 'LDAP_DEREF_ALWAYS';
diff --git a/lib/plugins/authldap/lang/eo/settings.php b/lib/plugins/authldap/lang/eo/settings.php
index 2863a1125..07b46c84a 100644
--- a/lib/plugins/authldap/lang/eo/settings.php
+++ b/lib/plugins/authldap/lang/eo/settings.php
@@ -1,7 +1,9 @@
<?php
+
/**
- * Esperanto language file
- *
+ * @license GPL 2 (http://www.gnu.org/licenses/gpl.html)
+ *
+ * @author Felipe Castro <fefcas@yahoo.com.br>
*/
$lang['server'] = 'Via LDAP-servilo. Aŭ servila nomo (<code>localhost</code>) aŭ plene detala URL (<code>ldap://servilo.lando:389</code>)';
$lang['port'] = 'LDAP-servila pordego, se vi supre ne indikis la plenan URL';
@@ -12,9 +14,14 @@ $lang['groupfilter'] = 'LDAP-filtrilo por serĉi grupojn, ekz. <code>(
$lang['version'] = 'La uzenda protokolversio. Eble necesas indiki <code>3</code>';
$lang['starttls'] = 'Ĉu uzi TLS-konektojn?';
$lang['referrals'] = 'Ĉu sekvi referencojn?';
+$lang['deref'] = 'Kiel dereferencigi kromnomojn?';
$lang['binddn'] = 'DN de opcie bindita uzanto, se anonima bindado ne sufiĉas, ekz. <code>cn=admin, dc=mia, dc=hejmo</code>';
$lang['bindpw'] = 'Pasvorto de tiu uzanto';
$lang['userscope'] = 'Limigi serĉospacon de uzantaj serĉoj';
$lang['groupscope'] = 'Limigi serĉospacon por grupaj serĉoj';
$lang['groupkey'] = 'Grupa membreco de iu uzanta atributo (anstataŭ standardaj AD-grupoj), ekz. grupo de departemento aŭ telefonnumero';
$lang['debug'] = 'Ĉu montri aldonajn erarinformojn?';
+$lang['deref_o_0'] = 'LDAP_DEREF_NEVER';
+$lang['deref_o_1'] = 'LDAP_DEREF_SEARCHING';
+$lang['deref_o_2'] = 'LDAP_DEREF_FINDING';
+$lang['deref_o_3'] = 'LDAP_DEREF_ALWAYS';
diff --git a/lib/plugins/authldap/lang/es/settings.php b/lib/plugins/authldap/lang/es/settings.php
new file mode 100644
index 000000000..f8c3ad014
--- /dev/null
+++ b/lib/plugins/authldap/lang/es/settings.php
@@ -0,0 +1,13 @@
+<?php
+
+/**
+ * @license GPL 2 (http://www.gnu.org/licenses/gpl.html)
+ *
+ * @author Antonio Bueno <atnbueno@gmail.com>
+ */
+$lang['starttls'] = 'Usar conexiones TLS?';
+$lang['debug'] = 'Mostrar información adicional para depuración de errores';
+$lang['deref_o_0'] = 'LDAP_DEREF_NEVER';
+$lang['deref_o_1'] = 'LDAP_DEREF_SEARCHING';
+$lang['deref_o_2'] = 'LDAP_DEREF_FINDING';
+$lang['deref_o_3'] = 'LDAP_DEREF_ALWAYS';
diff --git a/lib/plugins/authldap/lang/fi/settings.php b/lib/plugins/authldap/lang/fi/settings.php
index d3aa13e07..b15d8c676 100644
--- a/lib/plugins/authldap/lang/fi/settings.php
+++ b/lib/plugins/authldap/lang/fi/settings.php
@@ -1,6 +1,11 @@
<?php
+
/**
- * Finnish language file
- *
+ * @license GPL 2 (http://www.gnu.org/licenses/gpl.html)
+ *
* @author Otto Vainio <otto@valjakko.net>
*/
+$lang['starttls'] = 'Käytä TLS yhteyttä';
+$lang['bindpw'] = 'Ylläolevan käyttäjän salasana';
+$lang['userscope'] = 'Etsi vain käyttäjiä';
+$lang['groupscope'] = 'Etsi vain ryhmiä';
diff --git a/lib/plugins/authldap/lang/fr/settings.php b/lib/plugins/authldap/lang/fr/settings.php
index 607eed24d..dc475071e 100644
--- a/lib/plugins/authldap/lang/fr/settings.php
+++ b/lib/plugins/authldap/lang/fr/settings.php
@@ -4,6 +4,7 @@
* @license GPL 2 (http://www.gnu.org/licenses/gpl.html)
*
* @author Bruno Veilleux <bruno.vey@gmail.com>
+ * @author schplurtz <Schplurtz@laposte.net>
*/
$lang['server'] = 'Votre serveur LDAP. Soit le nom d\'hôte (<code>localhost</code>) ou l\'URL complète (<code>ldap://serveur.dom:389</code>)';
$lang['port'] = 'Port du serveur LDAP si l\'URL complète n\'a pas été indiquée ci-dessus';
@@ -14,9 +15,14 @@ $lang['groupfilter'] = 'Filtre LDAP pour rechercher les groupes. Ex.:
$lang['version'] = 'La version de protocole à utiliser. Il se peut que vous deviez utiliser <code>3</code>';
$lang['starttls'] = 'Utiliser les connexions TLS?';
$lang['referrals'] = 'Suivre les références?';
+$lang['deref'] = 'Comment déréférencer les alias ?';
$lang['binddn'] = 'Nom de domaine d\'un utilisateur de connexion facultatif si une connexion anonyme n\'est pas suffisante. Ex. : <code>cn=admin, dc=mon, dc=accueil</code>';
$lang['bindpw'] = 'Mot de passe de l\'utilisateur ci-dessus.';
$lang['userscope'] = 'Limiter la portée de recherche d\'utilisateurs';
$lang['groupscope'] = 'Limiter la portée de recherche de groupes';
$lang['groupkey'] = 'Affiliation aux groupes à partir de n\'importe quel attribut utilisateur (au lieu des groupes AD standards), p. ex. groupes par département ou numéro de téléphone';
$lang['debug'] = 'Afficher des informations de bégogage supplémentaires pour les erreurs';
+$lang['deref_o_0'] = 'LDAP_DEREF_NEVER';
+$lang['deref_o_1'] = 'LDAP_DEREF_SEARCHING';
+$lang['deref_o_2'] = 'LDAP_DEREF_FINDING';
+$lang['deref_o_3'] = 'LDAP_DEREF_ALWAYS';
diff --git a/lib/plugins/authldap/lang/he/settings.php b/lib/plugins/authldap/lang/he/settings.php
new file mode 100644
index 000000000..357a58c56
--- /dev/null
+++ b/lib/plugins/authldap/lang/he/settings.php
@@ -0,0 +1,8 @@
+<?php
+
+/**
+ * @license GPL 2 (http://www.gnu.org/licenses/gpl.html)
+ *
+ * @author matt carroll <matt.carroll@gmail.com>
+ */
+$lang['starttls'] = 'השתמש בחיבורי TLS';
diff --git a/lib/plugins/authldap/lang/hu/settings.php b/lib/plugins/authldap/lang/hu/settings.php
index b4b28d0a0..041f82755 100644
--- a/lib/plugins/authldap/lang/hu/settings.php
+++ b/lib/plugins/authldap/lang/hu/settings.php
@@ -1,7 +1,8 @@
<?php
+
/**
- * Hungarian language file
- *
+ * @license GPL 2 (http://www.gnu.org/licenses/gpl.html)
+ *
* @author Marton Sebok <sebokmarton@gmail.com>
*/
$lang['server'] = 'LDAP-szerver. Hosztnév (<code>localhost</code>) vagy abszolút URL portszámmal (<code>ldap://server.tld:389</code>)';
diff --git a/lib/plugins/authldap/lang/it/settings.php b/lib/plugins/authldap/lang/it/settings.php
index 023159489..eba7cde6e 100644
--- a/lib/plugins/authldap/lang/it/settings.php
+++ b/lib/plugins/authldap/lang/it/settings.php
@@ -4,6 +4,7 @@
* @license GPL 2 (http://www.gnu.org/licenses/gpl.html)
*
* @author Edmondo Di Tucci <snarchio@gmail.com>
+ * @author Claudio Lanconelli <lancos@libero.it>
*/
$lang['server'] = 'Il tuo server LDAP. Inserire o l\'hostname (<code>localhost</code>) oppure un URL completo (<code>ldap://server.tld:389</code>)';
$lang['port'] = 'Porta del server LDAP se non è stato fornito un URL completo più sopra.';
@@ -13,3 +14,6 @@ $lang['userfilter'] = 'Filtro per cercare l\'account utente LDAP. Eg.
$lang['groupfilter'] = 'Filtro per cercare i gruppi LDAP. Eg. <code>(&amp;(objectClass=posixGroup)(|(gidNumber=%{gid})(memberUID=%{user})))</code>';
$lang['version'] = 'Versione protocollo da usare. Pu<code>3</code>';
$lang['starttls'] = 'Usare la connessione TSL?';
+$lang['userscope'] = 'Limita il contesto di ricerca per la ricerca degli utenti';
+$lang['groupscope'] = 'Limita il contesto di ricerca per la ricerca dei gruppi';
+$lang['debug'] = 'In caso di errori mostra ulteriori informazioni di debug';
diff --git a/lib/plugins/authldap/lang/ja/settings.php b/lib/plugins/authldap/lang/ja/settings.php
index fdc6fc434..6dec9a576 100644
--- a/lib/plugins/authldap/lang/ja/settings.php
+++ b/lib/plugins/authldap/lang/ja/settings.php
@@ -1,6 +1,24 @@
<?php
+
/**
- * Japanese language file
- *
+ * @license GPL 2 (http://www.gnu.org/licenses/gpl.html)
+ *
* @author Satoshi Sahara <sahara.satoshi@gmail.com>
+ * @author Hideaki SAWADA <sawadakun@live.jp>
+ * @author Hideaki SAWADA <chuno@live.jp>
*/
+$lang['server'] = 'LDAPサーバー。ホスト名(<code>localhost</code)又は完全修飾URL(<code>ldap://server.tld:389</code>)';
+$lang['port'] = '上記が完全修飾URLでない場合、LDAPサーバーポート';
+$lang['usertree'] = 'ユーザーアカウントを探す場所。例:<code>ou=People, dc=server, dc=tld</code>';
+$lang['grouptree'] = 'ユーザーグループを探す場所。例:<code>ou=Group, dc=server, dc=tld</code>';
+$lang['userfilter'] = 'ユーザーアカウントを探すためのLDAP抽出条件。例:<code>(&amp;(uid=%{user})(objectClass=posixAccount))</code>';
+$lang['groupfilter'] = 'グループを探すLDAP抽出条件。例:<code>(&amp;(objectClass=posixGroup)(|(gidNumber=%{gid})(memberUID=%{user})))</code>';
+$lang['version'] = '使用するプロトコルのバージョン。<code>3</code>を設定する必要がある場合があります。';
+$lang['starttls'] = 'TLS接続を使用しますか?';
+$lang['binddn'] = '匿名バインドでは不十分な場合、オプションバインドユーザーのDN。例:<code>cn=admin, dc=my, dc=home</code>';
+$lang['bindpw'] = '上記ユーザーのパスワード';
+$lang['debug'] = 'エラーに関して追加のデバッグ情報を表示する。';
+$lang['deref_o_0'] = 'LDAP_DEREF_NEVER';
+$lang['deref_o_1'] = 'LDAP_DEREF_SEARCHING';
+$lang['deref_o_2'] = 'LDAP_DEREF_FINDING';
+$lang['deref_o_3'] = 'LDAP_DEREF_ALWAYS';
diff --git a/lib/plugins/authldap/lang/ko/settings.php b/lib/plugins/authldap/lang/ko/settings.php
index 6200a03b9..ae8dc7ab6 100644
--- a/lib/plugins/authldap/lang/ko/settings.php
+++ b/lib/plugins/authldap/lang/ko/settings.php
@@ -1,7 +1,8 @@
<?php
+
/**
- * Korean language file
- *
+ * @license GPL 2 (http://www.gnu.org/licenses/gpl.html)
+ *
* @author Myeongjin <aranet100@gmail.com>
*/
$lang['server'] = 'LDAP 서버. 호스트 이름(<code>localhost</code>)이나 전체 자격 URL(<code>ldap://server.tld:389</code>) 중 하나';
@@ -16,11 +17,11 @@ $lang['referrals'] = '참고(referrals)를 허용하겠습니까? ';
$lang['deref'] = '어떻게 별명을 간접 참고하겠습니까?';
$lang['binddn'] = '익명 바인드가 충분하지 않으면 선택적인 바인드 사용자의 DN. 예를 들어 <code>cn=admin, dc=my, dc=home</code>';
$lang['bindpw'] = '위 사용자의 비밀번호';
-$lang['userscope'] = '사용자 찾기에 대한 찾기 범위 제한';
-$lang['groupscope'] = '그룹 찾기에 대한 찾기 범위 제한';
+$lang['userscope'] = '사용자 검색에 대한 검색 범위 제한';
+$lang['groupscope'] = '그룹 검색에 대한 검색 범위 제한';
$lang['groupkey'] = '(표준 AD 그룹 대신) 사용자 속성에서 그룹 구성원. 예를 들어 부서나 전화에서 그룹';
$lang['debug'] = '오류에 대한 추가적인 디버그 정보를 보이기';
-$lang['deref_o_0'] = 'LDAP_DEREF_NEVER (없음)';
-$lang['deref_o_1'] = 'LDAP_DEREF_SEARCHING (검색)';
-$lang['deref_o_2'] = 'LDAP_DEREF_FINDING (발견)';
-$lang['deref_o_3'] = 'LDAP_DEREF_ALWAYS (항상)';
+$lang['deref_o_0'] = 'LDAP_DEREF_NEVER';
+$lang['deref_o_1'] = 'LDAP_DEREF_SEARCHING';
+$lang['deref_o_2'] = 'LDAP_DEREF_FINDING';
+$lang['deref_o_3'] = 'LDAP_DEREF_ALWAYS';
diff --git a/lib/plugins/authldap/lang/nl/settings.php b/lib/plugins/authldap/lang/nl/settings.php
index b6eed6f38..193d1a386 100644
--- a/lib/plugins/authldap/lang/nl/settings.php
+++ b/lib/plugins/authldap/lang/nl/settings.php
@@ -4,16 +4,17 @@
* @license GPL 2 (http://www.gnu.org/licenses/gpl.html)
*
* @author Gerrit Uitslag <klapinklapin@gmail.com>
+ * @author Remon <no@email.local>
*/
-$lang['server'] = 'Je LDAP server. Ofwel servernaam (<code>localhost</code>) of volledige URL (<code>ldap://server.tld:389</code>)';
-$lang['port'] = 'LDAP server poort als hiervoor geen volledige URL is opgegeven';
+$lang['server'] = 'Je LDAP server. Of de servernaam (<code>localhost</code>) of de volledige URL (<code>ldap://server.tld:389</code>)';
+$lang['port'] = 'LDAP server poort als bij de entry hierboven geen volledige URL is opgegeven';
$lang['usertree'] = 'Locatie van de gebruikersaccounts. Bijv. <code>ou=Personen,dc=server,dc=tld</code>';
$lang['grouptree'] = 'Locatie van de gebruikersgroepen. Bijv. <code>ou=Group,dc=server,dc=tld</code>';
$lang['userfilter'] = 'LDAP gebruikersfilter. Bijv. <code>(&amp;(uid=%{user})(objectClass=posixAccount))</code>';
$lang['groupfilter'] = 'LDAP groepsfilter. Bijv. <code>(&amp;(objectClass=posixGroup)(|(gidNumber=%{gid})(memberUID=%{user})))</code>';
-$lang['version'] = 'Te gebruiken protocolversie. Je zou het moeten kunnen instellen op <code>3</code>';
-$lang['starttls'] = 'Gebruiken TLS verbindingen';
-$lang['referrals'] = 'Moeten verwijzingen worden gevolg';
+$lang['version'] = 'Te gebruiken protocolversie. Mogelijk dat dit ingesteld moet worden op <code>3</code>';
+$lang['starttls'] = 'Gebruik maken van TLS verbindingen?';
+$lang['referrals'] = 'Moeten verwijzingen worden gevolgd?';
$lang['deref'] = 'Hoe moeten de verwijzing van aliases worden bepaald?';
$lang['binddn'] = 'DN van een optionele bind gebruiker als anonieme bind niet genoeg is. Bijv. <code>cn=beheer, dc=mijn, dc=thuis</code>';
$lang['bindpw'] = 'Wachtwoord van bovenstaande gebruiker';
diff --git a/lib/plugins/authldap/lang/pl/settings.php b/lib/plugins/authldap/lang/pl/settings.php
index 44641f514..084521e0d 100644
--- a/lib/plugins/authldap/lang/pl/settings.php
+++ b/lib/plugins/authldap/lang/pl/settings.php
@@ -1,7 +1,8 @@
<?php
+
/**
- * Polish language file
- *
+ * @license GPL 2 (http://www.gnu.org/licenses/gpl.html)
+ *
*/
$lang['starttls'] = 'Użyć połączeń TLS?';
$lang['bindpw'] = 'Hasło powyższego użytkownika';
diff --git a/lib/plugins/authldap/lang/pt-br/settings.php b/lib/plugins/authldap/lang/pt-br/settings.php
index d12a9cf36..6ad6b4862 100644
--- a/lib/plugins/authldap/lang/pt-br/settings.php
+++ b/lib/plugins/authldap/lang/pt-br/settings.php
@@ -1,7 +1,8 @@
<?php
+
/**
- * Brazilian Portuguese language file
- *
+ * @license GPL 2 (http://www.gnu.org/licenses/gpl.html)
+ *
* @author Victor Westmann <victor.westmann@gmail.com>
* @author Frederico Guimarães <frederico@teia.bio.br>
*/
diff --git a/lib/plugins/authldap/lang/pt/settings.php b/lib/plugins/authldap/lang/pt/settings.php
new file mode 100644
index 000000000..a2ccf87ad
--- /dev/null
+++ b/lib/plugins/authldap/lang/pt/settings.php
@@ -0,0 +1,18 @@
+<?php
+
+/**
+ * @license GPL 2 (http://www.gnu.org/licenses/gpl.html)
+ *
+ * @author André Neves <drakferion@gmail.com>
+ */
+$lang['server'] = 'O seu servidor de LDAP. Ou hostname (<code>localhost</code>) ou URL qualificado completo (<code>ldap://servidor.tld:389</code>)';
+$lang['port'] = 'Porta de servidor de LDAP se o URL completo não foi fornecido acima';
+$lang['usertree'] = 'Onde encontrar as contas de utilizador. Por exemplo <code>ou=Pessoas, dc=servidor, dc=tld</code>';
+$lang['grouptree'] = 'Onde encontrar os grupos de utilizadores. Por exemplo code>ou=Grupo, dc=servidor, dc=tld</code>';
+$lang['userfilter'] = 'Filtro LDAP para procurar por contas de utilizador. Por exemplo <code>(&amp;(uid=%{user})(objectClass=posixAccount))</code>';
+$lang['groupfilter'] = 'Filtro LDAP para procurar por grupos. Por exemplo <code>(&amp;(objectClass=posixGroup)(|(gidNumber=%{gid})(memberUID=%{user})))</code>';
+$lang['version'] = 'A versão do protocolo a utilizar. Pode precisar de alterar isto para <code>3</code>';
+$lang['starttls'] = 'Usar ligações TLS?';
+$lang['referrals'] = 'Referrals devem ser seguidos?';
+$lang['bindpw'] = 'Senha do utilizador acima';
+$lang['debug'] = 'Mostrar informação adicional de debug aquando de erros';
diff --git a/lib/plugins/authldap/lang/ru/settings.php b/lib/plugins/authldap/lang/ru/settings.php
index 4c394080e..70ad7b6f4 100644
--- a/lib/plugins/authldap/lang/ru/settings.php
+++ b/lib/plugins/authldap/lang/ru/settings.php
@@ -1,6 +1,9 @@
<?php
+
/**
- * Russian language file
- *
+ * @license GPL 2 (http://www.gnu.org/licenses/gpl.html)
+ *
* @author Ivan I. Udovichenko (sendtome@mymailbox.pp.ua)
+ * @author Aleksandr Selivanov <alexgearbox@gmail.com>
*/
+$lang['bindpw'] = 'Пароль для указанного пользователя.';
diff --git a/lib/plugins/authldap/lang/sk/settings.php b/lib/plugins/authldap/lang/sk/settings.php
new file mode 100644
index 000000000..c44f07e97
--- /dev/null
+++ b/lib/plugins/authldap/lang/sk/settings.php
@@ -0,0 +1,27 @@
+<?php
+
+/**
+ * @license GPL 2 (http://www.gnu.org/licenses/gpl.html)
+ *
+ * @author Martin Michalek <michalek.dev@gmail.com>
+ */
+$lang['server'] = 'LDAP server. Adresa (<code>localhost</code>) alebo úplné URL (<code>ldap://server.tld:389</code>)';
+$lang['port'] = 'Port LDAP servera, ak nebolo vyššie zadané úplné URL';
+$lang['usertree'] = 'Umiestnenie účtov používateľov. Napr. <code>ou=People, dc=server, dc=tld</code>';
+$lang['grouptree'] = 'Umiestnenie skupín používateľov. Napr. <code>ou=Group, dc=server, dc=tld</code>';
+$lang['userfilter'] = 'LDAP filter pre vyhľadávanie používateľských účtov. Napr. <code>(&amp;(uid=%{user})(objectClass=posixAccount))</code>';
+$lang['groupfilter'] = 'LDAP filter pre vyhľadávanie skupín. Napr. <code>(&amp;(objectClass=posixGroup)(|(gidNumber=%{gid})(memberUID=%{user})))</code>';
+$lang['version'] = 'Použitá verzia protokolu. Možno bude potrebné nastaviť na hodnotu <code>3</code>';
+$lang['starttls'] = 'Použiť TLS pripojenie?';
+$lang['referrals'] = 'Majú byť nasledované odkazy na používateľov (referrals)?';
+$lang['deref'] = 'Ako previesť aliasy?';
+$lang['binddn'] = 'DN prípadného priradenia používateľa, ak anonymné priradenie nie je dostatočné. Napr. <code>cn=admin, dc=my, dc=home</code>';
+$lang['bindpw'] = 'Heslo vyššie uvedeného používateľa';
+$lang['userscope'] = 'Obmedzenie oblasti pri vyhľadávaní používateľa';
+$lang['groupscope'] = 'Obmedzenie oblasti pri vyhľadávaní skupiny';
+$lang['groupkey'] = 'Príslušnost k skupine určená z daného atribútu používateľa (namiesto štandardnej AD skupiny) napr. skupiny podľa oddelenia alebo telefónneho čísla';
+$lang['debug'] = 'Zobraziť doplňujúce ladiace informácie pri chybe';
+$lang['deref_o_0'] = 'LDAP_DEREF_NEVER';
+$lang['deref_o_1'] = 'LDAP_DEREF_SEARCHING';
+$lang['deref_o_2'] = 'LDAP_DEREF_FINDING';
+$lang['deref_o_3'] = 'LDAP_DEREF_ALWAYS';
diff --git a/lib/plugins/authldap/lang/zh-tw/settings.php b/lib/plugins/authldap/lang/zh-tw/settings.php
index d2513eeff..7e35ef632 100644
--- a/lib/plugins/authldap/lang/zh-tw/settings.php
+++ b/lib/plugins/authldap/lang/zh-tw/settings.php
@@ -1,5 +1,4 @@
<?php
-
/**
* @license GPL 2 (http://www.gnu.org/licenses/gpl.html)
*
@@ -20,3 +19,8 @@ $lang['userscope'] = '限制使用者搜索的範圍';
$lang['groupscope'] = '限制群組搜索的範圍';
$lang['groupkey'] = '以其他使用者屬性 (而非標準 AD 群組) 來把使用者分組,例如以部門或電話號碼分類';
$lang['debug'] = '有錯誤時,顯示額外除錯資訊';
+
+$lang['deref_o_0'] = 'LDAP_DEREF_NEVER';
+$lang['deref_o_1'] = 'LDAP_DEREF_SEARCHING';
+$lang['deref_o_2'] = 'LDAP_DEREF_FINDING';
+$lang['deref_o_3'] = 'LDAP_DEREF_ALWAYS';
diff --git a/lib/plugins/authldap/lang/zh/settings.php b/lib/plugins/authldap/lang/zh/settings.php
index b531c192a..77c2c6952 100644
--- a/lib/plugins/authldap/lang/zh/settings.php
+++ b/lib/plugins/authldap/lang/zh/settings.php
@@ -20,3 +20,7 @@ $lang['userscope'] = '限制用户搜索的范围';
$lang['groupscope'] = '限制组搜索的范围';
$lang['groupkey'] = '根据任何用户属性得来的组成员(而不是标准的 AD 组),例如根据部门或者电话号码得到的组。';
$lang['debug'] = '有错误时显示额外的调试信息';
+$lang['deref_o_0'] = 'LDAP_DEREF_NEVER';
+$lang['deref_o_1'] = 'LDAP_DEREF_SEARCHING';
+$lang['deref_o_2'] = 'LDAP_DEREF_FINDING';
+$lang['deref_o_3'] = 'LDAP_DEREF_ALWAYS';
diff --git a/lib/plugins/authmysql/lang/bg/settings.php b/lib/plugins/authmysql/lang/bg/settings.php
index fcc7f625d..cd6370218 100644
--- a/lib/plugins/authmysql/lang/bg/settings.php
+++ b/lib/plugins/authmysql/lang/bg/settings.php
@@ -1,8 +1,10 @@
<?php
+
/**
- * Bulgarian language file
- *
+ * @license GPL 2 (http://www.gnu.org/licenses/gpl.html)
+ *
* @author Kiril <neohidra@gmail.com>
+ * @author Ivan Peltekov <ivan.peltekov@abv.bg>
*/
$lang['server'] = 'Вашият MySQL сървър';
$lang['user'] = 'MySQL потребителско име';
@@ -10,8 +12,8 @@ $lang['password'] = 'Парола за горния потреби
$lang['database'] = 'Име на базата от данни';
$lang['charset'] = 'Набор от знаци, който се ползва в базата от данни';
$lang['debug'] = 'Показване на допълнителна debug информация';
-
-
-$lang['debug_o_0'] = 'не';
-$lang['debug_o_1'] = 'само при грешка';
-$lang['debug_o_2'] = 'за всяко SQL запитване'; \ No newline at end of file
+$lang['checkPass'] = 'SQL заявка за проверка на паролите';
+$lang['getUserInfo'] = 'SQL заявка за извличане на информация за потребителя н';
+$lang['debug_o_0'] = 'не';
+$lang['debug_o_1'] = 'само при грешка';
+$lang['debug_o_2'] = 'за всяко SQL запитване';
diff --git a/lib/plugins/authmysql/lang/cs/settings.php b/lib/plugins/authmysql/lang/cs/settings.php
index 7fedefbbb..350c3236b 100644
--- a/lib/plugins/authmysql/lang/cs/settings.php
+++ b/lib/plugins/authmysql/lang/cs/settings.php
@@ -1,7 +1,8 @@
<?php
+
/**
- * Czech language file
- *
+ * @license GPL 2 (http://www.gnu.org/licenses/gpl.html)
+ *
* @author mkucera66@seznam.cz
*/
$lang['server'] = 'Váš server MySQL';
diff --git a/lib/plugins/authmysql/lang/da/settings.php b/lib/plugins/authmysql/lang/da/settings.php
new file mode 100644
index 000000000..1e38cb6b4
--- /dev/null
+++ b/lib/plugins/authmysql/lang/da/settings.php
@@ -0,0 +1,27 @@
+<?php
+
+/**
+ * @license GPL 2 (http://www.gnu.org/licenses/gpl.html)
+ *
+ * @author Jens Hyllegaard <jens.hyllegaard@gmail.com>
+ * @author soer9648 <soer9648@eucl.dk>
+ */
+$lang['server'] = 'Din MySQL server';
+$lang['user'] = 'MySQL brugernavn';
+$lang['password'] = 'Kodeord til ovenstående bruger';
+$lang['database'] = 'Database der skal benyttes';
+$lang['charset'] = 'Tegnsæt benyttet i database';
+$lang['checkPass'] = 'SQL-sætning til at kontrollere kodeord';
+$lang['getUserInfo'] = 'SQL-sætning til at hente brugerinformation';
+$lang['getUsers'] = 'SQL-sætning til at liste alle brugere';
+$lang['addUser'] = 'SQL-sætning til at tilføje en ny bruger';
+$lang['addGroup'] = 'SQL-sætning til at tilføje en ny gruppe';
+$lang['addUserGroup'] = 'SQL-sætning til at tilføje en bruger til en eksisterende gruppe';
+$lang['delGroup'] = 'SQL-sætning til at fjerne en gruppe';
+$lang['delUser'] = 'SQL-sætning til at slette en bruger';
+$lang['delUserRefs'] = 'SQL-sætning til at fjerne en bruger fra alle grupper';
+$lang['updateUser'] = 'SQL-sætning til at opdatere en brugerprofil';
+$lang['debug'] = 'Vis yderligere debug output';
+$lang['debug_o_0'] = 'ingen';
+$lang['debug_o_1'] = 'kun ved fejl';
+$lang['debug_o_2'] = 'alle SQL forespørgsler';
diff --git a/lib/plugins/authmysql/lang/de-informal/settings.php b/lib/plugins/authmysql/lang/de-informal/settings.php
index 540979cf4..d8d2778b9 100644
--- a/lib/plugins/authmysql/lang/de-informal/settings.php
+++ b/lib/plugins/authmysql/lang/de-informal/settings.php
@@ -1,8 +1,8 @@
<?php
+
/**
- * German informal language file
- *
* @license GPL 2 (http://www.gnu.org/licenses/gpl.html)
+ *
* @author Matthias Schulte <dokuwiki@lupo49.de>
* @author Volker Bödker <volker@boedker.de>
*/
diff --git a/lib/plugins/authmysql/lang/en/settings.php b/lib/plugins/authmysql/lang/en/settings.php
index 77e4806b9..b95f39701 100644
--- a/lib/plugins/authmysql/lang/en/settings.php
+++ b/lib/plugins/authmysql/lang/en/settings.php
@@ -19,7 +19,7 @@ $lang['FilterGroup'] = 'SQL clause for filtering users by group membership'
$lang['SortOrder'] = 'SQL clause to sort users';
$lang['addUser'] = 'SQL statement to add a new user';
$lang['addGroup'] = 'SQL statement to add a new group';
-$lang['addUserGroup'] = 'SQL statment to add a user to an existing group';
+$lang['addUserGroup'] = 'SQL statement to add a user to an existing group';
$lang['delGroup'] = 'SQL statement to remove a group';
$lang['getUserID'] = 'SQL statement to get the primary key of a user';
$lang['delUser'] = 'SQL statement to delete a user';
@@ -36,4 +36,4 @@ $lang['getGroupID'] = 'SQL statement to get the primary key of a given gro
$lang['debug_o_0'] = 'none';
$lang['debug_o_1'] = 'on errors only';
-$lang['debug_o_2'] = 'all SQL queries'; \ No newline at end of file
+$lang['debug_o_2'] = 'all SQL queries';
diff --git a/lib/plugins/authmysql/lang/eo/settings.php b/lib/plugins/authmysql/lang/eo/settings.php
index 907c761f8..92e973396 100644
--- a/lib/plugins/authmysql/lang/eo/settings.php
+++ b/lib/plugins/authmysql/lang/eo/settings.php
@@ -1,7 +1,8 @@
<?php
+
/**
- * Esperanto language file
- *
+ * @license GPL 2 (http://www.gnu.org/licenses/gpl.html)
+ *
*/
$lang['server'] = 'Via MySQL-servilo';
$lang['user'] = 'MySQL uzantonomo';
diff --git a/lib/plugins/authmysql/lang/es/settings.php b/lib/plugins/authmysql/lang/es/settings.php
new file mode 100644
index 000000000..64d422102
--- /dev/null
+++ b/lib/plugins/authmysql/lang/es/settings.php
@@ -0,0 +1,12 @@
+<?php
+
+/**
+ * @license GPL 2 (http://www.gnu.org/licenses/gpl.html)
+ *
+ * @author Antonio Bueno <atnbueno@gmail.com>
+ */
+$lang['server'] = 'Tu servidor MySQL';
+$lang['user'] = 'Nombre de usuario MySQL';
+$lang['database'] = 'Base de datos a usar';
+$lang['charset'] = 'Codificación usada en la base de datos';
+$lang['debug'] = 'Mostrar información adicional para depuración de errores';
diff --git a/lib/plugins/authmysql/lang/hu/settings.php b/lib/plugins/authmysql/lang/hu/settings.php
index 9489c73f9..4edceae1e 100644
--- a/lib/plugins/authmysql/lang/hu/settings.php
+++ b/lib/plugins/authmysql/lang/hu/settings.php
@@ -1,7 +1,8 @@
<?php
+
/**
- * Hungarian language file
- *
+ * @license GPL 2 (http://www.gnu.org/licenses/gpl.html)
+ *
* @author Marton Sebok <sebokmarton@gmail.com>
*/
$lang['server'] = 'MySQL-szerver';
diff --git a/lib/plugins/authmysql/lang/it/settings.php b/lib/plugins/authmysql/lang/it/settings.php
index 10ae72f87..e493ec7e9 100644
--- a/lib/plugins/authmysql/lang/it/settings.php
+++ b/lib/plugins/authmysql/lang/it/settings.php
@@ -1,5 +1,8 @@
<?php
+
/**
- * Italian language file
- *
+ * @license GPL 2 (http://www.gnu.org/licenses/gpl.html)
+ *
+ * @author Claudio Lanconelli <lancos@libero.it>
*/
+$lang['debug'] = 'Mostra ulteriori informazioni di debug';
diff --git a/lib/plugins/authmysql/lang/ja/settings.php b/lib/plugins/authmysql/lang/ja/settings.php
index 45f938fec..e5d5689df 100644
--- a/lib/plugins/authmysql/lang/ja/settings.php
+++ b/lib/plugins/authmysql/lang/ja/settings.php
@@ -1,7 +1,8 @@
<?php
+
/**
- * Japanese language file
- *
+ * @license GPL 2 (http://www.gnu.org/licenses/gpl.html)
+ *
* @author Satoshi Sahara <sahara.satoshi@gmail.com>
*/
$lang['server'] = 'MySQL のホスト名';
@@ -10,7 +11,7 @@ $lang['password'] = 'MySQL 接続用ユーザーのパスワード'
$lang['database'] = '使用するデータベース名';
$lang['charset'] = 'データベースの文字コード';
$lang['debug'] = 'デバック情報を表示する';
-$lang['forwardClearPass'] = '以下で定義する SQL ステートメントにおいて, パスワード変数 %{pass} を平文とする(DokiWiki側で暗号化しない)';
+$lang['forwardClearPass'] = '以下で定義する SQL ステートメントにおいて, パスワード変数 &#x25;{pass} を平文とする(DokiWiki側で暗号化しない)';
$lang['TablesToLock'] = '書き込み時にロックするテーブル(コンマ区切りで列挙)';
$lang['checkPass'] = 'パスワードの照合に用いる SQL ステートメント';
$lang['getUserInfo'] = 'ユーザー情報の取得に用いる SQL ステートメント';
diff --git a/lib/plugins/authmysql/lang/ko/settings.php b/lib/plugins/authmysql/lang/ko/settings.php
index c5518b8cc..b3479ad41 100644
--- a/lib/plugins/authmysql/lang/ko/settings.php
+++ b/lib/plugins/authmysql/lang/ko/settings.php
@@ -1,8 +1,10 @@
<?php
+
/**
- * Korean language file
- *
+ * @license GPL 2 (http://www.gnu.org/licenses/gpl.html)
+ *
* @author Myeongjin <aranet100@gmail.com>
+ * @author Garam <rowain8@gmail.com>
*/
$lang['server'] = 'MySQL 서버';
$lang['user'] = 'MySQL 사용자 이름';
@@ -16,10 +18,10 @@ $lang['checkPass'] = '비밀번호를 확인하기 위한 SQL 문';
$lang['getUserInfo'] = '사용자 정보를 가져오기 위한 SQL 문';
$lang['getGroups'] = '사용자의 그룹 구성원을 가져오기 위한 SQL 문';
$lang['getUsers'] = '모든 사용자를 나타낼 SQL 문';
-$lang['FilterLogin'] = '로그인 이름 별로 사용자를 필터하기 위한 SQL 조항';
-$lang['FilterName'] = '전체 이름 별로 사용자를 필터하기 위한 SQL 조항';
-$lang['FilterEmail'] = '이메일 주소 별로 사용자를 필터하기 위한 SQL 조항';
-$lang['FilterGroup'] = '그룹 구성원 별로 사용자를 필터하기 위한 SQL 조항';
+$lang['FilterLogin'] = '로그인 이름별로 사용자를 필터하기 위한 SQL 조항';
+$lang['FilterName'] = '전체 이름별로 사용자를 필터하기 위한 SQL 조항';
+$lang['FilterEmail'] = '이메일 주소별로 사용자를 필터하기 위한 SQL 조항';
+$lang['FilterGroup'] = '그룹 구성원별로 사용자를 필터하기 위한 SQL 조항';
$lang['SortOrder'] = '사용자를 정렬할 SQL 조항';
$lang['addUser'] = '새 사용자를 추가할 SQL 문';
$lang['addGroup'] = '새 그룹을 추가할 SQL 문';
diff --git a/lib/plugins/authmysql/lang/nl/settings.php b/lib/plugins/authmysql/lang/nl/settings.php
index 39fa32112..9848f2019 100644
--- a/lib/plugins/authmysql/lang/nl/settings.php
+++ b/lib/plugins/authmysql/lang/nl/settings.php
@@ -3,38 +3,39 @@
/**
* @license GPL 2 (http://www.gnu.org/licenses/gpl.html)
*
+ * @author Remon <no@email.local>
*/
-$lang['server'] = 'Je MySQL server';
+$lang['server'] = 'De MySQL server';
$lang['user'] = 'MySql gebruikersnaam';
$lang['password'] = 'Wachtwoord van bovenstaande gebruiker';
$lang['database'] = 'Te gebruiken database';
$lang['charset'] = 'Tekenset voor database';
$lang['debug'] = 'Tonen aanvullende debuginformatie';
$lang['forwardClearPass'] = 'Wachtwoorden als leesbare tekst in SQL commando\'s opnemen in plaats van versleutelde tekens';
-$lang['TablesToLock'] = 'Commagesepareerde lijst van tabellen die gelocked moeten worden bij schrijfacties';
-$lang['checkPass'] = 'SQL commando voor verifiëren van wachtwoorden';
-$lang['getUserInfo'] = 'SQL commando voor ophalen gebruikersinformatie';
-$lang['getGroups'] = 'SQL commando voor ophalen groepslidmaatschappen';
-$lang['getUsers'] = 'SQL commando voor tonen alle gebruikers';
-$lang['FilterLogin'] = 'SQL clausule voor filteren gebruikers op inlognaam';
-$lang['FilterName'] = 'SQL clausule voor filteren gebruikers op volledige naam';
-$lang['FilterEmail'] = 'SQL clausule voor filteren gebruikers op e-mailadres';
-$lang['FilterGroup'] = 'SQL clausule voor filteren gebruikers op groepslidmaatschap';
-$lang['SortOrder'] = 'SQL clausule voor sorteren gebruikers';
-$lang['addUser'] = 'SQL commando om een gebruiker toe te voegen';
-$lang['addGroup'] = 'SQL commando om een groep toe te voegen';
-$lang['addUserGroup'] = 'SQL commando om een gebruiker aan een groep toe te voegen';
+$lang['TablesToLock'] = 'Kommagescheiden lijst van tabellen die gelocked moeten worden bij schrijfacties';
+$lang['checkPass'] = 'SQL commando voor het verifiëren van wachtwoorden';
+$lang['getUserInfo'] = 'SQL commando voor het ophalen van gebruikersinformatie';
+$lang['getGroups'] = 'SQL commando voor het ophalen van groepslidmaatschappen';
+$lang['getUsers'] = 'SQL commando voor het tonen van alle gebruikers';
+$lang['FilterLogin'] = 'SQL clausule voor het filteren van gebruikers op inlognaam';
+$lang['FilterName'] = 'SQL clausule voor het filteren van gebruikers op volledige naam';
+$lang['FilterEmail'] = 'SQL clausule voor het filteren van gebruikers op e-mailadres';
+$lang['FilterGroup'] = 'SQL clausule voor het filteren van gebruikers op groepslidmaatschap';
+$lang['SortOrder'] = 'SQL clausule voor het sorteren van gebruikers';
+$lang['addUser'] = 'SQL commando om een nieuwe gebruiker toe te voegen';
+$lang['addGroup'] = 'SQL commando om een nieuwe groep toe te voegen';
+$lang['addUserGroup'] = 'SQL commando om een gebruiker aan een bestaande groep toe te voegen';
$lang['delGroup'] = 'SQL commando om een groep te verwijderen';
$lang['getUserID'] = 'SQL commando om de de primaire sleutel van een gebruiker op te halen';
$lang['delUser'] = 'SQL commando om een gebruiker te verwijderen';
$lang['delUserRefs'] = 'SQL commando om een gebruiker uit alle groepen te verwijderen';
$lang['updateUser'] = 'SQL commando om een gebruikersprofiel bij te werken';
-$lang['UpdateLogin'] = 'Bijwerkcommando om een inlognaam bij te werken';
-$lang['UpdatePass'] = 'Bijwerkcommando om een wachtwoord bij te werken';
-$lang['UpdateEmail'] = 'Bijwerkcommando om een e-mailadres bij te werken';
-$lang['UpdateName'] = 'Bijwerkcommando om een volledige naam te werken';
-$lang['UpdateTarget'] = 'Beperkingsclausule om gebruiker te identificeren voor bijwerken';
-$lang['delUserGroup'] = 'SQL commando om een gebruiker uit een bepaalde te verwijderen';
+$lang['UpdateLogin'] = 'Bijwerkcommando om de inlognaam van de gebruiker bij te werken';
+$lang['UpdatePass'] = 'Bijwerkcommando om het wachtwoord van de gebruiker bij te werken';
+$lang['UpdateEmail'] = 'Bijwerkcommando om het e-mailadres van de gebruiker bij te werken';
+$lang['UpdateName'] = 'Bijwerkcommando om de volledige naam van de gebruiker bij te werken';
+$lang['UpdateTarget'] = 'Beperkingsclausule om de gebruiker te identificeren voor bijwerken';
+$lang['delUserGroup'] = 'SQL commando om een gebruiker uit een bepaalde groep te verwijderen';
$lang['getGroupID'] = 'SQL commando om de primaire sletel van een bepaalde groep op te halen';
$lang['debug_o_0'] = 'geen';
$lang['debug_o_1'] = 'alleen bij fouten';
diff --git a/lib/plugins/authmysql/lang/pl/settings.php b/lib/plugins/authmysql/lang/pl/settings.php
index 93528cf34..5ae6bf168 100644
--- a/lib/plugins/authmysql/lang/pl/settings.php
+++ b/lib/plugins/authmysql/lang/pl/settings.php
@@ -1,7 +1,8 @@
<?php
+
/**
- * Polish language file
- *
+ * @license GPL 2 (http://www.gnu.org/licenses/gpl.html)
+ *
*/
$lang['server'] = 'Twój server MySQL';
$lang['user'] = 'Nazwa użytkownika MySQL';
diff --git a/lib/plugins/authmysql/lang/pt-br/settings.php b/lib/plugins/authmysql/lang/pt-br/settings.php
index 8ac775b54..1181a0b27 100644
--- a/lib/plugins/authmysql/lang/pt-br/settings.php
+++ b/lib/plugins/authmysql/lang/pt-br/settings.php
@@ -1,7 +1,8 @@
<?php
+
/**
- * Brazilian Portuguese language file
- *
+ * @license GPL 2 (http://www.gnu.org/licenses/gpl.html)
+ *
* @author Victor Westmann <victor.westmann@gmail.com>
* @author Frederico Guimarães <frederico@teia.bio.br>
*/
diff --git a/lib/plugins/authmysql/lang/pt/settings.php b/lib/plugins/authmysql/lang/pt/settings.php
new file mode 100644
index 000000000..0c7f303e7
--- /dev/null
+++ b/lib/plugins/authmysql/lang/pt/settings.php
@@ -0,0 +1,23 @@
+<?php
+
+/**
+ * @license GPL 2 (http://www.gnu.org/licenses/gpl.html)
+ *
+ * @author André Neves <drakferion@gmail.com>
+ */
+$lang['server'] = 'O seu servidor de MySQL';
+$lang['user'] = 'Utilizador MySQL';
+$lang['password'] = 'Senha para o utilizador acima';
+$lang['database'] = 'Base de dados a usar';
+$lang['debug'] = 'Mostrar informação adicional de debug';
+$lang['FilterLogin'] = 'Cláusula SQL para filtrar utilizadores por tipo de login';
+$lang['FilterName'] = 'Cláusula SQL para filtrar utilizadores por nome completo';
+$lang['FilterEmail'] = 'Cláusula SQL para filtrar utilizadores por endereço de email';
+$lang['FilterGroup'] = 'Cláusula SQL para filtrar utilizadores por pertença a grupo';
+$lang['SortOrder'] = 'Cláusula SQL para ordenar utilizadores';
+$lang['UpdateLogin'] = 'Cláusula de atualização para atualizar o nome de login do utilizador';
+$lang['UpdatePass'] = 'Cláusula de atualização para atualizar a senha do utilizador';
+$lang['UpdateEmail'] = 'Cláusula de atualização para atualizar o endereço de email do utilizador';
+$lang['UpdateName'] = 'Cláusula de atualização para atualizar o nome completo do utilizador';
+$lang['debug_o_0'] = 'nenhum';
+$lang['debug_o_1'] = 'só aquando de erros';
diff --git a/lib/plugins/authmysql/lang/ru/settings.php b/lib/plugins/authmysql/lang/ru/settings.php
index 23fd349af..2d8f4788e 100644
--- a/lib/plugins/authmysql/lang/ru/settings.php
+++ b/lib/plugins/authmysql/lang/ru/settings.php
@@ -4,6 +4,7 @@
* @license GPL 2 (http://www.gnu.org/licenses/gpl.html)
*
* @author Ivan I. Udovichenko (sendtome@mymailbox.pp.ua)
+ * @author Aleksandr Selivanov <alexgearbox@gmail.com>
*/
$lang['server'] = 'Ваш MySQL-сервер';
$lang['user'] = 'Имя пользователя MySQL';
@@ -17,12 +18,12 @@ $lang['checkPass'] = 'Выражение SQL, осуществляю
$lang['getUserInfo'] = 'Выражение SQL, осуществляющее извлечение информации о пользователе';
$lang['getGroups'] = 'Выражение SQL, осуществляющее извлечение информации о членстве пользователе в группах';
$lang['getUsers'] = 'Выражение SQL, осуществляющее извлечение полного списка пользователей';
-$lang['FilterLogin'] = 'Выражение SQL, осуществляющее фильтрацию пользователей по пользовательскому имени';
+$lang['FilterLogin'] = 'Выражение SQL, осуществляющее фильтрацию пользователей по логину';
$lang['FilterName'] = 'Выражение SQL, осуществляющее фильтрацию пользователей по полному имени';
$lang['FilterEmail'] = 'Выражение SQL, осуществляющее фильтрацию пользователей по адресу электронной почты';
$lang['FilterGroup'] = 'Выражение SQL, осуществляющее фильтрацию пользователей согласно членству в группе';
$lang['SortOrder'] = 'Выражение SQL, осуществляющее сортировку пользователей';
-$lang['addUser'] = 'Выражение SQL, осуществляющее добавление нового опльзователя';
+$lang['addUser'] = 'Выражение SQL, осуществляющее добавление нового пользователя';
$lang['addGroup'] = 'Выражение SQL, осуществляющее добавление новой группы';
$lang['addUserGroup'] = 'Выражение SQL, осуществляющее добавление пользователя в существующую группу';
$lang['delGroup'] = 'Выражение SQL, осуществляющее удаление группы';
diff --git a/lib/plugins/authmysql/lang/sk/settings.php b/lib/plugins/authmysql/lang/sk/settings.php
new file mode 100644
index 000000000..d7e8cb286
--- /dev/null
+++ b/lib/plugins/authmysql/lang/sk/settings.php
@@ -0,0 +1,42 @@
+<?php
+
+/**
+ * @license GPL 2 (http://www.gnu.org/licenses/gpl.html)
+ *
+ * @author Martin Michalek <michalek.dev@gmail.com>
+ */
+$lang['server'] = 'MySQL server';
+$lang['user'] = 'Meno používateľa MySQL';
+$lang['password'] = 'Heslo pre vyššie uvedeného používateľa';
+$lang['database'] = 'Použiť databázu';
+$lang['charset'] = 'Znaková sada databázy';
+$lang['debug'] = 'Zobraziť doplňujúce ladiace informácie';
+$lang['forwardClearPass'] = 'Posielať heslo ako nezakódovaný text nižšie uvedenému SQL príkazu namiesto použitia kódovania';
+$lang['TablesToLock'] = 'Zoznam tabuliek oddelených čiarkou, ktoré by mali byť uzamknuté pri operáciách zápisu';
+$lang['checkPass'] = 'SQL príkaz pre kontrolu hesla';
+$lang['getUserInfo'] = 'SQL príkaz pre získanie informácií o používateľovi';
+$lang['getGroups'] = 'SQL príkaz pre získanie informácií o skupinách používateľa';
+$lang['getUsers'] = 'SQL príkaz pre získanie zoznamu používateľov';
+$lang['FilterLogin'] = 'SQL podmienka pre filtrovanie používateľov podľa prihlasovacieho mena';
+$lang['FilterName'] = 'SQL podmienka pre filtrovanie používateľov podľa mena a priezviska';
+$lang['FilterEmail'] = 'SQL podmienka pre filtrovanie používateľov podľa emailovej adresy';
+$lang['FilterGroup'] = 'SQL podmienka pre filtrovanie používateľov podľa skupiny';
+$lang['SortOrder'] = 'SQL podmienka pre usporiadenia používateľov';
+$lang['addUser'] = 'SQL príkaz pre pridanie nového používateľa';
+$lang['addGroup'] = 'SQL príkaz pre pridanie novej skupiny';
+$lang['addUserGroup'] = 'SQL príkaz pre pridanie používateľa do existujúcej skupiny';
+$lang['delGroup'] = 'SQL príkaz pre zrušenie skupiny';
+$lang['getUserID'] = 'SQL príkaz pre získanie primárneho klúča používateľa';
+$lang['delUser'] = 'SQL príkaz pre zrušenie používateľa';
+$lang['delUserRefs'] = 'SQL príkaz pre vyradenie používateľa zo všetkých skupín';
+$lang['updateUser'] = 'SQL príkaz pre aktualizáciu informácií o používateľovi';
+$lang['UpdateLogin'] = 'SQL podmienka pre aktualizáciu prihlasovacieho mena používateľa';
+$lang['UpdatePass'] = 'SQL podmienka pre aktualizáciu hesla používateľa';
+$lang['UpdateEmail'] = 'SQL podmienka pre aktualizáciu emailovej adresy používateľa';
+$lang['UpdateName'] = 'SQL podmienka pre aktualizáciu mena a priezviska používateľa';
+$lang['UpdateTarget'] = 'Podmienka identifikácie používateľa pri aktualizácii';
+$lang['delUserGroup'] = 'SQL príkaz pre vyradenie používateľa z danej skupiny';
+$lang['getGroupID'] = 'SQL príkaz pre získanie primárneho kľúča skupiny';
+$lang['debug_o_0'] = 'žiadne';
+$lang['debug_o_1'] = 'iba pri chybách';
+$lang['debug_o_2'] = 'všetky SQL dopyty';
diff --git a/lib/plugins/authmysql/lang/sl/settings.php b/lib/plugins/authmysql/lang/sl/settings.php
new file mode 100644
index 000000000..5e82816df
--- /dev/null
+++ b/lib/plugins/authmysql/lang/sl/settings.php
@@ -0,0 +1,11 @@
+<?php
+
+/**
+ * @license GPL 2 (http://www.gnu.org/licenses/gpl.html)
+ *
+ * @author Matej Urbančič <mateju@svn.gnome.org>
+ */
+$lang['database'] = 'Podatkovna zbirka za uporabo';
+$lang['debug_o_0'] = 'brez';
+$lang['debug_o_1'] = 'le ob napakah';
+$lang['debug_o_2'] = 'vse poizvedbe SQL';
diff --git a/lib/plugins/authpgsql/lang/bg/settings.php b/lib/plugins/authpgsql/lang/bg/settings.php
index 0defdc4ff..bd6ae1cee 100644
--- a/lib/plugins/authpgsql/lang/bg/settings.php
+++ b/lib/plugins/authpgsql/lang/bg/settings.php
@@ -1,7 +1,8 @@
<?php
+
/**
- * Bulgarian language file
- *
+ * @license GPL 2 (http://www.gnu.org/licenses/gpl.html)
+ *
* @author Kiril <neohidra@gmail.com>
*/
$lang['server'] = 'Вашият PostgreSQL сървър';
@@ -9,4 +10,4 @@ $lang['port'] = 'Порт за PostgreSQL сървъра';
$lang['user'] = 'PostgreSQL потребител';
$lang['password'] = 'Парола за горния потребител';
$lang['database'] = 'Име на базата от данни';
-$lang['debug'] = 'Показване на допълнителна debug информация'; \ No newline at end of file
+$lang['debug'] = 'Показване на допълнителна debug информация';
diff --git a/lib/plugins/authpgsql/lang/cs/settings.php b/lib/plugins/authpgsql/lang/cs/settings.php
index 06abe86f4..aec7eecf1 100644
--- a/lib/plugins/authpgsql/lang/cs/settings.php
+++ b/lib/plugins/authpgsql/lang/cs/settings.php
@@ -1,7 +1,8 @@
<?php
+
/**
- * Czech language file
- *
+ * @license GPL 2 (http://www.gnu.org/licenses/gpl.html)
+ *
* @author mkucera66@seznam.cz
*/
$lang['server'] = 'Váš server PostgreSQL';
diff --git a/lib/plugins/authpgsql/lang/da/settings.php b/lib/plugins/authpgsql/lang/da/settings.php
new file mode 100644
index 000000000..007174815
--- /dev/null
+++ b/lib/plugins/authpgsql/lang/da/settings.php
@@ -0,0 +1,22 @@
+<?php
+
+/**
+ * @license GPL 2 (http://www.gnu.org/licenses/gpl.html)
+ *
+ * @author Jens Hyllegaard <jens.hyllegaard@gmail.com>
+ * @author soer9648 <soer9648@eucl.dk>
+ */
+$lang['server'] = 'Din PostgresSQL server';
+$lang['port'] = 'Din PostgresSQL servers port';
+$lang['password'] = 'Kodeord til ovenstående bruger';
+$lang['database'] = 'Database der skal benyttes';
+$lang['debug'] = 'Vis yderligere debug output';
+$lang['checkPass'] = 'SQL-sætning til at kontrollere kodeord';
+$lang['getUsers'] = 'SQL-sætning til at liste alle brugere';
+$lang['addUser'] = 'SQL-sætning til at tilføje en ny bruger';
+$lang['addGroup'] = 'SQL-sætning til at tilføje en ny gruppe';
+$lang['addUserGroup'] = 'SQL-sætning til at tilføje en bruger til en eksisterende gruppe';
+$lang['delGroup'] = 'SQL-sætning til at fjerne en gruppe';
+$lang['delUser'] = 'SQL-sætning til at slette en bruger';
+$lang['delUserRefs'] = 'SQL-sætning til at fjerne en bruger fra alle grupper';
+$lang['updateUser'] = 'SQL-sætning til at opdatere en brugerprofil';
diff --git a/lib/plugins/authpgsql/lang/de-informal/settings.php b/lib/plugins/authpgsql/lang/de-informal/settings.php
index d864d14d4..3e3a0dc4e 100644
--- a/lib/plugins/authpgsql/lang/de-informal/settings.php
+++ b/lib/plugins/authpgsql/lang/de-informal/settings.php
@@ -1,8 +1,8 @@
<?php
+
/**
- * German language file
- *
* @license GPL 2 (http://www.gnu.org/licenses/gpl.html)
+ *
* @author Matthias Schulte <dokuwiki@lupo49.de>
* @author Volker Bödker <volker@boedker.de>
*/
diff --git a/lib/plugins/authpgsql/lang/en/settings.php b/lib/plugins/authpgsql/lang/en/settings.php
index e67235cfa..cfb2686cb 100644
--- a/lib/plugins/authpgsql/lang/en/settings.php
+++ b/lib/plugins/authpgsql/lang/en/settings.php
@@ -18,7 +18,7 @@ $lang['FilterGroup'] = 'SQL clause for filtering users by group membership'
$lang['SortOrder'] = 'SQL clause to sort users';
$lang['addUser'] = 'SQL statement to add a new user';
$lang['addGroup'] = 'SQL statement to add a new group';
-$lang['addUserGroup'] = 'SQL statment to add a user to an existing group';
+$lang['addUserGroup'] = 'SQL statement to add a user to an existing group';
$lang['delGroup'] = 'SQL statement to remove a group';
$lang['getUserID'] = 'SQL statement to get the primary key of a user';
$lang['delUser'] = 'SQL statement to delete a user';
diff --git a/lib/plugins/authpgsql/lang/eo/settings.php b/lib/plugins/authpgsql/lang/eo/settings.php
index dbdfdd41b..2f59c4914 100644
--- a/lib/plugins/authpgsql/lang/eo/settings.php
+++ b/lib/plugins/authpgsql/lang/eo/settings.php
@@ -1,7 +1,8 @@
<?php
+
/**
- * Esperanto language file
- *
+ * @license GPL 2 (http://www.gnu.org/licenses/gpl.html)
+ *
*/
$lang['server'] = 'Via PostgreSQL-servilo';
$lang['port'] = 'Via PostgreSQL-servila pordego';
diff --git a/lib/plugins/authpgsql/lang/hu/settings.php b/lib/plugins/authpgsql/lang/hu/settings.php
index 7b9393256..ff62a7016 100644
--- a/lib/plugins/authpgsql/lang/hu/settings.php
+++ b/lib/plugins/authpgsql/lang/hu/settings.php
@@ -1,7 +1,8 @@
<?php
+
/**
- * Hungarian language file
- *
+ * @license GPL 2 (http://www.gnu.org/licenses/gpl.html)
+ *
* @author Marton Sebok <sebokmarton@gmail.com>
*/
$lang['server'] = 'PostgreSQL-szerver';
diff --git a/lib/plugins/authpgsql/lang/ja/settings.php b/lib/plugins/authpgsql/lang/ja/settings.php
index 4883caa4c..d7a5f6cf2 100644
--- a/lib/plugins/authpgsql/lang/ja/settings.php
+++ b/lib/plugins/authpgsql/lang/ja/settings.php
@@ -1,7 +1,8 @@
<?php
+
/**
- * Japanese language file
- *
+ * @license GPL 2 (http://www.gnu.org/licenses/gpl.html)
+ *
* @author Satoshi Sahara <sahara.satoshi@gmail.com>
*/
$lang['server'] = 'PostgreSQL のサーバー名';
@@ -10,7 +11,7 @@ $lang['user'] = 'PostgreSQL 接続用ユーザー名';
$lang['password'] = 'PostgreSQL 接続用ユーザーのパスワード';
$lang['database'] = '使用するデータベース名';
$lang['debug'] = 'デバック情報を表示する';
-$lang['forwardClearPass'] = '以下で定義する SQL ステートメントにおいて, パスワード変数 %{pass} を平文とする(DokiWiki側で暗号化しない)';
+$lang['forwardClearPass'] = '以下で定義する SQL ステートメントにおいて, パスワード変数 &#x25;{pass} を平文とする(DokiWiki側で暗号化しない)';
$lang['checkPass'] = 'パスワードの照合に用いる SQL ステートメント';
$lang['getUserInfo'] = 'ユーザー情報の取得に用いる SQL ステートメント';
$lang['getGroups'] = 'ユーザーが所属する全てのグループの取得に用いる SQL ステートメント';
diff --git a/lib/plugins/authpgsql/lang/ko/settings.php b/lib/plugins/authpgsql/lang/ko/settings.php
index d21e81cd6..bdf38b3c7 100644
--- a/lib/plugins/authpgsql/lang/ko/settings.php
+++ b/lib/plugins/authpgsql/lang/ko/settings.php
@@ -1,8 +1,10 @@
<?php
+
/**
- * Korean language file
- *
+ * @license GPL 2 (http://www.gnu.org/licenses/gpl.html)
+ *
* @author Myeongjin <aranet100@gmail.com>
+ * @author Garam <rowain8@gmail.com>
*/
$lang['server'] = 'PostgreSQL 서버';
$lang['port'] = 'PostgreSQL 서버의 포트';
@@ -15,10 +17,10 @@ $lang['checkPass'] = '비밀번호를 확인하기 위한 SQL 문';
$lang['getUserInfo'] = '사용자 정보를 가져오기 위한 SQL 문';
$lang['getGroups'] = '사용자의 그룹 구성원을 가져오기 위한 SQL 문';
$lang['getUsers'] = '모든 사용자를 나타낼 SQL 문';
-$lang['FilterLogin'] = '로그인 이름 별로 사용자를 필터하기 위한 SQL 조항';
-$lang['FilterName'] = '전체 이름 별로 사용자를 필터하기 위한 SQL 조항';
-$lang['FilterEmail'] = '이메일 주소 별로 사용자를 필터하기 위한 SQL 조항';
-$lang['FilterGroup'] = '그룹 구성원 별로 사용자를 필터하기 위한 SQL 조항';
+$lang['FilterLogin'] = '로그인 이름별로 사용자를 필터하기 위한 SQL 조항';
+$lang['FilterName'] = '전체 이름별로 사용자를 필터하기 위한 SQL 조항';
+$lang['FilterEmail'] = '이메일 주소별로 사용자를 필터하기 위한 SQL 조항';
+$lang['FilterGroup'] = '그룹 구성원별로 사용자를 필터하기 위한 SQL 조항';
$lang['SortOrder'] = '사용자를 정렬할 SQL 조항';
$lang['addUser'] = '새 사용자를 추가할 SQL 문';
$lang['addGroup'] = '새 그룹을 추가할 SQL 문';
diff --git a/lib/plugins/authpgsql/lang/nl/settings.php b/lib/plugins/authpgsql/lang/nl/settings.php
index 496017f1c..3faa78705 100644
--- a/lib/plugins/authpgsql/lang/nl/settings.php
+++ b/lib/plugins/authpgsql/lang/nl/settings.php
@@ -3,35 +3,36 @@
/**
* @license GPL 2 (http://www.gnu.org/licenses/gpl.html)
*
+ * @author Remon <no@email.local>
*/
-$lang['server'] = 'Je PostgrSQL server';
+$lang['server'] = 'Je PostgreSQL server';
$lang['port'] = 'Je PostgreSQL server poort';
-$lang['user'] = 'PostgrSQL gebruikersnaam';
+$lang['user'] = 'PostgreSQL gebruikersnaam';
$lang['password'] = 'Wachtwoord voor bovenstaande gebruiker';
$lang['database'] = 'Te gebruiken database';
$lang['debug'] = 'Tonen aanvullende debuginformatie';
-$lang['forwardClearPass'] = 'Wachtwoorden als leesbare tekst in SQL commando\'s opnemen in plaats van versleutelde tekens';
-$lang['checkPass'] = 'SQL commando voor verifiëren wachtwoorden';
-$lang['getUserInfo'] = 'SQL commando voor ophalen gebruikersinformatie';
-$lang['getGroups'] = 'SQL commando voor ophalen groepslidmaatschappen van gebruikers';
-$lang['getUsers'] = 'SQL commando voor tonen alle gebruikers';
-$lang['FilterLogin'] = 'SQL commando voor filteren gebruikers op inlognaam';
-$lang['FilterName'] = 'SQL commando voor filteren gebruikers op volledige naam';
-$lang['FilterEmail'] = 'SQL commando voor filteren gebruikers op e-mailadres';
-$lang['FilterGroup'] = 'SQL commando voor filteren gebruikers op groepslidmaatschap';
-$lang['SortOrder'] = 'SQL commando voor sorteren gebruikers';
-$lang['addUser'] = 'SQL commando voor toevoegen nieuwe gebruiker';
-$lang['addGroup'] = 'SQL commando voor toevoegen nieuwe groep';
-$lang['addUserGroup'] = 'SQL commando voor toevoegen gebruiker aan bestaande groep';
-$lang['delGroup'] = 'SQL commando voor verwijderen groep';
+$lang['forwardClearPass'] = 'Wachtwoorden als leesbare tekst in SQL commando\'s opnemen in plaats van versleuteld';
+$lang['checkPass'] = 'SQL commando voor het verifiëren van wachtwoorden';
+$lang['getUserInfo'] = 'SQL commando voor het ophalen van gebruikersinformatie';
+$lang['getGroups'] = 'SQL commando voor het ophalen van groepslidmaatschappen van gebruikers';
+$lang['getUsers'] = 'SQL commando voor het tonen van alle gebruikers';
+$lang['FilterLogin'] = 'SQL commando voor het filteren van gebruikers op inlognaam';
+$lang['FilterName'] = 'SQL commando voor het filteren van gebruikers op volledige naam';
+$lang['FilterEmail'] = 'SQL commando voor het filteren van gebruikers op e-mailadres';
+$lang['FilterGroup'] = 'SQL commando voor het filteren van gebruikers op groepslidmaatschap';
+$lang['SortOrder'] = 'SQL commando voor het sorteren van gebruikers';
+$lang['addUser'] = 'SQL commando voor het toevoegen van een nieuwe gebruiker';
+$lang['addGroup'] = 'SQL commando voor het toevoegen van een nieuwe groep';
+$lang['addUserGroup'] = 'SQL commando voor toevoegen van een gebruiker aan een bestaande groep';
+$lang['delGroup'] = 'SQL commando voor het verwijderen van een groep';
$lang['getUserID'] = 'SQL commando om de primaire sleutel van een gebruiker op te halen';
-$lang['delUser'] = 'SQL commando voor verwijderen gebruiker';
+$lang['delUser'] = 'SQL commando voor het verwijderen van een gebruiker';
$lang['delUserRefs'] = 'SQL commando om een gebruiker uit alle groepen te verwijderen';
$lang['updateUser'] = 'SQL commando om een gebruikersprofiel bij te werken';
$lang['UpdateLogin'] = 'SQL commando om een inlognaam bij te werken';
$lang['UpdatePass'] = 'SQL commando om een wachtwoord bij te werken';
$lang['UpdateEmail'] = 'SQL commando om een e-mailadres bij te werken';
$lang['UpdateName'] = 'SQL commando om een volledige naam bij te werken';
-$lang['UpdateTarget'] = 'Beperkingsclausule om gebruiker te identificeren voor bijwerken';
+$lang['UpdateTarget'] = 'Beperkingsclausule om de gebruiker te identificeren bij het bijwerken';
$lang['delUserGroup'] = 'SQL commando om een gebruiker uit een bepaalde groep te verwijderen';
$lang['getGroupID'] = 'SQL commando om de primaire sleutel van een bepaalde groep op te halen';
diff --git a/lib/plugins/authpgsql/lang/pt-br/settings.php b/lib/plugins/authpgsql/lang/pt-br/settings.php
index 5ffe13465..8d7725392 100644
--- a/lib/plugins/authpgsql/lang/pt-br/settings.php
+++ b/lib/plugins/authpgsql/lang/pt-br/settings.php
@@ -1,7 +1,8 @@
<?php
+
/**
- * Brazilian Portuguese language file
- *
+ * @license GPL 2 (http://www.gnu.org/licenses/gpl.html)
+ *
* @author Victor Westmann <victor.westmann@gmail.com>
* @author Frederico Guimarães <frederico@teia.bio.br>
*/
diff --git a/lib/plugins/authpgsql/lang/pt/settings.php b/lib/plugins/authpgsql/lang/pt/settings.php
new file mode 100644
index 000000000..b33b81141
--- /dev/null
+++ b/lib/plugins/authpgsql/lang/pt/settings.php
@@ -0,0 +1,22 @@
+<?php
+
+/**
+ * @license GPL 2 (http://www.gnu.org/licenses/gpl.html)
+ *
+ * @author André Neves <drakferion@gmail.com>
+ */
+$lang['server'] = 'O seu servidor PostgreSQL';
+$lang['port'] = 'A porta do seu servidor PostgreSQL';
+$lang['user'] = 'Nome de utilizador PostgreSQL';
+$lang['password'] = 'Senha do utilizador acima';
+$lang['database'] = 'Base de dados a usar';
+$lang['debug'] = 'Mostrar informação adicional de debug';
+$lang['FilterLogin'] = 'Cláusula SQL para filtrar utilizadores por nome de login';
+$lang['FilterName'] = 'Cláusula SQL para filtrar utilizadores por nome completo';
+$lang['FilterEmail'] = 'Cláusula SQL para filtrar utilizadores por endereço de email';
+$lang['FilterGroup'] = 'Cláusula SQL para filtrar utilizadores por pertença a grupo';
+$lang['SortOrder'] = 'Cláusula SQL para ordenar utilizadores';
+$lang['UpdateLogin'] = 'Cláusula de atualização para atualizar o nome de login do utilizador';
+$lang['UpdatePass'] = 'Cláusula de atualização para atualizar a senha do utilizador';
+$lang['UpdateEmail'] = 'Cláusula de atualização para atualizar o endereço de email do utilizador';
+$lang['UpdateName'] = 'Cláusula de atualização para atualizar o nome completo do utilizador';
diff --git a/lib/plugins/authpgsql/lang/ru/settings.php b/lib/plugins/authpgsql/lang/ru/settings.php
index 4c394080e..48dd2a87c 100644
--- a/lib/plugins/authpgsql/lang/ru/settings.php
+++ b/lib/plugins/authpgsql/lang/ru/settings.php
@@ -1,6 +1,32 @@
<?php
+
/**
- * Russian language file
- *
+ * @license GPL 2 (http://www.gnu.org/licenses/gpl.html)
+ *
* @author Ivan I. Udovichenko (sendtome@mymailbox.pp.ua)
+ * @author Aleksandr Selivanov <alexgearbox@gmail.com>
*/
+$lang['server'] = 'Ваш PostgreSQL-сервер';
+$lang['port'] = 'Порт вашего PostgreSQL-сервера';
+$lang['user'] = 'Имя пользователя PostgreSQL';
+$lang['password'] = 'Пароль для указанного пользователя.';
+$lang['database'] = 'Имя базы данных';
+$lang['checkPass'] = 'Выражение SQL, осуществляющее проверку пароля';
+$lang['getUserInfo'] = 'Выражение SQL, осуществляющее извлечение информации о пользователе';
+$lang['getGroups'] = 'Выражение SQL, осуществляющее извлечение информации о членстве пользователе в группах';
+$lang['getUsers'] = 'Выражение SQL, осуществляющее извлечение полного списка пользователей';
+$lang['FilterLogin'] = 'Выражение SQL, осуществляющее фильтрацию пользователей по логину';
+$lang['FilterName'] = 'Выражение SQL, осуществляющее фильтрацию пользователей по полному имени';
+$lang['FilterEmail'] = 'Выражение SQL, осуществляющее фильтрацию пользователей по адресу электронной почты';
+$lang['FilterGroup'] = 'Выражение SQL, осуществляющее фильтрацию пользователей согласно членству в группе';
+$lang['SortOrder'] = 'Выражение SQL, осуществляющее сортировку пользователей';
+$lang['addUser'] = 'Выражение SQL, осуществляющее добавление нового пользователя';
+$lang['addGroup'] = 'Выражение SQL, осуществляющее добавление новой группы';
+$lang['addUserGroup'] = 'Выражение SQL, осуществляющее добавление пользователя в существующую группу';
+$lang['delGroup'] = 'Выражение SQL, осуществляющее удаление группы';
+$lang['getUserID'] = 'Выражение SQL, обеспечивающее получение первичного ключа пользователя';
+$lang['delUser'] = 'Выражение SQL, осуществляющее удаление пользователя';
+$lang['delUserRefs'] = 'Выражение SQL, осуществляющее удаление пользователя из всех группы';
+$lang['updateUser'] = 'Выражение SQL, осуществляющее обновление профиля пользователя';
+$lang['delUserGroup'] = 'Выражение SQL, осуществляющее удаление пользователя из указанной группы';
+$lang['getGroupID'] = 'Выражение SQL, обеспечивающее получение первичного ключа указанной группы';
diff --git a/lib/plugins/authpgsql/lang/sk/settings.php b/lib/plugins/authpgsql/lang/sk/settings.php
new file mode 100644
index 000000000..861d1237d
--- /dev/null
+++ b/lib/plugins/authpgsql/lang/sk/settings.php
@@ -0,0 +1,38 @@
+<?php
+
+/**
+ * @license GPL 2 (http://www.gnu.org/licenses/gpl.html)
+ *
+ * @author Martin Michalek <michalek.dev@gmail.com>
+ */
+$lang['server'] = 'PostgreSQL server';
+$lang['port'] = 'Port PostgreSQL servera';
+$lang['user'] = 'Meno používateľa PostgreSQL';
+$lang['password'] = 'Heslo pre vyššie uvedeného používateľa';
+$lang['database'] = 'Použiť databázu';
+$lang['debug'] = 'Zobraziť doplňujúce ladiace informácie';
+$lang['forwardClearPass'] = 'Posielať heslo ako nezakódovaný text nižšie uvedenému SQL príkazu namiesto použitia kódovania';
+$lang['checkPass'] = 'SQL príkaz pre kontrolu hesla';
+$lang['getUserInfo'] = 'SQL príkaz pre získanie informácií o používateľovi';
+$lang['getGroups'] = 'SQL príkaz pre získanie informácií o skupinách používateľa';
+$lang['getUsers'] = 'SQL príkaz pre získanie zoznamu používateľov';
+$lang['FilterLogin'] = 'SQL podmienka pre filtrovanie používateľov podľa prihlasovacieho mena';
+$lang['FilterName'] = 'SQL podmienka pre filtrovanie používateľov podľa mena a priezviska';
+$lang['FilterEmail'] = 'SQL podmienka pre filtrovanie používateľov podľa emailovej adresy';
+$lang['FilterGroup'] = 'SQL podmienka pre filtrovanie používateľov podľa skupiny';
+$lang['SortOrder'] = 'SQL podmienka pre usporiadenia používateľov';
+$lang['addUser'] = 'SQL príkaz pre pridanie nového používateľa';
+$lang['addGroup'] = 'SQL príkaz pre pridanie novej skupiny';
+$lang['addUserGroup'] = 'SQL príkaz pre pridanie používateľa do existujúcej skupiny';
+$lang['delGroup'] = 'SQL príkaz pre zrušenie skupiny';
+$lang['getUserID'] = 'SQL príkaz pre získanie primárneho klúča používateľa';
+$lang['delUser'] = 'SQL príkaz pre zrušenie používateľa';
+$lang['delUserRefs'] = 'SQL príkaz pre vyradenie používateľa zo všetkých skupín';
+$lang['updateUser'] = 'SQL príkaz pre aktualizáciu informácií o používateľovi';
+$lang['UpdateLogin'] = 'SQL podmienka pre aktualizáciu prihlasovacieho mena používateľa';
+$lang['UpdatePass'] = 'SQL podmienka pre aktualizáciu hesla používateľa';
+$lang['UpdateEmail'] = 'SQL podmienka pre aktualizáciu emailovej adresy používateľa';
+$lang['UpdateName'] = 'SQL podmienka pre aktualizáciu mena a priezviska používateľa';
+$lang['UpdateTarget'] = 'Podmienka identifikácie používateľa pri aktualizácii';
+$lang['delUserGroup'] = 'SQL príkaz pre vyradenie používateľa z danej skupiny';
+$lang['getGroupID'] = 'SQL príkaz pre získanie primárneho kľúča skupiny';
diff --git a/lib/plugins/authpgsql/lang/sl/settings.php b/lib/plugins/authpgsql/lang/sl/settings.php
new file mode 100644
index 000000000..4c369abc0
--- /dev/null
+++ b/lib/plugins/authpgsql/lang/sl/settings.php
@@ -0,0 +1,8 @@
+<?php
+
+/**
+ * @license GPL 2 (http://www.gnu.org/licenses/gpl.html)
+ *
+ * @author Matej Urbančič <mateju@svn.gnome.org>
+ */
+$lang['database'] = 'Podatkovna zbirka za uporabo';
diff --git a/lib/plugins/config/admin.php b/lib/plugins/config/admin.php
index 29529760c..835d27775 100644
--- a/lib/plugins/config/admin.php
+++ b/lib/plugins/config/admin.php
@@ -38,168 +38,168 @@ class admin_plugin_config extends DokuWiki_Admin_Plugin {
* handle user request
*/
function handle() {
- global $ID, $INPUT;
+ global $ID, $INPUT;
- if (!$this->_restore_session()) return $this->_close_session();
- if ($INPUT->int('save') != 1) return $this->_close_session();
- if (!checkSecurityToken()) return $this->_close_session();
+ if (!$this->_restore_session()) return $this->_close_session();
+ if ($INPUT->int('save') != 1) return $this->_close_session();
+ if (!checkSecurityToken()) return $this->_close_session();
- if (is_null($this->_config)) { $this->_config = new configuration($this->_file); }
+ if (is_null($this->_config)) { $this->_config = new configuration($this->_file); }
- // don't go any further if the configuration is locked
- if ($this->_config->_locked) return $this->_close_session();
+ // don't go any further if the configuration is locked
+ if ($this->_config->_locked) return $this->_close_session();
- $this->_input = $INPUT->arr('config');
+ $this->_input = $INPUT->arr('config');
- while (list($key) = each($this->_config->setting)) {
- $input = isset($this->_input[$key]) ? $this->_input[$key] : NULL;
- if ($this->_config->setting[$key]->update($input)) {
- $this->_changed = true;
+ while (list($key) = each($this->_config->setting)) {
+ $input = isset($this->_input[$key]) ? $this->_input[$key] : null;
+ if ($this->_config->setting[$key]->update($input)) {
+ $this->_changed = true;
+ }
+ if ($this->_config->setting[$key]->error()) $this->_error = true;
}
- if ($this->_config->setting[$key]->error()) $this->_error = true;
- }
- if ($this->_changed && !$this->_error) {
- $this->_config->save_settings($this->getPluginName());
+ if ($this->_changed && !$this->_error) {
+ $this->_config->save_settings($this->getPluginName());
- // save state & force a page reload to get the new settings to take effect
- $_SESSION['PLUGIN_CONFIG'] = array('state' => 'updated', 'time' => time());
- $this->_close_session();
- send_redirect(wl($ID,array('do'=>'admin','page'=>'config'),true,'&'));
- exit();
- } elseif(!$this->_error) {
- $this->_config->touch_settings(); // just touch to refresh cache
- }
+ // save state & force a page reload to get the new settings to take effect
+ $_SESSION['PLUGIN_CONFIG'] = array('state' => 'updated', 'time' => time());
+ $this->_close_session();
+ send_redirect(wl($ID,array('do'=>'admin','page'=>'config'),true,'&'));
+ exit();
+ } elseif(!$this->_error) {
+ $this->_config->touch_settings(); // just touch to refresh cache
+ }
- $this->_close_session();
+ $this->_close_session();
}
/**
* output appropriate html
*/
function html() {
- $allow_debug = $GLOBALS['conf']['allowdebug']; // avoid global $conf; here.
- global $lang;
- global $ID;
-
- if (is_null($this->_config)) { $this->_config = new configuration($this->_file); }
- $this->setupLocale(true);
-
- print $this->locale_xhtml('intro');
-
- ptln('<div id="config__manager">');
-
- if ($this->_config->locked)
- ptln('<div class="info">'.$this->getLang('locked').'</div>');
- elseif ($this->_error)
- ptln('<div class="error">'.$this->getLang('error').'</div>');
- elseif ($this->_changed)
- ptln('<div class="success">'.$this->getLang('updated').'</div>');
-
- // POST to script() instead of wl($ID) so config manager still works if
- // rewrite config is broken. Add $ID as hidden field to remember
- // current ID in most cases.
- ptln('<form action="'.script().'" method="post">');
- ptln('<div class="no"><input type="hidden" name="id" value="'.$ID.'" /></div>');
- formSecurityToken();
- $this->_print_h1('dokuwiki_settings', $this->getLang('_header_dokuwiki'));
-
- $undefined_settings = array();
- $in_fieldset = false;
- $first_plugin_fieldset = true;
- $first_template_fieldset = true;
- foreach($this->_config->setting as $setting) {
- if (is_a($setting, 'setting_hidden')) {
- // skip hidden (and undefined) settings
- if ($allow_debug && is_a($setting, 'setting_undefined')) {
- $undefined_settings[] = $setting;
- } else {
- continue;
- }
- } else if (is_a($setting, 'setting_fieldset')) {
- // config setting group
- if ($in_fieldset) {
- ptln(' </table>');
- ptln(' </div>');
- ptln(' </fieldset>');
- } else {
- $in_fieldset = true;
- }
- if ($first_plugin_fieldset && substr($setting->_key, 0, 10)=='plugin'.CM_KEYMARKER) {
- $this->_print_h1('plugin_settings', $this->getLang('_header_plugin'));
- $first_plugin_fieldset = false;
- } else if ($first_template_fieldset && substr($setting->_key, 0, 7)=='tpl'.CM_KEYMARKER) {
- $this->_print_h1('template_settings', $this->getLang('_header_template'));
- $first_template_fieldset = false;
- }
- ptln(' <fieldset id="'.$setting->_key.'">');
- ptln(' <legend>'.$setting->prompt($this).'</legend>');
- ptln(' <div class="table">');
- ptln(' <table class="inline">');
- } else {
- // config settings
- list($label,$input) = $setting->html($this, $this->_error);
-
- $class = $setting->is_default() ? ' class="default"' : ($setting->is_protected() ? ' class="protected"' : '');
- $error = $setting->error() ? ' class="value error"' : ' class="value"';
- $icon = $setting->caution() ? '<img src="'.DOKU_PLUGIN_IMAGES.$setting->caution().'.png" alt="'.$setting->caution().'" title="'.$this->getLang($setting->caution()).'" />' : '';
-
- ptln(' <tr'.$class.'>');
- ptln(' <td class="label">');
- ptln(' <span class="outkey">'.$setting->_out_key(true, true).'</span>');
- ptln(' '.$icon.$label);
- ptln(' </td>');
- ptln(' <td'.$error.'>'.$input.'</td>');
- ptln(' </tr>');
+ $allow_debug = $GLOBALS['conf']['allowdebug']; // avoid global $conf; here.
+ global $lang;
+ global $ID;
+
+ if (is_null($this->_config)) { $this->_config = new configuration($this->_file); }
+ $this->setupLocale(true);
+
+ print $this->locale_xhtml('intro');
+
+ ptln('<div id="config__manager">');
+
+ if ($this->_config->locked)
+ ptln('<div class="info">'.$this->getLang('locked').'</div>');
+ elseif ($this->_error)
+ ptln('<div class="error">'.$this->getLang('error').'</div>');
+ elseif ($this->_changed)
+ ptln('<div class="success">'.$this->getLang('updated').'</div>');
+
+ // POST to script() instead of wl($ID) so config manager still works if
+ // rewrite config is broken. Add $ID as hidden field to remember
+ // current ID in most cases.
+ ptln('<form action="'.script().'" method="post">');
+ ptln('<div class="no"><input type="hidden" name="id" value="'.$ID.'" /></div>');
+ formSecurityToken();
+ $this->_print_h1('dokuwiki_settings', $this->getLang('_header_dokuwiki'));
+
+ $undefined_settings = array();
+ $in_fieldset = false;
+ $first_plugin_fieldset = true;
+ $first_template_fieldset = true;
+ foreach($this->_config->setting as $setting) {
+ if (is_a($setting, 'setting_hidden')) {
+ // skip hidden (and undefined) settings
+ if ($allow_debug && is_a($setting, 'setting_undefined')) {
+ $undefined_settings[] = $setting;
+ } else {
+ continue;
+ }
+ } else if (is_a($setting, 'setting_fieldset')) {
+ // config setting group
+ if ($in_fieldset) {
+ ptln(' </table>');
+ ptln(' </div>');
+ ptln(' </fieldset>');
+ } else {
+ $in_fieldset = true;
+ }
+ if ($first_plugin_fieldset && substr($setting->_key, 0, 10)=='plugin'.CM_KEYMARKER) {
+ $this->_print_h1('plugin_settings', $this->getLang('_header_plugin'));
+ $first_plugin_fieldset = false;
+ } else if ($first_template_fieldset && substr($setting->_key, 0, 7)=='tpl'.CM_KEYMARKER) {
+ $this->_print_h1('template_settings', $this->getLang('_header_template'));
+ $first_template_fieldset = false;
+ }
+ ptln(' <fieldset id="'.$setting->_key.'">');
+ ptln(' <legend>'.$setting->prompt($this).'</legend>');
+ ptln(' <div class="table">');
+ ptln(' <table class="inline">');
+ } else {
+ // config settings
+ list($label,$input) = $setting->html($this, $this->_error);
+
+ $class = $setting->is_default() ? ' class="default"' : ($setting->is_protected() ? ' class="protected"' : '');
+ $error = $setting->error() ? ' class="value error"' : ' class="value"';
+ $icon = $setting->caution() ? '<img src="'.DOKU_PLUGIN_IMAGES.$setting->caution().'.png" alt="'.$setting->caution().'" title="'.$this->getLang($setting->caution()).'" />' : '';
+
+ ptln(' <tr'.$class.'>');
+ ptln(' <td class="label">');
+ ptln(' <span class="outkey">'.$setting->_out_key(true, true).'</span>');
+ ptln(' '.$icon.$label);
+ ptln(' </td>');
+ ptln(' <td'.$error.'>'.$input.'</td>');
+ ptln(' </tr>');
+ }
}
- }
- ptln(' </table>');
- ptln(' </div>');
- if ($in_fieldset) {
- ptln(' </fieldset>');
- }
+ ptln(' </table>');
+ ptln(' </div>');
+ if ($in_fieldset) {
+ ptln(' </fieldset>');
+ }
- // show undefined settings list
- if ($allow_debug && !empty($undefined_settings)) {
- function _setting_natural_comparison($a, $b) { return strnatcmp($a->_key, $b->_key); }
- usort($undefined_settings, '_setting_natural_comparison');
- $this->_print_h1('undefined_settings', $this->getLang('_header_undefined'));
- ptln('<fieldset>');
- ptln('<div class="table">');
- ptln('<table class="inline">');
- $undefined_setting_match = array();
- foreach($undefined_settings as $setting) {
- if (preg_match('/^(?:plugin|tpl)'.CM_KEYMARKER.'.*?'.CM_KEYMARKER.'(.*)$/', $setting->_key, $undefined_setting_match)) {
- $undefined_setting_key = $undefined_setting_match[1];
- } else {
- $undefined_setting_key = $setting->_key;
- }
- ptln(' <tr>');
- ptln(' <td class="label"><span title="$meta[\''.$undefined_setting_key.'\']">$'.$this->_config->_name.'[\''.$setting->_out_key().'\']</span></td>');
- ptln(' <td>'.$this->getLang('_msg_'.get_class($setting)).'</td>');
- ptln(' </tr>');
+ // show undefined settings list
+ if ($allow_debug && !empty($undefined_settings)) {
+ function _setting_natural_comparison($a, $b) { return strnatcmp($a->_key, $b->_key); }
+ usort($undefined_settings, '_setting_natural_comparison');
+ $this->_print_h1('undefined_settings', $this->getLang('_header_undefined'));
+ ptln('<fieldset>');
+ ptln('<div class="table">');
+ ptln('<table class="inline">');
+ $undefined_setting_match = array();
+ foreach($undefined_settings as $setting) {
+ if (preg_match('/^(?:plugin|tpl)'.CM_KEYMARKER.'.*?'.CM_KEYMARKER.'(.*)$/', $setting->_key, $undefined_setting_match)) {
+ $undefined_setting_key = $undefined_setting_match[1];
+ } else {
+ $undefined_setting_key = $setting->_key;
+ }
+ ptln(' <tr>');
+ ptln(' <td class="label"><span title="$meta[\''.$undefined_setting_key.'\']">$'.$this->_config->_name.'[\''.$setting->_out_key().'\']</span></td>');
+ ptln(' <td>'.$this->getLang('_msg_'.get_class($setting)).'</td>');
+ ptln(' </tr>');
+ }
+ ptln('</table>');
+ ptln('</div>');
+ ptln('</fieldset>');
}
- ptln('</table>');
- ptln('</div>');
- ptln('</fieldset>');
- }
- // finish up form
- ptln('<p>');
- ptln(' <input type="hidden" name="do" value="admin" />');
- ptln(' <input type="hidden" name="page" value="config" />');
+ // finish up form
+ ptln('<p>');
+ ptln(' <input type="hidden" name="do" value="admin" />');
+ ptln(' <input type="hidden" name="page" value="config" />');
- if (!$this->_config->locked) {
- ptln(' <input type="hidden" name="save" value="1" />');
- ptln(' <input type="submit" name="submit" class="button" value="'.$lang['btn_save'].'" accesskey="s" />');
- ptln(' <input type="reset" class="button" value="'.$lang['btn_reset'].'" />');
- }
+ if (!$this->_config->locked) {
+ ptln(' <input type="hidden" name="save" value="1" />');
+ ptln(' <input type="submit" name="submit" class="button" value="'.$lang['btn_save'].'" accesskey="s" />');
+ ptln(' <input type="reset" class="button" value="'.$lang['btn_reset'].'" />');
+ }
- ptln('</p>');
+ ptln('</p>');
- ptln('</form>');
- ptln('</div>');
+ ptln('</form>');
+ ptln('</div>');
}
/**
@@ -207,28 +207,28 @@ class admin_plugin_config extends DokuWiki_Admin_Plugin {
*/
function _restore_session() {
- // dokuwiki closes the session before act_dispatch. $_SESSION variables are all set,
- // however they can't be changed without starting the session again
- if (!headers_sent()) {
- session_start();
- $this->_session_started = true;
- }
+ // dokuwiki closes the session before act_dispatch. $_SESSION variables are all set,
+ // however they can't be changed without starting the session again
+ if (!headers_sent()) {
+ session_start();
+ $this->_session_started = true;
+ }
- if (!isset($_SESSION['PLUGIN_CONFIG'])) return true;
+ if (!isset($_SESSION['PLUGIN_CONFIG'])) return true;
- $session = $_SESSION['PLUGIN_CONFIG'];
- unset($_SESSION['PLUGIN_CONFIG']);
+ $session = $_SESSION['PLUGIN_CONFIG'];
+ unset($_SESSION['PLUGIN_CONFIG']);
- // still valid?
- if (time() - $session['time'] > 120) return true;
+ // still valid?
+ if (time() - $session['time'] > 120) return true;
- switch ($session['state']) {
- case 'updated' :
- $this->_changed = true;
- return false;
- }
+ switch ($session['state']) {
+ case 'updated' :
+ $this->_changed = true;
+ return false;
+ }
- return true;
+ return true;
}
function _close_session() {
@@ -237,62 +237,62 @@ class admin_plugin_config extends DokuWiki_Admin_Plugin {
function setupLocale($prompts=false) {
- parent::setupLocale();
- if (!$prompts || $this->_localised_prompts) return;
+ parent::setupLocale();
+ if (!$prompts || $this->_localised_prompts) return;
- $this->_setup_localised_plugin_prompts();
- $this->_localised_prompts = true;
+ $this->_setup_localised_plugin_prompts();
+ $this->_localised_prompts = true;
}
function _setup_localised_plugin_prompts() {
- global $conf;
-
- $langfile = '/lang/'.$conf['lang'].'/settings.php';
- $enlangfile = '/lang/en/settings.php';
+ global $conf;
+
+ $langfile = '/lang/'.$conf['lang'].'/settings.php';
+ $enlangfile = '/lang/en/settings.php';
+
+ if ($dh = opendir(DOKU_PLUGIN)) {
+ while (false !== ($plugin = readdir($dh))) {
+ if ($plugin == '.' || $plugin == '..' || $plugin == 'tmp' || $plugin == 'config') continue;
+ if (is_file(DOKU_PLUGIN.$plugin)) continue;
+
+ if (@file_exists(DOKU_PLUGIN.$plugin.$enlangfile)){
+ $lang = array();
+ @include(DOKU_PLUGIN.$plugin.$enlangfile);
+ if ($conf['lang'] != 'en') @include(DOKU_PLUGIN.$plugin.$langfile);
+ foreach ($lang as $key => $value){
+ $this->lang['plugin'.CM_KEYMARKER.$plugin.CM_KEYMARKER.$key] = $value;
+ }
+ }
+
+ // fill in the plugin name if missing (should exist for plugins with settings)
+ if (!isset($this->lang['plugin'.CM_KEYMARKER.$plugin.CM_KEYMARKER.'plugin_settings_name'])) {
+ $this->lang['plugin'.CM_KEYMARKER.$plugin.CM_KEYMARKER.'plugin_settings_name'] =
+ ucwords(str_replace('_', ' ', $plugin));
+ }
+ }
+ closedir($dh);
+ }
- if ($dh = opendir(DOKU_PLUGIN)) {
- while (false !== ($plugin = readdir($dh))) {
- if ($plugin == '.' || $plugin == '..' || $plugin == 'tmp' || $plugin == 'config') continue;
- if (is_file(DOKU_PLUGIN.$plugin)) continue;
+ // the same for the active template
+ $tpl = $conf['template'];
- if (@file_exists(DOKU_PLUGIN.$plugin.$enlangfile)){
+ if (@file_exists(tpl_incdir().$enlangfile)){
$lang = array();
- @include(DOKU_PLUGIN.$plugin.$enlangfile);
- if ($conf['lang'] != 'en') @include(DOKU_PLUGIN.$plugin.$langfile);
+ @include(tpl_incdir().$enlangfile);
+ if ($conf['lang'] != 'en') @include(tpl_incdir().$langfile);
foreach ($lang as $key => $value){
- $this->lang['plugin'.CM_KEYMARKER.$plugin.CM_KEYMARKER.$key] = $value;
+ $this->lang['tpl'.CM_KEYMARKER.$tpl.CM_KEYMARKER.$key] = $value;
}
- }
-
- // fill in the plugin name if missing (should exist for plugins with settings)
- if (!isset($this->lang['plugin'.CM_KEYMARKER.$plugin.CM_KEYMARKER.'plugin_settings_name'])) {
- $this->lang['plugin'.CM_KEYMARKER.$plugin.CM_KEYMARKER.'plugin_settings_name'] =
- ucwords(str_replace('_', ' ', $plugin));
- }
}
- closedir($dh);
- }
-
- // the same for the active template
- $tpl = $conf['template'];
- if (@file_exists(tpl_incdir().$enlangfile)){
- $lang = array();
- @include(tpl_incdir().$enlangfile);
- if ($conf['lang'] != 'en') @include(tpl_incdir().$langfile);
- foreach ($lang as $key => $value){
- $this->lang['tpl'.CM_KEYMARKER.$tpl.CM_KEYMARKER.$key] = $value;
+ // fill in the template name if missing (should exist for templates with settings)
+ if (!isset($this->lang['tpl'.CM_KEYMARKER.$tpl.CM_KEYMARKER.'template_settings_name'])) {
+ $this->lang['tpl'.CM_KEYMARKER.$tpl.CM_KEYMARKER.'template_settings_name'] =
+ ucwords(str_replace('_', ' ', $tpl));
}
- }
-
- // fill in the template name if missing (should exist for templates with settings)
- if (!isset($this->lang['tpl'.CM_KEYMARKER.$tpl.CM_KEYMARKER.'template_settings_name'])) {
- $this->lang['tpl'.CM_KEYMARKER.$tpl.CM_KEYMARKER.'template_settings_name'] =
- ucwords(str_replace('_', ' ', $tpl));
- }
- return true;
+ return true;
}
/**
@@ -301,59 +301,59 @@ class admin_plugin_config extends DokuWiki_Admin_Plugin {
* @author Ben Coburn <btcoburn@silicodon.net>
*/
function getTOC() {
- if (is_null($this->_config)) { $this->_config = new configuration($this->_file); }
- $this->setupLocale(true);
-
- $allow_debug = $GLOBALS['conf']['allowdebug']; // avoid global $conf; here.
-
- // gather toc data
- $has_undefined = false;
- $toc = array('conf'=>array(), 'plugin'=>array(), 'template'=>null);
- foreach($this->_config->setting as $setting) {
- if (is_a($setting, 'setting_fieldset')) {
- if (substr($setting->_key, 0, 10)=='plugin'.CM_KEYMARKER) {
- $toc['plugin'][] = $setting;
- } else if (substr($setting->_key, 0, 7)=='tpl'.CM_KEYMARKER) {
- $toc['template'] = $setting;
- } else {
- $toc['conf'][] = $setting;
- }
- } else if (!$has_undefined && is_a($setting, 'setting_undefined')) {
- $has_undefined = true;
+ if (is_null($this->_config)) { $this->_config = new configuration($this->_file); }
+ $this->setupLocale(true);
+
+ $allow_debug = $GLOBALS['conf']['allowdebug']; // avoid global $conf; here.
+
+ // gather toc data
+ $has_undefined = false;
+ $toc = array('conf'=>array(), 'plugin'=>array(), 'template'=>null);
+ foreach($this->_config->setting as $setting) {
+ if (is_a($setting, 'setting_fieldset')) {
+ if (substr($setting->_key, 0, 10)=='plugin'.CM_KEYMARKER) {
+ $toc['plugin'][] = $setting;
+ } else if (substr($setting->_key, 0, 7)=='tpl'.CM_KEYMARKER) {
+ $toc['template'] = $setting;
+ } else {
+ $toc['conf'][] = $setting;
+ }
+ } else if (!$has_undefined && is_a($setting, 'setting_undefined')) {
+ $has_undefined = true;
+ }
}
- }
- // build toc
- $t = array();
+ // build toc
+ $t = array();
- $t[] = html_mktocitem('configuration_manager', $this->getLang('_configuration_manager'), 1);
- $t[] = html_mktocitem('dokuwiki_settings', $this->getLang('_header_dokuwiki'), 1);
- foreach($toc['conf'] as $setting) {
- $name = $setting->prompt($this);
- $t[] = html_mktocitem($setting->_key, $name, 2);
- }
- if (!empty($toc['plugin'])) {
- $t[] = html_mktocitem('plugin_settings', $this->getLang('_header_plugin'), 1);
- }
- foreach($toc['plugin'] as $setting) {
- $name = $setting->prompt($this);
- $t[] = html_mktocitem($setting->_key, $name, 2);
- }
- if (isset($toc['template'])) {
- $t[] = html_mktocitem('template_settings', $this->getLang('_header_template'), 1);
- $setting = $toc['template'];
- $name = $setting->prompt($this);
- $t[] = html_mktocitem($setting->_key, $name, 2);
- }
- if ($has_undefined && $allow_debug) {
- $t[] = html_mktocitem('undefined_settings', $this->getLang('_header_undefined'), 1);
- }
+ $t[] = html_mktocitem('configuration_manager', $this->getLang('_configuration_manager'), 1);
+ $t[] = html_mktocitem('dokuwiki_settings', $this->getLang('_header_dokuwiki'), 1);
+ foreach($toc['conf'] as $setting) {
+ $name = $setting->prompt($this);
+ $t[] = html_mktocitem($setting->_key, $name, 2);
+ }
+ if (!empty($toc['plugin'])) {
+ $t[] = html_mktocitem('plugin_settings', $this->getLang('_header_plugin'), 1);
+ }
+ foreach($toc['plugin'] as $setting) {
+ $name = $setting->prompt($this);
+ $t[] = html_mktocitem($setting->_key, $name, 2);
+ }
+ if (isset($toc['template'])) {
+ $t[] = html_mktocitem('template_settings', $this->getLang('_header_template'), 1);
+ $setting = $toc['template'];
+ $name = $setting->prompt($this);
+ $t[] = html_mktocitem($setting->_key, $name, 2);
+ }
+ if ($has_undefined && $allow_debug) {
+ $t[] = html_mktocitem('undefined_settings', $this->getLang('_header_undefined'), 1);
+ }
- return $t;
+ return $t;
}
function _print_h1($id, $text) {
- ptln('<h1 id="'.$id.'">'.$text.'</h1>');
+ ptln('<h1 id="'.$id.'">'.$text.'</h1>');
}
diff --git a/lib/plugins/config/lang/de-informal/lang.php b/lib/plugins/config/lang/de-informal/lang.php
index 598c1a72d..7a17ace4a 100644
--- a/lib/plugins/config/lang/de-informal/lang.php
+++ b/lib/plugins/config/lang/de-informal/lang.php
@@ -108,7 +108,6 @@ $lang['target____media'] = 'Zielfenstername für Medienlinks';
$lang['target____windows'] = 'Zielfenstername für Windows-Freigaben-Links';
$lang['mediarevisions'] = 'Media-Revisionen (ältere Versionen) aktivieren?';
$lang['refcheck'] = 'Auf Verwendung beim Löschen von Media-Dateien testen';
-$lang['refshow'] = 'Wie viele Verwendungsorte der Media-Datei zeigen';
$lang['gdlib'] = 'GD Lib Version';
$lang['im_convert'] = 'Pfad zu ImageMagicks-Konvertierwerkzeug';
$lang['jpg_quality'] = 'JPEG Kompressionsqualität (0-100)';
diff --git a/lib/plugins/config/lang/de/lang.php b/lib/plugins/config/lang/de/lang.php
index 07eb4a750..e55081a91 100644
--- a/lib/plugins/config/lang/de/lang.php
+++ b/lib/plugins/config/lang/de/lang.php
@@ -76,7 +76,6 @@ $lang['camelcase'] = 'CamelCase-Verlinkungen verwenden';
$lang['deaccent'] = 'Seitennamen bereinigen';
$lang['useheading'] = 'Erste Überschrift als Seitennamen verwenden';
$lang['refcheck'] = 'Auf Verwendung beim Löschen von Media-Dateien testen';
-$lang['refshow'] = 'Wie viele Verwendungsorte der Media-Datei zeigen';
$lang['allowdebug'] = 'Debug-Ausgaben erlauben <b>Abschalten wenn nicht benötigt!</b>';
$lang['mediarevisions'] = 'Media-Revisionen (ältere Versionen) aktivieren?';
$lang['usewordblock'] = 'Spam-Blocking benutzen';
diff --git a/lib/plugins/config/lang/en/lang.php b/lib/plugins/config/lang/en/lang.php
index 67d3ce51f..cdef85a85 100644
--- a/lib/plugins/config/lang/en/lang.php
+++ b/lib/plugins/config/lang/en/lang.php
@@ -63,7 +63,7 @@ $lang['baseurl'] = 'Server URL (eg. <code>http://www.yourserver.com</code>).
$lang['cookiedir'] = 'Cookie path. Leave blank for using baseurl.';
$lang['dmode'] = 'Directory creation mode';
$lang['fmode'] = 'File creation mode';
-$lang['allowdebug'] = 'Allow debug <b>disable if not needed!</b>';
+$lang['allowdebug'] = 'Allow debug. <b>Disable if not needed!</b>';
/* Display Settings */
$lang['recent'] = 'Number of entries per page in the recent changes';
@@ -83,7 +83,7 @@ $lang['camelcase'] = 'Use CamelCase for links';
$lang['deaccent'] = 'How to clean pagenames';
$lang['useheading'] = 'Use first heading for pagenames';
$lang['sneaky_index'] = 'By default, DokuWiki will show all namespaces in the sitemap. Enabling this option will hide those where the user doesn\'t have read permissions. This might result in hiding of accessable subnamespaces which may make the index unusable with certain ACL setups.';
-$lang['hidepages'] = 'Hide pages matching this regular expressions from search, the sitemap and other automatic indexes';
+$lang['hidepages'] = 'Hide pages matching this regular expression from search, the sitemap and other automatic indexes';
/* Authentication Settings */
$lang['useacl'] = 'Use access control lists';
@@ -181,7 +181,7 @@ $lang['proxy____port'] = 'Proxy port';
$lang['proxy____user'] = 'Proxy user name';
$lang['proxy____pass'] = 'Proxy password';
$lang['proxy____ssl'] = 'Use SSL to connect to proxy';
-$lang['proxy____except'] = 'Regular expression to match URLs for which the proxy should be skipped for.';
+$lang['proxy____except'] = 'Regular expression to match URLs for which the proxy should be skipped.';
/* Safemode Hack */
$lang['safemodehack'] = 'Enable safemode hack';
diff --git a/lib/plugins/config/lang/ko/intro.txt b/lib/plugins/config/lang/ko/intro.txt
index c8b146930..d0b85606c 100644
--- a/lib/plugins/config/lang/ko/intro.txt
+++ b/lib/plugins/config/lang/ko/intro.txt
@@ -1,7 +1,9 @@
====== 환경 설정 관리자 ======
-DokuWiki 설치할 때 설정을 바꾸기 위해 사용하는 페이지입니다. 각 설정에 대한 자세한 도움말이 필요하다면 [[doku>ko:config|설정]] 문서를 참고하세요. 플러그인에 대한 자세한 정보가 필요하다면 [[doku>ko:plugin:config|플러그인 설정]] 문서를 참고하세요.
+도쿠위키를 설치할 때 설정을 바꾸려면 이 페이지를 사용하세요. 개별 설정에 대한 도움말은 [[doku>ko:config]]를 참고하세요. 이 플러그인에 대한 자세한 내용은 [[doku>ko:plugin:config]]를 참고하세요.
+
+밝은 빨간색 배경으로 보이는 설정은 이 플러그인에서 바꿀 수 없도록 보호되어 있습니다. 파란색 배경으로 보이는 설정은 기본값이며 하얀색 배경으로 보이는 설정은 특수한 설치를 위해 로컬로 설정되어 있습니다. 파란색과 하얀색 배경으로 된 설정은 바꿀 수 있습니다.
+
+이 페이지를 떠나기 전에 **저장** 버튼을 누르지 않으면 바뀜이 사라지는 것에 주의하세요.
-빨간 배경색으로 보이는 설정은 이 플러그인에서 바꾸지 못하도록 되어있습니다. 파란 배경색으로 보이는 설정은 기본 설정값을 가지고 있습니다. 하얀 배경색으로 보이는 설정은 특별한 설치를 위해 설정되어 있습니다. 파란색과 하얀색 배경으로 된 설정은 바꿀 수 있습니다.
-이 페이지를 떠나기 전에 **저장** 버튼을 누르지 않으면 바뀐 값은 적용되지 않습니다. \ No newline at end of file
diff --git a/lib/plugins/config/lang/ko/lang.php b/lib/plugins/config/lang/ko/lang.php
index 1aab4731a..0cdaca90d 100644
--- a/lib/plugins/config/lang/ko/lang.php
+++ b/lib/plugins/config/lang/ko/lang.php
@@ -21,7 +21,7 @@ $lang['danger'] = '위험: 이 옵션을 잘못 바꾸면 환경
$lang['warning'] = '경고: 이 옵션을 잘못 바꾸면 잘못 동작할 수 있습니다.';
$lang['security'] = '보안 경고: 이 옵션은 보안에 위험이 있을 수 있습니다.';
$lang['_configuration_manager'] = '환경 설정 관리자';
-$lang['_header_dokuwiki'] = 'DokuWiki 설정';
+$lang['_header_dokuwiki'] = '도쿠위키 설정';
$lang['_header_plugin'] = '플러그인 설정';
$lang['_header_template'] = '템플릿 설정';
$lang['_header_undefined'] = '정의되지 않은 설정';
@@ -45,12 +45,12 @@ $lang['lang'] = '인터페이스 언어';
$lang['template'] = '템플릿 (위키 디자인)';
$lang['tagline'] = '태그 라인 (템플릿이 지원할 때에 한함)';
$lang['sidebar'] = '사이드바 문서 이름 (템플릿이 지원할 때에 한함), 비워두면 사이드바를 비활성화';
-$lang['license'] = '콘텐츠에 어떤 라이선스를 적용하겠습니까?';
-$lang['savedir'] = '데이터 저장 디렉토리';
+$lang['license'] = '내용에 어떤 라이선스를 적용하겠습니까?';
+$lang['savedir'] = '데이터 저장 디렉터리';
$lang['basedir'] = '서버 경로 (예를 들어 <code>/dokuwiki/</code>). 자동 감지를 하려면 비우세요.';
$lang['baseurl'] = '서버 URL (예를 들어 <code>http://www.yourserver.com</code>). 자동 감지를 하려면 비우세요.';
$lang['cookiedir'] = '쿠키 위치. 비워두면 기본 URL 위치로 지정됩니다.';
-$lang['dmode'] = '디렉토리 만들기 모드';
+$lang['dmode'] = '디렉터리 만들기 모드';
$lang['fmode'] = '파일 만들기 모드';
$lang['allowdebug'] = '디버그 허용 <b>필요하지 않으면 비활성화하세요!</b>';
$lang['recent'] = '최근 바뀐 문서당 항목 수';
@@ -69,9 +69,9 @@ $lang['maxseclevel'] = '문단 최대 편집 단계';
$lang['camelcase'] = '링크에 CamelCase 사용';
$lang['deaccent'] = '문서 이름을 지우는 방법';
$lang['useheading'] = '문서 이름으로 첫 문단 제목 사용';
-$lang['sneaky_index'] = '기본적으로 DokuWiki는 색인 목록에 모든 이름공간을 보여줍니다.
+$lang['sneaky_index'] = '기본적으로 도쿠위키는 색인 목록에 모든 이름공간을 보여줍니다.
이 옵션을 설정하면 사용자가 읽기 권한을 가지고 있지 않은 이름공간은 보여주지 않습니다. 접근 가능한 하위 이름공간을 보이지 않게 설정하면 자동으로 설정됩니다. 특정 ACL 설정은 색인 사용이 불가능하게 할 수도 있습니다.';
-$lang['hidepages'] = '사이트맵과 기타 자동 색인과 같은 찾기에서 정규 표현식과 일치하는 문서 숨기기';
+$lang['hidepages'] = '검색, 사이트맵과 기타 자동 색인에서 정규 표현식과 일치하는 문서 숨기기';
$lang['useacl'] = '접근 제어 목록 (ACL) 사용';
$lang['autopasswd'] = '자동으로 만들어진 비밀번호';
$lang['authtype'] = '인증 백-엔드';
@@ -81,14 +81,14 @@ $lang['superuser'] = '슈퍼 유저 - ACL 설정과 상관없이 모
$lang['manager'] = '관리자 - 관리 기능을 사용할 수 있는 그룹이나 사용자 또는 사용자1,@그룹1,사용자2 쉼표로 구분한 목록';
$lang['profileconfirm'] = '개인 정보를 바꿀 때 비밀번호 다시 확인';
$lang['rememberme'] = '항상 로그인 정보 저장 허용 (기억하기)';
-$lang['disableactions'] = 'DokuWiki 활동 비활성화';
+$lang['disableactions'] = '도쿠위키 활동 비활성화';
$lang['disableactions_check'] = '검사';
$lang['disableactions_subscription'] = '구독 신청/구독 취소';
$lang['disableactions_wikicode'] = '원본 보기/원본 내보내기';
$lang['disableactions_other'] = '다른 활동 (쉼표로 구분)';
$lang['auth_security_timeout'] = '인증 보안 초과 시간 (초)';
$lang['securecookie'] = 'HTTPS로 보내진 쿠키는 HTTPS에만 적용 할까요? 위키의 로그인 페이지만 SSL로 암호화하고 위키 문서는 그렇지 않은 경우 비활성화 합니다.';
-$lang['remote'] = '원격 API를 활성화 합니다. 이 항목을 허용하면 XML-RPC 및 기타 메카니즘을 통해 다른 어플리케이션으로 접근 가능합니다.';
+$lang['remote'] = '원격 API를 활성화 합니다. 이 항목을 허용하면 XML-RPC 및 기타 메커니즘을 통해 다른 어플리케이션으로 접근 가능합니다.';
$lang['remoteuser'] = '이 항목에 입력된 쉼표로 나눠진 그룹이나 사용자에게 원격 API 접근을 제한합니다. 빈칸으로 두면 모두에게 허용합니다.';
$lang['usewordblock'] = '금지 단어를 사용해 스팸 막기';
$lang['relnofollow'] = '바깥 링크에 rel="nofollow" 사용';
@@ -117,7 +117,7 @@ $lang['notify'] = '항상 이 이메일 주소로 바뀜 알림
$lang['registernotify'] = '항상 새 사용자한테 이 이메일 주소로 정보를 보냄';
$lang['mailfrom'] = '자동으로 보내지는 메일 발신자';
$lang['mailprefix'] = '자동으로 보내지는 메일의 제목 말머리 내용. 비웠을 경우 위키 제목 사용';
-$lang['htmlmail'] = '용량은 조금 더 크지만 보기 좋은 HTML 태그가 포함된 메일을 보냅니다. 텍스트만의 메일을 보내고자하면 비활성화하세요.';
+$lang['htmlmail'] = '용량은 조금 더 크지만 보기 좋은 HTML 태그가 포함된 메일을 보냅니다. 텍스트만의 메일을 보내려면 비활성화하세요.';
$lang['sitemap'] = '구글 사이트맵 생성 날짜 빈도. 0일 경우 비활성화합니다';
$lang['rss_type'] = 'XML 피드 타입';
$lang['rss_linkto'] = 'XML 피드 링크 정보';
@@ -125,7 +125,7 @@ $lang['rss_content'] = 'XML 피드 항목에 표시되는 내용은
$lang['rss_update'] = 'XML 피드 업데이트 주기 (초)';
$lang['rss_show_summary'] = 'XML 피드 제목에서 요약 보여주기';
$lang['rss_media'] = '어떤 규격으로 XML 피드를 받아보시겠습니까?';
-$lang['updatecheck'] = '업데이트와 보안 문제를 검사할까요? 이 기능을 사용하려면 DokuWiki를 update.dokuwiki.org에 연결해야 합니다.';
+$lang['updatecheck'] = '업데이트와 보안 문제를 검사할까요? 이 기능을 사용하려면 도쿠위키를 update.dokuwiki.org에 연결해야 합니다.';
$lang['userewrite'] = '멋진 URL 사용';
$lang['useslash'] = 'URL에서 이름 구분자로 슬래시 문자 사용';
$lang['sepchar'] = '문서 이름 단어 구분자';
@@ -136,13 +136,13 @@ $lang['compression'] = '첨부 파일 압축 방법 선택';
$lang['gzip_output'] = 'xhml 내용 gzip 압축 사용';
$lang['compress'] = '최적화된 CSS, 자바스크립트 출력';
$lang['cssdatauri'] = '그림이 렌더링될 최대 용량 크기를 CSS에 규정해야 HTTP 요청 헤더 오버헤드 크기를 감소시킬 수 있습니다. 이 기술은 IE 7 이하에서는 작동하지 않습니다! <code>400</code>에서 <code>600</code> 정도면 좋은 효율을 가져옵니다. <code>0</code>로 지정할 경우 비활성화 됩니다.';
-$lang['send404'] = '존재하지 않는 페이지에 대해 "HTTP 404/Page Not Found" 응답';
-$lang['broken_iua'] = '설치된 시스템에서 ignore_user_abort 기능에 문제가 있습니까? 문제가 있다면 색인이 정상적으로 동작하지 않습니다. 이 기능이 IIS+PHP/CGI에서 문제가 있는 것으로 알려졌습니다. 자세한 정보는 <a href="http://bugs.dokuwiki.org/?do=details&amp;task_id=852">버그 852</a>를 참고하시기 바랍니다.';
+$lang['send404'] = '존재하지 않는 페이지에 대해 "HTTP 404/페이지를 찾을 수 없습니다" 응답';
+$lang['broken_iua'] = '설치된 시스템에서 ignore_user_abort 기능에 문제가 있습니까? 문제가 있다면 검색 색인이 정상적으로 동작하지 않습니다. 이 기능이 IIS+PHP/CGI에서 문제가 있는 것으로 알려졌습니다. 자세한 정보는 <a href="http://bugs.dokuwiki.org/?do=details&amp;task_id=852">버그 852</a>를 참고하시기 바랍니다.';
$lang['xsendfile'] = '웹 서버가 정적 파일을 제공하도록 X-Sendfile 헤더를 사용하겠습니까? 웹 서버가 이 기능을 지원해야 합니다.';
$lang['renderer_xhtml'] = '주 (xhtml) 위키 출력 처리기';
-$lang['renderer__core'] = '%s (DokuWiki 내부)';
+$lang['renderer__core'] = '%s (도쿠위키 내부)';
$lang['renderer__plugin'] = '%s (플러그인)';
-$lang['dnslookups'] = '이 옵션을 활성화하면 DokuWiki가 문서를 편집하는 사용자의 호스트 네임과 원격 IP 주소를 확인합니다. 서버가 느리거나, DNS를 운영하지 않거나 이 기능을 원치 않으면 비활성화하세요';
+$lang['dnslookups'] = '이 옵션을 활성화하면 도쿠위키가 문서를 편집하는 사용자의 호스트 네임과 원격 IP 주소를 확인합니다. 서버가 느리거나, DNS를 운영하지 않거나 이 기능을 원치 않으면 비활성화하세요';
$lang['proxy____host'] = '프록시 서버 이름';
$lang['proxy____port'] = '프록시 서버 포트';
$lang['proxy____user'] = '프록시 사용자 이름';
@@ -154,14 +154,14 @@ $lang['ftp____host'] = 'safemode hack의 FTP 서버';
$lang['ftp____port'] = 'safemode hack의 FTP 포트';
$lang['ftp____user'] = 'safemode hack의 FTP 사용자 이름';
$lang['ftp____pass'] = 'safemode hack의 FTP 비밀번호';
-$lang['ftp____root'] = 'safemode hack의 FTP 루트 디렉토리';
+$lang['ftp____root'] = 'safemode hack의 FTP 루트 디렉터리';
$lang['license_o_'] = '선택하지 않음';
$lang['typography_o_0'] = '사용 안함';
$lang['typography_o_1'] = '이중 인용부호("")만 지원';
$lang['typography_o_2'] = '모든 가능한 인용 부호 (동작 안될 수도 있음)';
$lang['userewrite_o_0'] = '사용 안함';
$lang['userewrite_o_1'] = '.htaccess';
-$lang['userewrite_o_2'] = 'DokuWiki 내부 기능';
+$lang['userewrite_o_2'] = '도쿠위키 내부 기능';
$lang['deaccent_o_0'] = '끄기';
$lang['deaccent_o_1'] = '악센트 제거';
$lang['deaccent_o_2'] = '라틴문자화';
@@ -190,7 +190,7 @@ $lang['xsendfile_o_2'] = '표준 X-Sendfile 헤더';
$lang['xsendfile_o_3'] = '비공개 Nginx X-Accel-Redirect 헤더';
$lang['showuseras_o_loginname'] = '로그인 이름';
$lang['showuseras_o_username'] = '사용자의 전체 이름';
-$lang['showuseras_o_email'] = '사용자의 이메일 주소 (메일 주소 보호 설정에 따라 안보일 수 있음)';
+$lang['showuseras_o_email'] = '사용자의 이메일 주소 (메일 주소 설정에 따라 안보일 수 있음)';
$lang['showuseras_o_email_link'] = 'mailto: link로 표현될 사용자 이메일 주소';
$lang['useheading_o_0'] = '아니오';
$lang['useheading_o_navigation'] = '둘러보기에만';
diff --git a/lib/plugins/config/lang/pt-br/lang.php b/lib/plugins/config/lang/pt-br/lang.php
index ee1447b4e..795ee81c0 100644
--- a/lib/plugins/config/lang/pt-br/lang.php
+++ b/lib/plugins/config/lang/pt-br/lang.php
@@ -114,7 +114,6 @@ $lang['target____media'] = 'Parâmetro "target" para links de mídia';
$lang['target____windows'] = 'Parâmetro "target" para links do Windows';
$lang['mediarevisions'] = 'Habilitar revisões de mídias?';
$lang['refcheck'] = 'Verificação de referência da mídia';
-$lang['refshow'] = 'Número de referências de mídia a exibir';
$lang['gdlib'] = 'Versão da biblioteca "GD Lib"';
$lang['im_convert'] = 'Caminho para a ferramenta de conversão ImageMagick';
$lang['jpg_quality'] = 'Qualidade de compressão do JPG (0-100)';
diff --git a/lib/plugins/config/settings/config.class.php b/lib/plugins/config/settings/config.class.php
index 6d582ad30..05f8470f7 100644
--- a/lib/plugins/config/settings/config.class.php
+++ b/lib/plugins/config/settings/config.class.php
@@ -1,9 +1,9 @@
<?php
/**
- * Configuration Class and generic setting classes
+ * Configuration Class and generic setting classes
*
- * @author Chris Smith <chris@jalakai.co.uk>
- * @author Ben Coburn <btcoburn@silicodon.net>
+ * @author Chris Smith <chris@jalakai.co.uk>
+ * @author Ben Coburn <btcoburn@silicodon.net>
*/
@@ -11,500 +11,496 @@ if(!defined('CM_KEYMARKER')) define('CM_KEYMARKER','____');
if (!class_exists('configuration')) {
- class configuration {
-
- var $_name = 'conf'; // name of the config variable found in the files (overridden by $config['varname'])
- var $_format = 'php'; // format of the config file, supported formats - php (overridden by $config['format'])
- var $_heading = ''; // heading string written at top of config file - don't include comment indicators
- var $_loaded = false; // set to true after configuration files are loaded
- var $_metadata = array(); // holds metadata describing the settings
- var $setting = array(); // array of setting objects
- var $locked = false; // configuration is considered locked if it can't be updated
- var $show_disabled_plugins = false;
-
- // configuration filenames
- var $_default_files = array();
- var $_local_files = array(); // updated configuration is written to the first file
- var $_protected_files = array();
-
- var $_plugin_list = null;
-
- /**
- * constructor
- */
- function configuration($datafile) {
- global $conf, $config_cascade;
-
- if (!@file_exists($datafile)) {
- msg('No configuration metadata found at - '.htmlspecialchars($datafile),-1);
- return;
- }
- $meta = array();
- include($datafile);
-
- if (isset($config['varname'])) $this->_name = $config['varname'];
- if (isset($config['format'])) $this->_format = $config['format'];
- if (isset($config['heading'])) $this->_heading = $config['heading'];
-
- $this->_default_files = $config_cascade['main']['default'];
- $this->_local_files = $config_cascade['main']['local'];
- $this->_protected_files = $config_cascade['main']['protected'];
-
- $this->locked = $this->_is_locked();
- $this->_metadata = array_merge($meta, $this->get_plugintpl_metadata($conf['template']));
- $this->retrieve_settings();
- }
-
- function retrieve_settings() {
- global $conf;
- $no_default_check = array('setting_fieldset', 'setting_undefined', 'setting_no_class');
+ class configuration {
- if (!$this->_loaded) {
- $default = array_merge($this->get_plugintpl_default($conf['template']), $this->_read_config_group($this->_default_files));
- $local = $this->_read_config_group($this->_local_files);
- $protected = $this->_read_config_group($this->_protected_files);
+ var $_name = 'conf'; // name of the config variable found in the files (overridden by $config['varname'])
+ var $_format = 'php'; // format of the config file, supported formats - php (overridden by $config['format'])
+ var $_heading = ''; // heading string written at top of config file - don't include comment indicators
+ var $_loaded = false; // set to true after configuration files are loaded
+ var $_metadata = array(); // holds metadata describing the settings
+ var $setting = array(); // array of setting objects
+ var $locked = false; // configuration is considered locked if it can't be updated
+ var $show_disabled_plugins = false;
- $keys = array_merge(array_keys($this->_metadata),array_keys($default), array_keys($local), array_keys($protected));
- $keys = array_unique($keys);
+ // configuration filenames
+ var $_default_files = array();
+ var $_local_files = array(); // updated configuration is written to the first file
+ var $_protected_files = array();
- $param = null;
- foreach ($keys as $key) {
- if (isset($this->_metadata[$key])) {
- $class = $this->_metadata[$key][0];
+ var $_plugin_list = null;
- if($class && class_exists('setting_'.$class)){
- $class = 'setting_'.$class;
- } else {
- if($class != '') {
- $this->setting[] = new setting_no_class($key,$param);
- }
- $class = 'setting';
- }
+ /**
+ * constructor
+ */
+ function configuration($datafile) {
+ global $conf, $config_cascade;
- $param = $this->_metadata[$key];
- array_shift($param);
- } else {
- $class = 'setting_undefined';
- $param = null;
+ if (!@file_exists($datafile)) {
+ msg('No configuration metadata found at - '.htmlspecialchars($datafile),-1);
+ return;
}
+ $meta = array();
+ include($datafile);
- if (!in_array($class, $no_default_check) && !isset($default[$key])) {
- $this->setting[] = new setting_no_default($key,$param);
- }
+ if (isset($config['varname'])) $this->_name = $config['varname'];
+ if (isset($config['format'])) $this->_format = $config['format'];
+ if (isset($config['heading'])) $this->_heading = $config['heading'];
- $this->setting[$key] = new $class($key,$param);
- $this->setting[$key]->initialize($default[$key],$local[$key],$protected[$key]);
- }
+ $this->_default_files = $config_cascade['main']['default'];
+ $this->_local_files = $config_cascade['main']['local'];
+ $this->_protected_files = $config_cascade['main']['protected'];
- $this->_loaded = true;
+ $this->locked = $this->_is_locked();
+ $this->_metadata = array_merge($meta, $this->get_plugintpl_metadata($conf['template']));
+ $this->retrieve_settings();
}
- }
-
- function save_settings($id, $header='', $backup=true) {
- global $conf;
-
- if ($this->locked) return false;
- // write back to the last file in the local config cascade
- $file = end($this->_local_files);
-
- // backup current file (remove any existing backup)
- if (@file_exists($file) && $backup) {
- if (@file_exists($file.'.bak')) @unlink($file.'.bak');
- if (!io_rename($file, $file.'.bak')) return false;
- }
+ function retrieve_settings() {
+ global $conf;
+ $no_default_check = array('setting_fieldset', 'setting_undefined', 'setting_no_class');
+
+ if (!$this->_loaded) {
+ $default = array_merge($this->get_plugintpl_default($conf['template']), $this->_read_config_group($this->_default_files));
+ $local = $this->_read_config_group($this->_local_files);
+ $protected = $this->_read_config_group($this->_protected_files);
+
+ $keys = array_merge(array_keys($this->_metadata),array_keys($default), array_keys($local), array_keys($protected));
+ $keys = array_unique($keys);
+
+ $param = null;
+ foreach ($keys as $key) {
+ if (isset($this->_metadata[$key])) {
+ $class = $this->_metadata[$key][0];
+
+ if($class && class_exists('setting_'.$class)){
+ $class = 'setting_'.$class;
+ } else {
+ if($class != '') {
+ $this->setting[] = new setting_no_class($key,$param);
+ }
+ $class = 'setting';
+ }
+
+ $param = $this->_metadata[$key];
+ array_shift($param);
+ } else {
+ $class = 'setting_undefined';
+ $param = null;
+ }
+
+ if (!in_array($class, $no_default_check) && !isset($default[$key])) {
+ $this->setting[] = new setting_no_default($key,$param);
+ }
+
+ $this->setting[$key] = new $class($key,$param);
+ $this->setting[$key]->initialize($default[$key],$local[$key],$protected[$key]);
+ }
- if (!$fh = @fopen($file, 'wb')) {
- io_rename($file.'.bak', $file); // problem opening, restore the backup
- return false;
- }
+ $this->_loaded = true;
+ }
+ }
- if (empty($header)) $header = $this->_heading;
+ function save_settings($id, $header='', $backup=true) {
+ global $conf;
- $out = $this->_out_header($id,$header);
+ if ($this->locked) return false;
- foreach ($this->setting as $setting) {
- $out .= $setting->out($this->_name, $this->_format);
- }
+ // write back to the last file in the local config cascade
+ $file = end($this->_local_files);
- $out .= $this->_out_footer();
+ // backup current file (remove any existing backup)
+ if (@file_exists($file) && $backup) {
+ if (@file_exists($file.'.bak')) @unlink($file.'.bak');
+ if (!io_rename($file, $file.'.bak')) return false;
+ }
- @fwrite($fh, $out);
- fclose($fh);
- if($conf['fperm']) chmod($file, $conf['fperm']);
- return true;
- }
+ if (!$fh = @fopen($file, 'wb')) {
+ io_rename($file.'.bak', $file); // problem opening, restore the backup
+ return false;
+ }
- /**
- * Update last modified time stamp of the config file
- */
- function touch_settings(){
- if ($this->locked) return false;
- $file = end($this->_local_files);
- return @touch($file);
- }
+ if (empty($header)) $header = $this->_heading;
- function _read_config_group($files) {
- $config = array();
- foreach ($files as $file) {
- $config = array_merge($config, $this->_read_config($file));
- }
+ $out = $this->_out_header($id,$header);
- return $config;
- }
+ foreach ($this->setting as $setting) {
+ $out .= $setting->out($this->_name, $this->_format);
+ }
- /**
- * return an array of config settings
- */
- function _read_config($file) {
+ $out .= $this->_out_footer();
- if (!$file) return array();
+ @fwrite($fh, $out);
+ fclose($fh);
+ if($conf['fperm']) chmod($file, $conf['fperm']);
+ return true;
+ }
- $config = array();
+ /**
+ * Update last modified time stamp of the config file
+ */
+ function touch_settings(){
+ if ($this->locked) return false;
+ $file = end($this->_local_files);
+ return @touch($file);
+ }
- if ($this->_format == 'php') {
+ function _read_config_group($files) {
+ $config = array();
+ foreach ($files as $file) {
+ $config = array_merge($config, $this->_read_config($file));
+ }
- if(@file_exists($file)){
- $contents = @php_strip_whitespace($file);
- }else{
- $contents = '';
+ return $config;
}
- $pattern = '/\$'.$this->_name.'\[[\'"]([^=]+)[\'"]\] ?= ?(.*?);(?=[^;]*(?:\$'.$this->_name.'|$))/s';
- $matches=array();
- preg_match_all($pattern,$contents,$matches,PREG_SET_ORDER);
-
- for ($i=0; $i<count($matches); $i++) {
- $value = $matches[$i][2];
+ /**
+ * return an array of config settings
+ */
+ function _read_config($file) {
- // correct issues with the incoming data
- // FIXME ... for now merge multi-dimensional array indices using ____
- $key = preg_replace('/.\]\[./',CM_KEYMARKER,$matches[$i][1]);
+ if (!$file) return array();
+ $config = array();
- // handle arrays
- if(preg_match('/^array ?\((.*)\)/', $value, $match)){
- $arr = explode(',', $match[1]);
+ if ($this->_format == 'php') {
- // remove quotes from quoted strings & unescape escaped data
- $len = count($arr);
- for($j=0; $j<$len; $j++){
- $arr[$j] = trim($arr[$j]);
- $arr[$j] = preg_replace('/^(\'|")(.*)(?<!\\\\)\1$/s','$2',$arr[$j]);
- $arr[$j] = strtr($arr[$j], array('\\\\'=>'\\','\\\''=>'\'','\\"'=>'"'));
+ if(@file_exists($file)){
+ $contents = @php_strip_whitespace($file);
+ }else{
+ $contents = '';
+ }
+ $pattern = '/\$'.$this->_name.'\[[\'"]([^=]+)[\'"]\] ?= ?(.*?);(?=[^;]*(?:\$'.$this->_name.'|$))/s';
+ $matches=array();
+ preg_match_all($pattern,$contents,$matches,PREG_SET_ORDER);
+
+ for ($i=0; $i<count($matches); $i++) {
+ $value = $matches[$i][2];
+
+ // correct issues with the incoming data
+ // FIXME ... for now merge multi-dimensional array indices using ____
+ $key = preg_replace('/.\]\[./',CM_KEYMARKER,$matches[$i][1]);
+
+ // handle arrays
+ if(preg_match('/^array ?\((.*)\)/', $value, $match)){
+ $arr = explode(',', $match[1]);
+
+ // remove quotes from quoted strings & unescape escaped data
+ $len = count($arr);
+ for($j=0; $j<$len; $j++){
+ $arr[$j] = trim($arr[$j]);
+ $arr[$j] = preg_replace('/^(\'|")(.*)(?<!\\\\)\1$/s','$2',$arr[$j]);
+ $arr[$j] = strtr($arr[$j], array('\\\\'=>'\\','\\\''=>'\'','\\"'=>'"'));
+ }
+
+ $value = $arr;
+ }else{
+ // remove quotes from quoted strings & unescape escaped data
+ $value = preg_replace('/^(\'|")(.*)(?<!\\\\)\1$/s','$2',$value);
+ $value = strtr($value, array('\\\\'=>'\\','\\\''=>'\'','\\"'=>'"'));
+ }
+
+ $config[$key] = $value;
+ }
}
- $value = $arr;
- }else{
- // remove quotes from quoted strings & unescape escaped data
- $value = preg_replace('/^(\'|")(.*)(?<!\\\\)\1$/s','$2',$value);
- $value = strtr($value, array('\\\\'=>'\\','\\\''=>'\'','\\"'=>'"'));
- }
-
- $config[$key] = $value;
+ return $config;
}
- }
- return $config;
- }
+ function _out_header($id, $header) {
+ $out = '';
+ if ($this->_format == 'php') {
+ $out .= '<'.'?php'."\n".
+ "/*\n".
+ " * ".$header."\n".
+ " * Auto-generated by ".$id." plugin\n".
+ " * Run for user: ".$_SERVER['REMOTE_USER']."\n".
+ " * Date: ".date('r')."\n".
+ " */\n\n";
+ }
- function _out_header($id, $header) {
- $out = '';
- if ($this->_format == 'php') {
- $out .= '<'.'?php'."\n".
- "/*\n".
- " * ".$header."\n".
- " * Auto-generated by ".$id." plugin\n".
- " * Run for user: ".$_SERVER['REMOTE_USER']."\n".
- " * Date: ".date('r')."\n".
- " */\n\n";
- }
-
- return $out;
- }
+ return $out;
+ }
- function _out_footer() {
- $out = '';
- if ($this->_format == 'php') {
- $out .= "\n// end auto-generated content\n";
- }
+ function _out_footer() {
+ $out = '';
+ if ($this->_format == 'php') {
+ $out .= "\n// end auto-generated content\n";
+ }
- return $out;
- }
+ return $out;
+ }
- // configuration is considered locked if there is no local settings filename
- // or the directory its in is not writable or the file exists and is not writable
- function _is_locked() {
- if (!$this->_local_files) return true;
+ // configuration is considered locked if there is no local settings filename
+ // or the directory its in is not writable or the file exists and is not writable
+ function _is_locked() {
+ if (!$this->_local_files) return true;
- $local = $this->_local_files[0];
+ $local = $this->_local_files[0];
- if (!is_writable(dirname($local))) return true;
- if (@file_exists($local) && !is_writable($local)) return true;
+ if (!is_writable(dirname($local))) return true;
+ if (@file_exists($local) && !is_writable($local)) return true;
- return false;
- }
+ return false;
+ }
- /**
- * not used ... conf's contents are an array!
- * reduce any multidimensional settings to one dimension using CM_KEYMARKER
- */
- function _flatten($conf,$prefix='') {
+ /**
+ * not used ... conf's contents are an array!
+ * reduce any multidimensional settings to one dimension using CM_KEYMARKER
+ */
+ function _flatten($conf,$prefix='') {
- $out = array();
+ $out = array();
- foreach($conf as $key => $value) {
- if (!is_array($value)) {
- $out[$prefix.$key] = $value;
- continue;
- }
+ foreach($conf as $key => $value) {
+ if (!is_array($value)) {
+ $out[$prefix.$key] = $value;
+ continue;
+ }
- $tmp = $this->_flatten($value,$prefix.$key.CM_KEYMARKER);
- $out = array_merge($out,$tmp);
+ $tmp = $this->_flatten($value,$prefix.$key.CM_KEYMARKER);
+ $out = array_merge($out,$tmp);
+ }
+
+ return $out;
}
- return $out;
- }
+ function get_plugin_list() {
+ if (is_null($this->_plugin_list)) {
+ $list = plugin_list('',$this->show_disabled_plugins);
- function get_plugin_list() {
- if (is_null($this->_plugin_list)) {
- $list = plugin_list('',$this->show_disabled_plugins);
+ // remove this plugin from the list
+ $idx = array_search('config',$list);
+ unset($list[$idx]);
- // remove this plugin from the list
- $idx = array_search('config',$list);
- unset($list[$idx]);
+ trigger_event('PLUGIN_CONFIG_PLUGINLIST',$list);
+ $this->_plugin_list = $list;
+ }
- trigger_event('PLUGIN_CONFIG_PLUGINLIST',$list);
- $this->_plugin_list = $list;
- }
+ return $this->_plugin_list;
+ }
- return $this->_plugin_list;
- }
+ /**
+ * load metadata for plugin and template settings
+ */
+ function get_plugintpl_metadata($tpl){
+ $file = '/conf/metadata.php';
+ $class = '/conf/settings.class.php';
+ $metadata = array();
+
+ foreach ($this->get_plugin_list() as $plugin) {
+ $plugin_dir = plugin_directory($plugin);
+ if (@file_exists(DOKU_PLUGIN.$plugin_dir.$file)){
+ $meta = array();
+ @include(DOKU_PLUGIN.$plugin_dir.$file);
+ @include(DOKU_PLUGIN.$plugin_dir.$class);
+ if (!empty($meta)) {
+ $metadata['plugin'.CM_KEYMARKER.$plugin.CM_KEYMARKER.'plugin_settings_name'] = array('fieldset');
+ }
+ foreach ($meta as $key => $value){
+ if ($value[0]=='fieldset') { continue; } //plugins only get one fieldset
+ $metadata['plugin'.CM_KEYMARKER.$plugin.CM_KEYMARKER.$key] = $value;
+ }
+ }
+ }
- /**
- * load metadata for plugin and template settings
- */
- function get_plugintpl_metadata($tpl){
- $file = '/conf/metadata.php';
- $class = '/conf/settings.class.php';
- $metadata = array();
-
- foreach ($this->get_plugin_list() as $plugin) {
- $plugin_dir = plugin_directory($plugin);
- if (@file_exists(DOKU_PLUGIN.$plugin_dir.$file)){
- $meta = array();
- @include(DOKU_PLUGIN.$plugin_dir.$file);
- @include(DOKU_PLUGIN.$plugin_dir.$class);
- if (!empty($meta)) {
- $metadata['plugin'.CM_KEYMARKER.$plugin.CM_KEYMARKER.'plugin_settings_name'] = array('fieldset');
- }
- foreach ($meta as $key => $value){
- if ($value[0]=='fieldset') { continue; } //plugins only get one fieldset
- $metadata['plugin'.CM_KEYMARKER.$plugin.CM_KEYMARKER.$key] = $value;
- }
- }
- }
-
- // the same for the active template
- if (@file_exists(tpl_incdir().$file)){
- $meta = array();
- @include(tpl_incdir().$file);
- @include(tpl_incdir().$class);
- if (!empty($meta)) {
- $metadata['tpl'.CM_KEYMARKER.$tpl.CM_KEYMARKER.'template_settings_name'] = array('fieldset');
- }
- foreach ($meta as $key => $value){
- if ($value[0]=='fieldset') { continue; } //template only gets one fieldset
- $metadata['tpl'.CM_KEYMARKER.$tpl.CM_KEYMARKER.$key] = $value;
+ // the same for the active template
+ if (@file_exists(tpl_incdir().$file)){
+ $meta = array();
+ @include(tpl_incdir().$file);
+ @include(tpl_incdir().$class);
+ if (!empty($meta)) {
+ $metadata['tpl'.CM_KEYMARKER.$tpl.CM_KEYMARKER.'template_settings_name'] = array('fieldset');
+ }
+ foreach ($meta as $key => $value){
+ if ($value[0]=='fieldset') { continue; } //template only gets one fieldset
+ $metadata['tpl'.CM_KEYMARKER.$tpl.CM_KEYMARKER.$key] = $value;
+ }
+ }
+
+ return $metadata;
}
- }
- return $metadata;
- }
+ /**
+ * load default settings for plugins and templates
+ */
+ function get_plugintpl_default($tpl){
+ $file = '/conf/default.php';
+ $default = array();
+
+ foreach ($this->get_plugin_list() as $plugin) {
+ $plugin_dir = plugin_directory($plugin);
+ if (@file_exists(DOKU_PLUGIN.$plugin_dir.$file)){
+ $conf = $this->_read_config(DOKU_PLUGIN.$plugin_dir.$file);
+ foreach ($conf as $key => $value){
+ $default['plugin'.CM_KEYMARKER.$plugin.CM_KEYMARKER.$key] = $value;
+ }
+ }
+ }
- /**
- * load default settings for plugins and templates
- */
- function get_plugintpl_default($tpl){
- $file = '/conf/default.php';
- $default = array();
-
- foreach ($this->get_plugin_list() as $plugin) {
- $plugin_dir = plugin_directory($plugin);
- if (@file_exists(DOKU_PLUGIN.$plugin_dir.$file)){
- $conf = array();
- @include(DOKU_PLUGIN.$plugin_dir.$file);
- foreach ($conf as $key => $value){
- $default['plugin'.CM_KEYMARKER.$plugin.CM_KEYMARKER.$key] = $value;
- }
- }
- }
-
- // the same for the active template
- if (@file_exists(tpl_incdir().$file)){
- $conf = array();
- @include(tpl_incdir().$file);
- foreach ($conf as $key => $value){
- $default['tpl'.CM_KEYMARKER.$tpl.CM_KEYMARKER.$key] = $value;
+ // the same for the active template
+ if (@file_exists(tpl_incdir().$file)){
+ $conf = $this->_read_config(tpl_incdir().$file);
+ foreach ($conf as $key => $value){
+ $default['tpl'.CM_KEYMARKER.$tpl.CM_KEYMARKER.$key] = $value;
+ }
+ }
+
+ return $default;
}
- }
- return $default;
}
-
- }
}
if (!class_exists('setting')) {
- class setting {
+ class setting {
- var $_key = '';
- var $_default = null;
- var $_local = null;
- var $_protected = null;
+ var $_key = '';
+ var $_default = null;
+ var $_local = null;
+ var $_protected = null;
- var $_pattern = '';
- var $_error = false; // only used by those classes which error check
- var $_input = null; // only used by those classes which error check
- var $_caution = null; // used by any setting to provide an alert along with the setting
- // valid alerts, 'warning', 'danger', 'security'
- // images matching the alerts are in the plugin's images directory
+ var $_pattern = '';
+ var $_error = false; // only used by those classes which error check
+ var $_input = null; // only used by those classes which error check
+ var $_caution = null; // used by any setting to provide an alert along with the setting
+ // valid alerts, 'warning', 'danger', 'security'
+ // images matching the alerts are in the plugin's images directory
- static protected $_validCautions = array('warning','danger','security');
+ static protected $_validCautions = array('warning','danger','security');
- function setting($key, $params=null) {
- $this->_key = $key;
+ function setting($key, $params=null) {
+ $this->_key = $key;
- if (is_array($params)) {
- foreach($params as $property => $value) {
- $this->$property = $value;
- }
+ if (is_array($params)) {
+ foreach($params as $property => $value) {
+ $this->$property = $value;
+ }
+ }
}
- }
-
- /**
- * receives current values for the setting $key
- */
- function initialize($default, $local, $protected) {
- if (isset($default)) $this->_default = $default;
- if (isset($local)) $this->_local = $local;
- if (isset($protected)) $this->_protected = $protected;
- }
- /**
- * update changed setting with user provided value $input
- * - if changed value fails error check, save it to $this->_input (to allow echoing later)
- * - if changed value passes error check, set $this->_local to the new value
- *
- * @param mixed $input the new value
- * @return boolean true if changed, false otherwise (incl. on error)
- */
- function update($input) {
- if (is_null($input)) return false;
- if ($this->is_protected()) return false;
-
- $value = is_null($this->_local) ? $this->_default : $this->_local;
- if ($value == $input) return false;
-
- if ($this->_pattern && !preg_match($this->_pattern,$input)) {
- $this->_error = true;
- $this->_input = $input;
- return false;
+ /**
+ * receives current values for the setting $key
+ */
+ function initialize($default, $local, $protected) {
+ if (isset($default)) $this->_default = $default;
+ if (isset($local)) $this->_local = $local;
+ if (isset($protected)) $this->_protected = $protected;
}
- $this->_local = $input;
- return true;
- }
+ /**
+ * update changed setting with user provided value $input
+ * - if changed value fails error check, save it to $this->_input (to allow echoing later)
+ * - if changed value passes error check, set $this->_local to the new value
+ *
+ * @param mixed $input the new value
+ * @return boolean true if changed, false otherwise (incl. on error)
+ */
+ function update($input) {
+ if (is_null($input)) return false;
+ if ($this->is_protected()) return false;
- /**
- * @return array(string $label_html, string $input_html)
- */
- function html(&$plugin, $echo=false) {
- $value = '';
- $disable = '';
-
- if ($this->is_protected()) {
- $value = $this->_protected;
- $disable = 'disabled="disabled"';
- } else {
- if ($echo && $this->_error) {
- $value = $this->_input;
- } else {
$value = is_null($this->_local) ? $this->_default : $this->_local;
- }
- }
+ if ($value == $input) return false;
- $key = htmlspecialchars($this->_key);
- $value = formText($value);
+ if ($this->_pattern && !preg_match($this->_pattern,$input)) {
+ $this->_error = true;
+ $this->_input = $input;
+ return false;
+ }
- $label = '<label for="config___'.$key.'">'.$this->prompt($plugin).'</label>';
- $input = '<textarea rows="3" cols="40" id="config___'.$key.'" name="config['.$key.']" class="edit" '.$disable.'>'.$value.'</textarea>';
- return array($label,$input);
- }
+ $this->_local = $input;
+ return true;
+ }
- /**
- * generate string to save setting value to file according to $fmt
- */
- function out($var, $fmt='php') {
+ /**
+ * @return array(string $label_html, string $input_html)
+ */
+ function html(&$plugin, $echo=false) {
+ $value = '';
+ $disable = '';
- if ($this->is_protected()) return '';
- if (is_null($this->_local) || ($this->_default == $this->_local)) return '';
+ if ($this->is_protected()) {
+ $value = $this->_protected;
+ $disable = 'disabled="disabled"';
+ } else {
+ if ($echo && $this->_error) {
+ $value = $this->_input;
+ } else {
+ $value = is_null($this->_local) ? $this->_default : $this->_local;
+ }
+ }
- $out = '';
+ $key = htmlspecialchars($this->_key);
+ $value = formText($value);
- if ($fmt=='php') {
- $tr = array("\\" => '\\\\', "'" => '\\\'');
+ $label = '<label for="config___'.$key.'">'.$this->prompt($plugin).'</label>';
+ $input = '<textarea rows="3" cols="40" id="config___'.$key.'" name="config['.$key.']" class="edit" '.$disable.'>'.$value.'</textarea>';
+ return array($label,$input);
+ }
- $out = '$'.$var."['".$this->_out_key()."'] = '".strtr( cleanText($this->_local), $tr)."';\n";
- }
+ /**
+ * generate string to save setting value to file according to $fmt
+ */
+ function out($var, $fmt='php') {
- return $out;
- }
+ if ($this->is_protected()) return '';
+ if (is_null($this->_local) || ($this->_default == $this->_local)) return '';
- function prompt(&$plugin) {
- $prompt = $plugin->getLang($this->_key);
- if (!$prompt) $prompt = htmlspecialchars(str_replace(array('____','_'),' ',$this->_key));
- return $prompt;
- }
+ $out = '';
- function is_protected() { return !is_null($this->_protected); }
- function is_default() { return !$this->is_protected() && is_null($this->_local); }
- function error() { return $this->_error; }
+ if ($fmt=='php') {
+ $tr = array("\\" => '\\\\', "'" => '\\\'');
- function caution() {
- if (!empty($this->_caution)) {
- if (!in_array($this->_caution, setting::$_validCautions)) {
- trigger_error('Invalid caution string ('.$this->_caution.') in metadata for setting "'.$this->_key.'"', E_USER_WARNING);
- return false;
+ $out = '$'.$var."['".$this->_out_key()."'] = '".strtr( cleanText($this->_local), $tr)."';\n";
}
- return $this->_caution;
+
+ return $out;
}
- // compatibility with previous cautionList
- // TODO: check if any plugins use; remove
- if (!empty($this->_cautionList[$this->_key])) {
- $this->_caution = $this->_cautionList[$this->_key];
- unset($this->_cautionList);
- return $this->caution();
+ function prompt(&$plugin) {
+ $prompt = $plugin->getLang($this->_key);
+ if (!$prompt) $prompt = htmlspecialchars(str_replace(array('____','_'),' ',$this->_key));
+ return $prompt;
}
- return false;
- }
- function _out_key($pretty=false,$url=false) {
- if($pretty){
- $out = str_replace(CM_KEYMARKER,"»",$this->_key);
- if ($url && !strstr($out,'»')) {//provide no urls for plugins, etc.
- if ($out == 'start') //one exception
- return '<a href="http://www.dokuwiki.org/config:startpage">'.$out.'</a>';
- else
- return '<a href="http://www.dokuwiki.org/config:'.$out.'">'.$out.'</a>';
+ function is_protected() { return !is_null($this->_protected); }
+ function is_default() { return !$this->is_protected() && is_null($this->_local); }
+ function error() { return $this->_error; }
+
+ function caution() {
+ if (!empty($this->_caution)) {
+ if (!in_array($this->_caution, setting::$_validCautions)) {
+ trigger_error('Invalid caution string ('.$this->_caution.') in metadata for setting "'.$this->_key.'"', E_USER_WARNING);
+ return false;
+ }
+ return $this->_caution;
+ }
+ // compatibility with previous cautionList
+ // TODO: check if any plugins use; remove
+ if (!empty($this->_cautionList[$this->_key])) {
+ $this->_caution = $this->_cautionList[$this->_key];
+ unset($this->_cautionList);
+
+ return $this->caution();
+ }
+ return false;
+ }
+
+ function _out_key($pretty=false,$url=false) {
+ if($pretty){
+ $out = str_replace(CM_KEYMARKER,"»",$this->_key);
+ if ($url && !strstr($out,'»')) {//provide no urls for plugins, etc.
+ if ($out == 'start') //one exception
+ return '<a href="http://www.dokuwiki.org/config:startpage">'.$out.'</a>';
+ else
+ return '<a href="http://www.dokuwiki.org/config:'.$out.'">'.$out.'</a>';
+ }
+ return $out;
+ }else{
+ return str_replace(CM_KEYMARKER,"']['",$this->_key);
}
- return $out;
- }else{
- return str_replace(CM_KEYMARKER,"']['",$this->_key);
}
}
- }
}
@@ -612,201 +608,178 @@ if (!class_exists('setting_array')) {
}
if (!class_exists('setting_string')) {
- class setting_string extends setting {
- function html(&$plugin, $echo=false) {
- $value = '';
- $disable = '';
-
- if ($this->is_protected()) {
- $value = $this->_protected;
- $disable = 'disabled="disabled"';
- } else {
- if ($echo && $this->_error) {
- $value = $this->_input;
- } else {
- $value = is_null($this->_local) ? $this->_default : $this->_local;
- }
- }
+ class setting_string extends setting {
+ function html(&$plugin, $echo=false) {
+ $value = '';
+ $disable = '';
- $key = htmlspecialchars($this->_key);
- $value = htmlspecialchars($value);
+ if ($this->is_protected()) {
+ $value = $this->_protected;
+ $disable = 'disabled="disabled"';
+ } else {
+ if ($echo && $this->_error) {
+ $value = $this->_input;
+ } else {
+ $value = is_null($this->_local) ? $this->_default : $this->_local;
+ }
+ }
- $label = '<label for="config___'.$key.'">'.$this->prompt($plugin).'</label>';
- $input = '<input id="config___'.$key.'" name="config['.$key.']" type="text" class="edit" value="'.$value.'" '.$disable.'/>';
- return array($label,$input);
+ $key = htmlspecialchars($this->_key);
+ $value = htmlspecialchars($value);
+
+ $label = '<label for="config___'.$key.'">'.$this->prompt($plugin).'</label>';
+ $input = '<input id="config___'.$key.'" name="config['.$key.']" type="text" class="edit" value="'.$value.'" '.$disable.'/>';
+ return array($label,$input);
+ }
}
- }
}
if (!class_exists('setting_password')) {
- class setting_password extends setting_string {
+ class setting_password extends setting_string {
- var $_code = 'plain'; // mechanism to be used to obscure passwords
+ var $_code = 'plain'; // mechanism to be used to obscure passwords
- function update($input) {
- if ($this->is_protected()) return false;
- if (!$input) return false;
+ function update($input) {
+ if ($this->is_protected()) return false;
+ if (!$input) return false;
- if ($this->_pattern && !preg_match($this->_pattern,$input)) {
- $this->_error = true;
- $this->_input = $input;
- return false;
- }
+ if ($this->_pattern && !preg_match($this->_pattern,$input)) {
+ $this->_error = true;
+ $this->_input = $input;
+ return false;
+ }
- $this->_local = conf_encodeString($input,$this->_code);
- return true;
- }
+ $this->_local = conf_encodeString($input,$this->_code);
+ return true;
+ }
- function html(&$plugin, $echo=false) {
+ function html(&$plugin, $echo=false) {
- $value = '';
- $disable = $this->is_protected() ? 'disabled="disabled"' : '';
+ $value = '';
+ $disable = $this->is_protected() ? 'disabled="disabled"' : '';
- $key = htmlspecialchars($this->_key);
+ $key = htmlspecialchars($this->_key);
- $label = '<label for="config___'.$key.'">'.$this->prompt($plugin).'</label>';
- $input = '<input id="config___'.$key.'" name="config['.$key.']" autocomplete="off" type="password" class="edit" value="" '.$disable.' />';
- return array($label,$input);
+ $label = '<label for="config___'.$key.'">'.$this->prompt($plugin).'</label>';
+ $input = '<input id="config___'.$key.'" name="config['.$key.']" autocomplete="off" type="password" class="edit" value="" '.$disable.' />';
+ return array($label,$input);
+ }
}
- }
}
if (!class_exists('setting_email')) {
- class setting_email extends setting_string {
- var $_multiple = false;
- var $_placeholders = false;
-
- /**
- * update setting with user provided value $input
- * if value fails error check, save it
- *
- * @return boolean true if changed, false otherwise (incl. on error)
- */
- function update($input) {
- if (is_null($input)) return false;
- if ($this->is_protected()) return false;
-
- $value = is_null($this->_local) ? $this->_default : $this->_local;
- if ($value == $input) return false;
- if($input === ''){
- $this->_local = $input;
- return true;
- }
- $mail = $input;
+ class setting_email extends setting_string {
+ var $_multiple = false;
+ var $_placeholders = false;
- if($this->_placeholders){
- // replace variables with pseudo values
- $mail = str_replace('@USER@','joe',$mail);
- $mail = str_replace('@NAME@','Joe Schmoe',$mail);
- $mail = str_replace('@MAIL@','joe@example.com',$mail);
- }
+ /**
+ * update setting with user provided value $input
+ * if value fails error check, save it
+ *
+ * @return boolean true if changed, false otherwise (incl. on error)
+ */
+ function update($input) {
+ if (is_null($input)) return false;
+ if ($this->is_protected()) return false;
- // multiple mail addresses?
- if ($this->_multiple) {
- $mails = array_filter(array_map('trim', explode(',', $mail)));
- } else {
- $mails = array($mail);
- }
+ $value = is_null($this->_local) ? $this->_default : $this->_local;
+ if ($value == $input) return false;
+ if($input === ''){
+ $this->_local = $input;
+ return true;
+ }
+ $mail = $input;
- // check them all
- foreach ($mails as $mail) {
- // only check the address part
- if(preg_match('#(.*?)<(.*?)>#', $mail, $matches)){
- $addr = $matches[2];
- }else{
- $addr = $mail;
+ if($this->_placeholders){
+ // replace variables with pseudo values
+ $mail = str_replace('@USER@','joe',$mail);
+ $mail = str_replace('@NAME@','Joe Schmoe',$mail);
+ $mail = str_replace('@MAIL@','joe@example.com',$mail);
}
- if (!mail_isvalid($addr)) {
- $this->_error = true;
- $this->_input = $input;
- return false;
+ // multiple mail addresses?
+ if ($this->_multiple) {
+ $mails = array_filter(array_map('trim', explode(',', $mail)));
+ } else {
+ $mails = array($mail);
}
- }
- $this->_local = $input;
- return true;
- }
- function html(&$plugin, $echo=false) {
- $value = '';
- $disable = '';
-
- if ($this->is_protected()) {
- $value = $this->_protected;
- $disable = 'disabled="disabled"';
- } else {
- if ($echo && $this->_error) {
- $value = $this->_input;
- } else {
- $value = is_null($this->_local) ? $this->_default : $this->_local;
- }
- }
+ // check them all
+ foreach ($mails as $mail) {
+ // only check the address part
+ if(preg_match('#(.*?)<(.*?)>#', $mail, $matches)){
+ $addr = $matches[2];
+ }else{
+ $addr = $mail;
+ }
- $multiple = $this->_multiple ? 'multiple="multiple"' : '';
- $key = htmlspecialchars($this->_key);
- $value = htmlspecialchars($value);
+ if (!mail_isvalid($addr)) {
+ $this->_error = true;
+ $this->_input = $input;
+ return false;
+ }
+ }
- $label = '<label for="config___'.$key.'">'.$this->prompt($plugin).'</label>';
- $input = '<input id="config___'.$key.'" name="config['.$key.']" type="email" class="edit" value="'.$value.'" '.$multiple.' '.$disable.'/>';
- return array($label,$input);
+ $this->_local = $input;
+ return true;
+ }
}
- }
}
/**
* @deprecated 2013-02-16
*/
if (!class_exists('setting_richemail')) {
- class setting_richemail extends setting_email {
- function update($input) {
- $this->_placeholders = true;
- return parent::update($input);
- }
- }
+ class setting_richemail extends setting_email {
+ function update($input) {
+ $this->_placeholders = true;
+ return parent::update($input);
+ }
+ }
}
if (!class_exists('setting_numeric')) {
- class setting_numeric extends setting_string {
- // This allows for many PHP syntax errors...
- // var $_pattern = '/^[-+\/*0-9 ]*$/';
- // much more restrictive, but should eliminate syntax errors.
- var $_pattern = '/^[-+]? *[0-9]+ *(?:[-+*] *[0-9]+ *)*$/';
- var $_min = null;
- var $_max = null;
-
- function update($input) {
- $local = $this->_local;
- $valid = parent::update($input);
- if ($valid && !(is_null($this->_min) && is_null($this->_max))) {
- $numeric_local = (int) eval('return '.$this->_local.';');
- if ((!is_null($this->_min) && $numeric_local < $this->_min) ||
- (!is_null($this->_max) && $numeric_local > $this->_max)) {
- $this->_error = true;
- $this->_input = $input;
- $this->_local = $local;
- $valid = false;
+ class setting_numeric extends setting_string {
+ // This allows for many PHP syntax errors...
+ // var $_pattern = '/^[-+\/*0-9 ]*$/';
+ // much more restrictive, but should eliminate syntax errors.
+ var $_pattern = '/^[-+]? *[0-9]+ *(?:[-+*] *[0-9]+ *)*$/';
+ var $_min = null;
+ var $_max = null;
+
+ function update($input) {
+ $local = $this->_local;
+ $valid = parent::update($input);
+ if ($valid && !(is_null($this->_min) && is_null($this->_max))) {
+ $numeric_local = (int) eval('return '.$this->_local.';');
+ if ((!is_null($this->_min) && $numeric_local < $this->_min) ||
+ (!is_null($this->_max) && $numeric_local > $this->_max)) {
+ $this->_error = true;
+ $this->_input = $input;
+ $this->_local = $local;
+ $valid = false;
+ }
}
+ return $valid;
}
- return $valid;
- }
- function out($var, $fmt='php') {
+ function out($var, $fmt='php') {
- if ($this->is_protected()) return '';
- if (is_null($this->_local) || ($this->_default == $this->_local)) return '';
+ if ($this->is_protected()) return '';
+ if (is_null($this->_local) || ($this->_default == $this->_local)) return '';
- $out = '';
+ $out = '';
- if ($fmt=='php') {
- $local = $this->_local === '' ? "''" : $this->_local;
- $out .= '$'.$var."['".$this->_out_key()."'] = ".$local.";\n";
- }
+ if ($fmt=='php') {
+ $local = $this->_local === '' ? "''" : $this->_local;
+ $out .= '$'.$var."['".$this->_out_key()."'] = ".$local.";\n";
+ }
- return $out;
+ return $out;
+ }
}
- }
}
if (!class_exists('setting_numericopt')) {
@@ -817,320 +790,320 @@ if (!class_exists('setting_numericopt')) {
}
if (!class_exists('setting_onoff')) {
- class setting_onoff extends setting_numeric {
+ class setting_onoff extends setting_numeric {
- function html(&$plugin) {
- $value = '';
- $disable = '';
+ function html(&$plugin, $echo = false) {
+ $value = '';
+ $disable = '';
- if ($this->is_protected()) {
- $value = $this->_protected;
- $disable = ' disabled="disabled"';
- } else {
- $value = is_null($this->_local) ? $this->_default : $this->_local;
- }
+ if ($this->is_protected()) {
+ $value = $this->_protected;
+ $disable = ' disabled="disabled"';
+ } else {
+ $value = is_null($this->_local) ? $this->_default : $this->_local;
+ }
- $key = htmlspecialchars($this->_key);
- $checked = ($value) ? ' checked="checked"' : '';
+ $key = htmlspecialchars($this->_key);
+ $checked = ($value) ? ' checked="checked"' : '';
- $label = '<label for="config___'.$key.'">'.$this->prompt($plugin).'</label>';
- $input = '<div class="input"><input id="config___'.$key.'" name="config['.$key.']" type="checkbox" class="checkbox" value="1"'.$checked.$disable.'/></div>';
- return array($label,$input);
- }
+ $label = '<label for="config___'.$key.'">'.$this->prompt($plugin).'</label>';
+ $input = '<div class="input"><input id="config___'.$key.'" name="config['.$key.']" type="checkbox" class="checkbox" value="1"'.$checked.$disable.'/></div>';
+ return array($label,$input);
+ }
- function update($input) {
- if ($this->is_protected()) return false;
+ function update($input) {
+ if ($this->is_protected()) return false;
- $input = ($input) ? 1 : 0;
- $value = is_null($this->_local) ? $this->_default : $this->_local;
- if ($value == $input) return false;
+ $input = ($input) ? 1 : 0;
+ $value = is_null($this->_local) ? $this->_default : $this->_local;
+ if ($value == $input) return false;
- $this->_local = $input;
- return true;
+ $this->_local = $input;
+ return true;
+ }
}
- }
}
if (!class_exists('setting_multichoice')) {
- class setting_multichoice extends setting_string {
- var $_choices = array();
-
- function html(&$plugin) {
- $value = '';
- $disable = '';
- $nochoice = '';
-
- if ($this->is_protected()) {
- $value = $this->_protected;
- $disable = ' disabled="disabled"';
- } else {
- $value = is_null($this->_local) ? $this->_default : $this->_local;
- }
+ class setting_multichoice extends setting_string {
+ var $_choices = array();
- // ensure current value is included
- if (!in_array($value, $this->_choices)) {
- $this->_choices[] = $value;
- }
- // disable if no other choices
- if (!$this->is_protected() && count($this->_choices) <= 1) {
- $disable = ' disabled="disabled"';
- $nochoice = $plugin->getLang('nochoice');
- }
+ function html(&$plugin, $echo = false) {
+ $value = '';
+ $disable = '';
+ $nochoice = '';
- $key = htmlspecialchars($this->_key);
+ if ($this->is_protected()) {
+ $value = $this->_protected;
+ $disable = ' disabled="disabled"';
+ } else {
+ $value = is_null($this->_local) ? $this->_default : $this->_local;
+ }
- $label = '<label for="config___'.$key.'">'.$this->prompt($plugin).'</label>';
+ // ensure current value is included
+ if (!in_array($value, $this->_choices)) {
+ $this->_choices[] = $value;
+ }
+ // disable if no other choices
+ if (!$this->is_protected() && count($this->_choices) <= 1) {
+ $disable = ' disabled="disabled"';
+ $nochoice = $plugin->getLang('nochoice');
+ }
- $input = "<div class=\"input\">\n";
- $input .= '<select class="edit" id="config___'.$key.'" name="config['.$key.']"'.$disable.'>'."\n";
- foreach ($this->_choices as $choice) {
- $selected = ($value == $choice) ? ' selected="selected"' : '';
- $option = $plugin->getLang($this->_key.'_o_'.$choice);
- if (!$option && isset($this->lang[$this->_key.'_o_'.$choice])) $option = $this->lang[$this->_key.'_o_'.$choice];
- if (!$option) $option = $choice;
+ $key = htmlspecialchars($this->_key);
- $choice = htmlspecialchars($choice);
- $option = htmlspecialchars($option);
- $input .= ' <option value="'.$choice.'"'.$selected.' >'.$option.'</option>'."\n";
- }
- $input .= "</select> $nochoice \n";
- $input .= "</div>\n";
+ $label = '<label for="config___'.$key.'">'.$this->prompt($plugin).'</label>';
- return array($label,$input);
- }
+ $input = "<div class=\"input\">\n";
+ $input .= '<select class="edit" id="config___'.$key.'" name="config['.$key.']"'.$disable.'>'."\n";
+ foreach ($this->_choices as $choice) {
+ $selected = ($value == $choice) ? ' selected="selected"' : '';
+ $option = $plugin->getLang($this->_key.'_o_'.$choice);
+ if (!$option && isset($this->lang[$this->_key.'_o_'.$choice])) $option = $this->lang[$this->_key.'_o_'.$choice];
+ if (!$option) $option = $choice;
+
+ $choice = htmlspecialchars($choice);
+ $option = htmlspecialchars($option);
+ $input .= ' <option value="'.$choice.'"'.$selected.' >'.$option.'</option>'."\n";
+ }
+ $input .= "</select> $nochoice \n";
+ $input .= "</div>\n";
+
+ return array($label,$input);
+ }
- function update($input) {
- if (is_null($input)) return false;
- if ($this->is_protected()) return false;
+ function update($input) {
+ if (is_null($input)) return false;
+ if ($this->is_protected()) return false;
- $value = is_null($this->_local) ? $this->_default : $this->_local;
- if ($value == $input) return false;
+ $value = is_null($this->_local) ? $this->_default : $this->_local;
+ if ($value == $input) return false;
- if (!in_array($input, $this->_choices)) return false;
+ if (!in_array($input, $this->_choices)) return false;
- $this->_local = $input;
- return true;
+ $this->_local = $input;
+ return true;
+ }
}
- }
}
if (!class_exists('setting_dirchoice')) {
- class setting_dirchoice extends setting_multichoice {
+ class setting_dirchoice extends setting_multichoice {
- var $_dir = '';
+ var $_dir = '';
- function initialize($default,$local,$protected) {
+ function initialize($default,$local,$protected) {
- // populate $this->_choices with a list of directories
- $list = array();
+ // populate $this->_choices with a list of directories
+ $list = array();
- if ($dh = @opendir($this->_dir)) {
- while (false !== ($entry = readdir($dh))) {
- if ($entry == '.' || $entry == '..') continue;
- if ($this->_pattern && !preg_match($this->_pattern,$entry)) continue;
+ if ($dh = @opendir($this->_dir)) {
+ while (false !== ($entry = readdir($dh))) {
+ if ($entry == '.' || $entry == '..') continue;
+ if ($this->_pattern && !preg_match($this->_pattern,$entry)) continue;
- $file = (is_link($this->_dir.$entry)) ? readlink($this->_dir.$entry) : $this->_dir.$entry;
- if (is_dir($file)) $list[] = $entry;
- }
- closedir($dh);
- }
- sort($list);
- $this->_choices = $list;
+ $file = (is_link($this->_dir.$entry)) ? readlink($this->_dir.$entry) : $this->_dir.$entry;
+ if (is_dir($file)) $list[] = $entry;
+ }
+ closedir($dh);
+ }
+ sort($list);
+ $this->_choices = $list;
- parent::initialize($default,$local,$protected);
+ parent::initialize($default,$local,$protected);
+ }
}
- }
}
if (!class_exists('setting_hidden')) {
- class setting_hidden extends setting {
- // Used to explicitly ignore a setting in the configuration manager.
- }
+ class setting_hidden extends setting {
+ // Used to explicitly ignore a setting in the configuration manager.
+ }
}
if (!class_exists('setting_fieldset')) {
- class setting_fieldset extends setting {
- // A do-nothing class used to detect the 'fieldset' type.
- // Used to start a new settings "display-group".
- }
+ class setting_fieldset extends setting {
+ // A do-nothing class used to detect the 'fieldset' type.
+ // Used to start a new settings "display-group".
+ }
}
if (!class_exists('setting_undefined')) {
- class setting_undefined extends setting_hidden {
- // A do-nothing class used to detect settings with no metadata entry.
- // Used internaly to hide undefined settings, and generate the undefined settings list.
- }
+ class setting_undefined extends setting_hidden {
+ // A do-nothing class used to detect settings with no metadata entry.
+ // Used internaly to hide undefined settings, and generate the undefined settings list.
+ }
}
if (!class_exists('setting_no_class')) {
- class setting_no_class extends setting_undefined {
- // A do-nothing class used to detect settings with a missing setting class.
- // Used internaly to hide undefined settings, and generate the undefined settings list.
- }
+ class setting_no_class extends setting_undefined {
+ // A do-nothing class used to detect settings with a missing setting class.
+ // Used internaly to hide undefined settings, and generate the undefined settings list.
+ }
}
if (!class_exists('setting_no_default')) {
- class setting_no_default extends setting_undefined {
- // A do-nothing class used to detect settings with no default value.
- // Used internaly to hide undefined settings, and generate the undefined settings list.
- }
+ class setting_no_default extends setting_undefined {
+ // A do-nothing class used to detect settings with no default value.
+ // Used internaly to hide undefined settings, and generate the undefined settings list.
+ }
}
if (!class_exists('setting_multicheckbox')) {
- class setting_multicheckbox extends setting_string {
+ class setting_multicheckbox extends setting_string {
- var $_choices = array();
- var $_combine = array();
+ var $_choices = array();
+ var $_combine = array();
- function update($input) {
- if ($this->is_protected()) return false;
+ function update($input) {
+ if ($this->is_protected()) return false;
- // split any combined values + convert from array to comma separated string
- $input = ($input) ? $input : array();
- $input = $this->_array2str($input);
+ // split any combined values + convert from array to comma separated string
+ $input = ($input) ? $input : array();
+ $input = $this->_array2str($input);
- $value = is_null($this->_local) ? $this->_default : $this->_local;
- if ($value == $input) return false;
+ $value = is_null($this->_local) ? $this->_default : $this->_local;
+ if ($value == $input) return false;
+
+ if ($this->_pattern && !preg_match($this->_pattern,$input)) {
+ $this->_error = true;
+ $this->_input = $input;
+ return false;
+ }
- if ($this->_pattern && !preg_match($this->_pattern,$input)) {
- $this->_error = true;
- $this->_input = $input;
- return false;
+ $this->_local = $input;
+ return true;
}
- $this->_local = $input;
- return true;
- }
+ function html(&$plugin, $echo=false) {
- function html(&$plugin, $echo=false) {
+ $value = '';
+ $disable = '';
- $value = '';
- $disable = '';
+ if ($this->is_protected()) {
+ $value = $this->_protected;
+ $disable = 'disabled="disabled"';
+ } else {
+ if ($echo && $this->_error) {
+ $value = $this->_input;
+ } else {
+ $value = is_null($this->_local) ? $this->_default : $this->_local;
+ }
+ }
- if ($this->is_protected()) {
- $value = $this->_protected;
- $disable = 'disabled="disabled"';
- } else {
- if ($echo && $this->_error) {
- $value = $this->_input;
- } else {
- $value = is_null($this->_local) ? $this->_default : $this->_local;
- }
- }
+ $key = htmlspecialchars($this->_key);
- $key = htmlspecialchars($this->_key);
+ // convert from comma separated list into array + combine complimentary actions
+ $value = $this->_str2array($value);
+ $default = $this->_str2array($this->_default);
- // convert from comma separated list into array + combine complimentary actions
- $value = $this->_str2array($value);
- $default = $this->_str2array($this->_default);
+ $input = '';
+ foreach ($this->_choices as $choice) {
+ $idx = array_search($choice, $value);
+ $idx_default = array_search($choice,$default);
- $input = '';
- foreach ($this->_choices as $choice) {
- $idx = array_search($choice, $value);
- $idx_default = array_search($choice,$default);
+ $checked = ($idx !== false) ? 'checked="checked"' : '';
- $checked = ($idx !== false) ? 'checked="checked"' : '';
+ // ideally this would be handled using a second class of "default", however IE6 does not
+ // correctly support CSS selectors referencing multiple class names on the same element
+ // (e.g. .default.selection).
+ $class = (($idx !== false) == (false !== $idx_default)) ? " selectiondefault" : "";
- // ideally this would be handled using a second class of "default", however IE6 does not
- // correctly support CSS selectors referencing multiple class names on the same element
- // (e.g. .default.selection).
- $class = (($idx !== false) == (false !== $idx_default)) ? " selectiondefault" : "";
+ $prompt = ($plugin->getLang($this->_key.'_'.$choice) ?
+ $plugin->getLang($this->_key.'_'.$choice) : htmlspecialchars($choice));
- $prompt = ($plugin->getLang($this->_key.'_'.$choice) ?
- $plugin->getLang($this->_key.'_'.$choice) : htmlspecialchars($choice));
+ $input .= '<div class="selection'.$class.'">'."\n";
+ $input .= '<label for="config___'.$key.'_'.$choice.'">'.$prompt."</label>\n";
+ $input .= '<input id="config___'.$key.'_'.$choice.'" name="config['.$key.'][]" type="checkbox" class="checkbox" value="'.$choice.'" '.$disable.' '.$checked."/>\n";
+ $input .= "</div>\n";
- $input .= '<div class="selection'.$class.'">'."\n";
- $input .= '<label for="config___'.$key.'_'.$choice.'">'.$prompt."</label>\n";
- $input .= '<input id="config___'.$key.'_'.$choice.'" name="config['.$key.'][]" type="checkbox" class="checkbox" value="'.$choice.'" '.$disable.' '.$checked."/>\n";
- $input .= "</div>\n";
+ // remove this action from the disabledactions array
+ if ($idx !== false) unset($value[$idx]);
+ if ($idx_default !== false) unset($default[$idx_default]);
+ }
- // remove this action from the disabledactions array
- if ($idx !== false) unset($value[$idx]);
- if ($idx_default !== false) unset($default[$idx_default]);
- }
+ // handle any remaining values
+ $other = join(',',$value);
- // handle any remaining values
- $other = join(',',$value);
+ $class = (count($default == count($value)) && (count($value) == count(array_intersect($value,$default)))) ?
+ " selectiondefault" : "";
- $class = (count($default == count($value)) && (count($value) == count(array_intersect($value,$default)))) ?
- " selectiondefault" : "";
+ $input .= '<div class="other'.$class.'">'."\n";
+ $input .= '<label for="config___'.$key.'_other">'.$plugin->getLang($key.'_other')."</label>\n";
+ $input .= '<input id="config___'.$key.'_other" name="config['.$key.'][other]" type="text" class="edit" value="'.htmlspecialchars($other).'" '.$disable." />\n";
+ $input .= "</div>\n";
- $input .= '<div class="other'.$class.'">'."\n";
- $input .= '<label for="config___'.$key.'_other">'.$plugin->getLang($key.'_other')."</label>\n";
- $input .= '<input id="config___'.$key.'_other" name="config['.$key.'][other]" type="text" class="edit" value="'.htmlspecialchars($other).'" '.$disable." />\n";
- $input .= "</div>\n";
+ $label = '<label>'.$this->prompt($plugin).'</label>';
+ return array($label,$input);
+ }
- $label = '<label>'.$this->prompt($plugin).'</label>';
- return array($label,$input);
- }
+ /**
+ * convert comma separated list to an array and combine any complimentary values
+ */
+ function _str2array($str) {
+ $array = explode(',',$str);
+
+ if (!empty($this->_combine)) {
+ foreach ($this->_combine as $key => $combinators) {
+ $idx = array();
+ foreach ($combinators as $val) {
+ if (($idx[] = array_search($val, $array)) === false) break;
+ }
+
+ if (count($idx) && $idx[count($idx)-1] !== false) {
+ foreach ($idx as $i) unset($array[$i]);
+ $array[] = $key;
+ }
+ }
+ }
- /**
- * convert comma separated list to an array and combine any complimentary values
- */
- function _str2array($str) {
- $array = explode(',',$str);
-
- if (!empty($this->_combine)) {
- foreach ($this->_combine as $key => $combinators) {
- $idx = array();
- foreach ($combinators as $val) {
- if (($idx[] = array_search($val, $array)) === false) break;
- }
-
- if (count($idx) && $idx[count($idx)-1] !== false) {
- foreach ($idx as $i) unset($array[$i]);
- $array[] = $key;
- }
+ return $array;
}
- }
- return $array;
- }
+ /**
+ * convert array of values + other back to a comma separated list, incl. splitting any combined values
+ */
+ function _array2str($input) {
- /**
- * convert array of values + other back to a comma separated list, incl. splitting any combined values
- */
- function _array2str($input) {
+ // handle other
+ $other = trim($input['other']);
+ $other = !empty($other) ? explode(',',str_replace(' ','',$input['other'])) : array();
+ unset($input['other']);
- // handle other
- $other = trim($input['other']);
- $other = !empty($other) ? explode(',',str_replace(' ','',$input['other'])) : array();
- unset($input['other']);
+ $array = array_unique(array_merge($input, $other));
- $array = array_unique(array_merge($input, $other));
+ // deconstruct any combinations
+ if (!empty($this->_combine)) {
+ foreach ($this->_combine as $key => $combinators) {
- // deconstruct any combinations
- if (!empty($this->_combine)) {
- foreach ($this->_combine as $key => $combinators) {
+ $idx = array_search($key,$array);
+ if ($idx !== false) {
+ unset($array[$idx]);
+ $array = array_merge($array, $combinators);
+ }
+ }
+ }
- $idx = array_search($key,$array);
- if ($idx !== false) {
- unset($array[$idx]);
- $array = array_merge($array, $combinators);
- }
+ return join(',',array_unique($array));
}
- }
-
- return join(',',array_unique($array));
}
- }
}
if (!class_exists('setting_regex')){
- class setting_regex extends setting_string {
+ class setting_regex extends setting_string {
var $_delimiter = '/'; // regex delimiter to be used in testing input
var $_pregflags = 'ui'; // regex pattern modifiers to be used in testing input
/**
- * update changed setting with user provided value $input
- * - if changed value fails error check, save it to $this->_input (to allow echoing later)
- * - if changed value passes error check, set $this->_local to the new value
+ * update changed setting with user provided value $input
+ * - if changed value fails error check, save it to $this->_input (to allow echoing later)
+ * - if changed value passes error check, set $this->_local to the new value
*
- * @param mixed $input the new value
- * @return boolean true if changed, false otherwise (incl. on error)
+ * @param mixed $input the new value
+ * @return boolean true if changed, false otherwise (incl. on error)
*/
function update($input) {
diff --git a/lib/plugins/config/settings/config.metadata.php b/lib/plugins/config/settings/config.metadata.php
index f4c2ed265..f9dabfeb0 100644
--- a/lib/plugins/config/settings/config.metadata.php
+++ b/lib/plugins/config/settings/config.metadata.php
@@ -48,6 +48,7 @@
* 'compression' - no additional parameters. checks php installation supports possible compression alternatives
* 'licence' - as multichoice, selection constructed from licence strings in language files
* 'renderer' - as multichoice, selection constructed from enabled renderer plugins which canRender()
+ * 'authtype' - as multichoice, selection constructed from the enabled auth plugins
*
* Any setting commented or missing will use 'setting' class - text input, minimal validation, quoted output
*
diff --git a/lib/plugins/config/settings/extra.class.php b/lib/plugins/config/settings/extra.class.php
index e4b97eb01..83de802a3 100644
--- a/lib/plugins/config/settings/extra.class.php
+++ b/lib/plugins/config/settings/extra.class.php
@@ -6,204 +6,204 @@
*/
if (!class_exists('setting_sepchar')) {
- class setting_sepchar extends setting_multichoice {
+ class setting_sepchar extends setting_multichoice {
- function setting_sepchar($key,$param=NULL) {
- $str = '_-.';
- for ($i=0;$i<strlen($str);$i++) $this->_choices[] = $str{$i};
+ function setting_sepchar($key,$param=null) {
+ $str = '_-.';
+ for ($i=0;$i<strlen($str);$i++) $this->_choices[] = $str{$i};
- // call foundation class constructor
- $this->setting($key,$param);
+ // call foundation class constructor
+ $this->setting($key,$param);
+ }
}
- }
}
if (!class_exists('setting_savedir')) {
- class setting_savedir extends setting_string {
+ class setting_savedir extends setting_string {
- function update($input) {
- if ($this->is_protected()) return false;
+ function update($input) {
+ if ($this->is_protected()) return false;
- $value = is_null($this->_local) ? $this->_default : $this->_local;
- if ($value == $input) return false;
+ $value = is_null($this->_local) ? $this->_default : $this->_local;
+ if ($value == $input) return false;
- if (!init_path($input)) {
- $this->_error = true;
- $this->_input = $input;
- return false;
- }
+ if (!init_path($input)) {
+ $this->_error = true;
+ $this->_input = $input;
+ return false;
+ }
- $this->_local = $input;
- return true;
+ $this->_local = $input;
+ return true;
+ }
}
- }
}
if (!class_exists('setting_authtype')) {
- class setting_authtype extends setting_multichoice {
+ class setting_authtype extends setting_multichoice {
- function initialize($default,$local,$protected) {
- global $plugin_controller;
+ function initialize($default,$local,$protected) {
+ global $plugin_controller;
- // retrieve auth types provided by plugins
- foreach ($plugin_controller->getList('auth') as $plugin) {
- $this->_choices[] = $plugin;
- }
-
- parent::initialize($default,$local,$protected);
- }
-
- function update($input) {
- global $plugin_controller;
-
- // is an update possible/requested?
- $local = $this->_local; // save this, parent::update() may change it
- if (!parent::update($input)) return false; // nothing changed or an error caught by parent
- $this->_local = $local; // restore original, more error checking to come
-
- // attempt to load the plugin
- $auth_plugin = $plugin_controller->load('auth', $input);
-
- // @TODO: throw an error in plugin controller instead of returning null
- if (is_null($auth_plugin)) {
- $this->_error = true;
- msg('Cannot load Auth Plugin "' . $input . '"', -1);
- return false;
- }
+ // retrieve auth types provided by plugins
+ foreach ($plugin_controller->getList('auth') as $plugin) {
+ $this->_choices[] = $plugin;
+ }
- // verify proper instantiation (is this really a plugin?) @TODO use instanceof? implement interface?
- if (is_object($auth_plugin) && !method_exists($auth_plugin, 'getPluginName')) {
- $this->_error = true;
- msg('Cannot create Auth Plugin "' . $input . '"', -1);
- return false;
+ parent::initialize($default,$local,$protected);
}
- // did we change the auth type? logout
- global $conf;
- if($conf['authtype'] != $input) {
- msg('Authentication system changed. Please re-login.');
- auth_logoff();
+ function update($input) {
+ global $plugin_controller;
+
+ // is an update possible/requested?
+ $local = $this->_local; // save this, parent::update() may change it
+ if (!parent::update($input)) return false; // nothing changed or an error caught by parent
+ $this->_local = $local; // restore original, more error checking to come
+
+ // attempt to load the plugin
+ $auth_plugin = $plugin_controller->load('auth', $input);
+
+ // @TODO: throw an error in plugin controller instead of returning null
+ if (is_null($auth_plugin)) {
+ $this->_error = true;
+ msg('Cannot load Auth Plugin "' . $input . '"', -1);
+ return false;
+ }
+
+ // verify proper instantiation (is this really a plugin?) @TODO use instanceof? implement interface?
+ if (is_object($auth_plugin) && !method_exists($auth_plugin, 'getPluginName')) {
+ $this->_error = true;
+ msg('Cannot create Auth Plugin "' . $input . '"', -1);
+ return false;
+ }
+
+ // did we change the auth type? logout
+ global $conf;
+ if($conf['authtype'] != $input) {
+ msg('Authentication system changed. Please re-login.');
+ auth_logoff();
+ }
+
+ $this->_local = $input;
+ return true;
}
-
- $this->_local = $input;
- return true;
}
- }
}
if (!class_exists('setting_im_convert')) {
- class setting_im_convert extends setting_string {
+ class setting_im_convert extends setting_string {
- function update($input) {
- if ($this->is_protected()) return false;
+ function update($input) {
+ if ($this->is_protected()) return false;
- $input = trim($input);
+ $input = trim($input);
- $value = is_null($this->_local) ? $this->_default : $this->_local;
- if ($value == $input) return false;
+ $value = is_null($this->_local) ? $this->_default : $this->_local;
+ if ($value == $input) return false;
- if ($input && !@file_exists($input)) {
- $this->_error = true;
- $this->_input = $input;
- return false;
- }
+ if ($input && !@file_exists($input)) {
+ $this->_error = true;
+ $this->_input = $input;
+ return false;
+ }
- $this->_local = $input;
- return true;
+ $this->_local = $input;
+ return true;
+ }
}
- }
}
if (!class_exists('setting_disableactions')) {
- class setting_disableactions extends setting_multicheckbox {
+ class setting_disableactions extends setting_multicheckbox {
- function html(&$plugin, $echo=false) {
- global $lang;
+ function html(&$plugin, $echo=false) {
+ global $lang;
- // make some language adjustments (there must be a better way)
- // transfer some DokuWiki language strings to the plugin
- if (!$plugin->localised) $this->setupLocale();
- $plugin->lang[$this->_key.'_revisions'] = $lang['btn_revs'];
+ // make some language adjustments (there must be a better way)
+ // transfer some DokuWiki language strings to the plugin
+ if (!$plugin->localised) $this->setupLocale();
+ $plugin->lang[$this->_key.'_revisions'] = $lang['btn_revs'];
- foreach ($this->_choices as $choice)
- if (isset($lang['btn_'.$choice])) $plugin->lang[$this->_key.'_'.$choice] = $lang['btn_'.$choice];
+ foreach ($this->_choices as $choice)
+ if (isset($lang['btn_'.$choice])) $plugin->lang[$this->_key.'_'.$choice] = $lang['btn_'.$choice];
- return parent::html($plugin, $echo);
+ return parent::html($plugin, $echo);
+ }
}
- }
}
if (!class_exists('setting_compression')) {
- class setting_compression extends setting_multichoice {
+ class setting_compression extends setting_multichoice {
- var $_choices = array('0'); // 0 = no compression, always supported
+ var $_choices = array('0'); // 0 = no compression, always supported
- function initialize($default,$local,$protected) {
+ function initialize($default,$local,$protected) {
- // populate _choices with the compression methods supported by this php installation
- if (function_exists('gzopen')) $this->_choices[] = 'gz';
- if (function_exists('bzopen')) $this->_choices[] = 'bz2';
+ // populate _choices with the compression methods supported by this php installation
+ if (function_exists('gzopen')) $this->_choices[] = 'gz';
+ if (function_exists('bzopen')) $this->_choices[] = 'bz2';
- parent::initialize($default,$local,$protected);
+ parent::initialize($default,$local,$protected);
+ }
}
- }
}
if (!class_exists('setting_license')) {
- class setting_license extends setting_multichoice {
+ class setting_license extends setting_multichoice {
- var $_choices = array(''); // none choosen
+ var $_choices = array(''); // none choosen
- function initialize($default,$local,$protected) {
- global $license;
+ function initialize($default,$local,$protected) {
+ global $license;
- foreach($license as $key => $data){
- $this->_choices[] = $key;
- $this->lang[$this->_key.'_o_'.$key] = $data['name'];
- }
+ foreach($license as $key => $data){
+ $this->_choices[] = $key;
+ $this->lang[$this->_key.'_o_'.$key] = $data['name'];
+ }
- parent::initialize($default,$local,$protected);
+ parent::initialize($default,$local,$protected);
+ }
}
- }
}
if (!class_exists('setting_renderer')) {
- class setting_renderer extends setting_multichoice {
- var $_prompts = array();
+ class setting_renderer extends setting_multichoice {
+ var $_prompts = array();
- function initialize($default,$local,$protected) {
- $format = $this->_format;
+ function initialize($default,$local,$protected) {
+ $format = $this->_format;
- foreach (plugin_list('renderer') as $plugin) {
- $renderer =& plugin_load('renderer',$plugin);
- if (method_exists($renderer,'canRender') && $renderer->canRender($format)) {
- $this->_choices[] = $plugin;
+ foreach (plugin_list('renderer') as $plugin) {
+ $renderer = plugin_load('renderer',$plugin);
+ if (method_exists($renderer,'canRender') && $renderer->canRender($format)) {
+ $this->_choices[] = $plugin;
- $info = $renderer->getInfo();
- $this->_prompts[$plugin] = $info['name'];
- }
- }
-
- parent::initialize($default,$local,$protected);
- }
+ $info = $renderer->getInfo();
+ $this->_prompts[$plugin] = $info['name'];
+ }
+ }
- function html(&$plugin, $echo=false) {
-
- // make some language adjustments (there must be a better way)
- // transfer some plugin names to the config plugin
- if (!$plugin->localised) $this->setupLocale();
+ parent::initialize($default,$local,$protected);
+ }
- foreach ($this->_choices as $choice) {
- if (!isset($plugin->lang[$this->_key.'_o_'.$choice])) {
- if (!isset($this->_prompts[$choice])) {
- $plugin->lang[$this->_key.'_o_'.$choice] = sprintf($plugin->lang['renderer__core'],$choice);
- } else {
- $plugin->lang[$this->_key.'_o_'.$choice] = sprintf($plugin->lang['renderer__plugin'],$this->_prompts[$choice]);
- }
+ function html(&$plugin, $echo=false) {
+
+ // make some language adjustments (there must be a better way)
+ // transfer some plugin names to the config plugin
+ if (!$plugin->localised) $this->setupLocale();
+
+ foreach ($this->_choices as $choice) {
+ if (!isset($plugin->lang[$this->_key.'_o_'.$choice])) {
+ if (!isset($this->_prompts[$choice])) {
+ $plugin->lang[$this->_key.'_o_'.$choice] = sprintf($plugin->lang['renderer__core'],$choice);
+ } else {
+ $plugin->lang[$this->_key.'_o_'.$choice] = sprintf($plugin->lang['renderer__plugin'],$this->_prompts[$choice]);
+ }
+ }
+ }
+ return parent::html($plugin, $echo);
}
- }
- return parent::html($plugin, $echo);
}
- }
}
diff --git a/lib/plugins/info/syntax.php b/lib/plugins/info/syntax.php
index 5e7543603..f8c6eb484 100644
--- a/lib/plugins/info/syntax.php
+++ b/lib/plugins/info/syntax.php
@@ -48,7 +48,7 @@ class syntax_plugin_info extends DokuWiki_Syntax_Plugin {
/**
* Handle the match
*/
- function handle($match, $state, $pos, &$handler){
+ function handle($match, $state, $pos, Doku_Handler &$handler){
$match = substr($match,7,-2); //strip ~~INFO: from start and ~~ from end
return array(strtolower($match));
}
@@ -56,8 +56,9 @@ class syntax_plugin_info extends DokuWiki_Syntax_Plugin {
/**
* Create output
*/
- function render($format, &$renderer, $data) {
+ function render($format, Doku_Renderer &$renderer, $data) {
if($format == 'xhtml'){
+ /** @var Doku_Renderer_xhtml $renderer */
//handle various info stuff
switch ($data[0]){
case 'syntaxmodes':
@@ -112,7 +113,7 @@ class syntax_plugin_info extends DokuWiki_Syntax_Plugin {
// remove subparts
foreach($plugins as $p){
- if (!$po =& plugin_load($type,$p)) continue;
+ if (!$po = plugin_load($type,$p)) continue;
list($name,$part) = explode('_',$p,2);
$plginfo[$name] = $po->getInfo();
}
@@ -142,11 +143,9 @@ class syntax_plugin_info extends DokuWiki_Syntax_Plugin {
* uses some of the original renderer methods
*/
function _helpermethods_xhtml(Doku_Renderer &$renderer){
- global $lang;
-
$plugins = plugin_list('helper');
foreach($plugins as $p){
- if (!$po =& plugin_load('helper',$p)) continue;
+ if (!$po = plugin_load('helper',$p)) continue;
if (!method_exists($po, 'getMethods')) continue;
$methods = $po->getMethods();
@@ -156,7 +155,7 @@ class syntax_plugin_info extends DokuWiki_Syntax_Plugin {
$doc = '<h2><a name="'.$hid.'" id="'.$hid.'">'.hsc($info['name']).'</a></h2>';
$doc .= '<div class="level2">';
$doc .= '<p>'.strtr(hsc($info['desc']), array("\n"=>"<br />")).'</p>';
- $doc .= '<pre class="code">$'.$p." =& plugin_load('helper', '".$p."');</pre>";
+ $doc .= '<pre class="code">$'.$p." = plugin_load('helper', '".$p."');</pre>";
$doc .= '</div>';
foreach ($methods as $method){
$title = '$'.$p.'->'.$method['name'].'()';
@@ -215,21 +214,47 @@ class syntax_plugin_info extends DokuWiki_Syntax_Plugin {
*/
function _syntaxmodes_xhtml(){
$modes = p_get_parsermodes();
+
+ $compactmodes = array();
+ foreach($modes as $mode){
+ $compactmodes[$mode['sort']][] = $mode['mode'];
+ }
$doc = '';
+ $doc .= '<div class="table"><table class="inline"><tbody>';
+
+ foreach($compactmodes as $sort => $modes){
+ $rowspan = '';
+ if(count($modes) > 1) {
+ $rowspan = ' rowspan="'.count($modes).'"';
+ }
+
+ foreach($modes as $index => $mode) {
+ $doc .= '<tr>';
+ $doc .= '<td class="leftalign">';
+ $doc .= $mode;
+ $doc .= '</td>';
- foreach ($modes as $mode){
- $doc .= $mode['mode'].' ('.$mode['sort'].'), ';
+ if($index === 0) {
+ $doc .= '<td class="rightalign" '.$rowspan.'>';
+ $doc .= $sort;
+ $doc .= '</td>';
+ }
+ $doc .= '</tr>';
+ }
}
+
+ $doc .= '</tbody></table></div>';
return $doc;
}
/**
* Adds a TOC item
*/
- function _addToTOC($text, $level, Doku_Renderer_xhtml &$renderer){
+ function _addToTOC($text, $level, Doku_Renderer &$renderer){
global $conf;
if (($level >= $conf['toptoclevel']) && ($level <= $conf['maxtoclevel'])){
+ /** @var $renderer Doku_Renderer_xhtml */
$hid = $renderer->_headerToLink($text, 'true');
$renderer->toc[] = array(
'hid' => $hid,
diff --git a/lib/plugins/plugin/admin.php b/lib/plugins/plugin/admin.php
index de4de6aef..3f019d5e2 100644
--- a/lib/plugins/plugin/admin.php
+++ b/lib/plugins/plugin/admin.php
@@ -37,7 +37,7 @@ class admin_plugin_plugin extends DokuWiki_Admin_Plugin {
/**
* @var ap_manage
*/
- var $handler = NULL;
+ var $handler = null;
var $functions = array('delete','update',/*'settings',*/'info'); // require a plugin name
var $commands = array('manage','download','enable'); // don't require a plugin name
@@ -65,7 +65,6 @@ class admin_plugin_plugin extends DokuWiki_Admin_Plugin {
// enable direct access to language strings
$this->setupLocale();
-
$fn = $INPUT->param('fn');
if (is_array($fn)) {
$this->cmd = key($fn);
@@ -109,7 +108,7 @@ class admin_plugin_plugin extends DokuWiki_Admin_Plugin {
$this->setupLocale();
$this->_get_plugin_list();
- if ($this->handler === NULL) $this->handler = new ap_manage($this, $this->plugin);
+ if ($this->handler === null) $this->handler = new ap_manage($this, $this->plugin);
ptln('<div id="plugin__manager">');
$this->handler->html();
diff --git a/lib/plugins/plugin/classes/ap_download.class.php b/lib/plugins/plugin/classes/ap_download.class.php
index 3cc455867..b1be11506 100644
--- a/lib/plugins/plugin/classes/ap_download.class.php
+++ b/lib/plugins/plugin/classes/ap_download.class.php
@@ -24,7 +24,7 @@ class ap_download extends ap_manage {
ptln('<h2>'.$this->lang['downloading'].'</h2>');
if ($this->manager->error) {
- ptln('<div class="error">'.str_replace("\n","<br />",$this->manager->error).'</div>');
+ ptln('<div class="error">'.str_replace("\n","<br />",hsc($this->manager->error)).'</div>');
} else if (count($this->downloaded) == 1) {
ptln('<p>'.sprintf($this->lang['downloaded'],$this->downloaded[0]).'</p>');
} else if (count($this->downloaded)) { // more than one plugin in the download
diff --git a/lib/plugins/plugin/classes/ap_info.class.php b/lib/plugins/plugin/classes/ap_info.class.php
index 44926c035..89b78fa2d 100644
--- a/lib/plugins/plugin/classes/ap_info.class.php
+++ b/lib/plugins/plugin/classes/ap_info.class.php
@@ -13,9 +13,8 @@ class ap_info extends ap_manage {
$component_list = $this->get_plugin_components($this->manager->plugin);
usort($component_list, array($this,'component_sort'));
-
foreach ($component_list as $component) {
- if (($obj = &plugin_load($component['type'],$component['name'],false,true)) === NULL) continue;
+ if (($obj = plugin_load($component['type'],$component['name'],false,true)) === null) continue;
$compname = explode('_',$component['name']);
if($compname[1]){
diff --git a/lib/plugins/plugin/classes/ap_manage.class.php b/lib/plugins/plugin/classes/ap_manage.class.php
index 3ec740dae..48be63050 100644
--- a/lib/plugins/plugin/classes/ap_manage.class.php
+++ b/lib/plugins/plugin/classes/ap_manage.class.php
@@ -2,7 +2,7 @@
class ap_manage {
- var $manager = NULL;
+ var $manager = null;
var $lang = array();
var $plugin = '';
var $downloaded = array();
diff --git a/lib/plugins/plugin/lang/ar/lang.php b/lib/plugins/plugin/lang/ar/lang.php
index a1a778131..aae58fdb9 100644
--- a/lib/plugins/plugin/lang/ar/lang.php
+++ b/lib/plugins/plugin/lang/ar/lang.php
@@ -1,7 +1,8 @@
<?php
+
/**
- * Arabic language file
- *
+ * @license GPL 2 (http://www.gnu.org/licenses/gpl.html)
+ *
* @author Yaman Hokan <always.smile.yh@hotmail.com>
* @author Usama Akkad <uahello@gmail.com>
* @author uahello@gmail.com
diff --git a/lib/plugins/plugin/lang/bg/lang.php b/lib/plugins/plugin/lang/bg/lang.php
index 09ac35229..0e6a4cd28 100644
--- a/lib/plugins/plugin/lang/bg/lang.php
+++ b/lib/plugins/plugin/lang/bg/lang.php
@@ -1,8 +1,8 @@
<?php
+
/**
- * bulgarian language file
- *
* @license GPL 2 (http://www.gnu.org/licenses/gpl.html)
+ *
* @author Nikolay Vladimirov <nikolay@vladimiroff.com>
* @author Viktor Usunov <usun0v@mail.bg>
* @author Kiril <neohidra@gmail.com>
diff --git a/lib/plugins/plugin/lang/cs/lang.php b/lib/plugins/plugin/lang/cs/lang.php
index 98fae12c7..fb8b6cc4e 100644
--- a/lib/plugins/plugin/lang/cs/lang.php
+++ b/lib/plugins/plugin/lang/cs/lang.php
@@ -1,8 +1,8 @@
<?php
+
/**
- * Czech language file
- *
* @license GPL 2 (http://www.gnu.org/licenses/gpl.html)
+ *
* @author Tomas Valenta <t.valenta@sh.cvut.cz>
* @author Zbynek Krivka <zbynek.krivka@seznam.cz>
* @author Bohumir Zamecnik <bohumir@zamecnik.org>
@@ -14,6 +14,8 @@
* @author Bohumir Zamecnik <bohumir.zamecnik@gmail.com>
* @author Jakub A. Těšínský (j@kub.cz)
* @author mkucera66@seznam.cz
+ * @author Zbyněk Křivka <krivka@fit.vutbr.cz>
+ * @author Gerrit Uitslag <klapinklapin@gmail.com>
*/
$lang['menu'] = 'Správa pluginů';
$lang['download'] = 'Stáhnout a instalovat plugin';
diff --git a/lib/plugins/plugin/lang/da/lang.php b/lib/plugins/plugin/lang/da/lang.php
index d1deb6310..07077eaa1 100644
--- a/lib/plugins/plugin/lang/da/lang.php
+++ b/lib/plugins/plugin/lang/da/lang.php
@@ -1,8 +1,8 @@
<?php
+
/**
- * Danish language file
- *
* @license GPL 2 (http://www.gnu.org/licenses/gpl.html)
+ *
* @author Lars Næsbye Christensen <larsnaesbye@stud.ku.dk>
* @author Kalle Sommer Nielsen <kalle@php.net>
* @author Esben Laursen <hyber@hyber.dk>
@@ -12,6 +12,7 @@
* @author rasmus@kinnerup.com
* @author Michael Pedersen subben@gmail.com
* @author Mikael Lyngvig <mikael@lyngvig.org>
+ * @author Jens Hyllegaard <jens.hyllegaard@gmail.com>
*/
$lang['menu'] = 'Håndter udvidelser';
$lang['download'] = 'Hent og tilføj ny udvidelse';
@@ -23,7 +24,7 @@ $lang['btn_settings'] = 'indstillinger';
$lang['btn_download'] = 'Hent';
$lang['btn_enable'] = 'Gem';
$lang['url'] = 'URL-adresse';
-$lang['installed'] = 'Tliføjet:';
+$lang['installed'] = 'Tilføjet:';
$lang['lastupdate'] = 'Sidst opdateret:';
$lang['source'] = 'Kilde:';
$lang['unknown'] = 'ukendt';
diff --git a/lib/plugins/plugin/lang/de-informal/lang.php b/lib/plugins/plugin/lang/de-informal/lang.php
index 5d1649434..8f1cea5e5 100644
--- a/lib/plugins/plugin/lang/de-informal/lang.php
+++ b/lib/plugins/plugin/lang/de-informal/lang.php
@@ -1,7 +1,8 @@
<?php
+
/**
- * German (informal) language file
- *
+ * @license GPL 2 (http://www.gnu.org/licenses/gpl.html)
+ *
* @author Alexander Fischer <tbanus@os-forge.net>
* @author Juergen Schwarzer <jschwarzer@freenet.de>
* @author Marcel Metz <marcel_metz@gmx.de>
diff --git a/lib/plugins/plugin/lang/eo/lang.php b/lib/plugins/plugin/lang/eo/lang.php
index 67553454c..624246a21 100644
--- a/lib/plugins/plugin/lang/eo/lang.php
+++ b/lib/plugins/plugin/lang/eo/lang.php
@@ -1,7 +1,8 @@
<?php
+
/**
- * Esperantolanguage file
- *
+ * @license GPL 2 (http://www.gnu.org/licenses/gpl.html)
+ *
* @author Felipe Castro <fefcas@uol.com.br>
* @author Felipe Castro <fefcas@gmail.com>
* @author Felipe Castro <fefcas (cxe) gmail (punkto) com>
diff --git a/lib/plugins/plugin/lang/fa/lang.php b/lib/plugins/plugin/lang/fa/lang.php
index bc43ee3ef..0a8fadb3c 100644
--- a/lib/plugins/plugin/lang/fa/lang.php
+++ b/lib/plugins/plugin/lang/fa/lang.php
@@ -1,7 +1,8 @@
<?php
+
/**
- * Persian language file
- *
+ * @license GPL 2 (http://www.gnu.org/licenses/gpl.html)
+ *
* @author behrad eslamifar <behrad_es@yahoo.com)
* @author Mohsen Firoozmandan <info@mambolearn.com>
* @author omidmr@gmail.com
diff --git a/lib/plugins/plugin/lang/fi/lang.php b/lib/plugins/plugin/lang/fi/lang.php
index 923029a6f..f51746faa 100644
--- a/lib/plugins/plugin/lang/fi/lang.php
+++ b/lib/plugins/plugin/lang/fi/lang.php
@@ -1,7 +1,8 @@
<?php
+
/**
- * Finnish language file
- *
+ * @license GPL 2 (http://www.gnu.org/licenses/gpl.html)
+ *
* @author otto@valjakko.net
* @author Otto Vainio <otto@valjakko.net>
* @author Teemu Mattila <ghcsystems@gmail.com>
diff --git a/lib/plugins/plugin/lang/he/lang.php b/lib/plugins/plugin/lang/he/lang.php
index 47253e335..7753c23cf 100644
--- a/lib/plugins/plugin/lang/he/lang.php
+++ b/lib/plugins/plugin/lang/he/lang.php
@@ -1,8 +1,8 @@
<?php
+
/**
- * hebrew language file
- *
* @license GPL 2 (http://www.gnu.org/licenses/gpl.html)
+ *
* @author DoK <kamberd@yahoo.com>
* @author Dotan Kamber <kamberd@yahoo.com>
* @author Moshe Kaplan <mokplan@gmail.com>
diff --git a/lib/plugins/plugin/lang/hi/lang.php b/lib/plugins/plugin/lang/hi/lang.php
index 67b177256..89d27cee1 100644
--- a/lib/plugins/plugin/lang/hi/lang.php
+++ b/lib/plugins/plugin/lang/hi/lang.php
@@ -1,7 +1,8 @@
<?php
+
/**
- * Hindi language file
- *
+ * @license GPL 2 (http://www.gnu.org/licenses/gpl.html)
+ *
* @author Abhinav Tyagi <abhinavtyagi11@gmail.com>
* @author yndesai@gmail.com
*/
diff --git a/lib/plugins/plugin/lang/hu/lang.php b/lib/plugins/plugin/lang/hu/lang.php
index 235d33a0e..b8fa2cdbe 100644
--- a/lib/plugins/plugin/lang/hu/lang.php
+++ b/lib/plugins/plugin/lang/hu/lang.php
@@ -1,7 +1,8 @@
<?php
+
/**
- * Hungarian language file
- *
+ * @license GPL 2 (http://www.gnu.org/licenses/gpl.html)
+ *
* @author Sandor TIHANYI <stihanyi+dw@gmail.com>
* @author Siaynoq Mage <siaynoqmage@gmail.com>
* @author schilling.janos@gmail.com
diff --git a/lib/plugins/plugin/lang/id/lang.php b/lib/plugins/plugin/lang/id/lang.php
index f3a1fe4e6..2653b075e 100644
--- a/lib/plugins/plugin/lang/id/lang.php
+++ b/lib/plugins/plugin/lang/id/lang.php
@@ -1,7 +1,8 @@
<?php
+
/**
- * Indonesian language file
- *
+ * @license GPL 2 (http://www.gnu.org/licenses/gpl.html)
+ *
* @author Irwan Butar Butar <irwansah.putra@gmail.com>
* @author Yustinus Waruwu <juswaruwu@gmail.com>
*/
diff --git a/lib/plugins/plugin/lang/ja/lang.php b/lib/plugins/plugin/lang/ja/lang.php
index 73f295157..d66e109ce 100644
--- a/lib/plugins/plugin/lang/ja/lang.php
+++ b/lib/plugins/plugin/lang/ja/lang.php
@@ -1,8 +1,8 @@
<?php
+
/**
- * japanese language file
- *
* @license GPL 2 (http://www.gnu.org/licenses/gpl.html)
+ *
* @author Yuji Takenaka <webmaster@davilin.com>
* @author Christopher Smith <chris@jalakai.co.uk>
* @author Ikuo Obataya <i.obataya@gmail.com>
diff --git a/lib/plugins/plugin/lang/ko/admin_plugin.txt b/lib/plugins/plugin/lang/ko/admin_plugin.txt
index aeef5fedf..9390712dd 100644
--- a/lib/plugins/plugin/lang/ko/admin_plugin.txt
+++ b/lib/plugins/plugin/lang/ko/admin_plugin.txt
@@ -1,3 +1,3 @@
====== 플러그인 관리 ======
-이 페이지에서 Dokuwiki [[doku>ko:plugins|플러그인]]에 관련된 모든 관리 작업을 합니다. 플러그인을 다운로드하거나 설치하기 위해서는 웹 서버가 플러그인 디렉토리에 대해 쓰기 권한을 가지고 있어야 합니다. \ No newline at end of file
+이 페이지에서 도쿠위키 [[doku>ko:plugins|플러그인]]에 관련된 모든 관리를 할 수 있습니다. 플러그인을 다운로드하고 설치하기 위해서는 웹 서버가 플러그인 폴더에 대해 쓰기 권한이 있어야 합니다. \ No newline at end of file
diff --git a/lib/plugins/plugin/lang/ko/lang.php b/lib/plugins/plugin/lang/ko/lang.php
index 4e615b118..4cd1ae3c7 100644
--- a/lib/plugins/plugin/lang/ko/lang.php
+++ b/lib/plugins/plugin/lang/ko/lang.php
@@ -1,18 +1,19 @@
<?php
+
/**
- * Korean language file
- *
- * @license GPL 2 (http://www.gnu.org/licenses/gpl.html)
+ * @license GPL 2 (http://www.gnu.org/licenses/gpl.html)
+ *
* @author jk Lee
* @author dongnak@gmail.com
* @author Song Younghwan <purluno@gmail.com>
* @author Seung-Chul Yoo <dryoo@live.com>
* @author erial2@gmail.com
* @author Myeongjin <aranet100@gmail.com>
+ * @author Garam <rowain8@gmail.com>
*/
$lang['menu'] = '플러그인 관리';
-$lang['download'] = '새 플러그인 다운로드 및 설치';
-$lang['manage'] = '이미 설치한 플러그인';
+$lang['download'] = '새 플러그인을 다운로드하고 설치';
+$lang['manage'] = '설치된 플러그인';
$lang['btn_info'] = '정보';
$lang['btn_update'] = '업데이트';
$lang['btn_delete'] = '삭제';
@@ -21,7 +22,7 @@ $lang['btn_download'] = '다운로드';
$lang['btn_enable'] = '저장';
$lang['url'] = 'URL';
$lang['installed'] = '설치됨:';
-$lang['lastupdate'] = '가장 나중에 업데이트됨:';
+$lang['lastupdate'] = '마지막으로 업데이트됨:';
$lang['source'] = '원본:';
$lang['unknown'] = '알 수 없음';
$lang['updating'] = '업데이트 중 ...';
@@ -41,15 +42,15 @@ $lang['name'] = '이름:';
$lang['date'] = '날짜:';
$lang['type'] = '종류:';
$lang['desc'] = '설명:';
-$lang['author'] = '만든이:';
+$lang['author'] = '저자:';
$lang['www'] = '웹:';
$lang['error'] = '알 수 없는 문제가 발생했습니다.';
$lang['error_download'] = '플러그인 파일을 다운로드 할 수 없습니다: %s';
$lang['error_badurl'] = '잘못된 URL 같습니다 - URL에서 파일 이름을 알 수 없습니다';
-$lang['error_dircreate'] = '다운로드를 받기 위한 임시 디렉토리를 만들 수 없습니다';
-$lang['error_decompress'] = '플러그인 관리자가 다운로드 받은 파일을 압축을 풀 수 없습니다. 잘못 다운로드 받았을 수도 있으니 다시 한번 시도하거나 압축 포맷을 알 수 없는 경우에는 다운로드한 후 수동으로 직접 설치하세요.';
+$lang['error_dircreate'] = '다운로드를 받기 위한 임시 디렉터리를 만들 수 없습니다';
+$lang['error_decompress'] = '플러그인 관리자가 다운로드 받은 파일을 압축을 풀 수 없습니다. 잘못 다운로드 받았을 수도 있으니 다시 한 번 시도하거나 압축 포맷을 알 수 없는 경우에는 다운로드한 후 수동으로 직접 설치하세요.';
$lang['error_copy'] = '플러그인을 설치하는 동안 파일 복사하는 데 오류가 발생했습니다. <em>%s</em>: 디스크가 꽉 찼거나 파일 접근 권한이 잘못된 경우입니다. 플러그인 설치가 부분적으로만 이루어졌을 것입니다. 설치가 불완전합니다.';
-$lang['error_delete'] = '<em>%s</em> 플러그인을 삭제하는 동안 오류가 발생했습니다. 대부분의 경우 불완전한 파일이거나 디렉토리 접근 권한이 잘못된 경우입니다';
+$lang['error_delete'] = '<em>%s</em> 플러그인을 삭제하는 동안 오류가 발생했습니다. 대부분의 경우 불완전한 파일이거나 디렉터리 접근 권한이 잘못된 경우입니다';
$lang['enabled'] = '%s 플러그인을 활성화했습니다.';
$lang['notenabled'] = '%s 플러그인을 활성화할 수 없습니다. 파일 권한을 확인하세요.';
$lang['disabled'] = '%s 플러그인을 비활성화했습니다.';
diff --git a/lib/plugins/plugin/lang/ne/lang.php b/lib/plugins/plugin/lang/ne/lang.php
index 27c4f3b60..94e7b8089 100644
--- a/lib/plugins/plugin/lang/ne/lang.php
+++ b/lib/plugins/plugin/lang/ne/lang.php
@@ -1,7 +1,8 @@
<?php
+
/**
- * Nepali language file
- *
+ * @license GPL 2 (http://www.gnu.org/licenses/gpl.html)
+ *
* @author Saroj Kumar Dhakal <lotusnagarkot@gmail.com>
* @author SarojKumar Dhakal <lotusnagarkot@yahoo.com>
* @author Saroj Dhakal<lotusnagarkot@yahoo.com>
diff --git a/lib/plugins/plugin/lang/nl/lang.php b/lib/plugins/plugin/lang/nl/lang.php
index 1317e44f2..2836c7030 100644
--- a/lib/plugins/plugin/lang/nl/lang.php
+++ b/lib/plugins/plugin/lang/nl/lang.php
@@ -15,6 +15,7 @@
* @author Jeroen
* @author Ricardo Guijt <ricardoguijt@gmail.com>
* @author Gerrit <klapinklapin@gmail.com>
+ * @author Remon <no@email.local>
*/
$lang['menu'] = 'Plugins beheren';
$lang['download'] = 'Download en installeer een nieuwe plugin';
@@ -36,7 +37,7 @@ $lang['updates'] = 'De volgende plugins zijn succesvol bijgewerkt'
$lang['update_none'] = 'Geen updates gevonden.';
$lang['deleting'] = 'Verwijderen ...';
$lang['deleted'] = 'Plugin %s verwijderd.';
-$lang['downloading'] = 'Downloaden ...';
+$lang['downloading'] = 'Bezig met downloaden ...';
$lang['downloaded'] = 'Plugin %s succesvol geïnstalleerd';
$lang['downloads'] = 'De volgende plugins zijn succesvol geïnstalleerd:';
$lang['download_none'] = 'Geen plugins gevonden, of er is een onbekende fout opgetreden tijdens het downloaden en installeren.';
@@ -51,10 +52,10 @@ $lang['author'] = 'Auteur:';
$lang['www'] = 'Weblocatie:';
$lang['error'] = 'Er is een onbekende fout opgetreden.';
$lang['error_download'] = 'Kan het volgende plugin bestand niet downloaden: %s';
-$lang['error_badurl'] = 'Vermoedelijk onjuiste url - kan de filename niet uit de url afleiden';
+$lang['error_badurl'] = 'Vermoedelijk onjuiste url - kan de bestandsnaam niet uit de url afleiden';
$lang['error_dircreate'] = 'Kan geen tijdelijke directory aanmaken voor de download';
$lang['error_decompress'] = 'De pluginmanager kan het gedownloade bestand niet uitpakken. Dit kan het resultaat zijn van een mislukte download: probeer het opnieuw; of het compressieformaat is onbekend: in dat geval moet je de plugin handmatig downloaden en installeren.';
-$lang['error_copy'] = 'Er was een probleem met het kopiëren van een bestand tijdens de installatie van plugin <em>%s</em>: de schijf kan vol zijn of onjuiste toegangsrechten hebben. Dit kan tot gevolg hebben dat de plugin slechts gedeeltelijk geïnstalleerd is en kan uw wiki onstabiel maken.';
+$lang['error_copy'] = 'Er was een probleem met het kopiëren van een bestand tijdens de installatie van plugin <em>%s</em>: de schijf kan vol zijn of onjuiste toegangsrechten hebben. Dit kan tot gevolg hebben dat de plugin slechts gedeeltelijk geïnstalleerd is en kan de wiki onstabiel maken.';
$lang['error_delete'] = 'Er is een probleem opgetreden tijdens het verwijderen van plugin <em>%s</em>. De meest voorkomende oorzaak is onjuiste toegangsrechten op bestanden of directory\'s.';
$lang['enabled'] = 'Plugin %s ingeschakeld.';
$lang['notenabled'] = 'Plugin %s kon niet worden ingeschakeld, controleer bestandsrechten.';
diff --git a/lib/plugins/plugin/lang/no/lang.php b/lib/plugins/plugin/lang/no/lang.php
index 829d29387..2b890f972 100644
--- a/lib/plugins/plugin/lang/no/lang.php
+++ b/lib/plugins/plugin/lang/no/lang.php
@@ -1,13 +1,14 @@
<?php
+
/**
- * Norwegianlanguage file
- *
+ * @license GPL 2 (http://www.gnu.org/licenses/gpl.html)
+ *
* @author Thomas Nygreen <nygreen@gmail.com>
* @author Arild Burud <arildb@met.no>
* @author Torkill Bruland <torkar-b@online.no>
* @author Rune M. Andersen <rune.andersen@gmail.com>
* @author Jakob Vad Nielsen (me@jakobnielsen.net)
- * @author Kjell Tore Næsgaard <kjell.t.nasgaard@ntnu.no>
+ * @author Kjell Tore Næsgaard <kjell.t.nasgaard@ntnu.no>
* @author Knut Staring <knutst@gmail.com>
* @author Lisa Ditlefsen <lisa@vervesearch.com>
* @author Erik Pedersen <erik.pedersen@shaw.ca>
diff --git a/lib/plugins/plugin/lang/pl/lang.php b/lib/plugins/plugin/lang/pl/lang.php
index faaa69630..eae91f33e 100644
--- a/lib/plugins/plugin/lang/pl/lang.php
+++ b/lib/plugins/plugin/lang/pl/lang.php
@@ -1,8 +1,8 @@
<?php
+
/**
- * polish language file
- *
* @license GPL 2 (http://www.gnu.org/licenses/gpl.html)
+ *
* @author Michał Tkacz <mehow@autocom.pl>
* @author Grzegorz Żur <grzegorz.zur@gmail.com>
* @author Mariusz Kujawski <marinespl@gmail.com>
diff --git a/lib/plugins/plugin/lang/pt-br/lang.php b/lib/plugins/plugin/lang/pt-br/lang.php
index 437b6ca57..c025188f3 100644
--- a/lib/plugins/plugin/lang/pt-br/lang.php
+++ b/lib/plugins/plugin/lang/pt-br/lang.php
@@ -1,7 +1,8 @@
<?php
+
/**
- * Portuguese language file
- *
+ * @license GPL 2 (http://www.gnu.org/licenses/gpl.html)
+ *
* @author Frederico Gonçalves Guimarães <frederico@teia.bio.br>
* @author Felipe Castro <fefcas@gmail.com>
* @author Lucien Raven <lucienraven@yahoo.com.br>
diff --git a/lib/plugins/plugin/lang/pt/lang.php b/lib/plugins/plugin/lang/pt/lang.php
index dccd4f738..aa6b2e2ec 100644
--- a/lib/plugins/plugin/lang/pt/lang.php
+++ b/lib/plugins/plugin/lang/pt/lang.php
@@ -1,7 +1,8 @@
<?php
+
/**
- * Portugueselanguage file
- *
+ * @license GPL 2 (http://www.gnu.org/licenses/gpl.html)
+ *
* @author José Monteiro <Jose.Monteiro@DoWeDo-IT.com>
* @author Enrico Nicoletto <liverig@gmail.com>
* @author Fil <fil@meteopt.com>
diff --git a/lib/plugins/plugin/lang/ru/lang.php b/lib/plugins/plugin/lang/ru/lang.php
index fb53c321f..b933f7754 100644
--- a/lib/plugins/plugin/lang/ru/lang.php
+++ b/lib/plugins/plugin/lang/ru/lang.php
@@ -51,16 +51,16 @@ $lang['date'] = 'Дата:';
$lang['type'] = 'Тип:';
$lang['desc'] = 'Описание:';
$lang['author'] = 'Автор:';
-$lang['www'] = 'Странца:';
+$lang['www'] = 'Страница:';
$lang['error'] = 'Произошла неизвестная ошибка.';
$lang['error_download'] = 'Не могу скачать файл плагина: %s';
$lang['error_badurl'] = 'Возможно неправильный адрес — не могу определить имя файла из адреса';
$lang['error_dircreate'] = 'Не могу создать временную директорию для скачивания';
$lang['error_decompress'] = 'Менеджеру плагинов не удалось распаковать скачанный файл. Это может быть результатом ошибки при скачивании, в этом случае вы можете попробовать снова, или же плагин упакован неизвестным архиватором, тогда вам необходимо скачать и установить плагин вручную.';
-$lang['error_copy'] = 'Произошла ошибка копирования при попытке установки файлов для плагина <em>%s</em>: переполнение диска или неправильные права доступа. Это могло привести к частичной установке плагина и неустойчивости вашей вики.';
+$lang['error_copy'] = 'Произошла ошибка копирования при попытке установки файлов для плагина <em>%s</em>: переполнение диска или неправильные права доступа. Это могло привести к частичной установке плагина и неустойчивости работы вашей вики.';
$lang['error_delete'] = 'Произошла ошибка при попытке удалить плагин <em>%s</em>. Наиболее вероятно, что нет необходимых прав доступа к файлам или директориям';
-$lang['enabled'] = 'Плагин %s включён.';
+$lang['enabled'] = 'Плагин %s включен.';
$lang['notenabled'] = 'Не удалось включить плагин %s. Проверьте системные права доступа к файлам.';
-$lang['disabled'] = 'Плагин %s отключён.';
+$lang['disabled'] = 'Плагин %s отключен.';
$lang['notdisabled'] = 'Не удалось отключить плагин %s. Проверьте системные права доступа к файлам.';
$lang['packageinstalled'] = 'Пакет (%d плагин(а): %s) успешно установлен.';
diff --git a/lib/plugins/plugin/lang/sk/lang.php b/lib/plugins/plugin/lang/sk/lang.php
index 5024872f1..35c07cf80 100644
--- a/lib/plugins/plugin/lang/sk/lang.php
+++ b/lib/plugins/plugin/lang/sk/lang.php
@@ -1,7 +1,8 @@
<?php
+
/**
- * Slovak language file
- *
+ * @license GPL 2 (http://www.gnu.org/licenses/gpl.html)
+ *
* @author Ondrej Végh <ov@vsieti.sk>
* @author Michal Mesko <michal.mesko@gmail.com>
* @author exusik@gmail.com
diff --git a/lib/plugins/plugin/lang/sl/lang.php b/lib/plugins/plugin/lang/sl/lang.php
index 3e5f8c8af..e205c57f5 100644
--- a/lib/plugins/plugin/lang/sl/lang.php
+++ b/lib/plugins/plugin/lang/sl/lang.php
@@ -1,7 +1,8 @@
<?php
+
/**
- * Slovenian language file
- *
+ * @license GPL 2 (http://www.gnu.org/licenses/gpl.html)
+ *
* @author Dejan Levec <webphp@gmail.com>
* @author Boštjan Seničar <senicar@gmail.com>
* @author Gregor Skumavc (grega.skumavc@gmail.com)
diff --git a/lib/plugins/plugin/lang/tr/lang.php b/lib/plugins/plugin/lang/tr/lang.php
index 9598ade7d..a4feea8cd 100644
--- a/lib/plugins/plugin/lang/tr/lang.php
+++ b/lib/plugins/plugin/lang/tr/lang.php
@@ -1,7 +1,8 @@
<?php
+
/**
- * Turkish language file
- *
+ * @license GPL 2 (http://www.gnu.org/licenses/gpl.html)
+ *
* @author Aydın Coşkuner <aydinweb@gmail.com>
* @author Cihan Kahveci <kahvecicihan@gmail.com>
* @author Yavuz Selim <yavuzselim@gmail.com>
diff --git a/lib/plugins/plugin/lang/zh/lang.php b/lib/plugins/plugin/lang/zh/lang.php
index f69410503..b39c6b063 100644
--- a/lib/plugins/plugin/lang/zh/lang.php
+++ b/lib/plugins/plugin/lang/zh/lang.php
@@ -15,6 +15,7 @@
* @author caii, patent agent in China <zhoucaiqi@gmail.com>
* @author lainme993@gmail.com
* @author Shuo-Ting Jian <shoting@gmail.com>
+ * @author anjianshi <anjianshi@gmail.com>
*/
$lang['menu'] = '插件管理器';
$lang['download'] = '下载并安装新的插件';
@@ -26,7 +27,7 @@ $lang['btn_settings'] = '设置';
$lang['btn_download'] = '下载';
$lang['btn_enable'] = '保存';
$lang['url'] = 'URL';
-$lang['installed'] = '已安装:';
+$lang['installed'] = '安装时间:';
$lang['lastupdate'] = '最后更新于:';
$lang['source'] = '来源:';
$lang['unknown'] = '未知';
diff --git a/lib/plugins/popularity/action.php b/lib/plugins/popularity/action.php
index f0cbb771b..9e2e78d11 100644
--- a/lib/plugins/popularity/action.php
+++ b/lib/plugins/popularity/action.php
@@ -35,7 +35,6 @@ class action_plugin_popularity extends Dokuwiki_Action_Plugin {
//Actually send it
$status = $this->helper->sendData( $this->helper->gatherAsString() );
-
if ( $status !== '' ){
//If an error occured, log it
io_saveFile( $this->helper->autosubmitErrorFile, $status );
diff --git a/lib/plugins/popularity/admin.php b/lib/plugins/popularity/admin.php
index deb8048f4..bd2d090e1 100644
--- a/lib/plugins/popularity/admin.php
+++ b/lib/plugins/popularity/admin.php
@@ -13,7 +13,6 @@ if(!defined('DOKU_INC')) die();
* need to inherit from this class
*/
class admin_plugin_popularity extends DokuWiki_Admin_Plugin {
- var $version;
/**
* @var helper_plugin_popularity
@@ -23,9 +22,6 @@ class admin_plugin_popularity extends DokuWiki_Admin_Plugin {
function admin_plugin_popularity(){
$this->helper = $this->loadHelper('popularity', false);
-
- $pluginInfo = $this->getInfo();
- $this->version = $pluginInfo['date'];
}
/**
diff --git a/lib/plugins/popularity/helper.php b/lib/plugins/popularity/helper.php
index 0e38bcb88..eacde06d0 100644
--- a/lib/plugins/popularity/helper.php
+++ b/lib/plugins/popularity/helper.php
@@ -29,8 +29,6 @@ class helper_plugin_popularity extends Dokuwiki_Plugin {
*/
var $popularityLastSubmitFile;
- var $version;
-
function helper_plugin_popularity(){
global $conf;
@@ -39,6 +37,11 @@ class helper_plugin_popularity extends Dokuwiki_Plugin {
$this->popularityLastSubmitFile = $conf['cachedir'].'/lastSubmitTime.txt';
}
+ /**
+ * Return methods of this helper
+ *
+ * @return array with methods description
+ */
function getMethods(){
$result = array();
$result[] = array(
@@ -125,15 +128,17 @@ class helper_plugin_popularity extends Dokuwiki_Plugin {
*/
function _gather(){
global $conf;
+ /** @var $auth DokuWiki_Auth_Plugin */
global $auth;
$data = array();
$phptime = ini_get('max_execution_time');
@set_time_limit(0);
+ $pluginInfo = $this->getInfo();
// version
$data['anon_id'] = md5(auth_cookiesalt());
$data['version'] = getVersion();
- $data['popversion'] = $this->version;
+ $data['popversion'] = $pluginInfo['date'];
$data['language'] = $conf['lang'];
$data['now'] = time();
$data['popauto'] = (int) $this->isAutoSubmitEnabled();
@@ -245,6 +250,17 @@ class helper_plugin_popularity extends Dokuwiki_Plugin {
return $data;
}
+ /**
+ * Callback to search and count the content of directories in DokuWiki
+ *
+ * @param array &$data Reference to the result data structure
+ * @param string $base Base usually $conf['datadir']
+ * @param string $file current file or directory relative to $base
+ * @param string $type Type either 'd' for directory or 'f' for file
+ * @param int $lvl Current recursion depht
+ * @param array $opts option array as given to search()
+ * @return bool
+ */
function _search_count(&$data,$base,$file,$type,$lvl,$opts){
// traverse
if($type == 'd'){
diff --git a/lib/plugins/popularity/lang/ar/lang.php b/lib/plugins/popularity/lang/ar/lang.php
index 481668505..c3e21868f 100644
--- a/lib/plugins/popularity/lang/ar/lang.php
+++ b/lib/plugins/popularity/lang/ar/lang.php
@@ -1,7 +1,8 @@
<?php
+
/**
- * Arabic language file
- *
+ * @license GPL 2 (http://www.gnu.org/licenses/gpl.html)
+ *
* @author Yaman Hokan <always.smile.yh@hotmail.com>
* @author Usama Akkad <uahello@gmail.com>
* @author uahello@gmail.com
diff --git a/lib/plugins/popularity/lang/bg/lang.php b/lib/plugins/popularity/lang/bg/lang.php
index ba731c0fc..963b50e84 100644
--- a/lib/plugins/popularity/lang/bg/lang.php
+++ b/lib/plugins/popularity/lang/bg/lang.php
@@ -1,7 +1,8 @@
<?php
+
/**
- * Bulgarian language file
- *
+ * @license GPL 2 (http://www.gnu.org/licenses/gpl.html)
+ *
* @author Viktor Usunov <usun0v@mail.bg>
* @author Kiril <neohidra@gmail.com>
*/
diff --git a/lib/plugins/popularity/lang/cs/lang.php b/lib/plugins/popularity/lang/cs/lang.php
index ee090a131..4ab5916db 100644
--- a/lib/plugins/popularity/lang/cs/lang.php
+++ b/lib/plugins/popularity/lang/cs/lang.php
@@ -1,7 +1,8 @@
<?php
+
/**
- * Czech language file
- *
+ * @license GPL 2 (http://www.gnu.org/licenses/gpl.html)
+ *
* @author Bohumir Zamecnik <bohumir@zamecnik.org>
* @author tomas@valenta.cz
* @author Marek Sacha <sachamar@fel.cvut.cz>
diff --git a/lib/plugins/popularity/lang/da/lang.php b/lib/plugins/popularity/lang/da/lang.php
index bbf2a1ab4..78c447197 100644
--- a/lib/plugins/popularity/lang/da/lang.php
+++ b/lib/plugins/popularity/lang/da/lang.php
@@ -1,7 +1,8 @@
<?php
+
/**
- * Danish language file
- *
+ * @license GPL 2 (http://www.gnu.org/licenses/gpl.html)
+ *
* @author Kalle Sommer Nielsen <kalle@php.net>
* @author Esben Laursen <hyber@hyber.dk>
* @author Harith <haj@berlingske.dk>
diff --git a/lib/plugins/popularity/lang/da/submitted.txt b/lib/plugins/popularity/lang/da/submitted.txt
index 7d7d5429c..88e9ba060 100644
--- a/lib/plugins/popularity/lang/da/submitted.txt
+++ b/lib/plugins/popularity/lang/da/submitted.txt
@@ -1,3 +1,3 @@
-====== Popularitetsfeeback ======
+====== Popularitetsfeedback ======
Dataene er blevet sendt. \ No newline at end of file
diff --git a/lib/plugins/popularity/lang/de-informal/lang.php b/lib/plugins/popularity/lang/de-informal/lang.php
index 0abf90b0b..69efa7470 100644
--- a/lib/plugins/popularity/lang/de-informal/lang.php
+++ b/lib/plugins/popularity/lang/de-informal/lang.php
@@ -1,7 +1,8 @@
<?php
+
/**
- * German (informal) language file
- *
+ * @license GPL 2 (http://www.gnu.org/licenses/gpl.html)
+ *
* @author Alexander Fischer <tbanus@os-forge.net>
* @author Juergen Schwarzer <jschwarzer@freenet.de>
* @author Marcel Metz <marcel_metz@gmx.de>
diff --git a/lib/plugins/popularity/lang/eo/lang.php b/lib/plugins/popularity/lang/eo/lang.php
index c2bca23b1..5e67e5bdb 100644
--- a/lib/plugins/popularity/lang/eo/lang.php
+++ b/lib/plugins/popularity/lang/eo/lang.php
@@ -1,7 +1,8 @@
<?php
+
/**
- * Esperanto language file
- *
+ * @license GPL 2 (http://www.gnu.org/licenses/gpl.html)
+ *
* @author Felipo Kastro <fefcas@gmail.com>
* @author Felipe Castro <fefcas@gmail.com>
* @author Robert Bogenschneider <robog@gmx.de>
diff --git a/lib/plugins/popularity/lang/fa/lang.php b/lib/plugins/popularity/lang/fa/lang.php
index 6a0529891..d2f071b07 100644
--- a/lib/plugins/popularity/lang/fa/lang.php
+++ b/lib/plugins/popularity/lang/fa/lang.php
@@ -1,7 +1,8 @@
<?php
+
/**
- * Persian language file
- *
+ * @license GPL 2 (http://www.gnu.org/licenses/gpl.html)
+ *
* @author behrad eslamifar <behrad_es@yahoo.com)
* @author Mohsen Firoozmandan <info@mambolearn.com>
* @author omidmr@gmail.com
diff --git a/lib/plugins/popularity/lang/fi/lang.php b/lib/plugins/popularity/lang/fi/lang.php
index d7c230742..ec0fc4071 100644
--- a/lib/plugins/popularity/lang/fi/lang.php
+++ b/lib/plugins/popularity/lang/fi/lang.php
@@ -1,7 +1,8 @@
<?php
+
/**
- * Finnish language file
- *
+ * @license GPL 2 (http://www.gnu.org/licenses/gpl.html)
+ *
* @author Otto Vainio <otto@valjakko.net>
* @author Teemu Mattila <ghcsystems@gmail.com>
* @author Sami Olmari <sami@olmari.fi>
diff --git a/lib/plugins/popularity/lang/he/lang.php b/lib/plugins/popularity/lang/he/lang.php
index f619127cd..54341636b 100644
--- a/lib/plugins/popularity/lang/he/lang.php
+++ b/lib/plugins/popularity/lang/he/lang.php
@@ -1,7 +1,8 @@
<?php
+
/**
- * Hebrew language file
- *
+ * @license GPL 2 (http://www.gnu.org/licenses/gpl.html)
+ *
* @author Dotan Kamber <kamberd@yahoo.com>
* @author Moshe Kaplan <mokplan@gmail.com>
* @author Yaron Yogev <yaronyogev@gmail.com>
diff --git a/lib/plugins/popularity/lang/hi/lang.php b/lib/plugins/popularity/lang/hi/lang.php
index c0085d72a..c818c7a1e 100644
--- a/lib/plugins/popularity/lang/hi/lang.php
+++ b/lib/plugins/popularity/lang/hi/lang.php
@@ -1,7 +1,8 @@
<?php
+
/**
- * Hindi language file
- *
+ * @license GPL 2 (http://www.gnu.org/licenses/gpl.html)
+ *
* @author Abhinav Tyagi <abhinavtyagi11@gmail.com>
* @author yndesai@gmail.com
*/
diff --git a/lib/plugins/popularity/lang/hu/lang.php b/lib/plugins/popularity/lang/hu/lang.php
index 5ee40eacc..213d22655 100644
--- a/lib/plugins/popularity/lang/hu/lang.php
+++ b/lib/plugins/popularity/lang/hu/lang.php
@@ -1,7 +1,8 @@
<?php
+
/**
- * Hungarian language file
- *
+ * @license GPL 2 (http://www.gnu.org/licenses/gpl.html)
+ *
* @author Sandor TIHANYI <stihanyi+dw@gmail.com>
* @author Siaynoq Mage <siaynoqmage@gmail.com>
* @author schilling.janos@gmail.com
diff --git a/lib/plugins/popularity/lang/ja/lang.php b/lib/plugins/popularity/lang/ja/lang.php
index 774785511..50346c7ee 100644
--- a/lib/plugins/popularity/lang/ja/lang.php
+++ b/lib/plugins/popularity/lang/ja/lang.php
@@ -1,7 +1,8 @@
<?php
+
/**
- * Japanese language file
- *
+ * @license GPL 2 (http://www.gnu.org/licenses/gpl.html)
+ *
* @author Ikuo Obataya <i.obataya@gmail.com>
* @author Daniel Dupriest <kououken@gmail.com>
* @author Kazutaka Miyasaka <kazmiya@gmail.com>
diff --git a/lib/plugins/popularity/lang/ko/intro.txt b/lib/plugins/popularity/lang/ko/intro.txt
index 0c884546a..bc9bb9dd0 100644
--- a/lib/plugins/popularity/lang/ko/intro.txt
+++ b/lib/plugins/popularity/lang/ko/intro.txt
@@ -1,9 +1,9 @@
====== 인기도 조사 ======
-설치된 위키의 익명 정보를 DokuWiki 개발자에게 보냅니다. 이 [[doku>ko:popularity|도구]]는 DokuWiki가 실제 사용자에게 어떻게 사용되는지 DokuWiki 개발자에게 알려줌으로써 이 후 개발 시 참고가 됩니다.
+설치된 위키의 익명 정보를 도쿠위키 개발자에게 보냅니다. 이 [[doku>ko:popularity|도구]]는 도쿠위키가 실제 사용자에게 어떻게 사용되는지 도쿠위키 개발자에게 알려줌으로써 이 후 개발 시 참고가 됩니다.
설치된 위키가 커짐에 따라서 이 과정을 반복할 필요가 있습니다. 반복된 데이터는 익명 ID로 구별되어집니다.
-보내려는 데이터는 설치 DokuWiki 버전, 문서와 파일 수, 크기, 설치 플러그인, 설치 PHP 정보등을 포함하고 있습니다.
+보내려는 데이터는 설치 도쿠위키 버전, 문서와 파일 수, 크기, 설치 플러그인, 설치 PHP 정보등을 포함하고 있습니다.
실제 보내질 자료는 아래와 같습니다. 정보를 보내려면 "자료 보내기" 버튼을 클릭하세요. \ No newline at end of file
diff --git a/lib/plugins/popularity/lang/ko/lang.php b/lib/plugins/popularity/lang/ko/lang.php
index 3463f4f8e..f8cf4525d 100644
--- a/lib/plugins/popularity/lang/ko/lang.php
+++ b/lib/plugins/popularity/lang/ko/lang.php
@@ -1,17 +1,19 @@
<?php
+
/**
- * Korean language file
- *
+ * @license GPL 2 (http://www.gnu.org/licenses/gpl.html)
+ *
* @author jk Lee
* @author dongnak@gmail.com
* @author Song Younghwan <purluno@gmail.com>
* @author Seung-Chul Yoo <dryoo@live.com>
* @author erial2@gmail.com
* @author Myeongjin <aranet100@gmail.com>
+ * @author Garam <rowain8@gmail.com>
*/
$lang['name'] = '인기도 조사 (불러오는 데 시간이 걸릴 수 있습니다)';
$lang['submit'] = '자료 보내기';
-$lang['autosubmit'] = '자료를 자동으로 매달 한번씩 보내기';
+$lang['autosubmit'] = '자료를 자동으로 한 달에 한 번씩 보내기';
$lang['submissionFailed'] = '다음과 같은 이유로 자료 보내기에 실패했습니다:';
$lang['submitDirectly'] = '아래의 양식에 맞춰 수동으로 작성된 자료를 보낼 수 있습니다.';
$lang['autosubmitError'] = '다음과 같은 이유로 자동 자료 보내기에 실패했습니다:';
diff --git a/lib/plugins/popularity/lang/ne/lang.php b/lib/plugins/popularity/lang/ne/lang.php
index d6aa56eb7..c0d925a46 100644
--- a/lib/plugins/popularity/lang/ne/lang.php
+++ b/lib/plugins/popularity/lang/ne/lang.php
@@ -1,7 +1,8 @@
<?php
+
/**
- * Nepali language file
- *
+ * @license GPL 2 (http://www.gnu.org/licenses/gpl.html)
+ *
* @author Saroj Kumar Dhakal <lotusnagarkot@gmail.com>
* @author SarojKumar Dhakal <lotusnagarkot@yahoo.com>
* @author Saroj Dhakal<lotusnagarkot@yahoo.com>
diff --git a/lib/plugins/popularity/lang/nl/lang.php b/lib/plugins/popularity/lang/nl/lang.php
index dda4a1d7f..6ffa71e82 100644
--- a/lib/plugins/popularity/lang/nl/lang.php
+++ b/lib/plugins/popularity/lang/nl/lang.php
@@ -14,11 +14,12 @@
* @author Jeroen
* @author Ricardo Guijt <ricardoguijt@gmail.com>
* @author Gerrit <klapinklapin@gmail.com>
+ * @author Remon <no@email.local>
*/
$lang['name'] = 'Populariteitsfeedback (kan even duren om in te laden)';
-$lang['submit'] = 'Verstuur';
+$lang['submit'] = 'Verstuur gegevens';
$lang['autosubmit'] = 'Gegevens automatisch maandelijks verzenden';
-$lang['submissionFailed'] = 'De gegevens konden niet verstuurd worden vanwege de volgende fouten:';
+$lang['submissionFailed'] = 'De gegevens konden niet verstuurd worden vanwege de volgende fout:';
$lang['submitDirectly'] = 'Je kan de gegevens handmatig sturen door het onderstaande formulier te verzenden.';
$lang['autosubmitError'] = 'De laatste automatische verzending is mislukt vanwege de volgende fout:';
$lang['lastSent'] = 'De gegevens zijn verstuurd.';
diff --git a/lib/plugins/popularity/lang/no/lang.php b/lib/plugins/popularity/lang/no/lang.php
index df38f6e0e..dfa99d824 100644
--- a/lib/plugins/popularity/lang/no/lang.php
+++ b/lib/plugins/popularity/lang/no/lang.php
@@ -1,10 +1,11 @@
<?php
+
/**
- * Norwegian language file
- *
+ * @license GPL 2 (http://www.gnu.org/licenses/gpl.html)
+ *
* @author Rune M. Andersen <rune.andersen@gmail.com>
* @author Jakob Vad Nielsen (me@jakobnielsen.net)
- * @author Kjell Tore Næsgaard <kjell.t.nasgaard@ntnu.no>
+ * @author Kjell Tore Næsgaard <kjell.t.nasgaard@ntnu.no>
* @author Knut Staring <knutst@gmail.com>
* @author Lisa Ditlefsen <lisa@vervesearch.com>
* @author Erik Pedersen <erik.pedersen@shaw.ca>
diff --git a/lib/plugins/popularity/lang/pl/lang.php b/lib/plugins/popularity/lang/pl/lang.php
index 76a9464bd..045574a69 100644
--- a/lib/plugins/popularity/lang/pl/lang.php
+++ b/lib/plugins/popularity/lang/pl/lang.php
@@ -1,7 +1,8 @@
<?php
+
/**
- * Polish language file
- *
+ * @license GPL 2 (http://www.gnu.org/licenses/gpl.html)
+ *
* @author Grzegorz Żur <grzegorz.zur@gmail.com>
* @author Mariusz Kujawski <marinespl@gmail.com>
* @author Maciej Kurczewski <pipijajko@gmail.com>
diff --git a/lib/plugins/popularity/lang/pt-br/lang.php b/lib/plugins/popularity/lang/pt-br/lang.php
index c2ec36145..280f072b8 100644
--- a/lib/plugins/popularity/lang/pt-br/lang.php
+++ b/lib/plugins/popularity/lang/pt-br/lang.php
@@ -1,7 +1,8 @@
<?php
+
/**
- * Portuguese language file
- *
+ * @license GPL 2 (http://www.gnu.org/licenses/gpl.html)
+ *
* @author Frederico Gonçalves Guimarães <frederico@teia.bio.br>
* @author Lucien Raven <lucienraven@yahoo.com.br>
* @author Enrico Nicoletto <liverig@gmail.com>
diff --git a/lib/plugins/popularity/lang/pt/lang.php b/lib/plugins/popularity/lang/pt/lang.php
index ac27dc8c0..e30b9d62b 100644
--- a/lib/plugins/popularity/lang/pt/lang.php
+++ b/lib/plugins/popularity/lang/pt/lang.php
@@ -1,7 +1,8 @@
<?php
+
/**
- * Portuguese language file
- *
+ * @license GPL 2 (http://www.gnu.org/licenses/gpl.html)
+ *
* @author Enrico Nicoletto <liverig@gmail.com>
* @author Fil <fil@meteopt.com>
* @author André Neves <drakferion@gmail.com>
diff --git a/lib/plugins/popularity/lang/ru/intro.txt b/lib/plugins/popularity/lang/ru/intro.txt
index e8118e4eb..52f5a0ae2 100644
--- a/lib/plugins/popularity/lang/ru/intro.txt
+++ b/lib/plugins/popularity/lang/ru/intro.txt
@@ -1,6 +1,6 @@
====== Сбор информации о популярности ======
-Этот инструмент собирает анонимные данные о вашей вики и позволяет вам отправить их разработчикам «ДокуВики». Эти данные помогут им понять, как именно используется «ДокуВики», и удостовериться, что принимаемые проектные решения соответствуют жизненным реалиям.
+Этот [[doku>popularity|инструмент]] собирает анонимные данные о вашей вики и позволяет вам отправить их разработчикам «ДокуВики». Эти данные помогут им понять, как именно используется «ДокуВики», и удостовериться, что принимаемые проектные решения соответствуют жизненным реалиям.
Отправляйте данные время от времени для того, чтобы сообщать разработчикам о том, что ваша вики «подросла». Отправленные вами данные будут идентифицированы по анонимному ID.
diff --git a/lib/plugins/popularity/lang/ru/submitted.txt b/lib/plugins/popularity/lang/ru/submitted.txt
index a239943a4..845410171 100644
--- a/lib/plugins/popularity/lang/ru/submitted.txt
+++ b/lib/plugins/popularity/lang/ru/submitted.txt
@@ -1,2 +1,3 @@
-====== Общественная обратная связь ======
+====== Сбор информации о популярности ======
+
Данные были успешно отправлены. \ No newline at end of file
diff --git a/lib/plugins/popularity/lang/sk/lang.php b/lib/plugins/popularity/lang/sk/lang.php
index bc46b03c5..ab7accf0c 100644
--- a/lib/plugins/popularity/lang/sk/lang.php
+++ b/lib/plugins/popularity/lang/sk/lang.php
@@ -1,7 +1,8 @@
<?php
+
/**
- * Slovak language file
- *
+ * @license GPL 2 (http://www.gnu.org/licenses/gpl.html)
+ *
* @author Michal Mesko <michal.mesko@gmail.com>
* @author exusik@gmail.com
* @author Martin Michalek <michalek.dev@gmail.com>
diff --git a/lib/plugins/popularity/lang/sl/lang.php b/lib/plugins/popularity/lang/sl/lang.php
index 5c92dd7c4..abde6555b 100644
--- a/lib/plugins/popularity/lang/sl/lang.php
+++ b/lib/plugins/popularity/lang/sl/lang.php
@@ -1,7 +1,8 @@
<?php
+
/**
- * Slovenian language file
- *
+ * @license GPL 2 (http://www.gnu.org/licenses/gpl.html)
+ *
* @author Matej Urbančič (mateju@svn.gnome.org)
*/
$lang['name'] = 'Poročilo o uporabi (nalaganje strani je lahko dolgotrajno)';
diff --git a/lib/plugins/popularity/lang/tr/lang.php b/lib/plugins/popularity/lang/tr/lang.php
index 5339176bc..696ee38dc 100644
--- a/lib/plugins/popularity/lang/tr/lang.php
+++ b/lib/plugins/popularity/lang/tr/lang.php
@@ -1,7 +1,8 @@
<?php
+
/**
- * Turkish language file
- *
+ * @license GPL 2 (http://www.gnu.org/licenses/gpl.html)
+ *
* @author Aydın Coşkuner <aydinweb@gmail.com>
* @author Cihan Kahveci <kahvecicihan@gmail.com>
* @author Yavuz Selim <yavuzselim@gmail.com>
diff --git a/lib/plugins/revert/admin.php b/lib/plugins/revert/admin.php
index beff10ced..423d67449 100644
--- a/lib/plugins/revert/admin.php
+++ b/lib/plugins/revert/admin.php
@@ -120,7 +120,6 @@ class admin_plugin_revert extends DokuWiki_Admin_Plugin {
$recents = getRecents(0,$this->max_lines);
echo '<ul>';
-
$cnt = 0;
foreach($recents as $recent){
if($filter){
@@ -157,7 +156,7 @@ class admin_plugin_revert extends DokuWiki_Admin_Plugin {
echo "<img $att />";
echo '</a> ';
- echo html_wikilink(':'.$recent['id'],(useHeading('navigation'))?NULL:$recent['id']);
+ echo html_wikilink(':'.$recent['id'],(useHeading('navigation'))?null:$recent['id']);
echo ' – '.htmlspecialchars($recent['sum']);
echo ' <span class="user">';
diff --git a/lib/plugins/revert/lang/ar/lang.php b/lib/plugins/revert/lang/ar/lang.php
index a073c336d..71f411c52 100644
--- a/lib/plugins/revert/lang/ar/lang.php
+++ b/lib/plugins/revert/lang/ar/lang.php
@@ -1,10 +1,13 @@
<?php
+
/**
- * Arabic language file
- *
+ * @license GPL 2 (http://www.gnu.org/licenses/gpl.html)
+ *
* @author Yaman Hokan <always.smile.yh@hotmail.com>
* @author Usama Akkad <uahello@gmail.com>
* @author uahello@gmail.com
+ * @author Ahmad Abd-Elghany <tolpa1@gmail.com>
+ * @author alhajr <alhajr300@gmail.com>
*/
$lang['menu'] = 'مدير الاسترجاع';
$lang['filter'] = 'ابحث في الصفحات المتأذاة';
diff --git a/lib/plugins/revert/lang/bg/lang.php b/lib/plugins/revert/lang/bg/lang.php
index 0819de01a..5062a12ad 100644
--- a/lib/plugins/revert/lang/bg/lang.php
+++ b/lib/plugins/revert/lang/bg/lang.php
@@ -1,6 +1,8 @@
<?php
+
/**
- * bulgarian language file
+ * @license GPL 2 (http://www.gnu.org/licenses/gpl.html)
+ *
* @author Nikolay Vladimirov <nikolay@vladimiroff.com>
* @author Viktor Usunov <usun0v@mail.bg>
* @author Kiril <neohidra@gmail.com>
diff --git a/lib/plugins/revert/lang/cs/lang.php b/lib/plugins/revert/lang/cs/lang.php
index eef3295ba..b9e7284d4 100644
--- a/lib/plugins/revert/lang/cs/lang.php
+++ b/lib/plugins/revert/lang/cs/lang.php
@@ -1,9 +1,8 @@
<?php
+
/**
- * Czech language file
- *
* @license GPL 2 (http://www.gnu.org/licenses/gpl.html)
- *
+ *
* @author Bohumir Zamecnik <bohumir@zamecnik.org>
* @author Zbynek Krivka <zbynek.krivka@seznam.cz>
* @author tomas@valenta.cz
@@ -14,6 +13,8 @@
* @author Bohumir Zamecnik <bohumir.zamecnik@gmail.com>
* @author Jakub A. Těšínský (j@kub.cz)
* @author mkucera66@seznam.cz
+ * @author Zbyněk Křivka <krivka@fit.vutbr.cz>
+ * @author Gerrit Uitslag <klapinklapin@gmail.com>
*/
$lang['menu'] = 'Obnova zaspamovaných stránek';
$lang['filter'] = 'Hledat zaspamované stránky';
diff --git a/lib/plugins/revert/lang/da/lang.php b/lib/plugins/revert/lang/da/lang.php
index a76541a78..bb311f18f 100644
--- a/lib/plugins/revert/lang/da/lang.php
+++ b/lib/plugins/revert/lang/da/lang.php
@@ -1,7 +1,8 @@
<?php
+
/**
- * Danish language file
- *
+ * @license GPL 2 (http://www.gnu.org/licenses/gpl.html)
+ *
* @author Kalle Sommer Nielsen <kalle@php.net>
* @author Esben Laursen <hyber@hyber.dk>
* @author Harith <haj@berlingske.dk>
diff --git a/lib/plugins/revert/lang/de-informal/lang.php b/lib/plugins/revert/lang/de-informal/lang.php
index 7ca141e3c..93a932945 100644
--- a/lib/plugins/revert/lang/de-informal/lang.php
+++ b/lib/plugins/revert/lang/de-informal/lang.php
@@ -1,7 +1,8 @@
<?php
+
/**
- * German (informal) language file
- *
+ * @license GPL 2 (http://www.gnu.org/licenses/gpl.html)
+ *
* @author Alexander Fischer <tbanus@os-forge.net>
* @author Juergen Schwarzer <jschwarzer@freenet.de>
* @author Marcel Metz <marcel_metz@gmx.de>
diff --git a/lib/plugins/revert/lang/eo/lang.php b/lib/plugins/revert/lang/eo/lang.php
index 05eec26a8..2d0b0f267 100644
--- a/lib/plugins/revert/lang/eo/lang.php
+++ b/lib/plugins/revert/lang/eo/lang.php
@@ -1,7 +1,8 @@
<?php
+
/**
- * Esperantolanguage file
- *
+ * @license GPL 2 (http://www.gnu.org/licenses/gpl.html)
+ *
* @author Felipe Castro <fefcas@uol.com.br>
* @author Felipe Castro <fefcas@gmail.com>
* @author Felipe Castro <fefcas (cxe) gmail (punkto) com>
diff --git a/lib/plugins/revert/lang/fa/lang.php b/lib/plugins/revert/lang/fa/lang.php
index ba20313a3..c6ce6176f 100644
--- a/lib/plugins/revert/lang/fa/lang.php
+++ b/lib/plugins/revert/lang/fa/lang.php
@@ -1,7 +1,8 @@
<?php
+
/**
- * Persian language file
- *
+ * @license GPL 2 (http://www.gnu.org/licenses/gpl.html)
+ *
* @author behrad eslamifar <behrad_es@yahoo.com)
* @author Mohsen Firoozmandan <info@mambolearn.com>
* @author omidmr@gmail.com
diff --git a/lib/plugins/revert/lang/fi/lang.php b/lib/plugins/revert/lang/fi/lang.php
index fdf9bb81c..d14f527f9 100644
--- a/lib/plugins/revert/lang/fi/lang.php
+++ b/lib/plugins/revert/lang/fi/lang.php
@@ -1,7 +1,8 @@
<?php
+
/**
- * Finnish language file
- *
+ * @license GPL 2 (http://www.gnu.org/licenses/gpl.html)
+ *
* @author otto@valjakko.net
* @author Otto Vainio <otto@valjakko.net>
* @author Teemu Mattila <ghcsystems@gmail.com>
diff --git a/lib/plugins/revert/lang/he/lang.php b/lib/plugins/revert/lang/he/lang.php
index ac3c3412e..2f49856f5 100644
--- a/lib/plugins/revert/lang/he/lang.php
+++ b/lib/plugins/revert/lang/he/lang.php
@@ -1,7 +1,8 @@
<?php
+
/**
- * Hebrew language file
- *
+ * @license GPL 2 (http://www.gnu.org/licenses/gpl.html)
+ *
* @author Dotan Kamber <kamberd@yahoo.com>
* @author Moshe Kaplan <mokplan@gmail.com>
* @author Yaron Yogev <yaronyogev@gmail.com>
diff --git a/lib/plugins/revert/lang/hu/lang.php b/lib/plugins/revert/lang/hu/lang.php
index 051e7b7d7..d16764a35 100644
--- a/lib/plugins/revert/lang/hu/lang.php
+++ b/lib/plugins/revert/lang/hu/lang.php
@@ -1,7 +1,8 @@
<?php
+
/**
- * Hungarian language file
- *
+ * @license GPL 2 (http://www.gnu.org/licenses/gpl.html)
+ *
* @author Sandor TIHANYI <stihanyi+dw@gmail.com>
* @author Siaynoq Mage <siaynoqmage@gmail.com>
* @author schilling.janos@gmail.com
diff --git a/lib/plugins/revert/lang/ja/lang.php b/lib/plugins/revert/lang/ja/lang.php
index 7ef850ea7..9253ff533 100644
--- a/lib/plugins/revert/lang/ja/lang.php
+++ b/lib/plugins/revert/lang/ja/lang.php
@@ -1,6 +1,8 @@
<?php
+
/**
- * japanese language file
+ * @license GPL 2 (http://www.gnu.org/licenses/gpl.html)
+ *
* @author Yuji Takenaka <webmaster@davilin.com>
* @author Ikuo Obataya <i.obataya@gmail.com>
* @author Daniel Dupriest <kououken@gmail.com>
diff --git a/lib/plugins/revert/lang/ko/intro.txt b/lib/plugins/revert/lang/ko/intro.txt
index 7aa618ba6..565aa4bbe 100644
--- a/lib/plugins/revert/lang/ko/intro.txt
+++ b/lib/plugins/revert/lang/ko/intro.txt
@@ -1,3 +1,3 @@
====== 되돌리기 관리자 ======
-스팸 공격으로부터 자동으로 되돌리는데 이 페이지가 도움이 될 수 있습니다. 스팸 공격받은 문서 목록을 찾으려면 문자열을 입력하고(예를 들어 스팸 URL) 나서 찾은 문서가 스팸 공격을 받았는지 확인하고 되돌리세요. \ No newline at end of file
+스팸 공격으로부터 자동으로 되돌리는데 이 페이지가 도움이 될 수 있습니다. 스팸에 공격 받은 문서 목록을 찾으려면 검색어를 입력하고(예를 들어 스팸 URL) 나서 찾은 문서가 스팸 공격을 받았는지 확인하고 되돌리세요. \ No newline at end of file
diff --git a/lib/plugins/revert/lang/ko/lang.php b/lib/plugins/revert/lang/ko/lang.php
index f944361b8..5666100e9 100644
--- a/lib/plugins/revert/lang/ko/lang.php
+++ b/lib/plugins/revert/lang/ko/lang.php
@@ -1,7 +1,8 @@
<?php
+
/**
- * Korean language file
- *
+ * @license GPL 2 (http://www.gnu.org/licenses/gpl.html)
+ *
* @author jk Lee
* @author dongnak@gmail.com
* @author Song Younghwan <purluno@gmail.com>
@@ -10,11 +11,11 @@
* @author Myeongjin <aranet100@gmail.com>
*/
$lang['menu'] = '되돌리기 관리자';
-$lang['filter'] = '스팸 문서 찾기';
+$lang['filter'] = '스팸 문서 검색';
$lang['revert'] = '선택한 문서 되돌리기';
$lang['reverted'] = '%s 판을 %s 판으로 되돌림';
-$lang['removed'] = '%s 삭제함';
+$lang['removed'] = '%s 제거됨';
$lang['revstart'] = '되돌리기 작업을 시작합니다. 오랜 시간이 걸릴 수 있습니다. 완료되기 전에 스크립트 시간 초과가 발생한다면 더 작은 작업으로 나누어서 되돌리시기 바랍니다.';
$lang['revstop'] = '되돌리기 작업이 성공적으로 끝났습니다.';
$lang['note1'] = '참고: 대소문자를 구별해 찾습니다';
-$lang['note2'] = '참고: 이 문서는 <i>%s</i> 스팸 단어를 포함하지 않은 최근 이전 판으로 되돌립니다. ';
+$lang['note2'] = '참고: 문서는 <i>%s</i> 스팸 단어를 포함하지 않은 최신 판으로 되돌립니다. ';
diff --git a/lib/plugins/revert/lang/ne/lang.php b/lib/plugins/revert/lang/ne/lang.php
index 4fd337532..8bd7c3327 100644
--- a/lib/plugins/revert/lang/ne/lang.php
+++ b/lib/plugins/revert/lang/ne/lang.php
@@ -1,7 +1,8 @@
<?php
+
/**
- * Nepali language file
- *
+ * @license GPL 2 (http://www.gnu.org/licenses/gpl.html)
+ *
* @author Saroj Kumar Dhakal <lotusnagarkot@gmail.com>
* @author SarojKumar Dhakal <lotusnagarkot@yahoo.com>
* @author Saroj Dhakal<lotusnagarkot@yahoo.com>
diff --git a/lib/plugins/revert/lang/nl/lang.php b/lib/plugins/revert/lang/nl/lang.php
index 882675b81..ee8678e63 100644
--- a/lib/plugins/revert/lang/nl/lang.php
+++ b/lib/plugins/revert/lang/nl/lang.php
@@ -15,13 +15,14 @@
* @author Jeroen
* @author Ricardo Guijt <ricardoguijt@gmail.com>
* @author Gerrit <klapinklapin@gmail.com>
+ * @author Remon <no@email.local>
*/
$lang['menu'] = 'Herstelmanager';
$lang['filter'] = 'Zoek naar bekladde pagina\'s';
$lang['revert'] = 'Herstel geselecteerde pagina\'s';
$lang['reverted'] = '%s hersteld naar revisie %s';
$lang['removed'] = '%s verwijderd';
-$lang['revstart'] = 'Herstelproces begonnen. Dit kan een lange tijd duren. Als het script een timeout genereerd voor het klaar is, moet je in kleinere selecties herstellen.';
+$lang['revstart'] = 'Herstelproces is begonnen. Dit kan een lange tijd duren. Als het script een timeout genereert voor het klaar is, moet je in kleinere delen herstellen.';
$lang['revstop'] = 'Herstelproces succesvol afgerond.';
$lang['note1'] = 'NB: deze zoekopdracht is hoofdlettergevoelig';
$lang['note2'] = 'NB: de pagina zal hersteld worden naar de laatste versie waar de opgegeven spam-term <i>%s</i> niet op voorkomt.';
diff --git a/lib/plugins/revert/lang/no/lang.php b/lib/plugins/revert/lang/no/lang.php
index 299b12ea7..c58300dc0 100644
--- a/lib/plugins/revert/lang/no/lang.php
+++ b/lib/plugins/revert/lang/no/lang.php
@@ -1,13 +1,14 @@
<?php
+
/**
- * Norwegianlanguage file
- *
+ * @license GPL 2 (http://www.gnu.org/licenses/gpl.html)
+ *
* @author Thomas Nygreen <nygreen@gmail.com>
* @author Arild Burud <arildb@met.no>
* @author Torkill Bruland <torkar-b@online.no>
* @author Rune M. Andersen <rune.andersen@gmail.com>
* @author Jakob Vad Nielsen (me@jakobnielsen.net)
- * @author Kjell Tore Næsgaard <kjell.t.nasgaard@ntnu.no>
+ * @author Kjell Tore Næsgaard <kjell.t.nasgaard@ntnu.no>
* @author Knut Staring <knutst@gmail.com>
* @author Lisa Ditlefsen <lisa@vervesearch.com>
* @author Erik Pedersen <erik.pedersen@shaw.ca>
@@ -15,6 +16,8 @@
* @author Rune Rasmussen syntaxerror.no@gmail.com
* @author Jon Bøe <jonmagneboe@hotmail.com>
* @author Egil Hansen <egil@rosetta.no>
+ * @author Thomas Juberg <Thomas.Juberg@Gmail.com>
+ * @author Boris <boris@newton-media.no>
*/
$lang['menu'] = 'Tilbakestillingsbehandler';
$lang['filter'] = 'Søk etter søppelmeldinger';
diff --git a/lib/plugins/revert/lang/pl/lang.php b/lib/plugins/revert/lang/pl/lang.php
index 462841292..d2d53b87e 100644
--- a/lib/plugins/revert/lang/pl/lang.php
+++ b/lib/plugins/revert/lang/pl/lang.php
@@ -1,6 +1,8 @@
<?php
+
/**
- * polish language file
+ * @license GPL 2 (http://www.gnu.org/licenses/gpl.html)
+ *
* @author Grzegorz Żur <grzegorz.zur@gmail.com>
* @author Mariusz Kujawski <marinespl@gmail.com>
* @author Maciej Kurczewski <pipijajko@gmail.com>
diff --git a/lib/plugins/revert/lang/pt-br/lang.php b/lib/plugins/revert/lang/pt-br/lang.php
index b74e0408f..103970484 100644
--- a/lib/plugins/revert/lang/pt-br/lang.php
+++ b/lib/plugins/revert/lang/pt-br/lang.php
@@ -1,7 +1,8 @@
<?php
+
/**
- * Portuguese language file
- *
+ * @license GPL 2 (http://www.gnu.org/licenses/gpl.html)
+ *
* @author Frederico Gonçalves Guimarães <frederico@teia.bio.br>
* @author Felipe Castro <fefcas@gmail.com>
* @author Lucien Raven <lucienraven@yahoo.com.br>
diff --git a/lib/plugins/revert/lang/pt/lang.php b/lib/plugins/revert/lang/pt/lang.php
index 3b2850f41..f87f77db7 100644
--- a/lib/plugins/revert/lang/pt/lang.php
+++ b/lib/plugins/revert/lang/pt/lang.php
@@ -1,7 +1,8 @@
<?php
+
/**
- * Portuguese language file
- *
+ * @license GPL 2 (http://www.gnu.org/licenses/gpl.html)
+ *
* @author José Monteiro <Jose.Monteiro@DoWeDo-IT.com>
* @author Enrico Nicoletto <liverig@gmail.com>
* @author Fil <fil@meteopt.com>
diff --git a/lib/plugins/revert/lang/ru/lang.php b/lib/plugins/revert/lang/ru/lang.php
index defd86de0..73d69b33e 100644
--- a/lib/plugins/revert/lang/ru/lang.php
+++ b/lib/plugins/revert/lang/ru/lang.php
@@ -22,7 +22,7 @@
$lang['menu'] = 'Менеджер откаток';
$lang['filter'] = 'Поиск спам-страниц';
$lang['revert'] = 'Откатить изменения для выбранных страниц';
-$lang['reverted'] = '%s откачена к версии %s';
+$lang['reverted'] = '%s возвращена к версии %s';
$lang['removed'] = '%s удалена';
$lang['revstart'] = 'Начат процесс откатки. Он может занять много времени. Если скрипт не успевает завершить работу и выдаёт ошибку, необходимо произвести откатку более маленькими частями.';
$lang['revstop'] = 'Процесс откатки успешно завершён.';
diff --git a/lib/plugins/revert/lang/sk/intro.txt b/lib/plugins/revert/lang/sk/intro.txt
index e69de29bb..aa75a2c10 100644
--- a/lib/plugins/revert/lang/sk/intro.txt
+++ b/lib/plugins/revert/lang/sk/intro.txt
@@ -0,0 +1,3 @@
+====== Obnova dát ======
+
+Táto stránka slúži na automatické obnovenie obsahu stránok po útoku spamom. Pre identifikáciu napadnutých stránok zadajte vyhľadávací reťazec (napr. spam URL), potom potvrďte, že nájdené stránky sú skutočne napadnuté, a zrušte posledné zmeny. \ No newline at end of file
diff --git a/lib/plugins/revert/lang/sk/lang.php b/lib/plugins/revert/lang/sk/lang.php
index 368d2d929..7ab21f287 100644
--- a/lib/plugins/revert/lang/sk/lang.php
+++ b/lib/plugins/revert/lang/sk/lang.php
@@ -1,12 +1,13 @@
<?php
+
/**
- * Slovaklanguage file
- *
+ * @license GPL 2 (http://www.gnu.org/licenses/gpl.html)
+ *
* @author Michal Mesko <michal.mesko@gmail.com>
* @author exusik@gmail.com
* @author Martin Michalek <michalek.dev@gmail.com>
*/
-$lang['menu'] = 'Reverzný manažér';
+$lang['menu'] = 'Obnova dát';
$lang['filter'] = 'Hľadať spamerské stránky';
$lang['revert'] = 'Vrátiť vybrané stránky';
$lang['reverted'] = '%s vrátená na revíziu %s';
diff --git a/lib/plugins/revert/lang/sl/lang.php b/lib/plugins/revert/lang/sl/lang.php
index 92b0427ce..df778fd26 100644
--- a/lib/plugins/revert/lang/sl/lang.php
+++ b/lib/plugins/revert/lang/sl/lang.php
@@ -1,7 +1,8 @@
<?php
+
/**
- * Slovenian language file
- *
+ * @license GPL 2 (http://www.gnu.org/licenses/gpl.html)
+ *
* @author Matej Urbančič (mateju@svn.gnome.org)
*/
$lang['menu'] = 'Povrnitev okvarjene vsebine';
diff --git a/lib/plugins/revert/lang/sv/lang.php b/lib/plugins/revert/lang/sv/lang.php
index c30f82d93..e605a17d4 100644
--- a/lib/plugins/revert/lang/sv/lang.php
+++ b/lib/plugins/revert/lang/sv/lang.php
@@ -18,6 +18,7 @@
* @author Smorkster Andersson smorkster@gmail.com
* @author Henrik <henrik@idealis.se>
* @author Tor Härnqvist <tor.harnqvist@gmail.com>
+ * @author Hans Iwan Bratt <hibratt@gmail.com>
*/
$lang['menu'] = 'Hantera återställningar';
$lang['filter'] = 'Sök efter spamsidor';
diff --git a/lib/plugins/revert/lang/tr/lang.php b/lib/plugins/revert/lang/tr/lang.php
index 9030c31e3..52d28c6fa 100644
--- a/lib/plugins/revert/lang/tr/lang.php
+++ b/lib/plugins/revert/lang/tr/lang.php
@@ -1,7 +1,8 @@
<?php
+
/**
- * Turkish language file
- *
+ * @license GPL 2 (http://www.gnu.org/licenses/gpl.html)
+ *
* @author Aydın Coşkuner <aydinweb@gmail.com>
* @author Cihan Kahveci <kahvecicihan@gmail.com>
* @author Yavuz Selim <yavuzselim@gmail.com>
diff --git a/lib/plugins/safefnrecode/action.php b/lib/plugins/safefnrecode/action.php
index aae11c437..9127f8df2 100644
--- a/lib/plugins/safefnrecode/action.php
+++ b/lib/plugins/safefnrecode/action.php
@@ -15,7 +15,7 @@ class action_plugin_safefnrecode extends DokuWiki_Action_Plugin {
public function register(Doku_Event_Handler $controller) {
- $controller->register_hook('INDEXER_TASKS_RUN', 'BEFORE', $this, 'handle_indexer_tasks_run');
+ $controller->register_hook('INDEXER_TASKS_RUN', 'BEFORE', $this, 'handle_indexer_tasks_run');
}
diff --git a/lib/plugins/syntax.php b/lib/plugins/syntax.php
index b7839b2b2..8df5abb08 100644
--- a/lib/plugins/syntax.php
+++ b/lib/plugins/syntax.php
@@ -137,7 +137,7 @@ class DokuWiki_Syntax_Plugin extends Doku_Parser_Mode {
$idx = array_search(substr(get_class($this), 7), (array) $this->allowedModes);
if ($idx !== false) {
- unset($this->allowedModes[$idx]);
+ unset($this->allowedModes[$idx]);
}
$this->allowedModesSetup = true;
}
@@ -169,9 +169,9 @@ class DokuWiki_Syntax_Plugin extends Doku_Parser_Mode {
* @return string string in appropriate language or english if not available
*/
function getLang($id) {
- if (!$this->localised) $this->setupLocale();
+ if (!$this->localised) $this->setupLocale();
- return (isset($this->lang[$id]) ? $this->lang[$id] : '');
+ return (isset($this->lang[$id]) ? $this->lang[$id] : '');
}
/**
@@ -184,7 +184,7 @@ class DokuWiki_Syntax_Plugin extends Doku_Parser_Mode {
* @return string parsed contents of the wiki page in xhtml format
*/
function locale_xhtml($id) {
- return p_cached_output($this->localFN($id));
+ return p_cached_output($this->localFN($id));
}
/**
@@ -193,17 +193,17 @@ class DokuWiki_Syntax_Plugin extends Doku_Parser_Mode {
* plugin equivalent of localFN()
*/
function localFN($id) {
- global $conf;
- $plugin = $this->getPluginName();
- $file = DOKU_CONF.'/plugin_lang/'.$plugin.'/'.$conf['lang'].'/'.$id.'.txt';
- if (!@file_exists($file)){
- $file = DOKU_PLUGIN.$plugin.'/lang/'.$conf['lang'].'/'.$id.'.txt';
- if(!@file_exists($file)){
- //fall back to english
- $file = DOKU_PLUGIN.$plugin.'/lang/en/'.$id.'.txt';
+ global $conf;
+ $plugin = $this->getPluginName();
+ $file = DOKU_CONF.'/plugin_lang/'.$plugin.'/'.$conf['lang'].'/'.$id.'.txt';
+ if (!@file_exists($file)){
+ $file = DOKU_PLUGIN.$plugin.'/lang/'.$conf['lang'].'/'.$id.'.txt';
+ if(!@file_exists($file)){
+ //fall back to english
+ $file = DOKU_PLUGIN.$plugin.'/lang/en/'.$id.'.txt';
+ }
}
- }
- return $file;
+ return $file;
}
/**
@@ -214,16 +214,16 @@ class DokuWiki_Syntax_Plugin extends Doku_Parser_Mode {
function setupLocale() {
if ($this->localised) return;
- global $conf; // definitely don't invoke "global $lang"
- $path = DOKU_PLUGIN.$this->getPluginName().'/lang/';
+ global $conf; // definitely don't invoke "global $lang"
+ $path = DOKU_PLUGIN.$this->getPluginName().'/lang/';
- $lang = array();
- // don't include once, in case several plugin components require the same language file
- @include($path.'en/lang.php');
- if ($conf['lang'] != 'en') @include($path.$conf['lang'].'/lang.php');
+ $lang = array();
+ // don't include once, in case several plugin components require the same language file
+ @include($path.'en/lang.php');
+ if ($conf['lang'] != 'en') @include($path.$conf['lang'].'/lang.php');
- $this->lang = $lang;
- $this->localised = true;
+ $this->lang = $lang;
+ $this->localised = true;
}
// configuration methods
diff --git a/lib/plugins/usermanager/_test/csv_export.test.php b/lib/plugins/usermanager/_test/csv_export.test.php
new file mode 100644
index 000000000..667fc71dc
--- /dev/null
+++ b/lib/plugins/usermanager/_test/csv_export.test.php
@@ -0,0 +1,59 @@
+<?php
+
+/**
+ * @group plugin_usermanager
+ * @group admin_plugins
+ * @group plugins
+ * @group bundled_plugins
+ */
+require_once(dirname(__FILE__).'/mocks.class.php');
+
+class plugin_usermanager_csv_export_test extends DokuWikiTest {
+
+ protected $usermanager;
+
+ function setUp() {
+ $this->usermanager = new admin_mock_usermanager();
+ parent::setUp();
+ }
+
+ /**
+ * based on standard test user/conf setup
+ *
+ * users per _test/conf/users.auth.php
+ * expected to be: testuser:179ad45c6ce2cb97cf1029e212046e81:Arthur Dent:arthur@example.com
+ */
+ function test_export() {
+ $expected = 'User,"Real Name",Email,Groups
+testuser,"Arthur Dent",arthur@example.com,
+';
+ $this->assertEquals($expected, $this->usermanager->tryExport());
+ }
+
+ /**
+ * when configured to use a different locale, the column headings in the first line of the
+ * exported csv data should reflect the langauge strings of that locale
+ */
+ function test_export_withlocale(){
+ global $conf;
+ $old_conf = $conf;
+ $conf['lang'] = 'de';
+
+ $this->usermanager->localised = false;
+ $this->usermanager->setupLocale();
+
+ $conf = $old_conf;
+
+ $expected = 'Benutzername,"Voller Name",E-Mail,Gruppen
+testuser,"Arthur Dent",arthur@example.com,
+';
+ $this->assertEquals($expected, $this->usermanager->tryExport());
+ }
+/*
+ function test_export_withfilter(){
+ $this->markTestIncomplete(
+ 'This test has not been implemented yet.'
+ );
+ }
+*/
+}
diff --git a/lib/plugins/usermanager/_test/csv_import.test.php b/lib/plugins/usermanager/_test/csv_import.test.php
new file mode 100644
index 000000000..3968356bc
--- /dev/null
+++ b/lib/plugins/usermanager/_test/csv_import.test.php
@@ -0,0 +1,185 @@
+<?php
+
+/**
+ * @group plugin_usermanager
+ * @group admin_plugins
+ * @group plugins
+ * @group bundled_plugins
+ */
+
+require_once(dirname(__FILE__).'/mocks.class.php');
+
+/**
+ * !!!!! NOTE !!!!!
+ *
+ * At present, users imported in individual tests remain in the user list for subsequent tests
+ */
+class plugin_usermanager_csv_import_test extends DokuWikiTest {
+
+ private $old_files;
+ protected $usermanager;
+ protected $importfile;
+
+ function setUp() {
+ $this->importfile = tempnam(TMP_DIR, 'csv');
+
+ $this->old_files = $_FILES;
+ $_FILES = array(
+ 'import' => array(
+ 'name' => 'import.csv',
+ 'tmp_name' => $this->importfile,
+ 'type' => 'text/plain',
+ 'size' => 1,
+ 'error' => 0,
+ ),
+ );
+
+ $this->usermanager = new admin_mock_usermanager();
+ parent::setUp();
+ }
+
+ function tearDown() {
+ $_FILES = $this->old_files;
+ parent::tearDown();
+ }
+
+ function doImportTest($importCsv, $expectedResult, $expectedNewUsers, $expectedFailures) {
+ global $auth;
+ $before_users = $auth->retrieveUsers();
+
+ io_savefile($this->importfile, $importCsv);
+ $result = $this->usermanager->tryImport();
+
+ $after_users = $auth->retrieveUsers();
+ $import_count = count($after_users) - count($before_users);
+ $new_users = array_diff_key($after_users, $before_users);
+ $diff_users = array_diff_assoc($after_users, $before_users);
+
+ $expectedCount = count($expectedNewUsers);
+
+ $this->assertEquals($expectedResult, $result); // import result as expected
+ $this->assertEquals($expectedCount, $import_count); // number of new users matches expected number imported
+ $this->assertEquals($expectedNewUsers, $this->stripPasswords($new_users)); // new user data matches imported user data
+ $this->assertEquals($expectedCount, $this->countPasswords($new_users)); // new users have a password
+ $this->assertEquals($expectedCount, $this->usermanager->mock_email_notifications_sent); // new users notified of their passwords
+ $this->assertEquals($new_users, $diff_users); // no other users were harmed in the testing of this import
+ $this->assertEquals($expectedFailures, $this->usermanager->getImportFailures()); // failures as expected
+ }
+
+ function test_cantImport(){
+ global $auth;
+ $oldauth = $auth;
+
+ $auth = new auth_mock_authplain();
+ $auth->setCanDo('addUser', false);
+
+ $csv = 'User,"Real Name",Email,Groups
+importuser,"Ford Prefect",ford@example.com,user
+';
+
+ $this->doImportTest($csv, false, array(), array());
+
+ $auth = $oldauth;
+ }
+
+ function test_import() {
+ $csv = 'User,"Real Name",Email,Groups
+importuser,"Ford Prefect",ford@example.com,user
+';
+ $expected = array(
+ 'importuser' => array(
+ 'name' => 'Ford Prefect',
+ 'mail' => 'ford@example.com',
+ 'grps' => array('user'),
+ ),
+ );
+
+ $this->doImportTest($csv, true, $expected, array());
+ }
+
+ function test_importExisting() {
+ $csv = 'User,"Real Name",Email,Groups
+importuser,"Ford Prefect",ford@example.com,user
+';
+ $failures = array(
+ '2' => array(
+ 'error' => $this->usermanager->lang['import_error_create'],
+ 'user' => array(
+ 'importuser',
+ 'Ford Prefect',
+ 'ford@example.com',
+ 'user',
+ ),
+ 'orig' => 'importuser,"Ford Prefect",ford@example.com,user'.NL,
+ ),
+ );
+
+ $this->doImportTest($csv, true, array(), $failures);
+ }
+
+ function test_importUtf8() {
+ $csv = 'User,"Real Name",Email,Groups
+importutf8,"Førd Prefect",ford@example.com,user
+';
+ $expected = array(
+ 'importutf8' => array(
+ 'name' => 'Førd Prefect',
+ 'mail' => 'ford@example.com',
+ 'grps' => array('user'),
+ ),
+ );
+
+ $this->doImportTest($csv, true, $expected, array());
+ }
+
+ /**
+ * utf8: u+00F8 (ø) <=> 0xF8 :iso-8859-1
+ */
+ function test_importIso8859() {
+ $csv = 'User,"Real Name",Email,Groups
+importiso8859,"F'.chr(0xF8).'rd Prefect",ford@example.com,user
+';
+ $expected = array(
+ 'importiso8859' => array(
+ 'name' => 'Førd Prefect',
+ 'mail' => 'ford@example.com',
+ 'grps' => array('user'),
+ ),
+ );
+
+ $this->doImportTest($csv, true, $expected, array());
+ }
+
+ /**
+ * Verify usermanager::str_getcsv() behaves identically to php 5.3's str_getcsv()
+ * within the context/parameters required by _import()
+ *
+ * @requires PHP 5.3
+ * @deprecated remove when dokuwiki requires 5.3+
+ * also associated usermanager & mock usermanager access methods
+ */
+ function test_getcsvcompatibility() {
+ $line = 'importuser,"Ford Prefect",ford@example.com,user'.NL;
+
+ $this->assertEquals(str_getcsv($line), $this->usermanager->access_str_getcsv($line));
+ }
+
+ private function stripPasswords($array){
+ foreach ($array as $user => $data) {
+ unset($array[$user]['pass']);
+ }
+ return $array;
+ }
+
+ private function countPasswords($array){
+ $count = 0;
+ foreach ($array as $user => $data) {
+ if (!empty($data['pass'])) {
+ $count++;
+ }
+ }
+ return $count;
+ }
+
+}
+
diff --git a/lib/plugins/usermanager/_test/mocks.class.php b/lib/plugins/usermanager/_test/mocks.class.php
new file mode 100644
index 000000000..91c74768c
--- /dev/null
+++ b/lib/plugins/usermanager/_test/mocks.class.php
@@ -0,0 +1,58 @@
+<?php
+
+/**
+ * test wrapper to allow access to private/protected functions/properties
+ *
+ * NB: for plugin introspection methods, getPluginType() & getPluginName() to work
+ * this class name needs to start "admin_" and end "_usermanager". Internally
+ * these methods are used in setting up the class, e.g. for language strings
+ */
+class admin_mock_usermanager extends admin_plugin_usermanager {
+
+ public $mock_email_notifications = true;
+ public $mock_email_notifications_sent = 0;
+
+ public function getImportFailures() {
+ return $this->_import_failures;
+ }
+
+ public function tryExport() {
+ ob_start();
+ $this->_export();
+ return ob_get_clean();
+ }
+
+ public function tryImport() {
+ return $this->_import();
+ }
+
+ /**
+ * @deprecated remove when dokuwiki requires php 5.3+
+ * also associated unit test & usermanager methods
+ */
+ public function access_str_getcsv($line){
+ return $this->str_getcsv($line);
+ }
+
+ // no need to send email notifications (mostly)
+ protected function _notifyUser($user, $password, $status_alert=true) {
+ if ($this->mock_email_notifications) {
+ $this->mock_email_notifications_sent++;
+ return true;
+ } else {
+ return parent::_notifyUser($user, $password, $status_alert);
+ }
+ }
+
+ protected function _isUploadedFile($file) {
+ return file_exists($file);
+ }
+}
+
+class auth_mock_authplain extends auth_plugin_authplain {
+
+ public function setCanDo($op, $canDo) {
+ $this->cando[$op] = $canDo;
+ }
+
+}
diff --git a/lib/plugins/usermanager/admin.php b/lib/plugins/usermanager/admin.php
index 762daa6b9..156037f09 100644
--- a/lib/plugins/usermanager/admin.php
+++ b/lib/plugins/usermanager/admin.php
@@ -21,33 +21,34 @@ if(!defined('DOKU_PLUGIN_IMAGES')) define('DOKU_PLUGIN_IMAGES',DOKU_BASE.'lib/pl
*/
class admin_plugin_usermanager extends DokuWiki_Admin_Plugin {
- var $_auth = null; // auth object
- var $_user_total = 0; // number of registered users
- var $_filter = array(); // user selection filter(s)
- var $_start = 0; // index of first user to be displayed
- var $_last = 0; // index of the last user to be displayed
- var $_pagesize = 20; // number of users to list on one page
- var $_edit_user = ''; // set to user selected for editing
- var $_edit_userdata = array();
- var $_disabled = ''; // if disabled set to explanatory string
- var $_import_failures = array();
+ protected $_auth = null; // auth object
+ protected $_user_total = 0; // number of registered users
+ protected $_filter = array(); // user selection filter(s)
+ protected $_start = 0; // index of first user to be displayed
+ protected $_last = 0; // index of the last user to be displayed
+ protected $_pagesize = 20; // number of users to list on one page
+ protected $_edit_user = ''; // set to user selected for editing
+ protected $_edit_userdata = array();
+ protected $_disabled = ''; // if disabled set to explanatory string
+ protected $_import_failures = array();
/**
* Constructor
*/
- function admin_plugin_usermanager(){
+ public function admin_plugin_usermanager(){
+ /** @var DokuWiki_Auth_Plugin $auth */
global $auth;
$this->setupLocale();
if (!isset($auth)) {
- $this->disabled = $this->lang['noauth'];
+ $this->_disabled = $this->lang['noauth'];
} else if (!$auth->canDo('getUsers')) {
- $this->disabled = $this->lang['nosupport'];
+ $this->_disabled = $this->lang['nosupport'];
} else {
- // we're good to go
- $this->_auth = & $auth;
+ // we're good to go
+ $this->_auth = & $auth;
}
@@ -58,27 +59,27 @@ class admin_plugin_usermanager extends DokuWiki_Admin_Plugin {
}
/**
- * return prompt for admin menu
- */
- function getMenuText($language) {
+ * Return prompt for admin menu
+ */
+ public function getMenuText($language) {
if (!is_null($this->_auth))
return parent::getMenuText($language);
- return $this->getLang('menu').' '.$this->disabled;
+ return $this->getLang('menu').' '.$this->_disabled;
}
/**
* return sort order for position in admin menu
*/
- function getMenuSort() {
+ public function getMenuSort() {
return 2;
}
/**
- * handle user request
+ * Handle user request
*/
- function handle() {
+ public function handle() {
global $INPUT;
if (is_null($this->_auth)) return false;
@@ -95,39 +96,40 @@ class admin_plugin_usermanager extends DokuWiki_Admin_Plugin {
}
if ($cmd != "search") {
- $this->_start = $INPUT->int('start', 0);
- $this->_filter = $this->_retrieveFilter();
+ $this->_start = $INPUT->int('start', 0);
+ $this->_filter = $this->_retrieveFilter();
}
switch($cmd){
- case "add" : $this->_addUser(); break;
- case "delete" : $this->_deleteUser(); break;
- case "modify" : $this->_modifyUser(); break;
- case "edit" : $this->_editUser($param); break;
- case "search" : $this->_setFilter($param);
- $this->_start = 0;
- break;
- case "export" : $this->_export(); break;
- case "import" : $this->_import(); break;
- case "importfails" : $this->_downloadImportFailures(); break;
+ case "add" : $this->_addUser(); break;
+ case "delete" : $this->_deleteUser(); break;
+ case "modify" : $this->_modifyUser(); break;
+ case "edit" : $this->_editUser($param); break;
+ case "search" : $this->_setFilter($param);
+ $this->_start = 0;
+ break;
+ case "export" : $this->_export(); break;
+ case "import" : $this->_import(); break;
+ case "importfails" : $this->_downloadImportFailures(); break;
}
$this->_user_total = $this->_auth->canDo('getUserCount') ? $this->_auth->getUserCount($this->_filter) : -1;
// page handling
switch($cmd){
- case 'start' : $this->_start = 0; break;
- case 'prev' : $this->_start -= $this->_pagesize; break;
- case 'next' : $this->_start += $this->_pagesize; break;
- case 'last' : $this->_start = $this->_user_total; break;
+ case 'start' : $this->_start = 0; break;
+ case 'prev' : $this->_start -= $this->_pagesize; break;
+ case 'next' : $this->_start += $this->_pagesize; break;
+ case 'last' : $this->_start = $this->_user_total; break;
}
$this->_validatePagination();
+ return true;
}
/**
- * output appropriate html
+ * Output appropriate html
*/
- function html() {
+ public function html() {
global $ID;
if(is_null($this->_auth)) {
@@ -136,13 +138,12 @@ class admin_plugin_usermanager extends DokuWiki_Admin_Plugin {
}
$user_list = $this->_auth->retrieveUsers($this->_start, $this->_pagesize, $this->_filter);
- $users = array_keys($user_list);
$page_buttons = $this->_pagination();
$delete_disable = $this->_auth->canDo('delUser') ? '' : 'disabled="disabled"';
$editable = $this->_auth->canDo('UserMod');
- $export_label = empty($this->_filter) ? $this->lang['export_all'] : $this->lang[export_filtered];
+ $export_label = empty($this->_filter) ? $this->lang['export_all'] : $this->lang['export_filtered'];
print $this->locale_xhtml('intro');
print $this->locale_xhtml('list');
@@ -151,9 +152,14 @@ class admin_plugin_usermanager extends DokuWiki_Admin_Plugin {
ptln("<div class=\"level2\">");
if ($this->_user_total > 0) {
- ptln("<p>".sprintf($this->lang['summary'],$this->_start+1,$this->_last,$this->_user_total,$this->_auth->getUserCount())."</p>");
+ ptln("<p>".sprintf($this->lang['summary'],$this->_start+1,$this->_last,$this->_user_total,$this->_auth->getUserCount())."</p>");
} else {
- ptln("<p>".sprintf($this->lang['nonefound'],$this->_auth->getUserCount())."</p>");
+ if($this->_user_total < 0) {
+ $allUserTotal = 0;
+ } else {
+ $allUserTotal = $this->_auth->getUserCount();
+ }
+ ptln("<p>".sprintf($this->lang['nonefound'], $allUserTotal)."</p>");
}
ptln("<form action=\"".wl($ID)."\" method=\"post\">");
formSecurityToken();
@@ -174,25 +180,31 @@ class admin_plugin_usermanager extends DokuWiki_Admin_Plugin {
ptln(" </thead>");
if ($this->_user_total) {
- ptln(" <tbody>");
- foreach ($user_list as $user => $userinfo) {
- extract($userinfo);
- $groups = join(', ',$grps);
- ptln(" <tr class=\"user_info\">");
- ptln(" <td class=\"centeralign\"><input type=\"checkbox\" name=\"delete[".$user."]\" ".$delete_disable." /></td>");
- if ($editable) {
- ptln(" <td><a href=\"".wl($ID,array('fn[edit]['.hsc($user).']' => 1,
- 'do' => 'admin',
- 'page' => 'usermanager',
- 'sectok' => getSecurityToken())).
- "\" title=\"".$this->lang['edit_prompt']."\">".hsc($user)."</a></td>");
- } else {
- ptln(" <td>".hsc($user)."</td>");
+ ptln(" <tbody>");
+ foreach ($user_list as $user => $userinfo) {
+ extract($userinfo);
+ /**
+ * @var string $name
+ * @var string $pass
+ * @var string $mail
+ * @var array $grps
+ */
+ $groups = join(', ',$grps);
+ ptln(" <tr class=\"user_info\">");
+ ptln(" <td class=\"centeralign\"><input type=\"checkbox\" name=\"delete[".$user."]\" ".$delete_disable." /></td>");
+ if ($editable) {
+ ptln(" <td><a href=\"".wl($ID,array('fn[edit]['.hsc($user).']' => 1,
+ 'do' => 'admin',
+ 'page' => 'usermanager',
+ 'sectok' => getSecurityToken())).
+ "\" title=\"".$this->lang['edit_prompt']."\">".hsc($user)."</a></td>");
+ } else {
+ ptln(" <td>".hsc($user)."</td>");
+ }
+ ptln(" <td>".hsc($name)."</td><td>".hsc($mail)."</td><td>".hsc($groups)."</td>");
+ ptln(" </tr>");
}
- ptln(" <td>".hsc($name)."</td><td>".hsc($mail)."</td><td>".hsc($groups)."</td>");
- ptln(" </tr>");
- }
- ptln(" </tbody>");
+ ptln(" </tbody>");
}
ptln(" <tbody>");
@@ -226,38 +238,43 @@ class admin_plugin_usermanager extends DokuWiki_Admin_Plugin {
$style = $this->_edit_user ? " class=\"edit_user\"" : "";
if ($this->_auth->canDo('addUser')) {
- ptln("<div".$style.">");
- print $this->locale_xhtml('add');
- ptln(" <div class=\"level2\">");
+ ptln("<div".$style.">");
+ print $this->locale_xhtml('add');
+ ptln(" <div class=\"level2\">");
- $this->_htmlUserForm('add',null,array(),4);
+ $this->_htmlUserForm('add',null,array(),4);
- ptln(" </div>");
- ptln("</div>");
+ ptln(" </div>");
+ ptln("</div>");
}
if($this->_edit_user && $this->_auth->canDo('UserMod')){
- ptln("<div".$style." id=\"scroll__here\">");
- print $this->locale_xhtml('edit');
- ptln(" <div class=\"level2\">");
+ ptln("<div".$style." id=\"scroll__here\">");
+ print $this->locale_xhtml('edit');
+ ptln(" <div class=\"level2\">");
- $this->_htmlUserForm('modify',$this->_edit_user,$this->_edit_userdata,4);
+ $this->_htmlUserForm('modify',$this->_edit_user,$this->_edit_userdata,4);
- ptln(" </div>");
- ptln("</div>");
+ ptln(" </div>");
+ ptln("</div>");
}
if ($this->_auth->canDo('addUser')) {
- $this->_htmlImportForm();
+ $this->_htmlImportForm();
}
ptln("</div>");
+ return true;
}
-
/**
- * @todo disable fields which the backend can't change
+ * Display form to add or modify a user
+ *
+ * @param string $cmd 'add' or 'modify'
+ * @param string $user id of user
+ * @param array $userdata array with name, mail, pass and grps
+ * @param int $indent
*/
- function _htmlUserForm($cmd,$user='',$userdata=array(),$indent=0) {
+ protected function _htmlUserForm($cmd,$user='',$userdata=array(),$indent=0) {
global $conf;
global $ID;
@@ -265,10 +282,10 @@ class admin_plugin_usermanager extends DokuWiki_Admin_Plugin {
$notes = array();
if ($user) {
- extract($userdata);
- if (!empty($grps)) $groups = join(',',$grps);
+ extract($userdata);
+ if (!empty($grps)) $groups = join(',',$grps);
} else {
- $notes[] = sprintf($this->lang['note_group'],$conf['defaultgroup']);
+ $notes[] = sprintf($this->lang['note_group'],$conf['defaultgroup']);
}
ptln("<form action=\"".wl($ID)."\" method=\"post\">",$indent);
@@ -287,14 +304,14 @@ class admin_plugin_usermanager extends DokuWiki_Admin_Plugin {
$this->_htmlInputField($cmd."_usergroups","usergroups",$this->lang["user_groups"],$groups,$this->_auth->canDo("modGroups"),$indent+6);
if ($this->_auth->canDo("modPass")) {
- if ($cmd == 'add') {
- $notes[] = $this->lang['note_pass'];
- }
- if ($user) {
- $notes[] = $this->lang['note_notify'];
- }
+ if ($cmd == 'add') {
+ $notes[] = $this->lang['note_pass'];
+ }
+ if ($user) {
+ $notes[] = $this->lang['note_notify'];
+ }
- ptln("<tr><td><label for=\"".$cmd."_usernotify\" >".$this->lang["user_notify"].": </label></td><td><input type=\"checkbox\" id=\"".$cmd."_usernotify\" name=\"usernotify\" value=\"1\" /></td></tr>", $indent);
+ ptln("<tr><td><label for=\"".$cmd."_usernotify\" >".$this->lang["user_notify"].": </label></td><td><input type=\"checkbox\" id=\"".$cmd."_usernotify\" name=\"usernotify\" value=\"1\" /></td></tr>", $indent);
}
ptln(" </tbody>",$indent);
@@ -317,17 +334,27 @@ class admin_plugin_usermanager extends DokuWiki_Admin_Plugin {
ptln(" </table>",$indent);
if ($notes) {
- ptln(" <ul class=\"notes\">");
- foreach ($notes as $note) {
- ptln(" <li><span class=\"li\">".$note."</span></li>",$indent);
- }
- ptln(" </ul>");
+ ptln(" <ul class=\"notes\">");
+ foreach ($notes as $note) {
+ ptln(" <li><span class=\"li\">".$note."</span></li>",$indent);
+ }
+ ptln(" </ul>");
}
ptln(" </div>",$indent);
ptln("</form>",$indent);
}
- function _htmlInputField($id, $name, $label, $value, $cando, $indent=0) {
+ /**
+ * Prints a inputfield
+ *
+ * @param string $id
+ * @param string $name
+ * @param string $label
+ * @param string $value
+ * @param bool $cando whether auth backend is capable to do this action
+ * @param int $indent
+ */
+ protected function _htmlInputField($id, $name, $label, $value, $cando, $indent=0) {
$class = $cando ? '' : ' class="disabled"';
echo str_pad('',$indent);
@@ -342,7 +369,6 @@ class admin_plugin_usermanager extends DokuWiki_Admin_Plugin {
$autocomp = '';
}
-
echo "<tr $class>";
echo "<td><label for=\"$id\" >$label: </label></td>";
echo "<td>";
@@ -356,21 +382,37 @@ class admin_plugin_usermanager extends DokuWiki_Admin_Plugin {
echo "</tr>";
}
- function _htmlFilter($key) {
+ /**
+ * Returns htmlescaped filter value
+ *
+ * @param string $key name of search field
+ * @return string html escaped value
+ */
+ protected function _htmlFilter($key) {
if (empty($this->_filter)) return '';
return (isset($this->_filter[$key]) ? hsc($this->_filter[$key]) : '');
}
- function _htmlFilterSettings($indent=0) {
+ /**
+ * Print hidden inputs with the current filter values
+ *
+ * @param int $indent
+ */
+ protected function _htmlFilterSettings($indent=0) {
ptln("<input type=\"hidden\" name=\"start\" value=\"".$this->_start."\" />",$indent);
foreach ($this->_filter as $key => $filter) {
- ptln("<input type=\"hidden\" name=\"filter[".$key."]\" value=\"".hsc($filter)."\" />",$indent);
+ ptln("<input type=\"hidden\" name=\"filter[".$key."]\" value=\"".hsc($filter)."\" />",$indent);
}
}
- function _htmlImportForm($indent=0) {
+ /**
+ * Print import form and summary of previous import
+ *
+ * @param int $indent
+ */
+ protected function _htmlImportForm($indent=0) {
global $ID;
$failure_download_link = wl($ID,array('do'=>'admin','page'=>'usermanager','fn[importfails]'=>1));
@@ -379,7 +421,7 @@ class admin_plugin_usermanager extends DokuWiki_Admin_Plugin {
print $this->locale_xhtml('import');
ptln(' <form action="'.wl($ID).'" method="post" enctype="multipart/form-data">',$indent);
formSecurityToken();
- ptln(' <label>User list file (csv): <input type="file" name="import" /></label>',$indent);
+ ptln(' <label>'.$this->lang['import_userlistcsv'].'<input type="file" name="import" /></label>',$indent);
ptln(' <input type="submit" name="fn[import]" value="'.$this->lang['import'].'" />',$indent);
ptln(' <input type="hidden" name="do" value="admin" />',$indent);
ptln(' <input type="hidden" name="page" value="usermanager" />',$indent);
@@ -392,7 +434,7 @@ class admin_plugin_usermanager extends DokuWiki_Admin_Plugin {
if ($this->_import_failures) {
$digits = strlen(count($this->_import_failures));
ptln('<div class="level3 import_failures">',$indent);
- ptln(' <h3>Most Recent Import - Failures</h3>');
+ ptln(' <h3>'.$this->lang['import_header'].'</h3>');
ptln(' <table class="import_failures">',$indent);
ptln(' <thead>',$indent);
ptln(' <tr>',$indent);
@@ -417,13 +459,18 @@ class admin_plugin_usermanager extends DokuWiki_Admin_Plugin {
}
ptln(' </tbody>',$indent);
ptln(' </table>',$indent);
- ptln(' <p><a href="'.$failure_download_link.'">Download Failures as CSV for correction</a></p>');
+ ptln(' <p><a href="'.$failure_download_link.'">'.$this->lang['import_downloadfailures'].'</a></p>');
ptln('</div>');
}
}
- function _addUser(){
+ /**
+ * Add an user to auth backend
+ *
+ * @return bool whether succesful
+ */
+ protected function _addUser(){
global $INPUT;
if (!checkSecurityToken()) return false;
if (!$this->_auth->canDo('addUser')) return false;
@@ -432,61 +479,63 @@ class admin_plugin_usermanager extends DokuWiki_Admin_Plugin {
if (empty($user)) return false;
if ($this->_auth->canDo('modPass')){
- if (empty($pass)){
- if($INPUT->has('usernotify')){
- $pass = auth_pwgen($user);
- } else {
- msg($this->lang['add_fail'], -1);
- return false;
+ if (empty($pass)){
+ if($INPUT->has('usernotify')){
+ $pass = auth_pwgen($user);
+ } else {
+ msg($this->lang['add_fail'], -1);
+ return false;
+ }
}
- }
} else {
- if (!empty($pass)){
- msg($this->lang['add_fail'], -1);
- return false;
- }
+ if (!empty($pass)){
+ msg($this->lang['add_fail'], -1);
+ return false;
+ }
}
if ($this->_auth->canDo('modName')){
- if (empty($name)){
- msg($this->lang['add_fail'], -1);
- return false;
- }
+ if (empty($name)){
+ msg($this->lang['add_fail'], -1);
+ return false;
+ }
} else {
- if (!empty($name)){
- return false;
- }
+ if (!empty($name)){
+ return false;
+ }
}
if ($this->_auth->canDo('modMail')){
- if (empty($mail)){
- msg($this->lang['add_fail'], -1);
- return false;
- }
+ if (empty($mail)){
+ msg($this->lang['add_fail'], -1);
+ return false;
+ }
} else {
- if (!empty($mail)){
- return false;
- }
+ if (!empty($mail)){
+ return false;
+ }
}
if ($ok = $this->_auth->triggerUserMod('create', array($user,$pass,$name,$mail,$grps))) {
- msg($this->lang['add_ok'], 1);
+ msg($this->lang['add_ok'], 1);
- if ($INPUT->has('usernotify') && $pass) {
- $this->_notifyUser($user,$pass);
- }
+ if ($INPUT->has('usernotify') && $pass) {
+ $this->_notifyUser($user,$pass);
+ }
} else {
- msg($this->lang['add_fail'], -1);
+ msg($this->lang['add_fail'], -1);
}
return $ok;
}
/**
- * Delete user
+ * Delete user from auth backend
+ *
+ * @return bool whether succesful
*/
- function _deleteUser(){
+ protected function _deleteUser(){
global $conf, $INPUT;
if (!checkSecurityToken()) return false;
@@ -503,12 +552,12 @@ class admin_plugin_usermanager extends DokuWiki_Admin_Plugin {
$count = $this->_auth->triggerUserMod('delete', array($selected));
if ($count == count($selected)) {
- $text = str_replace('%d', $count, $this->lang['delete_ok']);
- msg("$text.", 1);
+ $text = str_replace('%d', $count, $this->lang['delete_ok']);
+ msg("$text.", 1);
} else {
- $part1 = str_replace('%d', $count, $this->lang['delete_ok']);
- $part2 = str_replace('%d', (count($selected)-$count), $this->lang['delete_fail']);
- msg("$part1, $part2",-1);
+ $part1 = str_replace('%d', $count, $this->lang['delete_ok']);
+ $part2 = str_replace('%d', (count($selected)-$count), $this->lang['delete_fail']);
+ msg("$part1, $part2",-1);
}
// invalidate all sessions
@@ -519,18 +568,20 @@ class admin_plugin_usermanager extends DokuWiki_Admin_Plugin {
/**
* Edit user (a user has been selected for editing)
+ *
+ * @param string $param id of the user
+ * @return bool whether succesful
*/
- function _editUser($param) {
+ protected function _editUser($param) {
if (!checkSecurityToken()) return false;
if (!$this->_auth->canDo('UserMod')) return false;
-
- $user = cleanID(preg_replace('/.*:/','',$param));
+ $user = $this->_auth->cleanUser(preg_replace('/.*[:\/]/','',$param));
$userdata = $this->_auth->getUserData($user);
// no user found?
if (!$userdata) {
- msg($this->lang['edit_usermissing'],-1);
- return false;
+ msg($this->lang['edit_usermissing'],-1);
+ return false;
}
$this->_edit_user = $user;
@@ -540,16 +591,18 @@ class admin_plugin_usermanager extends DokuWiki_Admin_Plugin {
}
/**
- * Modify user (modified user data has been recieved)
+ * Modify user in the auth backend (modified user data has been recieved)
+ *
+ * @return bool whether succesful
*/
- function _modifyUser(){
+ protected function _modifyUser(){
global $conf, $INPUT;
if (!checkSecurityToken()) return false;
if (!$this->_auth->canDo('UserMod')) return false;
// get currently valid user data
- $olduser = cleanID(preg_replace('/.*:/','',$INPUT->str('userid_old')));
+ $olduser = $this->_auth->cleanUser(preg_replace('/.*[:\/]/','',$INPUT->str('userid_old')));
$oldinfo = $this->_auth->getUserData($olduser);
// get new user data subject to change
@@ -559,18 +612,18 @@ class admin_plugin_usermanager extends DokuWiki_Admin_Plugin {
$changes = array();
if ($newuser != $olduser) {
- if (!$this->_auth->canDo('modLogin')) { // sanity check, shouldn't be possible
- msg($this->lang['update_fail'],-1);
- return false;
- }
+ if (!$this->_auth->canDo('modLogin')) { // sanity check, shouldn't be possible
+ msg($this->lang['update_fail'],-1);
+ return false;
+ }
- // check if $newuser already exists
- if ($this->_auth->getUserData($newuser)) {
- msg(sprintf($this->lang['update_exists'],$newuser),-1);
- $re_edit = true;
- } else {
- $changes['user'] = $newuser;
- }
+ // check if $newuser already exists
+ if ($this->_auth->getUserData($newuser)) {
+ msg(sprintf($this->lang['update_exists'],$newuser),-1);
+ $re_edit = true;
+ } else {
+ $changes['user'] = $newuser;
+ }
}
// generate password if left empty and notification is on
@@ -588,18 +641,18 @@ class admin_plugin_usermanager extends DokuWiki_Admin_Plugin {
$changes['grps'] = $newgrps;
if ($ok = $this->_auth->triggerUserMod('modify', array($olduser, $changes))) {
- msg($this->lang['update_ok'],1);
+ msg($this->lang['update_ok'],1);
- if ($INPUT->has('usernotify') && $newpass) {
- $notify = empty($changes['user']) ? $olduser : $newuser;
- $this->_notifyUser($notify,$newpass);
- }
+ if ($INPUT->has('usernotify') && $newpass) {
+ $notify = empty($changes['user']) ? $olduser : $newuser;
+ $this->_notifyUser($notify,$newpass);
+ }
- // invalidate all sessions
- io_saveFile($conf['cachedir'].'/sessionpurge',time());
+ // invalidate all sessions
+ io_saveFile($conf['cachedir'].'/sessionpurge',time());
} else {
- msg($this->lang['update_fail'],-1);
+ msg($this->lang['update_fail'],-1);
}
if (!empty($re_edit)) {
@@ -610,29 +663,36 @@ class admin_plugin_usermanager extends DokuWiki_Admin_Plugin {
}
/**
- * send password change notification email
+ * Send password change notification email
+ *
+ * @param string $user id of user
+ * @param string $password plain text
+ * @param bool $status_alert whether status alert should be shown
+ * @return bool whether succesful
*/
- function _notifyUser($user, $password, $status_alert=true) {
+ protected function _notifyUser($user, $password, $status_alert=true) {
if ($sent = auth_sendPassword($user,$password)) {
- if ($status_alert) {
- msg($this->lang['notify_ok'], 1);
- }
+ if ($status_alert) {
+ msg($this->lang['notify_ok'], 1);
+ }
} else {
- if ($status_alert) {
- msg($this->lang['notify_fail'], -1);
- }
+ if ($status_alert) {
+ msg($this->lang['notify_fail'], -1);
+ }
}
return $sent;
}
/**
- * retrieve & clean user data from the form
+ * Retrieve & clean user data from the form
*
+ * @param bool $clean whether the cleanUser method of the authentication backend is applied
* @return array (user, password, full name, email, array(groups))
*/
- function _retrieveUser($clean=true) {
+ protected function _retrieveUser($clean=true) {
+ /** @var DokuWiki_Auth_Plugin $auth */
global $auth;
global $INPUT;
@@ -651,21 +711,31 @@ class admin_plugin_usermanager extends DokuWiki_Admin_Plugin {
return $user;
}
- function _setFilter($op) {
+ /**
+ * Set the filter with the current search terms or clear the filter
+ *
+ * @param string $op 'new' or 'clear'
+ */
+ protected function _setFilter($op) {
$this->_filter = array();
if ($op == 'new') {
- list($user,$pass,$name,$mail,$grps) = $this->_retrieveUser(false);
+ list($user,$pass,$name,$mail,$grps) = $this->_retrieveUser(false);
- if (!empty($user)) $this->_filter['user'] = $user;
- if (!empty($name)) $this->_filter['name'] = $name;
- if (!empty($mail)) $this->_filter['mail'] = $mail;
- if (!empty($grps)) $this->_filter['grps'] = join('|',$grps);
+ if (!empty($user)) $this->_filter['user'] = $user;
+ if (!empty($name)) $this->_filter['name'] = $name;
+ if (!empty($mail)) $this->_filter['mail'] = $mail;
+ if (!empty($grps)) $this->_filter['grps'] = join('|',$grps);
}
}
- function _retrieveFilter() {
+ /**
+ * Get the current search terms
+ *
+ * @return array
+ */
+ protected function _retrieveFilter() {
global $INPUT;
$t_filter = $INPUT->arr('filter');
@@ -681,39 +751,44 @@ class admin_plugin_usermanager extends DokuWiki_Admin_Plugin {
return $filter;
}
- function _validatePagination() {
+ /**
+ * Validate and improve the pagination values
+ */
+ protected function _validatePagination() {
if ($this->_start >= $this->_user_total) {
- $this->_start = $this->_user_total - $this->_pagesize;
+ $this->_start = $this->_user_total - $this->_pagesize;
}
if ($this->_start < 0) $this->_start = 0;
$this->_last = min($this->_user_total, $this->_start + $this->_pagesize);
}
- /*
- * return an array of strings to enable/disable pagination buttons
+ /**
+ * Return an array of strings to enable/disable pagination buttons
+ *
+ * @return array with enable/disable attributes
*/
- function _pagination() {
+ protected function _pagination() {
$disabled = 'disabled="disabled"';
$buttons['start'] = $buttons['prev'] = ($this->_start == 0) ? $disabled : '';
if ($this->_user_total == -1) {
- $buttons['last'] = $disabled;
- $buttons['next'] = '';
+ $buttons['last'] = $disabled;
+ $buttons['next'] = '';
} else {
- $buttons['last'] = $buttons['next'] = (($this->_start + $this->_pagesize) >= $this->_user_total) ? $disabled : '';
+ $buttons['last'] = $buttons['next'] = (($this->_start + $this->_pagesize) >= $this->_user_total) ? $disabled : '';
}
return $buttons;
}
- /*
- * export a list of users in csv format using the current filter criteria
+ /**
+ * Export a list of users in csv format using the current filter criteria
*/
- function _export() {
+ protected function _export() {
// list of users for export - based on current filter criteria
$user_list = $this->_auth->retrieveUsers(0, 0, $this->_filter);
$column_headings = array(
@@ -739,21 +814,25 @@ class admin_plugin_usermanager extends DokuWiki_Admin_Plugin {
fputcsv($fd, $line);
}
fclose($fd);
+ if (defined('DOKU_UNITTEST')){ return; }
+
die;
}
- /*
- * import a file of users in csv format
+ /**
+ * Import a file of users in csv format
*
* csv file should have 4 columns, user_id, full name, email, groups (comma separated)
+ *
+ * @return bool whether successful
*/
- function _import() {
+ protected function _import() {
// check we are allowed to add users
if (!checkSecurityToken()) return false;
if (!$this->_auth->canDo('addUser')) return false;
// check file uploaded ok.
- if (empty($_FILES['import']['size']) || !empty($FILES['import']['error']) && is_uploaded_file($FILES['import']['tmp_name'])) {
+ if (empty($_FILES['import']['size']) || !empty($_FILES['import']['error']) && $this->_isUploadedFile($_FILES['import']['tmp_name'])) {
msg($this->lang['import_error_upload'],-1);
return false;
}
@@ -768,7 +847,7 @@ class admin_plugin_usermanager extends DokuWiki_Admin_Plugin {
if (!utf8_check($csv)) {
$csv = utf8_encode($csv);
}
- $raw = str_getcsv($csv);
+ $raw = $this->_getcsv($csv);
$error = ''; // clean out any errors from the previous line
// data checks...
if (1 == ++$line) {
@@ -790,6 +869,7 @@ class admin_plugin_usermanager extends DokuWiki_Admin_Plugin {
$import_success_count++;
} else {
$import_fail_count++;
+ array_splice($raw, 1, 1); // remove the spliced in password
$this->_import_failures[$line] = array('error' => $error, 'user' => $raw, 'orig' => $csv);
}
}
@@ -803,13 +883,21 @@ class admin_plugin_usermanager extends DokuWiki_Admin_Plugin {
// save import failures into the session
if (!headers_sent()) {
- session_start();
- $_SESSION['import_failures'] = $this->_import_failures;
- session_write_close();
+ session_start();
+ $_SESSION['import_failures'] = $this->_import_failures;
+ session_write_close();
}
+ return true;
}
- function _cleanImportUser($candidate, & $error){
+ /**
+ * Returns cleaned user data
+ *
+ * @param array $candidate raw values of line from input file
+ * @param $error
+ * @return array|bool cleaned data or false
+ */
+ protected function _cleanImportUser($candidate, & $error){
global $INPUT;
// kludgy ....
@@ -848,7 +936,16 @@ class admin_plugin_usermanager extends DokuWiki_Admin_Plugin {
return $cleaned;
}
- function _addImportUser($user, & $error){
+ /**
+ * Adds imported user to auth backend
+ *
+ * Required a check of canDo('addUser') before
+ *
+ * @param array $user data of user
+ * @param string &$error reference catched error message
+ * @return bool whether successful
+ */
+ protected function _addImportUser($user, & $error){
if (!$this->_auth->triggerUserMod('create', $user)) {
$error = $this->lang['import_error_create'];
return false;
@@ -857,7 +954,10 @@ class admin_plugin_usermanager extends DokuWiki_Admin_Plugin {
return true;
}
- function _downloadImportFailures(){
+ /**
+ * Downloads failures as csv file
+ */
+ protected function _downloadImportFailures(){
// ==============================================================================================
// GENERATE OUTPUT
@@ -869,11 +969,44 @@ class admin_plugin_usermanager extends DokuWiki_Admin_Plugin {
// output the csv
$fd = fopen('php://output','w');
- foreach ($this->_import_failures as $line => $fail) {
+ foreach ($this->_import_failures as $fail) {
fputs($fd, $fail['orig']);
}
fclose($fd);
die;
}
+ /**
+ * wrapper for is_uploaded_file to facilitate overriding by test suite
+ */
+ protected function _isUploadedFile($file) {
+ return is_uploaded_file($file);
+ }
+
+ /**
+ * wrapper for str_getcsv() to simplify maintaining compatibility with php 5.2
+ *
+ * @deprecated remove when dokuwiki php requirement increases to 5.3+
+ * also associated unit test & mock access method
+ */
+ protected function _getcsv($csv) {
+ return function_exists('str_getcsv') ? str_getcsv($csv) : $this->str_getcsv($csv);
+ }
+
+ /**
+ * replacement str_getcsv() function for php < 5.3
+ * loosely based on www.php.net/str_getcsv#88311
+ *
+ * @deprecated remove when dokuwiki php requirement increases to 5.3+
+ */
+ protected function str_getcsv($str) {
+ $fp = fopen("php://temp/maxmemory:1048576", 'r+'); // 1MiB
+ fputs($fp, $str);
+ rewind($fp);
+
+ $data = fgetcsv($fp);
+
+ fclose($fp);
+ return $data;
+ }
}
diff --git a/lib/plugins/usermanager/lang/ar/lang.php b/lib/plugins/usermanager/lang/ar/lang.php
index d4b891320..0a751e7fb 100644
--- a/lib/plugins/usermanager/lang/ar/lang.php
+++ b/lib/plugins/usermanager/lang/ar/lang.php
@@ -1,7 +1,8 @@
<?php
+
/**
- * Arabic language file
- *
+ * @license GPL 2 (http://www.gnu.org/licenses/gpl.html)
+ *
* @author Yaman Hokan <always.smile.yh@hotmail.com>
* @author Usama Akkad <uahello@gmail.com>
* @author uahello@gmail.com
diff --git a/lib/plugins/usermanager/lang/bg/lang.php b/lib/plugins/usermanager/lang/bg/lang.php
index 9ed27f42a..9700385f8 100644
--- a/lib/plugins/usermanager/lang/bg/lang.php
+++ b/lib/plugins/usermanager/lang/bg/lang.php
@@ -1,7 +1,8 @@
<?php
+
/**
- * bulgarian language file
- *
+ * @license GPL 2 (http://www.gnu.org/licenses/gpl.html)
+ *
* @author Nikolay Vladimirov <nikolay@vladimiroff.com>
* @author Viktor Usunov <usun0v@mail.bg>
* @author Kiril <neohidra@gmail.com>
diff --git a/lib/plugins/usermanager/lang/cs/import.txt b/lib/plugins/usermanager/lang/cs/import.txt
new file mode 100644
index 000000000..c264ae185
--- /dev/null
+++ b/lib/plugins/usermanager/lang/cs/import.txt
@@ -0,0 +1,9 @@
+===== Hromadný import uživatelů =====
+
+Vyžaduje CSV soubor s uživateli obsahující alespoň 4 sloupce.
+Sloupce obsahují (v daném pořadí): user-id, celé jméno, emailovou adresu, seznam skupin.
+Položky CSV musí být odděleny čárkou (,) a řetězce umístěny v uvozovkách (""). Zpětné lomítko (\) lze použít pro escapování.
+Pro získání příkladu takového souboru využijte funkci "Exportovat uživatele" výše.
+Záznamy s duplicitním user-id budou ignorovány.
+
+Hesla budou vygenerována a zaslána e-mailem všem úspěšně importovaným uživatelům. \ No newline at end of file
diff --git a/lib/plugins/usermanager/lang/cs/lang.php b/lib/plugins/usermanager/lang/cs/lang.php
index 9fc3a5e75..bbb560679 100644
--- a/lib/plugins/usermanager/lang/cs/lang.php
+++ b/lib/plugins/usermanager/lang/cs/lang.php
@@ -1,7 +1,8 @@
<?php
+
/**
- * Czech language file
- *
+ * @license GPL 2 (http://www.gnu.org/licenses/gpl.html)
+ *
* @author Tomas Valenta <t.valenta@sh.cvut.cz>
* @author Zbynek Krivka <zbynek.krivka@seznam.cz>
* @author Bohumir Zamecnik <bohumir@zamecnik.org>
@@ -13,6 +14,7 @@
* @author Bohumir Zamecnik <bohumir.zamecnik@gmail.com>
* @author Jakub A. Těšínský (j@kub.cz)
* @author mkucera66@seznam.cz
+ * @author Zbyněk Křivka <krivka@fit.vutbr.cz>
*/
$lang['menu'] = 'Správa uživatelů';
$lang['noauth'] = '(autentizace uživatelů není k dispozici)';
@@ -35,6 +37,11 @@ $lang['search'] = 'Hledání';
$lang['search_prompt'] = 'Prohledat';
$lang['clear'] = 'Zrušit vyhledávací filtr';
$lang['filter'] = 'Filtr';
+$lang['export_all'] = 'Exportovat všechny uživatele (CSV)';
+$lang['export_filtered'] = 'Exportovat filtrovaný seznam uživatelů (CSV)';
+$lang['import'] = 'Importovat nové uživatele';
+$lang['line'] = 'Řádek č.';
+$lang['error'] = 'Chybová zpráva';
$lang['summary'] = 'Zobrazuji uživatele %1$d-%2$d z %3$d nalezených. Celkem %4$d uživatelů.';
$lang['nonefound'] = 'Žadný uživatel nenalezen. Celkem %d uživatelů.';
$lang['delete_ok'] = '%d uživatelů smazáno';
@@ -50,8 +57,18 @@ $lang['edit_usermissing'] = 'Vybraný uživatel nebyl nalezen, zadané uži
$lang['user_notify'] = 'Upozornit uživatele';
$lang['note_notify'] = 'Maily s upozorněním se budou posílat pouze, když uživatel dostává nové heslo.';
$lang['note_group'] = 'Noví uživatelé budou přidáváni do této výchozí skupiny (%s), pokud pro ně není uvedena žádná skupina.';
-$lang['note_pass'] = 'Heslo bude automaticky vygenerováno pokud je pole ponecháno prázdné a je zapnutá notifikace uživatele.';
+$lang['note_pass'] = 'Heslo bude automaticky vygenerováno, pokud je pole ponecháno prázdné a je zapnuto upozornění uživatele.';
$lang['add_ok'] = 'Uživatel úspěšně vytvořen';
$lang['add_fail'] = 'Vytvoření uživatele selhalo';
$lang['notify_ok'] = 'Odeslán mail s upozorněním';
$lang['notify_fail'] = 'Mail s upozorněním nebylo možno odeslat';
+$lang['import_success_count'] = 'Import uživatelů: nalezeno %d uživatelů, %d úspěšně importováno.';
+$lang['import_failure_count'] = 'Import uživatelů: %d selhalo. Seznam chybných je níže.';
+$lang['import_error_fields'] = 'Nedostatek položek, nalezena/y %d, požadovány 4.';
+$lang['import_error_baduserid'] = 'Chybí User-id';
+$lang['import_error_badname'] = 'Špatné jméno';
+$lang['import_error_badmail'] = 'Špatná emailová adresa';
+$lang['import_error_upload'] = 'Import selhal. CSV soubor nemohl být nahrán nebo je prázdný.';
+$lang['import_error_readfail'] = 'Import selhal. Nelze číst nahraný soubor.';
+$lang['import_error_create'] = 'Nelze vytvořit uživatele';
+$lang['import_notify_fail'] = 'Importovanému uživateli %s s emailem %s nemohlo být zasláno upozornění.';
diff --git a/lib/plugins/usermanager/lang/da/lang.php b/lib/plugins/usermanager/lang/da/lang.php
index 845457f7e..47d7efea2 100644
--- a/lib/plugins/usermanager/lang/da/lang.php
+++ b/lib/plugins/usermanager/lang/da/lang.php
@@ -1,7 +1,8 @@
<?php
+
/**
- * Danish language file
- *
+ * @license GPL 2 (http://www.gnu.org/licenses/gpl.html)
+ *
* @author Lars Næsbye Christensen <larsnaesbye@stud.ku.dk>
* @author Kalle Sommer Nielsen <kalle@php.net>
* @author Esben Laursen <hyber@hyber.dk>
@@ -11,6 +12,7 @@
* @author rasmus@kinnerup.com
* @author Michael Pedersen subben@gmail.com
* @author Mikael Lyngvig <mikael@lyngvig.org>
+ * @author soer9648 <soer9648@eucl.dk>
*/
$lang['menu'] = 'Brugerstyring';
$lang['noauth'] = '(Brugervalidering er ikke tilgængelig)';
@@ -33,6 +35,11 @@ $lang['search'] = 'Søg';
$lang['search_prompt'] = 'Udfør søgning';
$lang['clear'] = 'Nulstil søgefilter';
$lang['filter'] = 'Filter';
+$lang['export_all'] = 'Eksportér Alle Brugere (CSV)';
+$lang['export_filtered'] = 'Eksportér Filtrerede Brugerliste (CSV)';
+$lang['import'] = 'Importér Nye Brugere';
+$lang['line'] = 'Linje nr.';
+$lang['error'] = 'Fejlmeddelelse';
$lang['summary'] = 'Viser brugerne %1$d-%2$d ud af %3$d fundne. %4$d brugere totalt.';
$lang['nonefound'] = 'Ingen brugere fundet. %d brugere totalt.';
$lang['delete_ok'] = '%d brugere slettet';
@@ -53,3 +60,15 @@ $lang['add_ok'] = 'Bruger tilføjet uden fejl.';
$lang['add_fail'] = 'Tilføjelse af bruger mislykkedes';
$lang['notify_ok'] = 'Meddelelse sendt';
$lang['notify_fail'] = 'Meddelelse kunne ikke sendes';
+$lang['import_userlistcsv'] = 'Brugerlistefil (CSV):';
+$lang['import_header'] = 'Nyeste Import - Fejl';
+$lang['import_success_count'] = 'Bruger-Import: %d brugere fundet, %d importeret med succes.';
+$lang['import_failure_count'] = 'Bruger-Import: %d fejlet. Fejl er listet nedenfor.';
+$lang['import_error_fields'] = 'Utilstrækkelige felter, fandt %d, påkrævet 4.';
+$lang['import_error_baduserid'] = 'Bruger-id mangler';
+$lang['import_error_badname'] = 'Ugyldigt navn';
+$lang['import_error_badmail'] = 'Ugyldig email-adresse';
+$lang['import_error_upload'] = 'Import Fejlet. CSV-filen kunne ikke uploades eller er tom.';
+$lang['import_error_readfail'] = 'Import Fejlet. Ikke muligt at læse uploadede fil.';
+$lang['import_error_create'] = 'Ikke muligt at oprette brugeren';
+$lang['import_notify_fail'] = 'Notifikationsmeddelelse kunne ikke sendes for importerede bruger %s, med emailen %s.';
diff --git a/lib/plugins/usermanager/lang/de-informal/import.txt b/lib/plugins/usermanager/lang/de-informal/import.txt
new file mode 100644
index 000000000..6fd6b8d8c
--- /dev/null
+++ b/lib/plugins/usermanager/lang/de-informal/import.txt
@@ -0,0 +1,7 @@
+===== Massenimport von Benutzern =====
+
+Dieser Import benötigt eine CSV-Datei mit mindestens vier Spalten. Diese Spalten müssen die folgenden Daten (in dieser Reihenfolge) enthalten: Benutzername, Name, E-Mailadresse und Gruppenzugehörigkeit.
+Die CSV-Felder müssen durch ein Komma (,) getrennt sein. Die Zeichenfolgen müssen von Anführungszeichen ("") umgeben sein. Ein Backslash (\) kann zum Maskieren benutzt werden.
+Für eine Beispieldatei kannst Du die "Benutzer exportieren"-Funktion oben benutzen. Doppelte Benutzername werden ignoriert.
+
+Ein Passwort wird generiert und den einzelnen, erfolgreich importierten Benutzern zugemailt. \ No newline at end of file
diff --git a/lib/plugins/usermanager/lang/de-informal/lang.php b/lib/plugins/usermanager/lang/de-informal/lang.php
index 791cfa74f..bea4159d0 100644
--- a/lib/plugins/usermanager/lang/de-informal/lang.php
+++ b/lib/plugins/usermanager/lang/de-informal/lang.php
@@ -1,7 +1,8 @@
<?php
+
/**
- * German (informal) language file
- *
+ * @license GPL 2 (http://www.gnu.org/licenses/gpl.html)
+ *
* @author Alexander Fischer <tbanus@os-forge.net>
* @author Juergen Schwarzer <jschwarzer@freenet.de>
* @author Marcel Metz <marcel_metz@gmx.de>
@@ -10,6 +11,7 @@
* @author Pierre Corell <info@joomla-praxis.de>
* @author Frank Loizzi <contact@software.bacal.de>
* @author Volker Bödker <volker@boedker.de>
+ * @author Dennis Plöger <develop@dieploegers.de>
*/
$lang['menu'] = 'Benutzerverwaltung';
$lang['noauth'] = '(Benutzeranmeldung ist nicht verfügbar)';
@@ -32,6 +34,11 @@ $lang['search'] = 'Suchen';
$lang['search_prompt'] = 'Suche ausführen';
$lang['clear'] = 'Suchfilter zurücksetzen';
$lang['filter'] = 'Filter';
+$lang['export_all'] = 'Alle Benutzer exportieren (CSV)';
+$lang['export_filtered'] = 'Gefilterte Benutzerliste exportieren (CSV)';
+$lang['import'] = 'Neue Benutzer importieren';
+$lang['line'] = 'Zeile Nr.';
+$lang['error'] = 'Fehlermeldung';
$lang['summary'] = 'Zeige Benutzer %1$d-%2$d von %3$d gefundenen. %4$d Benutzer insgesamt.';
$lang['nonefound'] = 'Keinen Benutzer gefunden. Insgesamt %d Benutzer.';
$lang['delete_ok'] = '%d Benutzer wurden gelöscht';
@@ -52,3 +59,13 @@ $lang['add_ok'] = 'Benutzer erfolgreich hinzugefügt';
$lang['add_fail'] = 'Hinzufügen des Benutzers fehlgeschlagen';
$lang['notify_ok'] = 'Benachrichtigungsmail wurde versendet';
$lang['notify_fail'] = 'Benachrichtigungsemail konnte nicht gesendet werden';
+$lang['import_success_count'] = 'Benutzerimport: %d Benutzer gefunden, %d erfolgreich importiert.';
+$lang['import_failure_count'] = 'Benutzerimport: %d Benutzerimporte fehlgeschalten. Alle Fehler werden unten angezeigt.';
+$lang['import_error_fields'] = 'Falsche Anzahl Felder. Gefunden: %d. Benötigt: 4.';
+$lang['import_error_baduserid'] = 'Benutzername fehlt';
+$lang['import_error_badname'] = 'Ungültiger Name';
+$lang['import_error_badmail'] = 'Ungültige E-Mailadresse';
+$lang['import_error_upload'] = 'Import fehlgeschlagen. Die CSV-Datei konnte nicht hochgeladen werden oder ist leer.';
+$lang['import_error_readfail'] = 'Import fehlgeschlagen. Konnte die hochgeladene Datei nicht lesen.';
+$lang['import_error_create'] = 'Konnte den Benutzer nicht erzeugen';
+$lang['import_notify_fail'] = 'Benachrichtigung konnte an Benutzer %s (%s) nicht geschickt werden.';
diff --git a/lib/plugins/usermanager/lang/de/import.txt b/lib/plugins/usermanager/lang/de/import.txt
new file mode 100644
index 000000000..bf0d2922e
--- /dev/null
+++ b/lib/plugins/usermanager/lang/de/import.txt
@@ -0,0 +1,8 @@
+===== Benutzer-Massenimport =====
+
+Um mehrere Benutzer gleichzeitig zu importieren, wird eine CSV-Datei mit den folgenden vier Spalten benötigt (In dieser Reihenfolge): Benutzer-ID, Voller Name, E-Mail-Adresse und Gruppen.
+Die CSV-Felder sind Kommata-separiert (,) und mit Anführungszeichen eingefasst ("). Mit Backslashes (\) können Sonderzeichen maskiert werden.
+Ein Beispiel für eine gültige Datei kann mit der Benutzer-Export-Funktion oben generiert werden.
+Doppelte Benutzer-IDs werden ignoriert.
+
+Für jeden importierten Benutzer wird ein Passwort generiert und dem Benutzer per Mail zugestellt. \ No newline at end of file
diff --git a/lib/plugins/usermanager/lang/de/lang.php b/lib/plugins/usermanager/lang/de/lang.php
index 68cdf359f..4b297b0dc 100644
--- a/lib/plugins/usermanager/lang/de/lang.php
+++ b/lib/plugins/usermanager/lang/de/lang.php
@@ -19,6 +19,9 @@
* @author Pierre Corell <info@joomla-praxis.de>
* @author Matthias Schulte <dokuwiki@lupo49.de>
* @author Sven <Svenluecke48@gmx.d>
+ * @author christian studer <cstuder@existenz.ch>
+ * @author Ben Fey <benedikt.fey@beck-heun.de>
+ * @author Jonas Gröger <jonas.groeger@gmail.com>
*/
$lang['menu'] = 'Benutzerverwaltung';
$lang['noauth'] = '(Authentifizierungssystem nicht verfügbar)';
@@ -66,6 +69,8 @@ $lang['add_ok'] = 'Nutzer erfolgreich angelegt';
$lang['add_fail'] = 'Nutzer konnte nicht angelegt werden';
$lang['notify_ok'] = 'Benachrichtigungsmail wurde versandt';
$lang['notify_fail'] = 'Benachrichtigungsmail konnte nicht versandt werden';
+$lang['import_userlistcsv'] = 'Benutzerliste (CSV-Datei):';
+$lang['import_header'] = 'Letzte Fehler bei Import';
$lang['import_success_count'] = 'User-Import: %d User gefunden, %d erfolgreich importiert.';
$lang['import_failure_count'] = 'User-Import: %d fehlgeschlagen. Fehlgeschlagene User sind nachfolgend aufgelistet.';
$lang['import_error_fields'] = 'Unzureichende Anzahl an Feldern: %d gefunden, benötigt sind 4.';
@@ -75,3 +80,5 @@ $lang['import_error_badmail'] = 'Ungültige E-Mail';
$lang['import_error_upload'] = 'Import fehlgeschlagen. Die CSV-Datei konnte nicht hochgeladen werden, oder ist leer.';
$lang['import_error_readfail'] = 'Import fehlgeschlagen. Die hochgeladene Datei konnte nicht gelesen werden.';
$lang['import_error_create'] = 'User konnte nicht angelegt werden';
+$lang['import_notify_fail'] = 'Notifikation konnte nicht an den importierten Benutzer %s (E-Mail: %s) gesendet werden.';
+$lang['import_downloadfailures'] = 'Fehler als CSV-Datei zur Korrektur herunterladen';
diff --git a/lib/plugins/usermanager/lang/en/lang.php b/lib/plugins/usermanager/lang/en/lang.php
index 69119e196..f87c77afb 100644
--- a/lib/plugins/usermanager/lang/en/lang.php
+++ b/lib/plugins/usermanager/lang/en/lang.php
@@ -61,7 +61,9 @@ $lang['add_fail'] = 'User addition failed';
$lang['notify_ok'] = 'Notification email sent';
$lang['notify_fail'] = 'Notification email could not be sent';
-// import errors
+// import & errors
+$lang['import_userlistcsv'] = 'User list file (CSV): ';
+$lang['import_header'] = 'Most Recent Import - Failures';
$lang['import_success_count'] = 'User Import: %d users found, %d imported successfully.';
$lang['import_failure_count'] = 'User Import: %d failed. Failures are listed below.';
$lang['import_error_fields'] = "Insufficient fields, found %d, require 4.";
@@ -72,5 +74,6 @@ $lang['import_error_upload'] = 'Import Failed. The csv file could not be upload
$lang['import_error_readfail'] = 'Import Failed. Unable to read uploaded file.';
$lang['import_error_create'] = 'Unable to create the user';
$lang['import_notify_fail'] = 'Notification message could not be sent for imported user, %s with email %s.';
+$lang['import_downloadfailures'] = 'Download Failures as CSV for correction';
diff --git a/lib/plugins/usermanager/lang/eo/import.txt b/lib/plugins/usermanager/lang/eo/import.txt
new file mode 100644
index 000000000..61c2c74de
--- /dev/null
+++ b/lib/plugins/usermanager/lang/eo/import.txt
@@ -0,0 +1,9 @@
+===== Amasa importo de uzantoj =====
+
+Tio ĉi postulas CSV-dosiero de uzantoj kun minimume kvar kolumnoj.
+La kolumnoj devas enhavi, laŭorde: uzant-id, kompleta nomo, retadreso kaj grupoj.
+La CSV-kampoj devos esti apartitaj per komoj (,) kaj ĉenoj devas esti limigitaj per citiloj (""). Retroklino (\) povas esti uzata por eskapo.
+Por ekzemplo de taŭga dosiero, provu la funkcion "Eksporti uzantojn" supre.
+Duobligitaj uzant-id estos preteratentataj.
+
+Pasvorto estos generata kaj retsendata al ĉiu sukecse importita uzanto. \ No newline at end of file
diff --git a/lib/plugins/usermanager/lang/eo/lang.php b/lib/plugins/usermanager/lang/eo/lang.php
index 75782fe23..ff7818e05 100644
--- a/lib/plugins/usermanager/lang/eo/lang.php
+++ b/lib/plugins/usermanager/lang/eo/lang.php
@@ -1,7 +1,8 @@
<?php
+
/**
- * Esperantolanguage file
- *
+ * @license GPL 2 (http://www.gnu.org/licenses/gpl.html)
+ *
* @author Felipe Castro <fefcas@uol.com.br>
* @author Felipe Castro <fefcas@gmail.com>
* @author Felipe Castro <fefcas (cxe) gmail (punkto) com>
@@ -10,6 +11,7 @@
* @author Erik Pedersen <erik pedersen@shaw.ca>
* @author Erik Pedersen <erik.pedersen@shaw.ca>
* @author Robert Bogenschneider <bogi@uea.org>
+ * @author Felipe Castro <fefcas@yahoo.com.br>
*/
$lang['menu'] = 'Administrado de uzantoj';
$lang['noauth'] = '(identiĝo de uzantoj ne disponeblas)';
@@ -32,6 +34,11 @@ $lang['search'] = 'Serĉi';
$lang['search_prompt'] = 'Fari serĉon';
$lang['clear'] = 'Refari serĉan filtron';
$lang['filter'] = 'Filtro';
+$lang['export_all'] = 'Eksporti ĉiujn uzantojn (CSV)';
+$lang['export_filtered'] = 'Eksporti filtritan uzant-liston (CSV)';
+$lang['import'] = 'Importi novajn uzantojn';
+$lang['line'] = 'Lini-num.';
+$lang['error'] = 'Erar-mesaĝo';
$lang['summary'] = 'Montriĝas uzantoj %1$d-%2$d el %3$d trovitaj. %4$d uzantoj entute.';
$lang['nonefound'] = 'Neniuj uzantoj troviĝas. %d uzantoj entute.';
$lang['delete_ok'] = '%d uzantoj forigiĝis';
@@ -52,3 +59,16 @@ $lang['add_ok'] = 'La uzanto sukcese aldoniĝis';
$lang['add_fail'] = 'Ne eblis aldoni uzanton';
$lang['notify_ok'] = 'Avizanta mesaĝo sendiĝis';
$lang['notify_fail'] = 'La avizanta mesaĝo ne povis esti sendita';
+$lang['import_userlistcsv'] = 'Dosiero kun listo de uzantoj (CSV):';
+$lang['import_header'] = 'Plej lastaj Import-eraroj';
+$lang['import_success_count'] = 'Uzant-importo: %d uzantoj trovataj, %d sukcese importitaj.';
+$lang['import_failure_count'] = 'Uzant-importo: %d fiaskis. Fiaskoj estas sube listitaj.';
+$lang['import_error_fields'] = 'Nesufiĉe da kampoj, ni trovis %d, necesas 4.';
+$lang['import_error_baduserid'] = 'Mankas uzant-id';
+$lang['import_error_badname'] = 'Malĝusta nomo';
+$lang['import_error_badmail'] = 'Malĝusta retadreso';
+$lang['import_error_upload'] = 'Importo fiaskis. La csv-dosiero ne povis esti alŝutata aŭ ĝi estas malplena.';
+$lang['import_error_readfail'] = 'Importo fiaskis. Ne eblas legi alŝutitan dosieron.';
+$lang['import_error_create'] = 'Ne eblas krei la uzanton';
+$lang['import_notify_fail'] = 'Averta mesaĝo ne povis esti sendata al la importita uzanto %s, kun retdreso %s.';
+$lang['import_downloadfailures'] = 'Elŝut-eraroj por korektado (CSV)';
diff --git a/lib/plugins/usermanager/lang/fa/lang.php b/lib/plugins/usermanager/lang/fa/lang.php
index 8176b776b..a6a484411 100644
--- a/lib/plugins/usermanager/lang/fa/lang.php
+++ b/lib/plugins/usermanager/lang/fa/lang.php
@@ -1,7 +1,8 @@
<?php
+
/**
- * Persian language file
- *
+ * @license GPL 2 (http://www.gnu.org/licenses/gpl.html)
+ *
* @author behrad eslamifar <behrad_es@yahoo.com)
* @author Mohsen Firoozmandan <info@mambolearn.com>
* @author omidmr@gmail.com
diff --git a/lib/plugins/usermanager/lang/fi/lang.php b/lib/plugins/usermanager/lang/fi/lang.php
index 1db4bd7fb..de243133a 100644
--- a/lib/plugins/usermanager/lang/fi/lang.php
+++ b/lib/plugins/usermanager/lang/fi/lang.php
@@ -1,7 +1,8 @@
<?php
+
/**
- * Finnish language file
- *
+ * @license GPL 2 (http://www.gnu.org/licenses/gpl.html)
+ *
* @author otto@valjakko.net
* @author Otto Vainio <otto@valjakko.net>
* @author Teemu Mattila <ghcsystems@gmail.com>
diff --git a/lib/plugins/usermanager/lang/fr/import.txt b/lib/plugins/usermanager/lang/fr/import.txt
new file mode 100644
index 000000000..191bb8370
--- /dev/null
+++ b/lib/plugins/usermanager/lang/fr/import.txt
@@ -0,0 +1,11 @@
+===== Importation d'utilisateurs par lot =====
+
+Requière un fichier [[wpfr>CSV]] d'utilisateurs avec un minimum de quatre colonnes.
+Les colonnes doivent comporter, dans l'ordre : identifiant, nom complet, adresse de courriel et groupes.
+
+Les champs doivent être séparés par une virgule (,), les chaînes sont délimitées par des guillemets (""). On peut utiliser la balance inverse (\) comme caractère d'échappement.
+Pour obtenir un exemple de fichier acceptable, essayer la fonction "Exporter les utilisateurs" ci dessus.
+
+Les identifiants dupliqués seront ignorés.
+
+L'importation générera un mot de passe et l'enverra à chaque utilisateur correctement importé. \ No newline at end of file
diff --git a/lib/plugins/usermanager/lang/fr/lang.php b/lib/plugins/usermanager/lang/fr/lang.php
index 2ff1bd7a0..dd0e64fc4 100644
--- a/lib/plugins/usermanager/lang/fr/lang.php
+++ b/lib/plugins/usermanager/lang/fr/lang.php
@@ -21,6 +21,9 @@
* @author Olivier DUVAL <zorky00@gmail.com>
* @author Anael Mobilia <contrib@anael.eu>
* @author Bruno Veilleux <bruno.vey@gmail.com>
+ * @author Antoine Turmel <geekshadow@gmail.com>
+ * @author schplurtz <Schplurtz@laposte.net>
+ * @author Jérôme Brandt <jeromebrandt@gmail.com>
*/
$lang['menu'] = 'Gestion des utilisateurs';
$lang['noauth'] = '(authentification de l\'utilisateur non disponible)';
@@ -43,6 +46,11 @@ $lang['search'] = 'Rechercher';
$lang['search_prompt'] = 'Effectuer la recherche';
$lang['clear'] = 'Réinitialiser la recherche';
$lang['filter'] = 'Filtre';
+$lang['export_all'] = 'Exporter tous les utilisateurs (CSV)';
+$lang['export_filtered'] = 'Exporter la liste d\'utilisateurs filtrés (CSV)';
+$lang['import'] = 'Importer de nouveaux utilisateurs';
+$lang['line'] = 'Ligne n°';
+$lang['error'] = 'Message d\'erreur';
$lang['summary'] = 'Affichage des utilisateurs %1$d-%2$d parmi %3$d trouvés. %4$d utilisateurs au total.';
$lang['nonefound'] = 'Aucun utilisateur trouvé. %d utilisateurs au total.';
$lang['delete_ok'] = '%d utilisateurs effacés';
@@ -63,3 +71,16 @@ $lang['add_ok'] = 'Utilisateur ajouté avec succès';
$lang['add_fail'] = 'Échec de l\'ajout de l\'utilisateur';
$lang['notify_ok'] = 'Courriel de notification expédié';
$lang['notify_fail'] = 'Échec de l\'expédition du courriel de notification';
+$lang['import_userlistcsv'] = 'Liste utilisateur (fichier CSV)';
+$lang['import_header'] = 'Erreurs d\'import les plus récentes';
+$lang['import_success_count'] = 'Import d’utilisateurs : %d utilisateurs trouvés, %d utilisateurs importés avec succès.';
+$lang['import_failure_count'] = 'Import d\'utilisateurs : %d ont échoué. Les erreurs sont listées ci-dessous.';
+$lang['import_error_fields'] = 'Nombre de champs insuffisant, %d trouvé, 4 requis.';
+$lang['import_error_baduserid'] = 'Identifiant de l\'utilisateur manquant';
+$lang['import_error_badname'] = 'Mauvais nom';
+$lang['import_error_badmail'] = 'Mauvaise adresse e-mail';
+$lang['import_error_upload'] = 'L\'import a échoué. Le fichier csv n\'a pas pu être téléchargé ou bien il est vide.';
+$lang['import_error_readfail'] = 'L\'import a échoué. Impossible de lire le fichier téléchargé.';
+$lang['import_error_create'] = 'Impossible de créer l\'utilisateur';
+$lang['import_notify_fail'] = 'Impossible d\'expédier une notification à l\'utilisateur importé %s, adresse %s.';
+$lang['import_downloadfailures'] = 'Télécharger les erreurs au format CSV pour correction';
diff --git a/lib/plugins/usermanager/lang/he/lang.php b/lib/plugins/usermanager/lang/he/lang.php
index 601163013..18202584e 100644
--- a/lib/plugins/usermanager/lang/he/lang.php
+++ b/lib/plugins/usermanager/lang/he/lang.php
@@ -1,7 +1,8 @@
<?php
+
/**
- * hebrew language file
- *
+ * @license GPL 2 (http://www.gnu.org/licenses/gpl.html)
+ *
* @author DoK <kamberd@yahoo.com>
* @author Dotan Kamber <kamberd@yahoo.com>
* @author Moshe Kaplan <mokplan@gmail.com>
diff --git a/lib/plugins/usermanager/lang/hu/import.txt b/lib/plugins/usermanager/lang/hu/import.txt
new file mode 100644
index 000000000..5a4bc8b1c
--- /dev/null
+++ b/lib/plugins/usermanager/lang/hu/import.txt
@@ -0,0 +1,9 @@
+==== Felhasználók tömeges importálása ====
+
+Egy, legalább 4 oszlopot tartalmazó, felhasználóikat tartalmazó fájl szükséges hozzá.
+Az oszlopok kötelező tartalma, megfelelő sorrendben: felhasználói azonosító, teljes név, e-mailcím és csoportjai.
+A CSV mezőit vesszővel (,) kell elválasztani, a szövegeket idézőjelek ("") közé kell foglalni.
+Mintafájl megtekintéséhez próbáld ki a fenti, "Felhasználók exportálása" funkciót. A fordított törtvonallal (\) lehet kilépni.
+Megegyező felhasználói azonosítók esetén, nem kerülnek feldolgozásra.
+
+Minden sikeresen importált felhasználó kap egy e-mailt, amiben megtalálja a generált jelszavát. \ No newline at end of file
diff --git a/lib/plugins/usermanager/lang/hu/lang.php b/lib/plugins/usermanager/lang/hu/lang.php
index 71a5b4bc9..dd76bfd50 100644
--- a/lib/plugins/usermanager/lang/hu/lang.php
+++ b/lib/plugins/usermanager/lang/hu/lang.php
@@ -1,7 +1,8 @@
<?php
+
/**
- * Hungarian language file
- *
+ * @license GPL 2 (http://www.gnu.org/licenses/gpl.html)
+ *
* @author Sandor TIHANYI <stihanyi+dw@gmail.com>
* @author Siaynoq Mage <siaynoqmage@gmail.com>
* @author schilling.janos@gmail.com
@@ -9,6 +10,7 @@
* @author Sándor TIHANYI <stihanyi+dw@gmail.com>
* @author David Szabo <szabo.david@gyumolcstarhely.hu>
* @author Marton Sebok <sebokmarton@gmail.com>
+ * @author Serenity87HUN <anikototh87@gmail.com>
*/
$lang['menu'] = 'Felhasználók kezelése';
$lang['noauth'] = '(A felhasználói azonosítás nem működik.)';
@@ -31,6 +33,11 @@ $lang['search'] = 'Keresés';
$lang['search_prompt'] = 'Keresés';
$lang['clear'] = 'Keresési szűrés törlése';
$lang['filter'] = 'Szűrés';
+$lang['export_all'] = 'Összes felhasználó exportálása (CSV)';
+$lang['export_filtered'] = 'Kiválasztott felhasználók exportálása (CSV)';
+$lang['import'] = 'Új felhasználók importálása';
+$lang['line'] = 'Sor száma';
+$lang['error'] = 'Hibaüzenet';
$lang['summary'] = '%1$d-%2$d. felhasználók megjelenítése a(z) %3$d megtalált felhasználóból. %4$d felhasználó van összesen.';
$lang['nonefound'] = 'Nincs ilyen felhasználó. %d felhasználó van összesen.';
$lang['delete_ok'] = '%d felhasználó törölve.';
@@ -51,3 +58,16 @@ $lang['add_ok'] = 'A felhasználó sikeresen hozzáadva.';
$lang['add_fail'] = 'A felhasználó hozzáadása nem sikerült.';
$lang['notify_ok'] = 'Értesítő levél elküldve.';
$lang['notify_fail'] = 'Nem sikerült az értesítő levelet elküldeni.';
+$lang['import_userlistcsv'] = 'Felhasználók listája fájl (CSV)';
+$lang['import_header'] = 'Legutóbbi importálás - Hibák';
+$lang['import_success_count'] = 'Felhasználók importálása: %d felhasználót találtunk, ebből %d sikeresen importálva.';
+$lang['import_failure_count'] = 'Felhasználók importálása: %d sikertelen. A sikertelenség okait lejjebb találod.';
+$lang['import_error_fields'] = 'Túl kevés mezőt adtál meg, %d darabot találtunk, legalább 4-re van szükség.';
+$lang['import_error_baduserid'] = 'Felhasználói azonosító hiányzik';
+$lang['import_error_badname'] = 'Nem megfelelő név';
+$lang['import_error_badmail'] = 'Nem megfelelő e-mailcím';
+$lang['import_error_upload'] = 'Sikertelen importálás. A csv fájl nem feltölthető vagy üres.';
+$lang['import_error_readfail'] = 'Sikertelen importálás. A feltöltött fájl nem olvasható.';
+$lang['import_error_create'] = 'Ez a felhasználó nem hozható létre';
+$lang['import_notify_fail'] = 'Az értesítő e-mail nem küldhető el az alábbi importált felhasználónak: %s e-mailcíme: %s.';
+$lang['import_downloadfailures'] = 'Töltsd le a hibákat tartalmazó fájlt CSV formátumban, hogy ki tudd javítani a hibákat';
diff --git a/lib/plugins/usermanager/lang/id/lang.php b/lib/plugins/usermanager/lang/id/lang.php
index 457ad4963..425b2ff59 100644
--- a/lib/plugins/usermanager/lang/id/lang.php
+++ b/lib/plugins/usermanager/lang/id/lang.php
@@ -1,7 +1,8 @@
<?php
+
/**
- * Indonesian language file
- *
+ * @license GPL 2 (http://www.gnu.org/licenses/gpl.html)
+ *
* @author Irwan Butar Butar <irwansah.putra@gmail.com>
* @author Yustinus Waruwu <juswaruwu@gmail.com>
*/
diff --git a/lib/plugins/usermanager/lang/it/lang.php b/lib/plugins/usermanager/lang/it/lang.php
index dfacc6545..6c6789442 100644
--- a/lib/plugins/usermanager/lang/it/lang.php
+++ b/lib/plugins/usermanager/lang/it/lang.php
@@ -15,6 +15,7 @@
* @author Jacopo Corbetta <jacopo.corbetta@gmail.com>
* @author Matteo Pasotti <matteo@xquiet.eu>
* @author snarchio@gmail.com
+ * @author Claudio Lanconelli <lancos@libero.it>
*/
$lang['menu'] = 'Gestione Utenti';
$lang['noauth'] = '(autenticazione non disponibile)';
@@ -37,6 +38,8 @@ $lang['search'] = 'Cerca';
$lang['search_prompt'] = 'Esegui ricerca';
$lang['clear'] = 'Azzera filtro di ricerca';
$lang['filter'] = 'Filtro';
+$lang['export_all'] = 'Esporta tutti gli utenti (CSV)';
+$lang['export_filtered'] = 'Esporta elenco utenti filtrati (CSV)';
$lang['summary'] = 'Visualizzazione utenti %1$d-%2$d di %3$d trovati. %4$d utenti totali.';
$lang['nonefound'] = 'Nessun utente trovato. %d utenti totali.';
$lang['delete_ok'] = '%d utenti eliminati';
diff --git a/lib/plugins/usermanager/lang/ja/import.txt b/lib/plugins/usermanager/lang/ja/import.txt
new file mode 100644
index 000000000..751e515ac
--- /dev/null
+++ b/lib/plugins/usermanager/lang/ja/import.txt
@@ -0,0 +1,10 @@
+===== 一括ユーザーインポート =====
+
+少なくとも4列のユーザーCSVファイルが必要です。
+列の順序:ユーザーID、氏名、電子メールアドレス、グループ。
+CSVフィールドはカンマ(,)区切り、文字列は引用符("")区切りです。
+エスケープにバックスラッシュ(\)を使用できます。
+適切なファイル例は、上記の"エクスポートユーザー"機能で試して下さい。
+重複するユーザーIDは無視されます。
+
+正常にインポートされたユーザー毎に、パスワードを作成し、電子メールで送付します。 \ No newline at end of file
diff --git a/lib/plugins/usermanager/lang/ja/lang.php b/lib/plugins/usermanager/lang/ja/lang.php
index 1510d1eb0..23109f2a2 100644
--- a/lib/plugins/usermanager/lang/ja/lang.php
+++ b/lib/plugins/usermanager/lang/ja/lang.php
@@ -1,6 +1,8 @@
<?php
+
/**
- * japanese language file
+ * @license GPL 2 (http://www.gnu.org/licenses/gpl.html)
+ *
* @author Yuji Takenaka <webmaster@davilin.com>
* @author Chris Smith <chris@jalakai.co.uk>
* @author Ikuo Obataya <i.obataya@gmail.com>
@@ -8,6 +10,8 @@
* @author Kazutaka Miyasaka <kazmiya@gmail.com>
* @author Taisuke Shimamoto <dentostar@gmail.com>
* @author Satoshi Sahara <sahara.satoshi@gmail.com>
+ * @author Hideaki SAWADA <sawadakun@live.jp>
+ * @author Hideaki SAWADA <chuno@live.jp>
*/
$lang['menu'] = 'ユーザー管理';
$lang['noauth'] = '(ユーザー認証が無効です)';
@@ -30,6 +34,11 @@ $lang['search'] = '検索';
$lang['search_prompt'] = '検索を実行';
$lang['clear'] = '検索フィルターをリセット';
$lang['filter'] = 'フィルター';
+$lang['export_all'] = '全ユーザーのエクスポート(CSV)';
+$lang['export_filtered'] = '抽出したユーザー一覧のエクスポート(CSV)';
+$lang['import'] = '新規ユーザーのインポート';
+$lang['line'] = '行番号';
+$lang['error'] = 'エラーメッセージ';
$lang['summary'] = 'ユーザー %1$d-%2$d / %3$d, 総ユーザー数 %4$d';
$lang['nonefound'] = 'ユーザーが見つかりません, 総ユーザー数 %d';
$lang['delete_ok'] = '%d ユーザーが削除されました';
@@ -45,8 +54,21 @@ $lang['edit_usermissing'] = '選択したユーザーは見つかりませ
$lang['user_notify'] = 'ユーザーに通知する';
$lang['note_notify'] = '通知メールは、ユーザーに新たなパスワードが設定された場合のみ送信されます。';
$lang['note_group'] = 'グループを指定しない場合は、既定のグループ(%s)に配属されます。';
-$lang['note_pass'] = 'パスワードを空欄とした場合は、(”ユーザーに通知する”がチェックされていなくとも)自動生成したパスワードの通知がユーザー宛てに送信されます。';
+$lang['note_pass'] = '”ユーザーに通知する”をチェックしてパスワードを空欄にすると、パスワードは自動生成されます。';
$lang['add_ok'] = 'ユーザーを登録しました';
$lang['add_fail'] = 'ユーザーの登録に失敗しました';
$lang['notify_ok'] = '通知メールを送信しました';
$lang['notify_fail'] = '通知メールを送信できませんでした';
+$lang['import_userlistcsv'] = 'ユーザー一覧ファイル(CSV):';
+$lang['import_header'] = '最新インポート - 失敗';
+$lang['import_success_count'] = 'ユーザーインポート:ユーザーが%d件あり、%d件正常にインポートされました。';
+$lang['import_failure_count'] = 'ユーザーインポート:%d件が失敗しました。失敗は次のとおりです。';
+$lang['import_error_fields'] = '列の不足(4列必要)が%d件ありました。';
+$lang['import_error_baduserid'] = '欠落したユーザーID';
+$lang['import_error_badname'] = '不正な氏名';
+$lang['import_error_badmail'] = '不正な電子メールアドレス';
+$lang['import_error_upload'] = 'インポートが失敗しました。CSVファイルをアップロードできなかったか、ファイルが空です。';
+$lang['import_error_readfail'] = 'インポートが失敗しました。アップロードされたファイルが読込できません。';
+$lang['import_error_create'] = 'ユーザーが作成できません。';
+$lang['import_notify_fail'] = '通知メッセージがインポートされたユーザー(%s)・電子メールアドレス(%s)に送信できませんでした。';
+$lang['import_downloadfailures'] = '修正用に失敗を CSVファイルとしてダウンロードする。';
diff --git a/lib/plugins/usermanager/lang/ko/import.txt b/lib/plugins/usermanager/lang/ko/import.txt
new file mode 100644
index 000000000..44fe392d0
--- /dev/null
+++ b/lib/plugins/usermanager/lang/ko/import.txt
@@ -0,0 +1,9 @@
+===== 대량 사용자 가져오기 =====
+
+적어도 열 네 개가 있는 사용자의 CSV 파일이 필요합니다.
+열은 다음과 같이 포함해야 합니다: 사용자 id, 실명, 이메일 주소와 그룹.
+CSV 필드는 인용 부호("")로 쉼표(,)와 구분된 문자열로 구분해야 합니다. 백슬래시(\)는 탈출에 사용할 수 있습니다.
+적절한 파일의 예를 들어, 위의 "사용자 목록 내보내기"를 시도하세요.
+중복된 사용자 id는 무시됩니다.
+
+비밀번호는 생성되고 각 성공적으로 가져온 사용자에게 이메일로 보내집니다. \ No newline at end of file
diff --git a/lib/plugins/usermanager/lang/ko/lang.php b/lib/plugins/usermanager/lang/ko/lang.php
index 57bfbc4a2..ac129c95e 100644
--- a/lib/plugins/usermanager/lang/ko/lang.php
+++ b/lib/plugins/usermanager/lang/ko/lang.php
@@ -1,21 +1,24 @@
<?php
+
/**
- * Korean language file
- *
+ * @license GPL 2 (http://www.gnu.org/licenses/gpl.html)
+ *
* @author jk Lee
* @author dongnak@gmail.com
* @author Song Younghwan <purluno@gmail.com>
* @author Seung-Chul Yoo <dryoo@live.com>
* @author erial2@gmail.com
* @author Myeongjin <aranet100@gmail.com>
+ * @author Gerrit Uitslag <klapinklapin@gmail.com>
+ * @author Garam <rowain8@gmail.com>
*/
$lang['menu'] = '사용자 관리자';
$lang['noauth'] = '(사용자 인증이 불가능합니다)';
$lang['nosupport'] = '(사용자 관리가 지원되지 않습니다)';
-$lang['badauth'] = '인증 메카니즘이 잘못되었습니다';
+$lang['badauth'] = '인증 메커니즘이 잘못되었습니다';
$lang['user_id'] = '사용자';
$lang['user_pass'] = '비밀번호';
-$lang['user_name'] = '실제 이름';
+$lang['user_name'] = '실명';
$lang['user_mail'] = '이메일 ';
$lang['user_groups'] = '그룹';
$lang['field'] = '항목';
@@ -26,14 +29,19 @@ $lang['delete_selected'] = '선택 삭제';
$lang['edit'] = '편집';
$lang['edit_prompt'] = '이 사용자 편집';
$lang['modify'] = '바뀜 저장';
-$lang['search'] = '찾기';
-$lang['search_prompt'] = '찾기 실행';
-$lang['clear'] = '찾기 필터 초기화';
+$lang['search'] = '검색';
+$lang['search_prompt'] = '검색 수행';
+$lang['clear'] = '검색 필터 재설정';
$lang['filter'] = '필터';
+$lang['export_all'] = '모든 사용자 목록 내보내기 (CSV)';
+$lang['export_filtered'] = '필터된 사용자 목록 내보내기 (CSV)';
+$lang['import'] = '새 사용자 목록 가져오기';
+$lang['line'] = '줄 번호';
+$lang['error'] = '오류 메시지';
$lang['summary'] = '찾은 사용자 %3$d 중 %1$d-%2$d을(를) 봅니다. 전체 사용자는 %4$d명입니다.';
$lang['nonefound'] = '찾은 사용자가 없습니다. 전체 사용자는 %d명입니다.';
$lang['delete_ok'] = '사용자 %d명이 삭제되었습니다';
-$lang['delete_fail'] = '사용자 %d명의 삭제가 실패했습니다.';
+$lang['delete_fail'] = '사용자 %d명을 삭제하는 데 실패했습니다.';
$lang['update_ok'] = '사용자 정보를 성공적으로 바꾸었습니다';
$lang['update_fail'] = '사용자 정보를 바꾸는 데 실패했습니다';
$lang['update_exists'] = '사용자 이름을 바꾸는 데 실패했습니다. 사용자 이름(%s)이 이미 존재합니다. (다른 항목의 바뀜은 적용됩니다.)';
@@ -45,8 +53,21 @@ $lang['edit_usermissing'] = '선택된 사용자를 찾을 수 없습니다
$lang['user_notify'] = '사용자에게 알림';
$lang['note_notify'] = '사용자에게 새로운 비밀번호를 준 경우에만 알림 이메일이 보내집니다.';
$lang['note_group'] = '새로운 사용자는 어떤 그룹도 설정하지 않은 경우에 기본 그룹(%s)에 추가됩니다.';
-$lang['note_pass'] = '사용자 통지가 지정되어 있을 때 필드에 아무 값도 입력하지 않으면 비밀번호가 자동으로 만들어집니다.';
+$lang['note_pass'] = '사용자 알림이 지정되어 있을 때 필드에 아무 값도 입력하지 않으면 비밀번호가 자동으로 만들어집니다.';
$lang['add_ok'] = '사용자를 성공적으로 추가했습니다';
$lang['add_fail'] = '사용자 추가를 실패했습니다';
$lang['notify_ok'] = '알림 이메일을 성공적으로 보냈습니다';
$lang['notify_fail'] = '알림 이메일을 보낼 수 없습니다';
+$lang['import_userlistcsv'] = '사용자 목록 파일 (CSV):';
+$lang['import_header'] = '가장 최근 가져오기 - 실패';
+$lang['import_success_count'] = '사용자 가져오기: 사용자 %d명을 찾았고, %d명을 성공적으로 가져왔습니다.';
+$lang['import_failure_count'] = '사용자 가져오기: %d명을 가져오지 못했습니다. 실패는 아래에 나타나 있습니다.';
+$lang['import_error_fields'] = '충분하지 않은 필드로, %d개를 찾았고, 4개가 필요합니다.';
+$lang['import_error_baduserid'] = '사용자 id 없음';
+$lang['import_error_badname'] = '잘못된 이름';
+$lang['import_error_badmail'] = '잘못된 이메일 주소';
+$lang['import_error_upload'] = '가져오기를 실패했습니다. csv 파일을 올릴 수 없거나 비어 있습니다.';
+$lang['import_error_readfail'] = '가져오기를 실패했습니다. 올린 파일을 읽을 수 없습니다.';
+$lang['import_error_create'] = '사용자를 만들 수 없습니다.';
+$lang['import_notify_fail'] = '알림 메시지를 가져온 %s (이메일: %s) 사용자에게 보낼 수 없습니다.';
+$lang['import_downloadfailures'] = '교정을 위한 CSV로 다운로드 실패';
diff --git a/lib/plugins/usermanager/lang/ne/lang.php b/lib/plugins/usermanager/lang/ne/lang.php
index f68ed2074..9a44d19ce 100644
--- a/lib/plugins/usermanager/lang/ne/lang.php
+++ b/lib/plugins/usermanager/lang/ne/lang.php
@@ -1,7 +1,8 @@
<?php
+
/**
- * Nepali language file
- *
+ * @license GPL 2 (http://www.gnu.org/licenses/gpl.html)
+ *
* @author Saroj Kumar Dhakal <lotusnagarkot@gmail.com>
* @author SarojKumar Dhakal <lotusnagarkot@yahoo.com>
* @author Saroj Dhakal<lotusnagarkot@yahoo.com>
diff --git a/lib/plugins/usermanager/lang/nl/import.txt b/lib/plugins/usermanager/lang/nl/import.txt
index 69d2c2306..267891098 100644
--- a/lib/plugins/usermanager/lang/nl/import.txt
+++ b/lib/plugins/usermanager/lang/nl/import.txt
@@ -1,7 +1,7 @@
===== Massa-import van gebruikers =====
Hiervoor is een CSV-bestand nodig van de gebruikers met minstens vier kolommen. De kolommen moeten bevatten, in deze volgorde: gebruikers-id, complete naam, e-mailadres en groepen.
-Het CSV-velden moeten worden gescheiden met komma's (,) en de teksten moeten worden omringt met dubbele aanhalingstekens (""). Backslash (\) kan worden gebruikt om te escapen.
+Het CSV-velden moeten worden gescheiden met komma's (,) en de teksten moeten worden omringd met dubbele aanhalingstekens (""). Backslash (\) kan worden gebruikt om te escapen.
Voor een voorbeeld van een werkend bestand, probeer de "Exporteer Gebruikers" functie hierboven.
Dubbele gebruikers-id's zullen worden genegeerd.
diff --git a/lib/plugins/usermanager/lang/nl/lang.php b/lib/plugins/usermanager/lang/nl/lang.php
index 7be10c16a..5cebede89 100644
--- a/lib/plugins/usermanager/lang/nl/lang.php
+++ b/lib/plugins/usermanager/lang/nl/lang.php
@@ -14,7 +14,6 @@
* @author Timon Van Overveldt <timonvo@gmail.com>
* @author Jeroen
* @author Ricardo Guijt <ricardoguijt@gmail.com>
- * @author Gerrit <klapinklapin@gmail.com>
* @author Gerrit Uitslag <klapinklapin@gmail.com>
*/
$lang['menu'] = 'Gebruikersmanager';
@@ -39,7 +38,7 @@ $lang['search_prompt'] = 'Voer zoekopdracht uit';
$lang['clear'] = 'Verwijder zoekfilter';
$lang['filter'] = 'Filter';
$lang['export_all'] = 'Exporteer Alle Gebruikers (CSV)';
-$lang['export_filtered'] = 'Exporteer de lijst van Gefilterde Gebruikers (CSV)';
+$lang['export_filtered'] = 'Exporteer Gefilterde Gebruikers (CSV)';
$lang['import'] = 'Importeer Nieuwe Gebruikers';
$lang['line'] = 'Regelnummer';
$lang['error'] = 'Foutmelding';
@@ -63,6 +62,8 @@ $lang['add_ok'] = 'Gebruiker succesvol toegevoegd';
$lang['add_fail'] = 'Gebruiker kon niet worden toegevoegd';
$lang['notify_ok'] = 'Notificatie-e-mail verzonden';
$lang['notify_fail'] = 'Notificatie-e-mail kon niet worden verzonden';
+$lang['import_userlistcsv'] = 'Gebruikerslijst (CSV-bestand):';
+$lang['import_header'] = 'Meest recente import - Gevonden fouten';
$lang['import_success_count'] = 'Gebruikers importeren: %d gebruikers gevonden, %d geïmporteerd';
$lang['import_failure_count'] = 'Gebruikers importeren: %d mislukt. Fouten zijn hieronder weergegeven.';
$lang['import_error_fields'] = 'Onvoldoende velden, gevonden %d, nodig 4.';
@@ -73,3 +74,4 @@ $lang['import_error_upload'] = 'Importeren mislukt. Het CSV bestand kon niet w
$lang['import_error_readfail'] = 'Importeren mislukt. Lezen van het geüploade bestand is mislukt.';
$lang['import_error_create'] = 'Aanmaken van de gebruiker was niet mogelijk.';
$lang['import_notify_fail'] = 'Notificatiebericht kon niet naar de geïmporteerde gebruiker worden verstuurd, %s met e-mail %s.';
+$lang['import_downloadfailures'] = 'Download de gevonden fouten als CSV voor correctie';
diff --git a/lib/plugins/usermanager/lang/no/lang.php b/lib/plugins/usermanager/lang/no/lang.php
index 7124e4811..83823b2b8 100644
--- a/lib/plugins/usermanager/lang/no/lang.php
+++ b/lib/plugins/usermanager/lang/no/lang.php
@@ -1,13 +1,14 @@
<?php
+
/**
- * Norwegianlanguage file
- *
+ * @license GPL 2 (http://www.gnu.org/licenses/gpl.html)
+ *
* @author Thomas Nygreen <nygreen@gmail.com>
* @author Arild Burud <arildb@met.no>
* @author Torkill Bruland <torkar-b@online.no>
* @author Rune M. Andersen <rune.andersen@gmail.com>
* @author Jakob Vad Nielsen (me@jakobnielsen.net)
- * @author Kjell Tore Næsgaard <kjell.t.nasgaard@ntnu.no>
+ * @author Kjell Tore Næsgaard <kjell.t.nasgaard@ntnu.no>
* @author Knut Staring <knutst@gmail.com>
* @author Lisa Ditlefsen <lisa@vervesearch.com>
* @author Erik Pedersen <erik.pedersen@shaw.ca>
diff --git a/lib/plugins/usermanager/lang/pl/lang.php b/lib/plugins/usermanager/lang/pl/lang.php
index cfc0ba327..2e063d2bb 100644
--- a/lib/plugins/usermanager/lang/pl/lang.php
+++ b/lib/plugins/usermanager/lang/pl/lang.php
@@ -1,7 +1,8 @@
<?php
+
/**
- * polish language file
- *
+ * @license GPL 2 (http://www.gnu.org/licenses/gpl.html)
+ *
* @author Grzegorz Żur <grzegorz.zur@gmail.com>
* @author Mariusz Kujawski <marinespl@gmail.com>
* @author Maciej Kurczewski <pipijajko@gmail.com>
diff --git a/lib/plugins/usermanager/lang/pt-br/lang.php b/lib/plugins/usermanager/lang/pt-br/lang.php
index 637be8860..356d139eb 100644
--- a/lib/plugins/usermanager/lang/pt-br/lang.php
+++ b/lib/plugins/usermanager/lang/pt-br/lang.php
@@ -1,7 +1,8 @@
<?php
+
/**
- * Portuguese language file
- *
+ * @license GPL 2 (http://www.gnu.org/licenses/gpl.html)
+ *
* @author Frederico Gonçalves Guimarães <frederico@teia.bio.br>
* @author Felipe Castro <fefcas@gmail.com>
* @author Lucien Raven <lucienraven@yahoo.com.br>
@@ -17,6 +18,9 @@
* @author Isaias Masiero Filho <masiero@masiero.org>
* @author Balaco Baco <balacobaco@imap.cc>
* @author Victor Westmann <victor.westmann@gmail.com>
+ * @author Leone Lisboa Magevski <leone1983@gmail.com>
+ * @author Dário Estevão <darioems@gmail.com>
+ * @author Juliano Marconi Lanigra <juliano.marconi@gmail.com>
*/
$lang['menu'] = 'Gerenciamento de Usuários';
$lang['noauth'] = '(o gerenciamento de usuários não está disponível)';
@@ -39,6 +43,11 @@ $lang['search'] = 'Pesquisar';
$lang['search_prompt'] = 'Executar a pesquisa';
$lang['clear'] = 'Limpar o filtro de pesquisa';
$lang['filter'] = 'Filtro';
+$lang['export_all'] = 'Exportar Todos Usuários (CSV)';
+$lang['export_filtered'] = 'Exportar lista de Usuários Filtrados (CSV)';
+$lang['import'] = 'Importar Novos Usuários';
+$lang['line'] = 'Linha Nº.';
+$lang['error'] = 'Mensagem de Erro';
$lang['summary'] = 'Exibindo usuários %1$d-%2$d de %3$d encontrados. %4$d usuários no total.';
$lang['nonefound'] = 'Nenhum usuário encontrado. %d usuários no total.';
$lang['delete_ok'] = '%d usuários excluídos';
@@ -59,3 +68,16 @@ $lang['add_ok'] = 'O usuário foi adicionado com sucesso';
$lang['add_fail'] = 'O usuário não foi adicionado';
$lang['notify_ok'] = 'O e-mail de notificação foi enviado';
$lang['notify_fail'] = 'Não foi possível enviar o e-mail de notificação';
+$lang['import_userlistcsv'] = 'Arquivo de lista de usuários (CSV):';
+$lang['import_header'] = 'Importações Mais Recentes - Falhas';
+$lang['import_success_count'] = 'Importação de Usuário: %d usuário (s) encontrado (s), %d importado (s) com sucesso.';
+$lang['import_failure_count'] = 'Importação de Usuário: %d falhou. As falhas estão listadas abaixo.';
+$lang['import_error_fields'] = 'Campos insuficientes, encontrado (s) %d, necessário 4.';
+$lang['import_error_baduserid'] = 'Id do usuário não encontrado.';
+$lang['import_error_badname'] = 'Nome errado';
+$lang['import_error_badmail'] = 'Endereço de email errado';
+$lang['import_error_upload'] = 'Falha na Importação: O arquivo csv não pode ser carregado ou está vazio.';
+$lang['import_error_readfail'] = 'Falha na Importação: Habilitar para ler o arquivo a ser carregado.';
+$lang['import_error_create'] = 'Habilitar para criar o usuário.';
+$lang['import_notify_fail'] = 'Mensagem de notificação não pode ser enviada para o usuário importado, %s com email %s.';
+$lang['import_downloadfailures'] = 'Falhas no Download como CSV para correção';
diff --git a/lib/plugins/usermanager/lang/pt/import.txt b/lib/plugins/usermanager/lang/pt/import.txt
new file mode 100644
index 000000000..3a604030c
--- /dev/null
+++ b/lib/plugins/usermanager/lang/pt/import.txt
@@ -0,0 +1,9 @@
+===== Importação de Utilizadores em Massa =====
+
+Requer um ficheiro CSV de utilizadores com pelo menos quatro colunas.
+As colunas têm de conter, em ordem: id de utilizador, nome completo, endereço de email e grupos.
+Os campos CSV devem ser separados por vírgulas (,) e as strings delimitadas por aspas (""). A contra-barra (\) pode ser usada para escapar.
+Para um exemplo de um ficheiro adequado, tente a função "Exportar Utilizadores" acima.
+Ids de utilizador duplicados serão ignorados.
+
+Uma senha será gerada e enviada por email a cada utilizador importado com sucesso. \ No newline at end of file
diff --git a/lib/plugins/usermanager/lang/pt/lang.php b/lib/plugins/usermanager/lang/pt/lang.php
index 6d0d85e38..b59649aa1 100644
--- a/lib/plugins/usermanager/lang/pt/lang.php
+++ b/lib/plugins/usermanager/lang/pt/lang.php
@@ -1,7 +1,8 @@
<?php
+
/**
- * Portugueselanguage file
- *
+ * @license GPL 2 (http://www.gnu.org/licenses/gpl.html)
+ *
* @author José Monteiro <Jose.Monteiro@DoWeDo-IT.com>
* @author Enrico Nicoletto <liverig@gmail.com>
* @author Fil <fil@meteopt.com>
@@ -29,6 +30,10 @@ $lang['search'] = 'Pesquisar';
$lang['search_prompt'] = 'Pesquisar';
$lang['clear'] = 'Limpar Filtro de Pesquisa';
$lang['filter'] = 'Filtro';
+$lang['export_all'] = 'Exportar Todos os Utilizadores (CSV)';
+$lang['export_filtered'] = 'Exportar a lista de utilizadores filtrada (CSV)';
+$lang['import'] = 'Importar Novos Utilizadores';
+$lang['error'] = 'Mensagem de erro';
$lang['summary'] = 'Apresentar utilizadores %1$d-%2$d de %3$d encontrados. %4$d inscritos.';
$lang['nonefound'] = 'Nenhum utilizador encontrado. %d inscritos.';
$lang['delete_ok'] = '%d utilizadores removidos';
@@ -49,3 +54,11 @@ $lang['add_ok'] = 'Utilizador adicionado.';
$lang['add_fail'] = 'Utilizador não adicionado.';
$lang['notify_ok'] = 'Mensagem de notificação enviada.';
$lang['notify_fail'] = 'Não foi possível enviar mensagem de notificação';
+$lang['import_success_count'] = 'Importar Utilizadores: %d utiliyadores encontrados, %d importados com sucesso.';
+$lang['import_failure_count'] = 'Importar Utilizadores: %d falharam. As falhas estão listadas abaixo.';
+$lang['import_error_fields'] = 'Campos insuficientes, encontrados %d mas requeridos 4.';
+$lang['import_error_baduserid'] = 'Falta id de utilizador';
+$lang['import_error_upload'] = 'Falhou a importação. O ficheiro csv não pôde ser importado ou está vazio.';
+$lang['import_error_readfail'] = 'Falhou a importação. Não foi possível ler o ficheiro submetido.';
+$lang['import_error_create'] = 'Não foi possível criar o utilizador.';
+$lang['import_notify_fail'] = 'A mensagem de notificação não pôde ser enviada para o utilizador importado, %s com email %s.';
diff --git a/lib/plugins/usermanager/lang/ru/import.txt b/lib/plugins/usermanager/lang/ru/import.txt
index 271a9b177..3a25f34ce 100644
--- a/lib/plugins/usermanager/lang/ru/import.txt
+++ b/lib/plugins/usermanager/lang/ru/import.txt
@@ -2,8 +2,8 @@
Потребуется список пользователей в файле формата CSV, состоящий из 4 столбцов.
Столбцы должны быть заполнены следующим образом: user-id, полное имя, эл. почта, группы.
-Поля CSV должны быть отделены запятой (,) а строки должны быть заключены в кавычки (""). Обратный слэш используется как прерывание.
-В качестве примера можете взять список пользователей, экспортированный через "Экспорт пользователей".
+Поля CSV должны быть отделены запятой (,), а строки должны быть заключены в кавычки (""). Обратный слэш используется как прерывание.
+В качестве примера можете взять список пользователей, экспортированный через «Экспорт пользователей».
Повторяющиеся идентификаторы user-id будут игнорироваться.
-Парол доступа будет сгенерирован и отправлен по почте удачно импортированному пользователю. \ No newline at end of file
+Пароль доступа будет сгенерирован и отправлен по почте удачно импортированному пользователю. \ No newline at end of file
diff --git a/lib/plugins/usermanager/lang/ru/lang.php b/lib/plugins/usermanager/lang/ru/lang.php
index f2029e58b..3102ac32a 100644
--- a/lib/plugins/usermanager/lang/ru/lang.php
+++ b/lib/plugins/usermanager/lang/ru/lang.php
@@ -44,9 +44,9 @@ $lang['filter'] = 'Фильтр';
$lang['export_all'] = 'Экспорт всех пользователей (CSV)';
$lang['export_filtered'] = 'Экспорт пользователей с фильтрацией списка (CSV)';
$lang['import'] = 'Импорт новых пользователей';
-$lang['line'] = 'Строка №.';
+$lang['line'] = 'Строка №';
$lang['error'] = 'Ошибка';
-$lang['summary'] = 'Показаны пользователи %1$d-%2$d из %3$d найденных. Всего пользователей: %4$d.';
+$lang['summary'] = 'Показаны пользователи %1$d–%2$d из %3$d найденных. Всего пользователей: %4$d.';
$lang['nonefound'] = 'Не найдено ни одного пользователя. Всего пользователей: %d.';
$lang['delete_ok'] = 'Удалено пользователей: %d';
$lang['delete_fail'] = 'Не удалось удалить %d.';
diff --git a/lib/plugins/usermanager/lang/sk/import.txt b/lib/plugins/usermanager/lang/sk/import.txt
new file mode 100644
index 000000000..91fa3e370
--- /dev/null
+++ b/lib/plugins/usermanager/lang/sk/import.txt
@@ -0,0 +1,9 @@
+===== Hromadný import používateľov =====
+
+Vyžaduje CSV súbor používateľov s minimálne 4 stĺpcami.
+Stĺpce musia obsahovať postupne: ID používateľa, meno a priezvisko, emailová adresa a skupiny.
+CVS záznamy by mali byť oddelené čiarkou (,) a reťazce uzavreté úvodzovkami (""). Znak (\) sa používa v spojení so špeciálnymi znakmi.
+Príklad vhodného súboru je možné získať funkciou "Export používateľov".
+Duplicitné ID používateľov budú ignorované.
+
+Každému úspešne importovanému používateľovi bude vygenerované heslo a zaslaný email. \ No newline at end of file
diff --git a/lib/plugins/usermanager/lang/sk/lang.php b/lib/plugins/usermanager/lang/sk/lang.php
index 54ed374c6..9aadbb53a 100644
--- a/lib/plugins/usermanager/lang/sk/lang.php
+++ b/lib/plugins/usermanager/lang/sk/lang.php
@@ -1,7 +1,8 @@
<?php
+
/**
- * Slovak language file
- *
+ * @license GPL 2 (http://www.gnu.org/licenses/gpl.html)
+ *
* @author Ondrej Végh <ov@vsieti.sk>
* @author Michal Mesko <michal.mesko@gmail.com>
* @author exusik@gmail.com
@@ -28,6 +29,11 @@ $lang['search'] = 'Hľadať';
$lang['search_prompt'] = 'Vykonať vyhľadávanie';
$lang['clear'] = 'Vynulovať vyhľadávací filter';
$lang['filter'] = 'Filter';
+$lang['export_all'] = 'Export všetkých používateľov (CSV)';
+$lang['export_filtered'] = 'Export zoznamu používateľov na základe filtra (CSV)';
+$lang['import'] = 'Import nových používateľov';
+$lang['line'] = 'Riadok č.';
+$lang['error'] = 'Chybová správa';
$lang['summary'] = 'Zobrazenie užívateľov %1$d-%2$d z %3$d nájdených. %4$d užívateľov celkom.';
$lang['nonefound'] = 'Žiadni užívatelia nenájdení. %d užívateľov celkom.';
$lang['delete_ok'] = '%d užívateľov zmazaných';
@@ -48,3 +54,16 @@ $lang['add_ok'] = 'Používateľ úspešne pridaný';
$lang['add_fail'] = 'Pridávanie užívateľa nebolo úspešné';
$lang['notify_ok'] = 'Notifikačný e-mail bol poslaný';
$lang['notify_fail'] = 'Notifikačný e-mail nemohol byť poslaný';
+$lang['import_userlistcsv'] = 'Súbor so zoznamov používateľov (CSV):';
+$lang['import_header'] = 'Chyby pri poslednom importe';
+$lang['import_success_count'] = 'Import používateľov: %d nájdených, %d úspešne importovaných.';
+$lang['import_failure_count'] = 'Import používateľov: %d neúspešných. Problámy vypísané nižšie.';
+$lang['import_error_fields'] = 'Neúplné záznamy, %d nájdené, 4 požadované.';
+$lang['import_error_baduserid'] = 'Chýba ID používateľa';
+$lang['import_error_badname'] = 'Nesprávne meno';
+$lang['import_error_badmail'] = 'Nesprávna emailová adresa';
+$lang['import_error_upload'] = 'Import neúspešný. CSV súbor nemohol byť nahraný alebo je prázdny.';
+$lang['import_error_readfail'] = 'Import neúspešný. Nie je možné prečítať nahraný súbor.';
+$lang['import_error_create'] = 'Nie je možné vytvoriť pouzívateľa';
+$lang['import_notify_fail'] = 'Správa nemohla byť zaslaná importovanému používatelovi, %s s emailom %s.';
+$lang['import_downloadfailures'] = 'Stiahnuť chyby vo formáte CSV za účelom opravy';
diff --git a/lib/plugins/usermanager/lang/sl/lang.php b/lib/plugins/usermanager/lang/sl/lang.php
index 96acfd0af..dc2de375e 100644
--- a/lib/plugins/usermanager/lang/sl/lang.php
+++ b/lib/plugins/usermanager/lang/sl/lang.php
@@ -1,11 +1,13 @@
<?php
+
/**
- * Slovenian language file
- *
+ * @license GPL 2 (http://www.gnu.org/licenses/gpl.html)
+ *
* @author Dejan Levec <webphp@gmail.com>
* @author Boštjan Seničar <senicar@gmail.com>
* @author Gregor Skumavc (grega.skumavc@gmail.com)
* @author Matej Urbančič (mateju@svn.gnome.org)
+ * @author Matej Urbančič <mateju@svn.gnome.org>
*/
$lang['menu'] = 'Upravljanje uporabnikov';
$lang['noauth'] = '(overjanje istovetnosti uporabnikov ni na voljo)';
@@ -28,6 +30,9 @@ $lang['search'] = 'Iskanje';
$lang['search_prompt'] = 'Poišči';
$lang['clear'] = 'Počisti filter iskanja';
$lang['filter'] = 'Filter';
+$lang['import'] = 'Uvozi nove uporabnike';
+$lang['line'] = 'Številka vrstice';
+$lang['error'] = 'Sporočilo napake';
$lang['summary'] = 'Izpisani so uporabniki %1$d-%2$d od skupno %3$d. Vseh uporabnikov je %4$d.';
$lang['nonefound'] = 'Ni najdenih uporabnikov. Vseh uporabnikov je %d.';
$lang['delete_ok'] = '%d uporabnikov je izbrisanih';
@@ -48,3 +53,11 @@ $lang['add_ok'] = 'Uporabnik je uspešno dodan';
$lang['add_fail'] = 'Dodajanje uporabnika je spodletelo';
$lang['notify_ok'] = 'Obvestilno sporočilo je poslano.';
$lang['notify_fail'] = 'Obvestilnega sporočila ni mogoče poslati.';
+$lang['import_error_fields'] = 'Neustrezno število polj; najdenih je %d, zahtevana pa so 4.';
+$lang['import_error_baduserid'] = 'Manjka ID uporabnika';
+$lang['import_error_badname'] = 'Napačno navedeno ime';
+$lang['import_error_badmail'] = 'Napačno naveden elektronski naslov';
+$lang['import_error_upload'] = 'Uvoz je spodletel. Datoteke CSV ni mogoče naložiti ali pa je prazna.';
+$lang['import_error_readfail'] = 'Uvoz je spodletel. Ni mogoče prebrati vsebine datoteke.';
+$lang['import_error_create'] = 'Ni mogoče ustvariti računa uporabnika';
+$lang['import_notify_fail'] = 'Obvestilnega sporočila za uvoženega uporabnika %s z elektronskim naslovom %s ni mogoče poslati.';
diff --git a/lib/plugins/usermanager/lang/tr/lang.php b/lib/plugins/usermanager/lang/tr/lang.php
index 7ddb7dd5d..6329803a8 100644
--- a/lib/plugins/usermanager/lang/tr/lang.php
+++ b/lib/plugins/usermanager/lang/tr/lang.php
@@ -1,7 +1,8 @@
<?php
+
/**
- * Turkish language file
- *
+ * @license GPL 2 (http://www.gnu.org/licenses/gpl.html)
+ *
* @author Aydın Coşkuner <aydinweb@gmail.com>
* @author Cihan Kahveci <kahvecicihan@gmail.com>
* @author Yavuz Selim <yavuzselim@gmail.com>
diff --git a/lib/plugins/usermanager/lang/zh-tw/import.txt b/lib/plugins/usermanager/lang/zh-tw/import.txt
new file mode 100644
index 000000000..a6bb5f6ef
--- /dev/null
+++ b/lib/plugins/usermanager/lang/zh-tw/import.txt
@@ -0,0 +1,9 @@
+===== 批次匯入使用者 =====
+
+需提供 CSV 格式的使用者列表檔案(UTF-8 編碼)。
+每列至少 4 欄,依序為:帳號、姓名、電郵、群組。
+各欄以半形逗號 (,) 分隔,有半形逗號的字串可用半形雙引號 ("") 分開,引號可用反斜線 (\) 跳脫。
+重複的使用者帳號會自動忽略。
+如需要範例檔案,可用上面的「匯出使用者」取得。
+
+系統會為成功匯入的使用者產生密碼並寄信通知。
diff --git a/lib/plugins/usermanager/lang/zh-tw/lang.php b/lib/plugins/usermanager/lang/zh-tw/lang.php
index c7126bd1a..3fb6b6712 100644
--- a/lib/plugins/usermanager/lang/zh-tw/lang.php
+++ b/lib/plugins/usermanager/lang/zh-tw/lang.php
@@ -9,21 +9,26 @@
* @author Wayne San <waynesan@zerozone.tw>
* @author Li-Jiun Huang <ljhuang.tw@gmai.com>
* @author Cheng-Wei Chien <e.cwchien@gmail.com>
- * @author Danny Lin <danny0838@pchome.com.tw>
* @author Shuo-Ting Jian <shoting@gmail.com>
* @author syaoranhinata@gmail.com
* @author Ichirou Uchiki <syaoranhinata@gmail.com>
* @author tsangho <ou4222@gmail.com>
+ * @author Danny Lin <danny0838@gmail.com>
*/
$lang['menu'] = '帳號管理器';
+
+// custom language strings for the plugin
$lang['noauth'] = '(帳號認證尚未開放)';
$lang['nosupport'] = '(尚不支援帳號管理)';
+
$lang['badauth'] = '錯誤的認證機制';
+
$lang['user_id'] = '帳號';
$lang['user_pass'] = '密碼';
$lang['user_name'] = '名稱';
$lang['user_mail'] = '電郵';
$lang['user_groups'] = '群組';
+
$lang['field'] = '欄位';
$lang['value'] = '設定值';
$lang['add'] = '增加';
@@ -36,8 +41,12 @@ $lang['search'] = '搜尋';
$lang['search_prompt'] = '開始搜尋';
$lang['clear'] = '重設篩選條件';
$lang['filter'] = '篩選條件 (Filter)';
-$lang['import'] = '匯入新的用戶';
+$lang['export_all'] = '匯出所有使用者 (CSV)';
+$lang['export_filtered'] = '匯出篩選後的使用者列表 (CSV)';
+$lang['import'] = '匯入新使用者';
+$lang['line'] = '列號';
$lang['error'] = '錯誤訊息';
+
$lang['summary'] = '顯示帳號 %1$d-%2$d,共 %3$d 筆符合。共有 %4$d 個帳號。';
$lang['nonefound'] = '找不到帳號。共有 %d 個帳號。';
$lang['delete_ok'] = '已刪除 %d 個帳號';
@@ -45,10 +54,13 @@ $lang['delete_fail'] = '%d 個帳號無法刪除。';
$lang['update_ok'] = '已更新該帳號';
$lang['update_fail'] = '無法更新該帳號';
$lang['update_exists'] = '無法變更帳號名稱 (%s) ,因為有同名帳號存在。其他修改則已套用。';
+
$lang['start'] = '開始';
$lang['prev'] = '上一頁';
$lang['next'] = '下一頁';
$lang['last'] = '最後一頁';
+
+// added after 2006-03-09 release
$lang['edit_usermissing'] = '找不到選取的帳號,可能已被刪除或改為其他名稱。';
$lang['user_notify'] = '通知使用者';
$lang['note_notify'] = '通知信只會在指定使用者新密碼時寄送。';
@@ -58,4 +70,18 @@ $lang['add_ok'] = '已新增使用者';
$lang['add_fail'] = '無法新增使用者';
$lang['notify_ok'] = '通知信已寄出';
$lang['notify_fail'] = '通知信無法寄出';
-$lang['import_error_readfail'] = '會入錯誤,無法讀取已經上傳的檔案';
+
+// import & errors
+$lang['import_userlistcsv'] = '使用者列表檔案 (CSV): ';
+$lang['import_header'] = '最近一次匯入 - 失敗';
+$lang['import_success_count'] = '使用者匯入:找到 %d 個使用者,已成功匯入 %d 個。';
+$lang['import_failure_count'] = '使用者匯入:%d 個匯入失敗,列出於下。';
+$lang['import_error_fields'] = '欄位不足,需要 4 個,找到 %d 個。';
+$lang['import_error_baduserid'] = '使用者帳號遺失';
+$lang['import_error_badname'] = '名稱不正確';
+$lang['import_error_badmail'] = '電郵位址不正確';
+$lang['import_error_upload'] = '匯入失敗,CSV 檔案內容空白或無法匯入。';
+$lang['import_error_readfail'] = '匯入錯誤,無法讀取上傳的檔案';
+$lang['import_error_create'] = '無法建立使用者';
+$lang['import_notify_fail'] = '通知訊息無法寄給已匯入的使用者 %s(電郵 %s)';
+$lang['import_downloadfailures'] = '下載失敗項的 CSV 檔案以供修正';
diff --git a/lib/plugins/usermanager/lang/zh/import.txt b/lib/plugins/usermanager/lang/zh/import.txt
new file mode 100644
index 000000000..eacce5a77
--- /dev/null
+++ b/lib/plugins/usermanager/lang/zh/import.txt
@@ -0,0 +1,7 @@
+===== 批量导入用户 =====
+
+需要至少有 4 列的 CSV 格式用户列表文件。列必须按顺序包括:用户ID、全名、电子邮件地址和组。
+CSV 域需要用逗号 (,) 分隔,字符串用英文双引号 ("") 分开。反斜杠可以用来转义。
+可以尝试上面的“导入用户”功能来查看示例文件。重复的用户ID将被忽略。
+
+密码生成后会通过电子邮件发送给每个成功导入的用户。 \ No newline at end of file
diff --git a/lib/plugins/usermanager/lang/zh/lang.php b/lib/plugins/usermanager/lang/zh/lang.php
index 2674983b2..25eb1a294 100644
--- a/lib/plugins/usermanager/lang/zh/lang.php
+++ b/lib/plugins/usermanager/lang/zh/lang.php
@@ -16,6 +16,7 @@
* @author lainme993@gmail.com
* @author Shuo-Ting Jian <shoting@gmail.com>
* @author Rachel <rzhang0802@gmail.com>
+ * @author Yangyu Huang <yangyu.huang@gmail.com>
*/
$lang['menu'] = '用户管理器';
$lang['noauth'] = '(用户认证不可用)';
@@ -38,6 +39,8 @@ $lang['search'] = '搜索';
$lang['search_prompt'] = '进行搜索';
$lang['clear'] = '重置搜索过滤器';
$lang['filter'] = '过滤器';
+$lang['export_all'] = '导出所有用户(CSV)';
+$lang['export_filtered'] = '导出已筛选的用户列表(CSV)';
$lang['import'] = '请输入新用户名';
$lang['line'] = '行号';
$lang['error'] = '信息错误';
@@ -61,7 +64,15 @@ $lang['add_ok'] = '用户添加成功';
$lang['add_fail'] = '用户添加失败';
$lang['notify_ok'] = '通知邮件已发送';
$lang['notify_fail'] = '通知邮件无法发送';
+$lang['import_userlistcsv'] = '用户列表文件(CSV)';
+$lang['import_header'] = '最近一次导入 - 失败';
+$lang['import_success_count'] = '用户导入:找到了 %d 个用户,%d 个用户被成功导入。';
+$lang['import_failure_count'] = '用户导入:%d 个用户导入失败。下面列出了失败的用户。';
+$lang['import_error_fields'] = '域的数目不足,发现 %d 个,需要 4 个。';
$lang['import_error_baduserid'] = '用户ID丢失';
$lang['import_error_badname'] = '名称错误';
$lang['import_error_badmail'] = '邮件地址错误';
+$lang['import_error_upload'] = '导入失败。CSV 文件无法上传或是空的。';
+$lang['import_error_readfail'] = '导入失败。无法读取上传的文件。';
$lang['import_error_create'] = '不能创建新用户';
+$lang['import_notify_fail'] = '通知消息无法发送到导入的用户 %s,电子邮件地址是 %s。';
diff --git a/lib/plugins/usermanager/style.css b/lib/plugins/usermanager/style.css
index 2874b4f1c..d119b195a 100644
--- a/lib/plugins/usermanager/style.css
+++ b/lib/plugins/usermanager/style.css
@@ -22,12 +22,12 @@
border-color: #ccc!important;
}
#user__manager .import_users {
- margin-top: 1.4em;
+ margin-top: 1.4em;
}
#user__manager .import_failures {
- margin-top: 1.4em;
+ margin-top: 1.4em;
}
#user__manager .import_failures td.lineno {
- text-align: center;
+ text-align: center;
}
/* IE won't understand but doesn't require it */