diff options
26 files changed, 517 insertions, 37 deletions
diff --git a/_test/tests/inc/auth_browseruid.test.php b/_test/tests/inc/auth_browseruid.test.php new file mode 100644 index 000000000..d33552582 --- /dev/null +++ b/_test/tests/inc/auth_browseruid.test.php @@ -0,0 +1,30 @@ +<?php + +class auth_browseruid_test extends DokuWikiTest { + + + /** + * regression test to ensure correct browser id on IE9. + * + * IE9 send different HTTP_ACCEPT_LANGUAGE header on ajax request. + */ + function testIE9JsVsDefault() { + + // javascript request + $_SERVER['HTTP_USER_AGENT'] = 'Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.1; Trident/5.0)'; + $_SERVER['HTTP_ACCEPT_ENCODING'] = 'gzip, deflate'; + $_SERVER['HTTP_ACCEPT_LANGUAGE'] = 'de'; + unset($_SERVER['HTTP_ACCEPT_CHARSET']); + $javascriptId = auth_browseruid(); + + // default request + $_SERVER['HTTP_USER_AGENT'] = 'Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.1; Trident/5.0)'; + $_SERVER['HTTP_ACCEPT_ENCODING'] = 'gzip, deflate'; + $_SERVER['HTTP_ACCEPT_LANGUAGE'] = 'de-DE'; + $normalId = auth_browseruid(); + + $this->assertEquals($normalId, $javascriptId); + + } + +}
\ No newline at end of file diff --git a/_test/tests/inc/common_pageinfo.test.php b/_test/tests/inc/common_pageinfo.test.php new file mode 100644 index 000000000..c54fbce26 --- /dev/null +++ b/_test/tests/inc/common_pageinfo.test.php @@ -0,0 +1,299 @@ +<?php +/** + * Unit Test for inc/common.php - pageinfo() + * + * @author Christopher Smith <chris@jalakai.co.uk> + */ +class common_pageinfo_test extends DokuWikiTest { + + function setup(){ + parent::setup(); + + global $USERINFO; + $USERINFO = array( + 'pass' => '179ad45c6ce2cb97cf1029e212046e81', + 'name' => 'Arthur Dent', + 'mail' => 'arthur@example.com', + 'grps' => array ('admin','user'), + ); + $_SERVER['REMOTE_USER'] = 'testuser'; + $_SERVER['REMOTE_ADDR'] = '1.2.3.4'; + } + + function _get_expected_pageinfo() { + global $USERINFO; + $info = array ( + 'isadmin' => true, + 'ismanager' => true, + 'userinfo' => $USERINFO, + 'perm' => 255, + 'namespace' => false, + 'ismobile' => false, + 'client' => 'testuser', + ); + $info['rev'] = null;
+ $info['subscribed'] = false;
+ $info['locked'] = false;
+ $info['exists'] = false;
+ $info['writable'] = true;
+ $info['editable'] = true;
+ $info['lastmod'] = false;
+ $info['meta'] = array();
+ $info['ip'] = null;
+ $info['user'] = null;
+ $info['sum'] = null;
+ $info['editor'] = null;
+ + return $info; + } + + /** + * check info keys and values for a non-existent page & admin user + */ + function test_basic_nonexistentpage(){ + global $ID,$conf; + $ID = 'wiki:start'; + + $info = $this->_get_expected_pageinfo(); + $info['id'] = 'wiki:start'; + $info['namespace'] = 'wiki'; + $info['filepath'] = $conf['datadir'].'/wiki/start.txt'; + + $this->assertEquals($info, pageinfo()); + } + + /** + * check info keys and values for a existing page & admin user + */ + function test_basic_existingpage(){ + global $ID,$conf; + $ID = 'wiki:syntax'; + $filename = $conf['datadir'].'/wiki/syntax.txt'; + $rev = filemtime($filename); + + $info = $this->_get_expected_pageinfo(); + $info['id'] = 'wiki:syntax';
+ $info['namespace'] = 'wiki'; + $info['filepath'] = $filename; + $info['exists'] = true;
+ $info['lastmod'] = $rev;
+ $info['meta'] = p_get_metadata($ID);
+ + $this->assertEquals($info, pageinfo()); + }
+ + /** + * check info keys and values for anonymous user + */ + function test_anonymoususer(){ + global $ID,$conf,$REV; + + unset($_SERVER['REMOTE_USER']);
+ global $USERINFO; $USERINFO = array();
+ + $ID = 'wiki:syntax'; + $filename = $conf['datadir'].'/wiki/syntax.txt'; + $rev = filemtime($filename); + + $info = $this->_get_expected_pageinfo(); + $info['id'] = 'wiki:syntax'; + $info['namespace'] = 'wiki'; + $info['filepath'] = $filename; + $info['exists'] = true; + $info['lastmod'] = $rev; + $info['meta'] = p_get_metadata($ID); + $info['rev'] = ''; + + $info = array_merge($info, array(
+ 'isadmin' => false,
+ 'ismanager' => false,
+ 'perm' => 8,
+ 'client' => '1.2.3.4',
+ )); + unset($info['userinfo']); + $this->assertEquals($info, pageinfo()); + }
+ + /** + * check info keys and values with $REV + * (also see $RANGE tests) + */ + function test_rev(){ + global $ID,$conf,$REV; + + $ID = 'wiki:syntax'; + $filename = $conf['datadir'].'/wiki/syntax.txt'; + $rev = filemtime($filename); + $REV = $rev - 100; + + $info = $this->_get_expected_pageinfo(); + $info['id'] = 'wiki:syntax'; + $info['namespace'] = 'wiki'; + $info['meta'] = p_get_metadata($ID); + $info['rev'] = $REV; + $info['filepath'] = str_replace('pages','attic',substr($filename,0,-3).$REV.'.txt.gz'); + + $this->assertEquals($info, pageinfo()); + $this->assertEquals($rev-100, $REV); + }
+ + /** + * check info keys and values with $RANGE + */ + function test_range(){ + global $ID,$conf,$REV,$RANGE; + + $ID = 'wiki:syntax'; + $filename = $conf['datadir'].'/wiki/syntax.txt'; + $rev = filemtime($filename); + $range = '1000-2000';
+ + $info = $this->_get_expected_pageinfo(); + $info['id'] = 'wiki:syntax'; + $info['namespace'] = 'wiki'; + $info['exists'] = true; + $info['lastmod'] = $rev; + $info['meta'] = p_get_metadata($ID); + $info['filepath'] = $filename; + + // check $RANGE without $REV + // expected result $RANGE unchanged + $RANGE = $range; + + $this->assertEquals($info, pageinfo());
+ $this->assertFalse(isset($REV)); + $this->assertEquals($range,$RANGE);
+ + // check $RANGE with $REV = current + // expected result: $RANGE unchanged, $REV cleared + $REV = $rev; + $info['rev'] = '';
+ + $this->assertEquals($info, pageinfo());
+ $this->assertEquals('',$REV); + $this->assertEquals($range,$RANGE);
+ + // check with a real $REV + // expected result: $REV and $RANGE are cleared + $REV = $rev - 100; + + $this->assertEquals($info, pageinfo()); + $this->assertEquals('',$REV); + $this->assertEquals('',$RANGE); + } + + /** + * test editor entry and external edit + */ + function test_editor_and_externaledits(){ + global $ID,$conf; + $ID = 'wiki:syntax'; + $filename = $conf['datadir'].'/wiki/syntax.txt'; + $rev = filemtime($filename); + + $info = $this->_get_expected_pageinfo(); + $info['id'] = 'wiki:syntax'; + $info['namespace'] = 'wiki'; + $info['filepath'] = $filename; + $info['exists'] = true; + $info['lastmod'] = $rev; + $info['meta'] = p_get_metadata($ID); // need $INFO set correctly for addLogEntry() + + global $INFO; + $INFO = $info; + + // add an editor for the current version of $ID + addLogEntry($rev, $ID); + + $info['meta'] = p_get_metadata($ID); + $info['editor'] = $_SERVER['REMOTE_USER']; + $info['user'] = $_SERVER['REMOTE_USER']; + $info['ip'] = $_SERVER['REMOTE_ADDR']; + $info['sum'] = ''; + + // with an editor ... + $this->assertEquals($info, pageinfo()); + + // clear the meta['last_change'] value, pageinfo should restore it + p_set_metadata($ID,array('last_change' => false)); + + $this->assertEquals($info, pageinfo()); + $this->assertEquals($info['meta']['last_change'], p_get_metadata($ID,'last_change'));
+ + // fake an external edit, pageinfo should clear the last change from meta data + // and not return any editor data + $now = time()+10; + touch($filename,$now); + + $info['lastmod'] = $now; + $info['meta']['last_change'] = false; + $info['ip'] = null; + $info['user'] = null; + $info['sum'] = null; + $info['editor'] = null; + + $this->assertEquals($info, pageinfo()); + $this->assertEquals($info['meta'], p_get_metadata($ID)); // check metadata has been updated correctly + } + + /** + * check draft + */ + function test_draft(){ + global $ID,$conf; + $ID = 'wiki:syntax'; + $filename = $conf['datadir'].'/wiki/syntax.txt'; + $rev = filemtime($filename); + + $info = $this->_get_expected_pageinfo(); + $info['id'] = 'wiki:syntax'; + $info['namespace'] = 'wiki'; + $info['filepath'] = $filename; + $info['exists'] = true; + $info['lastmod'] = $rev; + $info['meta'] = p_get_metadata($ID); + + // setup a draft, make it more recent than the current page + // - pageinfo should recognise it and keep it + $draft = getCacheName($info['client'].$ID,'.draft'); + touch($draft,$rev + 10); + + $info['draft'] = $draft; + + $this->assertEquals($info, pageinfo()); + $this->assertFileExists($draft); + + // make the draft older than the current page + // - pageinfo should remove it and not return the 'draft' key + touch($draft,$rev - 10); + unset($info['draft']); + + $this->assertEquals($info, pageinfo()); + $this->assertFalse(file_exists($draft)); + } + + /** + * check ismobile + */ + function test_ismobile(){ + global $ID,$conf; + $ID = 'wiki:start'; + + $info = $this->_get_expected_pageinfo(); + $info['id'] = 'wiki:start'; + $info['namespace'] = 'wiki'; + $info['filepath'] = $conf['datadir'].'/wiki/start.txt'; + + // overkill, ripped from clientismobile() as we aren't testing detection - but forcing it + $_SERVER['HTTP_X_WAP_PROFILE'] = 'a fake url'; + $_SERVER['HTTP_ACCEPT'] .= ';wap'; + $_SERVER['HTTP_USER_AGENT'] = 'blackberry,symbian,hand,mobi,phone'; + + $info['ismobile'] = clientismobile(); + + $this->assertTrue(clientismobile()); // ensure THIS test fails if clientismobile() returns false + $this->assertEquals($info, pageinfo()); // it would be a test failure not a pageinfo failure. + } +} + +//Setup VIM: ex: et ts=4 : diff --git a/_test/tests/inc/search/search.test.php b/_test/tests/inc/search/search.test.php index 9c854a661..33d4e9d8d 100644 --- a/_test/tests/inc/search/search.test.php +++ b/_test/tests/inc/search/search.test.php @@ -22,9 +22,9 @@ class search_test extends DokuWikiTest { search($data, dirname(__FILE__) . '/data', 'search_allpages', array('depth' => 1), 'ns1/ns3'); $this->assertEquals(0, count($data)); - //depth is 1 so I should get only pages from ns1 + //depth is 2 so I should get only pages from ns1 $data = array(); - search($data, dirname(__FILE__) . '/data', 'search_allpages', array('depth' => 1), 'ns1'); + search($data, dirname(__FILE__) . '/data', 'search_allpages', array('depth' => 2), 'ns1'); $this->assertEquals(2, count($data)); } diff --git a/data/pages/wiki/syntax.txt b/data/pages/wiki/syntax.txt index 55bbabab2..f2c2864ed 100644 --- a/data/pages/wiki/syntax.txt +++ b/data/pages/wiki/syntax.txt @@ -83,9 +83,9 @@ Windows shares like [[\\server\share|this]] are recognized, too. Please note tha Notes: * For security reasons direct browsing of windows shares only works in Microsoft Internet Explorer per default (and only in the "local zone"). - * For Mozilla and Firefox it can be enabled through different workaround mentioned in the [[http://kb.mozillazine.org/Links_to_local_pages_do_not_work|Mozilla Knowledge Base]]. However, there will still be a JavaScript warning about trying to open a Windows Share. To remove this warning (for all users), put the following line in ''conf/local.protected.php'': + * For Mozilla and Firefox it can be enabled through different workaround mentioned in the [[http://kb.mozillazine.org/Links_to_local_pages_do_not_work|Mozilla Knowledge Base]]. However, there will still be a JavaScript warning about trying to open a Windows Share. To remove this warning (for all users), put the following line in ''conf/userscript.js'': - $lang['js']['nosmblinks'] = ''; + LANG.nosmblinks = ''; ==== Image Links ==== @@ -29,7 +29,7 @@ if(isset($_SERVER['HTTP_X_DOKUWIKI_DO'])) { require_once(DOKU_INC.'inc/init.php'); //import variables -$_REQUEST['id'] = str_replace("\xC2\xAD", '', $INPUT->str('id')); //soft-hyphen +$INPUT->set('id', str_replace("\xC2\xAD", '', $INPUT->str('id'))); //soft-hyphen $QUERY = trim($INPUT->str('id')); $ID = getID(); diff --git a/inc/auth.php b/inc/auth.php index 9566a2615..68b6b438d 100644 --- a/inc/auth.php +++ b/inc/auth.php @@ -54,16 +54,17 @@ function auth_setup() { } } - if(!$auth){ + if(!isset($auth) || !$auth){ msg($lang['authtempfail'], -1); return false; } - if ($auth && $auth->success == false) { + if ($auth->success == false) { // degrade to unauthenticated user unset($auth); auth_logoff(); msg($lang['authtempfail'], -1); + return false; } // do the login either by cookie or provided credentials XXX @@ -91,7 +92,7 @@ function auth_setup() { // apply cleaning if (true === $auth->success) { - $_REQUEST['u'] = $auth->cleanUser($_REQUEST['u']); + $INPUT->set('u', $auth->cleanUser($INPUT->str('u'))); } if($INPUT->str('authtok')) { @@ -311,7 +312,6 @@ function auth_browseruid() { $uid = ''; $uid .= $_SERVER['HTTP_USER_AGENT']; $uid .= $_SERVER['HTTP_ACCEPT_ENCODING']; - $uid .= $_SERVER['HTTP_ACCEPT_LANGUAGE']; $uid .= $_SERVER['HTTP_ACCEPT_CHARSET']; $uid .= substr($ip, 0, strpos($ip, '.')); $uid = strtolower($uid); diff --git a/inc/lang/it/lang.php b/inc/lang/it/lang.php index 307e7292f..92bf5fea8 100644 --- a/inc/lang/it/lang.php +++ b/inc/lang/it/lang.php @@ -205,6 +205,7 @@ $lang['mail_new_user'] = 'nuovo utente:'; $lang['mail_upload'] = 'file caricato:'; $lang['changes_type'] = 'Guarda cambiamenti di'; $lang['pages_changes'] = 'Pagine'; +$lang['media_changes'] = 'File multimediali'; $lang['both_changes'] = 'Sia pagine che media files'; $lang['qb_bold'] = 'Grassetto'; $lang['qb_italic'] = 'Corsivo'; @@ -263,6 +264,8 @@ $lang['subscr_m_unsubscribe'] = 'Rimuovi sottoscrizione'; $lang['subscr_m_subscribe'] = 'Sottoscrivi'; $lang['subscr_m_receive'] = 'Ricevi'; $lang['subscr_style_every'] = 'email per ogni modifica'; +$lang['subscr_style_digest'] = 'email di riassunto dei cambiamenti per ogni pagina (ogni %.2f giorni)'; +$lang['subscr_style_list'] = 'lista delle pagine cambiate dall\'ultima email (ogni %.2f giorni)'; $lang['authmodfailed'] = 'La configurazione dell\'autenticazione non è corretta. Informa l\'amministratore di questo wiki.'; $lang['authtempfail'] = 'L\'autenticazione è temporaneamente non disponibile. Se questa situazione persiste, informa l\'amministratore di questo wiki.'; $lang['authpwdexpire'] = 'La tua password scadrà in %d giorni, dovresti cambiarla quanto prima.'; @@ -290,6 +293,9 @@ $lang['i_pol1'] = 'Wiki Pubblico (lettura per tutti, scrittura e $lang['i_pol2'] = 'Wiki Chiuso (lettura, scrittura, caricamento file solamente per gli utenti registrati)'; $lang['i_retry'] = 'Riprova'; $lang['i_license'] = 'Per favore scegli la licenza sotto cui vuoi rilasciare il contenuto:'; +$lang['i_license_none'] = 'Non mostrare informazioni sulla licenza'; +$lang['i_pop_field'] = 'Per favore, aiutaci ad incrementare la conoscenza di DokuWiki:'; +$lang['i_pop_label'] = 'Mensilmente invia una statistica d\'uso anonima di DokuWiki agli sviluppatori'; $lang['recent_global'] = 'Stai attualmente vedendo le modifiche effettuate nell\'area <b>%s</b>. Puoi anche <a href="%s">vedere le modifiche recenti dell\'intero wiki</a>.'; $lang['years'] = '%d anni fa'; $lang['months'] = '%d mesi fa'; @@ -314,8 +320,10 @@ $lang['media_files'] = 'File in %s'; $lang['media_upload'] = 'Upload al %s'; $lang['media_search'] = 'Cerca in %s'; $lang['media_view'] = '%s'; +$lang['media_viewold'] = '%s a %s'; $lang['media_edit'] = 'Modifica %s'; $lang['media_history'] = 'Storia di %s'; +$lang['media_meta_edited'] = 'metadata modificati'; $lang['media_perm_read'] = 'Spiacente, non hai abbastanza privilegi per leggere i files.'; $lang['media_perm_upload'] = 'Spiacente, non hai abbastanza privilegi per caricare files.'; $lang['media_update'] = 'Carica nuova versione'; diff --git a/inc/lang/zh/lang.php b/inc/lang/zh/lang.php index e6e568cb5..f404010ba 100644 --- a/inc/lang/zh/lang.php +++ b/inc/lang/zh/lang.php @@ -298,6 +298,9 @@ $lang['i_pol1'] = '公共的维基(任何人都有读的权限 $lang['i_pol2'] = '关闭的维基(只有注册用户才有读、写、上传的权限)'; $lang['i_retry'] = '重试'; $lang['i_license'] = '请选择您希望的内容发布许可协议:'; +$lang['i_license_none'] = '不要显示任何许可协议信息'; +$lang['i_pop_field'] = '请帮助我们改进 Dokuwiki 的体验:'; +$lang['i_pop_label'] = '每个月向 Dokuwiki 开发者发送匿名的使用数据'; $lang['recent_global'] = '您当前看到的是<b>%s</b> 名称空间的变动。你还可以在<a href="%s">查看整个维基的近期变动</a>。'; $lang['years'] = '%d年前'; $lang['months'] = '%d月前'; diff --git a/inc/parser/xhtml.php b/inc/parser/xhtml.php index 4dd8c5e78..84a999e56 100644 --- a/inc/parser/xhtml.php +++ b/inc/parser/xhtml.php @@ -889,7 +889,7 @@ class Doku_Renderer_xhtml extends Doku_Renderer { // title is escaped by SimplePie, we unescape here because it // is escaped again in externallink() FS#1705 $this->externallink($item->get_permalink(), - htmlspecialchars_decode($item->get_title())); + html_entity_decode($item->get_title(), ENT_QUOTES, 'UTF-8')); }else{ $this->doc .= ' '.$item->get_title(); } diff --git a/inc/search.php b/inc/search.php index e4aa3b9eb..6927fff5f 100644 --- a/inc/search.php +++ b/inc/search.php @@ -243,8 +243,8 @@ function search_pagename(&$data,$base,$file,$type,$lvl,$opts){ function search_allpages(&$data,$base,$file,$type,$lvl,$opts){ if(isset($opts['depth']) && $opts['depth']){ $parts = explode('/',ltrim($file,'/')); - if(($type == 'd' && count($parts) > $opts['depth']) - || ($type != 'd' && count($parts) > $opts['depth'] + 1)){ + if(($type == 'd' && count($parts) >= $opts['depth']) + || ($type != 'd' && count($parts) > $opts['depth'])){ return false; // depth reached } } diff --git a/inc/template.php b/inc/template.php index 4bfc3f572..415b56de7 100644 --- a/inc/template.php +++ b/inc/template.php @@ -764,7 +764,7 @@ function tpl_searchform($ajax = true, $autocomplete = true) { global $QUERY; // don't print the search form if search action has been disabled - if(!actionOk('search')) return false; + if(!actionOK('search')) return false; print '<form action="'.wl().'" accept-charset="utf-8" class="search" id="dw__search" method="get"><div class="no">'; print '<input type="hidden" name="do" value="search" />'; diff --git a/lib/plugins/authad/auth.php b/lib/plugins/authad/auth.php index f651d87a1..6c49eafbb 100644 --- a/lib/plugins/authad/auth.php +++ b/lib/plugins/authad/auth.php @@ -71,6 +71,7 @@ class auth_plugin_authad extends DokuWiki_Auth_Plugin { * Constructor */ public function __construct() { + global $INPUT; parent::__construct(); // we load the config early to modify it a bit here @@ -99,8 +100,8 @@ class auth_plugin_authad extends DokuWiki_Auth_Plugin { // we need to simulate a login if(empty($_COOKIE[DOKU_COOKIE])) { - $_REQUEST['u'] = $_SERVER['REMOTE_USER']; - $_REQUEST['p'] = 'sso_only'; + $INPUT->set('u', $_SERVER['REMOTE_USER']); + $INPUT->set('p', 'sso_only'); } } diff --git a/lib/plugins/authad/lang/it/settings.php b/lib/plugins/authad/lang/it/settings.php new file mode 100644 index 000000000..10ae72f87 --- /dev/null +++ b/lib/plugins/authad/lang/it/settings.php @@ -0,0 +1,5 @@ +<?php +/** + * Italian language file + * + */ diff --git a/lib/plugins/authad/lang/zh/settings.php b/lib/plugins/authad/lang/zh/settings.php new file mode 100644 index 000000000..9fd3c4e35 --- /dev/null +++ b/lib/plugins/authad/lang/zh/settings.php @@ -0,0 +1,18 @@ +<?php +/** + * Chinese language file + * + * @author lainme <lainme993@gmail.com> + */ +$lang['account_suffix'] = '您的账户后缀。例如 <code>@my.domain.org</code>'; +$lang['base_dn'] = '您的基本分辨名。例如 <code>DC=my,DC=domain,DC=org</code>'; +$lang['domain_controllers'] = '逗号分隔的域名控制器列表。例如 <code>srv1.domain.org,srv2.domain.org</code>'; +$lang['ad_username'] = '一个活动目录的特权用户,可以查看其他所有用户的数据。可选,但对某些活动例如发送订阅邮件是必须的。'; +$lang['ad_password'] = '上述用户的密码。'; +$lang['sso'] = '是否使用经由 Kerberos 和 NTLM 的 Single-Sign-On?'; +$lang['real_primarygroup'] = ' 是否解析真实的主要组,而不是假设为“域用户” (较慢)'; +$lang['use_ssl'] = '使用 SSL 连接?如果是,不要激活下面的 TLS。'; +$lang['use_tls'] = '使用 TLS 连接?如果是 ,不要激活上面的 SSL。'; +$lang['debug'] = '有错误时显示额外的调试信息?'; +$lang['expirywarn'] = '提前多少天警告用户密码即将到期。0 则禁用。'; +$lang['additional'] = '需要从用户数据中获取的额外 AD 属性的列表,以逗号分隔。用于某些插件。'; diff --git a/lib/plugins/authldap/lang/en/settings.php b/lib/plugins/authldap/lang/en/settings.php index 0bb397be5..ddedf8ae3 100644 --- a/lib/plugins/authldap/lang/en/settings.php +++ b/lib/plugins/authldap/lang/en/settings.php @@ -1,14 +1,14 @@ <?php $lang['server'] = 'Your LDAP server. Either hostname (<code>localhost</code>) or full qualified URL (<code>ldap://server.tld:389</code>)'; $lang['port'] = 'LDAP server port if no full URL was given above'; -$lang['usertree'] = 'Where to finde the user accounts. Eg. <code>ou=People, dc=server, dc=tld</code>'; +$lang['usertree'] = 'Where to find the user accounts. Eg. <code>ou=People, dc=server, dc=tld</code>'; $lang['grouptree'] = 'Where to find the user groups. Eg. <code>ou=Group, dc=server, dc=tld</code>'; $lang['userfilter'] = 'LDAP filter to search for user accounts. Eg. <code>(&(uid=%{user})(objectClass=posixAccount))</code>'; $lang['groupfilter'] = 'LDAP filter to search for groups. Eg. <code>(&(objectClass=posixGroup)(|(gidNumber=%{gid})(memberUID=%{user})))</code>'; $lang['version'] = 'The protocol version to use. You may need to set this to <code>3</code>'; $lang['starttls'] = 'Use TLS connections?'; $lang['referrals'] = 'Shall referrals be followed?'; -$lang['binddn'] = 'DN of an ptional bind user if anonymous bind is not sufficient. Eg. <code>cn=admin, dc=my, dc=home</code>'; +$lang['binddn'] = 'DN of an optional bind user if anonymous bind is not sufficient. Eg. <code>cn=admin, dc=my, dc=home</code>'; $lang['bindpw'] = 'Password of above user'; $lang['userscope'] = 'Limit search scope for user search'; $lang['groupscope'] = 'Limit search scope for group search'; diff --git a/lib/plugins/authldap/lang/it/settings.php b/lib/plugins/authldap/lang/it/settings.php new file mode 100644 index 000000000..10ae72f87 --- /dev/null +++ b/lib/plugins/authldap/lang/it/settings.php @@ -0,0 +1,5 @@ +<?php +/** + * Italian language file + * + */ diff --git a/lib/plugins/authldap/lang/zh/settings.php b/lib/plugins/authldap/lang/zh/settings.php new file mode 100644 index 000000000..e84511b42 --- /dev/null +++ b/lib/plugins/authldap/lang/zh/settings.php @@ -0,0 +1,20 @@ +<?php +/** + * Chinese language file + * + * @author lainme <lainme993@gmail.com> + */ +$lang['server'] = '您的 LDAP 服务器。填写主机名 (<code>localhost</code>) 或者完整的 URL (<code>ldap://server.tld:389</code>)'; +$lang['port'] = 'LDAP 服务器端口 (如果上面没有给出完整的 URL)'; +$lang['usertree'] = '何处查找用户账户。例如 <code>ou=People, dc=server, dc=tld</code>'; +$lang['grouptree'] = '何处查找用户组。例如 <code>ou=Group, dc=server, dc=tld</code>'; +$lang['userfilter'] = '用于搜索用户账户的 LDAP 筛选器。例如 <code>(&(uid=%{user})(objectClass=posixAccount))</code>'; +$lang['groupfilter'] = '用于搜索组的 LDAP 筛选器。例如 <code>(&(objectClass=posixGroup)(|(gidNumber=%{gid})(memberUID=%{user})))</code>'; +$lang['version'] = '使用的协议版本。您或许需要设置为 <code>3</code>'; +$lang['starttls'] = '使用 TLS 连接?'; +$lang['referrals'] = '是否允许引用 (referrals)?'; +$lang['binddn'] = '一个可选的绑定用户的 DN (如果匿名绑定不满足要求)。例如 Eg. <code>cn=admin, dc=my, dc=home</code>'; +$lang['bindpw'] = '上述用户的密码'; +$lang['userscope'] = '限制用户搜索的范围'; +$lang['groupscope'] = '限制组搜索的范围'; +$lang['debug'] = '有错误时显示额外的调试信息'; diff --git a/lib/plugins/authmysql/lang/it/settings.php b/lib/plugins/authmysql/lang/it/settings.php new file mode 100644 index 000000000..10ae72f87 --- /dev/null +++ b/lib/plugins/authmysql/lang/it/settings.php @@ -0,0 +1,5 @@ +<?php +/** + * Italian language file + * + */ diff --git a/lib/plugins/authmysql/lang/zh/settings.php b/lib/plugins/authmysql/lang/zh/settings.php new file mode 100644 index 000000000..43cfbb3c0 --- /dev/null +++ b/lib/plugins/authmysql/lang/zh/settings.php @@ -0,0 +1,40 @@ +<?php +/** + * Chinese language file + * + * @author lainme <lainme993@gmail.com> + */ +$lang['server'] = '您的 MySQL 服务器'; +$lang['user'] = 'MySQL 用户名'; +$lang['password'] = '上述用户的密码'; +$lang['database'] = '使用的数据库'; +$lang['debug'] = '显示额外调试信息'; +$lang['forwardClearPass'] = '将用户密码以明文形式传送给下面的 SQL 语句,而不使用 passcrypt 密码加密选项'; +$lang['TablesToLock'] = '在写操作时需要锁定的数据表列表,以逗号分隔'; +$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['UpdateLogin'] = '更新用户登录名的 Update 子句'; +$lang['UpdatePass'] = '更新用户密码的 Update 子句'; +$lang['UpdateEmail'] = '更新用户电子邮件地址的 Update 子句'; +$lang['UpdateName'] = '更新用户全名的 Update 子句'; +$lang['UpdateTarget'] = '更新时识别用户的 Limit 子句'; +$lang['delUserGroup'] = '从指定组删除用户的 SQL 语句'; +$lang['getGroupID'] = '获取指定组主键的 SQL 语句'; +$lang['debug_o_0'] = '无'; +$lang['debug_o_1'] = '仅在有错误时'; +$lang['debug_o_2'] = '所有 SQL 查询'; diff --git a/lib/plugins/authpgsql/lang/en/settings.php b/lib/plugins/authpgsql/lang/en/settings.php index 74a1c1cc9..8c048fa0f 100644 --- a/lib/plugins/authpgsql/lang/en/settings.php +++ b/lib/plugins/authpgsql/lang/en/settings.php @@ -20,7 +20,7 @@ $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['delGroup'] = 'SQL statement to remove a group'; -$lang['getUserID'] = 'SQL statement to get the primary ey of a user'; +$lang['getUserID'] = 'SQL statement to get the primary key of a user'; $lang['delUser'] = 'SQL statement to delete a user'; $lang['delUserRefs'] = 'SQL statement to remove a user from all groups'; $lang['updateUser'] = 'SQL statement to update a user profile'; diff --git a/lib/plugins/authpgsql/lang/it/settings.php b/lib/plugins/authpgsql/lang/it/settings.php new file mode 100644 index 000000000..10ae72f87 --- /dev/null +++ b/lib/plugins/authpgsql/lang/it/settings.php @@ -0,0 +1,5 @@ +<?php +/** + * Italian language file + * + */ diff --git a/lib/plugins/authpgsql/lang/zh/settings.php b/lib/plugins/authpgsql/lang/zh/settings.php new file mode 100644 index 000000000..dc7223d89 --- /dev/null +++ b/lib/plugins/authpgsql/lang/zh/settings.php @@ -0,0 +1,37 @@ +<?php +/** + * Chinese language file + * + * @author lainme <lainme993@gmail.com> + */ +$lang['server'] = '您的 PostgreSQL 服务器'; +$lang['port'] = '您的 PostgreSQL 服务器端口'; +$lang['user'] = 'PostgreSQL 用户名'; +$lang['password'] = '上述用户的密码'; +$lang['database'] = '使用的数据库'; +$lang['debug'] = '显示额外调试信息'; +$lang['forwardClearPass'] = '将用户密码以明文形式传送给下面的 SQL 语句,而不使用 passcrypt 密码加密选项'; +$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['UpdateLogin'] = '更新用户登录名的 Update 子句'; +$lang['UpdatePass'] = '更新用户密码的 Update 子句'; +$lang['UpdateEmail'] = '更新用户电子邮件地址的 Update 子句'; +$lang['UpdateName'] = '更新用户全名的 Update 子句'; +$lang['UpdateTarget'] = '更新时识别用户的 Limit 子句'; +$lang['delUserGroup'] = '从指定组删除用户的 SQL 语句'; +$lang['getGroupID'] = '获取指定组主键的 SQL 语句'; diff --git a/lib/plugins/config/lang/it/lang.php b/lib/plugins/config/lang/it/lang.php index 751e5ee95..62dd00f0c 100644 --- a/lib/plugins/config/lang/it/lang.php +++ b/lib/plugins/config/lang/it/lang.php @@ -39,6 +39,7 @@ $lang['_editing'] = 'Impostazioni Modifica'; $lang['_links'] = 'Impostazioni Collegamenti'; $lang['_media'] = 'Impostazioni File'; $lang['_notifications'] = 'Impostazioni di notifica'; +$lang['_syndication'] = 'Impostazioni di collaborazione'; $lang['_advanced'] = 'Impostazioni Avanzate'; $lang['_network'] = 'Impostazioni Rete'; $lang['_plugin_sufix'] = 'Impostazioni Plugin'; diff --git a/lib/plugins/plugin/admin.php b/lib/plugins/plugin/admin.php index 8b1ee3c7d..de4de6aef 100644 --- a/lib/plugins/plugin/admin.php +++ b/lib/plugins/plugin/admin.php @@ -61,11 +61,12 @@ class admin_plugin_plugin extends DokuWiki_Admin_Plugin { * handle user request */ function handle() { + global $INPUT; // enable direct access to language strings $this->setupLocale(); - $fn = $_REQUEST['fn']; + $fn = $INPUT->param('fn'); if (is_array($fn)) { $this->cmd = key($fn); $this->plugin = is_array($fn[$this->cmd]) ? key($fn[$this->cmd]) : null; diff --git a/lib/plugins/revert/admin.php b/lib/plugins/revert/admin.php index fcdaa230d..847e38876 100644 --- a/lib/plugins/revert/admin.php +++ b/lib/plugins/revert/admin.php @@ -44,15 +44,16 @@ class admin_plugin_revert extends DokuWiki_Admin_Plugin { * output appropriate html */ function html() { + global $INPUT; echo $this->plugin_locale_xhtml('intro'); $this->_searchform(); - if(is_array($_REQUEST['revert']) && checkSecurityToken()){ - $this->_revert($_REQUEST['revert'],$_REQUEST['filter']); - }elseif(isset($_REQUEST['filter'])){ - $this->_list($_REQUEST['filter']); + if(is_array($INPUT->param('revert')) && checkSecurityToken()){ + $this->_revert($INPUT->arr('revert'),$INPUT->str('filter')); + }elseif($INPUT->has('filter')){ + $this->_list($INPUT->str('filter')); } } @@ -60,10 +61,10 @@ class admin_plugin_revert extends DokuWiki_Admin_Plugin { * Display the form for searching spam pages */ function _searchform(){ - global $lang; + global $lang, $INPUT; echo '<form action="" method="post"><div class="no">'; echo '<label>'.$this->getLang('filter').': </label>'; - echo '<input type="text" name="filter" class="edit" value="'.hsc($_REQUEST['filter']).'" />'; + echo '<input type="text" name="filter" class="edit" value="'.hsc($INPUT->str('filter')).'" />'; echo ' <input type="submit" class="button" value="'.$lang['btn_search'].'" />'; echo ' <span>'.$this->getLang('note1').'</span>'; echo '</div></form><br /><br />'; diff --git a/lib/plugins/usermanager/admin.php b/lib/plugins/usermanager/admin.php index cf8963e64..01f4a4cdb 100644 --- a/lib/plugins/usermanager/admin.php +++ b/lib/plugins/usermanager/admin.php @@ -73,11 +73,12 @@ class admin_plugin_usermanager extends DokuWiki_Admin_Plugin { * handle user request */ function handle() { + global $INPUT; if (is_null($this->_auth)) return false; // extract the command and any specific parameters // submit button name is of the form - fn[cmd][param(s)] - $fn = $_REQUEST['fn']; + $fn = $INPUT->param('fn'); if (is_array($fn)) { $cmd = key($fn); @@ -88,8 +89,7 @@ class admin_plugin_usermanager extends DokuWiki_Admin_Plugin { } if ($cmd != "search") { - if (!empty($_REQUEST['start'])) - $this->_start = $_REQUEST['start']; + $this->_start = $INPUT->int('start', 0); $this->_filter = $this->_retrieveFilter(); } @@ -345,6 +345,7 @@ class admin_plugin_usermanager extends DokuWiki_Admin_Plugin { } function _addUser(){ + global $INPUT; if (!checkSecurityToken()) return false; if (!$this->_auth->canDo('addUser')) return false; @@ -353,7 +354,7 @@ class admin_plugin_usermanager extends DokuWiki_Admin_Plugin { if ($this->_auth->canDo('modPass')){ if (empty($pass)){ - if(!empty($_REQUEST['usernotify'])){ + if($INPUT->has('usernotify')){ $pass = auth_pwgen(); } else { msg($this->lang['add_fail'], -1); @@ -393,7 +394,7 @@ class admin_plugin_usermanager extends DokuWiki_Admin_Plugin { msg($this->lang['add_ok'], 1); - if (!empty($_REQUEST['usernotify']) && $pass) { + if ($INPUT->has('usernotify') && $pass) { $this->_notifyUser($user,$pass); } } else { @@ -407,13 +408,13 @@ class admin_plugin_usermanager extends DokuWiki_Admin_Plugin { * Delete user */ function _deleteUser(){ - global $conf; + global $conf, $INPUT; if (!checkSecurityToken()) return false; if (!$this->_auth->canDo('delUser')) return false; - $selected = $_REQUEST['delete']; - if (!is_array($selected) || empty($selected)) return false; + $selected = $INPUT->arr('delete'); + if (empty($selected)) return false; $selected = array_keys($selected); if(in_array($_SERVER['REMOTE_USER'], $selected)) { @@ -463,13 +464,13 @@ class admin_plugin_usermanager extends DokuWiki_Admin_Plugin { * Modify user (modified user data has been recieved) */ function _modifyUser(){ - global $conf; + global $conf, $INPUT; if (!checkSecurityToken()) return false; if (!$this->_auth->canDo('UserMod')) return false; // get currently valid user data - $olduser = cleanID(preg_replace('/.*:/','',$_REQUEST['userid_old'])); + $olduser = cleanID(preg_replace('/.*:/','',$INPUT->str('userid_old'))); $oldinfo = $this->_auth->getUserData($olduser); // get new user data subject to change @@ -494,7 +495,7 @@ class admin_plugin_usermanager extends DokuWiki_Admin_Plugin { } // generate password if left empty and notification is on - if(!empty($_REQUEST['usernotify']) && empty($newpass)){ + if($INPUT->has('usernotify') && empty($newpass)){ $newpass = auth_pwgen(); } @@ -510,7 +511,7 @@ class admin_plugin_usermanager extends DokuWiki_Admin_Plugin { if ($ok = $this->_auth->triggerUserMod('modify', array($olduser, $changes))) { msg($this->lang['update_ok'],1); - if (!empty($_REQUEST['usernotify']) && $newpass) { + if ($INPUT->has('usernotify') && $newpass) { $notify = empty($changes['user']) ? $olduser : $newuser; $this->_notifyUser($notify,$newpass); } |