diff options
Diffstat (limited to 'lib/plugins')
-rw-r--r-- | lib/plugins/acl/action.php | 88 | ||||
-rw-r--r-- | lib/plugins/acl/ajax.php | 57 | ||||
-rw-r--r-- | lib/plugins/acl/lang/da/lang.php | 4 | ||||
-rw-r--r-- | lib/plugins/acl/script.js | 9 | ||||
-rw-r--r-- | lib/plugins/action.php | 2 | ||||
-rw-r--r-- | lib/plugins/authad/lang/da/settings.php | 10 | ||||
-rw-r--r-- | lib/plugins/config/settings/config.class.php | 4 | ||||
-rw-r--r-- | lib/plugins/config/settings/config.metadata.php | 1 | ||||
-rw-r--r-- | lib/plugins/config/settings/extra.class.php | 2 | ||||
-rw-r--r-- | lib/plugins/info/syntax.php | 6 | ||||
-rw-r--r-- | lib/plugins/plugin/classes/ap_info.class.php | 2 | ||||
-rw-r--r-- | lib/plugins/plugin/lang/da/lang.php | 4 | ||||
-rw-r--r-- | lib/plugins/popularity/admin.php | 4 | ||||
-rw-r--r-- | lib/plugins/popularity/helper.php | 22 | ||||
-rw-r--r-- | lib/plugins/popularity/lang/da/lang.php | 5 | ||||
-rw-r--r-- | lib/plugins/revert/lang/da/lang.php | 5 | ||||
-rw-r--r-- | lib/plugins/usermanager/lang/da/lang.php | 5 | ||||
-rw-r--r-- | lib/plugins/usermanager/lang/zh/lang.php | 7 |
18 files changed, 151 insertions, 86 deletions
diff --git a/lib/plugins/acl/action.php b/lib/plugins/acl/action.php new file mode 100644 index 000000000..5e186fb61 --- /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/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/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/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/action.php b/lib/plugins/action.php index 04b4f07a6..4b5eef60a 100644 --- a/lib/plugins/action.php +++ b/lib/plugins/action.php @@ -17,7 +17,7 @@ class DokuWiki_Action_Plugin extends DokuWiki_Plugin { /** * Registers a callback function for a given event */ - function register(Doku_Event_Handler $controller) { + 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/lang/da/settings.php b/lib/plugins/authad/lang/da/settings.php new file mode 100644 index 000000000..958c41cf5 --- /dev/null +++ b/lib/plugins/authad/lang/da/settings.php @@ -0,0 +1,10 @@ +<?php + +/** + * @license GPL 2 (http://www.gnu.org/licenses/gpl.html) + * + * @author Soren Birk <soer9648@hotmail.com> + */ +$lang['admin_password'] = 'Kodeordet til den ovenstående bruger.'; +$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.'; diff --git a/lib/plugins/config/settings/config.class.php b/lib/plugins/config/settings/config.class.php index 1d2173706..a5a11cda1 100644 --- a/lib/plugins/config/settings/config.class.php +++ b/lib/plugins/config/settings/config.class.php @@ -794,7 +794,7 @@ if (!class_exists('setting_numericopt')) { if (!class_exists('setting_onoff')) { class setting_onoff extends setting_numeric { - function html(&$plugin) { + function html(&$plugin, $echo = false) { $value = ''; $disable = ''; @@ -830,7 +830,7 @@ if (!class_exists('setting_multichoice')) { class setting_multichoice extends setting_string { var $_choices = array(); - function html(&$plugin) { + function html(&$plugin, $echo = false) { $value = ''; $disable = ''; $nochoice = ''; 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 d0f99fa8f..83de802a3 100644 --- a/lib/plugins/config/settings/extra.class.php +++ b/lib/plugins/config/settings/extra.class.php @@ -176,7 +176,7 @@ if (!class_exists('setting_renderer')) { $format = $this->_format; foreach (plugin_list('renderer') as $plugin) { - $renderer =& plugin_load('renderer',$plugin); + $renderer = plugin_load('renderer',$plugin); if (method_exists($renderer,'canRender') && $renderer->canRender($format)) { $this->_choices[] = $plugin; diff --git a/lib/plugins/info/syntax.php b/lib/plugins/info/syntax.php index 5d969d7a2..f8c6eb484 100644 --- a/lib/plugins/info/syntax.php +++ b/lib/plugins/info/syntax.php @@ -58,6 +58,7 @@ class syntax_plugin_info extends DokuWiki_Syntax_Plugin { */ function render($format, Doku_Renderer &$renderer, $data) { if($format == 'xhtml'){ + /** @var Doku_Renderer_xhtml $renderer */ //handle various info stuff switch ($data[0]){ case 'syntaxmodes': @@ -142,8 +143,6 @@ 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; @@ -251,10 +250,11 @@ class syntax_plugin_info extends DokuWiki_Syntax_Plugin { /** * 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/classes/ap_info.class.php b/lib/plugins/plugin/classes/ap_info.class.php index b3826b944..89b78fa2d 100644 --- a/lib/plugins/plugin/classes/ap_info.class.php +++ b/lib/plugins/plugin/classes/ap_info.class.php @@ -14,7 +14,7 @@ class ap_info extends ap_manage { 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/lang/da/lang.php b/lib/plugins/plugin/lang/da/lang.php index d1deb6310..d2751fa1b 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> 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/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/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/usermanager/lang/da/lang.php b/lib/plugins/usermanager/lang/da/lang.php index 845457f7e..6b615b51d 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> diff --git a/lib/plugins/usermanager/lang/zh/lang.php b/lib/plugins/usermanager/lang/zh/lang.php index 2674983b2..06656110f 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,6 +64,10 @@ $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_baduserid'] = '用户ID丢失'; $lang['import_error_badname'] = '名称错误'; $lang['import_error_badmail'] = '邮件地址错误'; |