summaryrefslogtreecommitdiff
path: root/lib/plugins
diff options
context:
space:
mode:
authorKlap-in <klapinklapin@gmail.com>2013-02-16 23:08:08 +0100
committerKlap-in <klapinklapin@gmail.com>2013-02-16 23:08:08 +0100
commite57cf65d092c1a6458c3a468b017018905018eeb (patch)
treecb06ff0cf82afed514aa95c5c33e5faef8a9ef62 /lib/plugins
parenta0e625181ad2e2369e8db0e5691f7356363776d0 (diff)
parent9bbf02e86e5c1181bbc288ce42f1937f309a7e79 (diff)
downloadrpg-e57cf65d092c1a6458c3a468b017018905018eeb.tar.gz
rpg-e57cf65d092c1a6458c3a468b017018905018eeb.tar.bz2
Merge remote-tracking branch 'origin/master' into authpluginconfig
Diffstat (limited to 'lib/plugins')
-rw-r--r--lib/plugins/acl/script.js8
-rw-r--r--lib/plugins/auth.php1
-rw-r--r--lib/plugins/config/settings/config.class.php85
-rw-r--r--lib/plugins/config/settings/config.metadata.php10
-rw-r--r--lib/plugins/config/style.css9
-rw-r--r--lib/plugins/info/plugin.info.txt2
-rw-r--r--lib/plugins/info/syntax.php3
-rw-r--r--lib/plugins/plugin/lang/ar/lang.php2
-rw-r--r--lib/plugins/plugin/lang/hi/lang.php1
-rw-r--r--lib/plugins/plugin/lang/pl/lang.php2
-rw-r--r--lib/plugins/plugin/lang/zh-tw/lang.php2
-rw-r--r--lib/plugins/usermanager/lang/ca-valencia/lang.php2
12 files changed, 48 insertions, 79 deletions
diff --git a/lib/plugins/acl/script.js b/lib/plugins/acl/script.js
index 0ba91cdc9..c3763dc8d 100644
--- a/lib/plugins/acl/script.js
+++ b/lib/plugins/acl/script.js
@@ -117,11 +117,3 @@ var dw_acl = {
};
jQuery(dw_acl.init);
-
-var acl = {
- init: DEPRECATED_WRAP(dw_acl.init, dw_acl),
- userselhandler: DEPRECATED_WRAP(dw_acl.userselhandler, dw_acl),
- loadinfo: DEPRECATED_WRAP(dw_acl.loadinfo, dw_acl),
- parseatt: DEPRECATED_WRAP(dw_acl.parseatt, dw_acl),
- treehandler: DEPRECATED_WRAP(dw_acl.treehandler, dw_acl)
-};
diff --git a/lib/plugins/auth.php b/lib/plugins/auth.php
index 42dbf1859..c14a04dfb 100644
--- a/lib/plugins/auth.php
+++ b/lib/plugins/auth.php
@@ -434,6 +434,7 @@ class DokuWiki_Auth_Plugin extends DokuWiki_Plugin {
if(isset($conf['auth'][$plugin])) $oldconf = (array) $conf['auth'][$plugin];
$conf['plugin'][$plugin] = array_merge($default, $oldconf, $conf['plugin'][$plugin]);
+ $this->conf =& $conf['plugin'][$plugin];
$this->configloaded = true;
}
}
diff --git a/lib/plugins/config/settings/config.class.php b/lib/plugins/config/settings/config.class.php
index a3cfae9f8..4a84d6dc8 100644
--- a/lib/plugins/config/settings/config.class.php
+++ b/lib/plugins/config/settings/config.class.php
@@ -84,7 +84,7 @@ if (!class_exists('configuration')) {
array_shift($param);
} else {
$class = 'setting_undefined';
- $param = NULL;
+ $param = null;
}
if (!in_array($class, $no_default_check) && !isset($default[$key])) {
@@ -358,13 +358,13 @@ if (!class_exists('setting')) {
class setting {
var $_key = '';
- var $_default = NULL;
- var $_local = NULL;
- var $_protected = NULL;
+ 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 $_input = null; // only used by those classes which error check
var $_cautionList = array(
'basedir' => 'danger', 'baseurl' => 'danger', 'savedir' => 'danger', 'cookiedir' => 'danger', 'useacl' => 'danger', 'authtype' => 'danger', 'superuser' => 'danger', 'userewrite' => 'danger',
@@ -372,7 +372,7 @@ if (!class_exists('setting')) {
'allowdebug' => 'security', 'htmlok' => 'security', 'phpok' => 'security', 'iexssprotect' => 'security', 'xmlrpc' => 'security', 'fullpath' => 'security'
);
- function setting($key, $params=NULL) {
+ function setting($key, $params=null) {
$this->_key = $key;
if (is_array($params)) {
@@ -661,6 +661,7 @@ if (!class_exists('setting_email')) {
class setting_email extends setting_string {
var $_pattern = SETTING_EMAIL_PATTERN; // no longer required, retained for backward compatibility - FIXME, may not be necessary
var $_multiple = false;
+ var $_placeholders = false;
/**
* update setting with user provided value $input
@@ -674,15 +675,36 @@ if (!class_exists('setting_email')) {
$value = is_null($this->_local) ? $this->_default : $this->_local;
if ($value == $input) return false;
+ if($input === ''){
+ $this->_local = $input;
+ return true;
+ }
+ $mail = $input;
+
+ 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);
+ }
+ // multiple mail addresses?
if ($this->_multiple) {
- $mails = array_filter(array_map('trim', explode(',', $input)));
+ $mails = array_filter(array_map('trim', explode(',', $mail)));
} else {
- $mails = array($input);
+ $mails = array($mail);
}
+ // check them all
foreach ($mails as $mail) {
- if (!mail_isvalid($mail)) {
+ // only check the address part
+ if(preg_match('#(.*?)<(.*?)>#', $mail, $matches)){
+ $addr = $matches[2];
+ }else{
+ $addr = $mail;
+ }
+
+ if (!mail_isvalid($addr)) {
$this->_error = true;
$this->_input = $input;
return false;
@@ -695,46 +717,15 @@ if (!class_exists('setting_email')) {
}
}
+/**
+ * @deprecated 2013-02-16
+ */
if (!class_exists('setting_richemail')) {
class setting_richemail extends setting_email {
-
- /**
- * 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;
-
- // replace variables with pseudo values
- $test = $input;
- $test = str_replace('@USER@','joe',$test);
- $test = str_replace('@NAME@','Joe Schmoe',$test);
- $test = str_replace('@MAIL@','joe@example.com',$test);
-
- // now only check the address part
- if(preg_match('#(.*?)<(.*?)>#',$test,$matches)){
- $text = trim($matches[1]);
- $addr = $matches[2];
- }else{
- $addr = $test;
- }
-
- if ($test !== '' && !mail_isvalid($addr)) {
- $this->_error = true;
- $this->_input = $input;
- return false;
- }
-
- $this->_local = $input;
- return true;
- }
-
+ function update($input) {
+ $this->_placeholders = true;
+ return parent::update($input);
+ }
}
}
diff --git a/lib/plugins/config/settings/config.metadata.php b/lib/plugins/config/settings/config.metadata.php
index 585015085..bdbc4311f 100644
--- a/lib/plugins/config/settings/config.metadata.php
+++ b/lib/plugins/config/settings/config.metadata.php
@@ -20,9 +20,7 @@
* 'numericopt' - like above, but accepts empty values
* 'onoff' - checkbox input, setting output 0|1
* 'multichoice' - select input (single choice), setting output with quotes, required _choices parameter
- * 'email' - text input, input must conform to email address format, setting output in quotes
- * 'richemail' - text input, input must conform to email address format but accepts variables and
- * emails with a real name prepended (when email address is given in <>)
+ * 'email' - text input, input must conform to email address format
* 'password' - password input, minimal input validation, setting output text in quotes, maybe encoded
* according to the _code parameter
* 'dirchoice' - as multichoice, selection choices based on folders found at location specified in _dir
@@ -129,7 +127,7 @@ $meta['_authentication'] = array('fieldset');
$meta['useacl'] = array('onoff');
$meta['autopasswd'] = array('onoff');
$meta['authtype'] = array('authtype');
-$meta['passcrypt'] = array('multichoice','_choices' => array('smd5','md5','apr1','sha1','ssha','lsmd5','crypt','mysql','my411','kmd5','pmd5','hmd5','mediawiki','bcrypt','sha512'));
+$meta['passcrypt'] = array('multichoice','_choices' => array('smd5','md5','apr1','sha1','ssha','lsmd5','crypt','mysql','my411','kmd5','pmd5','hmd5','mediawiki','bcrypt','djangomd5','djangosha1','sha512'));
$meta['defaultgroup']= array('string');
$meta['superuser'] = array('string');
$meta['manager'] = array('string');
@@ -177,8 +175,8 @@ $meta['_notifications'] = array('fieldset');
$meta['subscribers'] = array('onoff');
$meta['subscribe_time'] = array('numeric');
$meta['notify'] = array('email', '_multiple' => true);
-$meta['registernotify'] = array('email');
-$meta['mailfrom'] = array('richemail');
+$meta['registernotify'] = array('email', '_multiple' => true);
+$meta['mailfrom'] = array('email', '_placeholders' => true);
$meta['mailprefix'] = array('string');
$meta['htmlmail'] = array('onoff');
diff --git a/lib/plugins/config/style.css b/lib/plugins/config/style.css
index 397328937..054021ed8 100644
--- a/lib/plugins/config/style.css
+++ b/lib/plugins/config/style.css
@@ -154,15 +154,6 @@
}
-/* IE6 correction */
-* html #config__manager .selection label {
- padding-top: 2px;
-}
-
-#config__manager .selection input.checkbox {
- padding-left: 0.7em;
-}
-
#config__manager .other {
clear: both;
padding-top: 0.5em;
diff --git a/lib/plugins/info/plugin.info.txt b/lib/plugins/info/plugin.info.txt
index 5c7d583c0..053743639 100644
--- a/lib/plugins/info/plugin.info.txt
+++ b/lib/plugins/info/plugin.info.txt
@@ -1,7 +1,7 @@
base info
author Andreas Gohr
email andi@splitbrain.org
-date 2012-02-04
+date 2013-02-16
name Info Plugin
desc Displays information about various DokuWiki internals
url http://dokuwiki.org/plugin:info
diff --git a/lib/plugins/info/syntax.php b/lib/plugins/info/syntax.php
index d813aa23a..97b28076b 100644
--- a/lib/plugins/info/syntax.php
+++ b/lib/plugins/info/syntax.php
@@ -60,9 +60,6 @@ class syntax_plugin_info extends DokuWiki_Syntax_Plugin {
if($format == 'xhtml'){
//handle various info stuff
switch ($data[0]){
- case 'version':
- $renderer->doc .= getVersion();
- break;
case 'syntaxmodes':
$renderer->doc .= $this->_syntaxmodes_xhtml();
break;
diff --git a/lib/plugins/plugin/lang/ar/lang.php b/lib/plugins/plugin/lang/ar/lang.php
index 8327e5ce3..a1a778131 100644
--- a/lib/plugins/plugin/lang/ar/lang.php
+++ b/lib/plugins/plugin/lang/ar/lang.php
@@ -50,4 +50,4 @@ $lang['enabled'] = 'الاضافة %s فُعلت. ';
$lang['notenabled'] = 'تعذر تفعيل الاضافة %s، تحقق من اذونات الملف.';
$lang['disabled'] = 'عُطلت الإضافة %s.';
$lang['notdisabled'] = 'تعذر تعطيل الإضافة %s، تحقق من اذونات الملف.';
-$lang['packageinstalled'] = 'حزمة الإضافة (%d plugin(s): %Xs) ثبتت بنجاج.';
+$lang['packageinstalled'] = 'حزمة الإضافة (%d plugin(s): %s) ثبتت بنجاج.';
diff --git a/lib/plugins/plugin/lang/hi/lang.php b/lib/plugins/plugin/lang/hi/lang.php
index ab29c6550..67b177256 100644
--- a/lib/plugins/plugin/lang/hi/lang.php
+++ b/lib/plugins/plugin/lang/hi/lang.php
@@ -6,7 +6,6 @@
* @author yndesai@gmail.com
*/
$lang['unknown'] = 'अज्ञात';
-$lang['deleted'] = 'मिटाया हुआ';
$lang['date'] = 'दिनांक:';
$lang['author'] = 'लेखक:';
$lang['error'] = 'अज्ञात त्रुटि हुइ';
diff --git a/lib/plugins/plugin/lang/pl/lang.php b/lib/plugins/plugin/lang/pl/lang.php
index 1d3bbbc03..faaa69630 100644
--- a/lib/plugins/plugin/lang/pl/lang.php
+++ b/lib/plugins/plugin/lang/pl/lang.php
@@ -60,4 +60,4 @@ $lang['enabled'] = 'Wtyczka %s włączona.';
$lang['notenabled'] = 'Nie udało się uruchomić wtyczki %s, sprawdź uprawnienia dostępu do plików.';
$lang['disabled'] = 'Wtyczka %s wyłączona.';
$lang['notdisabled'] = 'Nie udało się wyłączyć wtyczki %s, sprawdź uprawnienia dostępu do plików.';
-$lang['packageinstalled'] = 'Pakiet wtyczek (%d wtyczki:% s) zainstalowany pomyślnie.';
+$lang['packageinstalled'] = 'Pakiet wtyczek (%d wtyczki: %s) zainstalowany pomyślnie.';
diff --git a/lib/plugins/plugin/lang/zh-tw/lang.php b/lib/plugins/plugin/lang/zh-tw/lang.php
index 7b38a02c8..56149e79e 100644
--- a/lib/plugins/plugin/lang/zh-tw/lang.php
+++ b/lib/plugins/plugin/lang/zh-tw/lang.php
@@ -56,4 +56,4 @@ $lang['enabled'] = '附加元件 %s 已啟用。';
$lang['notenabled'] = '附加元件 %s 無法啟用,請檢查檔案權限。';
$lang['disabled'] = '附加元件 %s 已停用。';
$lang['notdisabled'] = '附加元件 %s 無法停用,請檢查檔案權限。';
-$lang['packageinstalled'] = '附加元件 (%d 附加元件%s: %s) 已安裝好。';
+$lang['packageinstalled'] = '附加元件 (%d 附加元件: %s) 已安裝好。';
diff --git a/lib/plugins/usermanager/lang/ca-valencia/lang.php b/lib/plugins/usermanager/lang/ca-valencia/lang.php
index 5b0c628ed..c39c2f9b3 100644
--- a/lib/plugins/usermanager/lang/ca-valencia/lang.php
+++ b/lib/plugins/usermanager/lang/ca-valencia/lang.php
@@ -33,7 +33,7 @@ $lang['delete_ok'] = '%d usuaris borrats';
$lang['delete_fail'] = 'Erro borrant %d.';
$lang['update_ok'] = 'Usuari actualisat correctament';
$lang['update_fail'] = 'Erro actualisant usuari';
-$lang['update_exists'] = 'Erro canviant el nom de l\'usuari, el nom d\'usuari que ha donat ya existix (els demés canvis s\'aplicaran).';
+$lang['update_exists'] = 'Erro canviant el nom de l\'usuari (%s), el nom d\'usuari que ha donat ya existix (els demés canvis s\'aplicaran).';
$lang['start'] = 'primera';
$lang['prev'] = 'anterior';
$lang['next'] = 'següent';