summaryrefslogtreecommitdiff
path: root/inc
diff options
context:
space:
mode:
Diffstat (limited to 'inc')
-rw-r--r--inc/auth.php14
-rw-r--r--inc/common.php2
-rw-r--r--inc/fulltext.php2
-rw-r--r--inc/init.php12
-rw-r--r--inc/lang/ta/lang.php7
-rw-r--r--inc/lang/zh/lang.php2
6 files changed, 26 insertions, 13 deletions
diff --git a/inc/auth.php b/inc/auth.php
index e224b2fb5..e938830ef 100644
--- a/inc/auth.php
+++ b/inc/auth.php
@@ -95,9 +95,10 @@ function auth_setup() {
$INPUT->set('http_credentials', true);
}
- // apply cleaning
+ // apply cleaning (auth specific user names, remove control chars)
if (true === $auth->success) {
- $INPUT->set('u', $auth->cleanUser($INPUT->str('u')));
+ $INPUT->set('u', $auth->cleanUser(stripctl($INPUT->str('u'))));
+ $INPUT->set('p', stripctl($INPUT->str('p')));
}
if($INPUT->str('authtok')) {
@@ -228,7 +229,7 @@ function auth_login($user, $pass, $sticky = false, $silent = false) {
if(!empty($user)) {
//usual login
- if($auth->checkPass($user, $pass)) {
+ if(!empty($pass) && $auth->checkPass($user, $pass)) {
// make logininfo globally available
$INPUT->server->set('REMOTE_USER', $user);
$secret = auth_cookiesalt(!$sticky, true); //bind non-sticky to session
@@ -638,6 +639,7 @@ function auth_isMember($memberlist, $user, array $groups) {
// compare cleaned values
foreach($members as $member) {
+ if($member == '@ALL' ) return true;
if(!$auth->isCaseSensitive()) $member = utf8_strtolower($member);
if($member[0] == '@') {
$member = $auth->cleanGroup(substr($member, 1));
@@ -922,7 +924,7 @@ function auth_sendPassword($user, $password) {
if(!$auth) return false;
$user = $auth->cleanUser($user);
- $userinfo = $auth->getUserData($user);
+ $userinfo = $auth->getUserData($user, $requireGroups = false);
if(!$userinfo['mail']) return false;
@@ -1184,7 +1186,7 @@ function act_resendpwd() {
}
$user = io_readfile($tfile);
- $userinfo = $auth->getUserData($user);
+ $userinfo = $auth->getUserData($user, $requireGroups = false);
if(!$userinfo['mail']) {
msg($lang['resendpwdnouser'], -1);
return false;
@@ -1236,7 +1238,7 @@ function act_resendpwd() {
$user = trim($auth->cleanUser($INPUT->post->str('login')));
}
- $userinfo = $auth->getUserData($user);
+ $userinfo = $auth->getUserData($user, $requireGroups = false);
if(!$userinfo['mail']) {
msg($lang['resendpwdnouser'], -1);
return false;
diff --git a/inc/common.php b/inc/common.php
index 503155c46..e56285f62 100644
--- a/inc/common.php
+++ b/inc/common.php
@@ -1583,7 +1583,7 @@ function shorten($keep, $short, $max, $min = 9, $char = '…') {
}
/**
- * Return the users realname or e-mail address for use
+ * Return the users real name or e-mail address for use
* in page footer and recent changes pages
*
* @param string|null $username or null when currently logged-in user should be used
diff --git a/inc/fulltext.php b/inc/fulltext.php
index dd918f214..aaef090e1 100644
--- a/inc/fulltext.php
+++ b/inc/fulltext.php
@@ -215,7 +215,7 @@ function ft_pageLookup($id, $in_ns=false, $in_title=false){
function _ft_pageLookup(&$data){
// split out original parameters
$id = $data['id'];
- if (preg_match('/(?:^| )@(\w+)/', $id, $matches)) {
+ if (preg_match('/(?:^| )(?:@|ns:)([\w:]+)/', $id, $matches)) {
$ns = cleanID($matches[1]) . ':';
$id = str_replace($matches[0], '', $id);
}
diff --git a/inc/init.php b/inc/init.php
index 4ff239787..d825b5250 100644
--- a/inc/init.php
+++ b/inc/init.php
@@ -456,10 +456,6 @@ function getBaseURL($abs=null){
$port = '';
}
- if(!$port && isset($_SERVER['SERVER_PORT'])) {
- $port = $_SERVER['SERVER_PORT'];
- }
-
if(is_null($port)){
$port = '';
}
@@ -490,6 +486,14 @@ function getBaseURL($abs=null){
* @returns bool true when SSL is active
*/
function is_ssl(){
+ // check if we are behind a reverse proxy
+ if (isset($_SERVER['HTTP_X_FORWARDED_PROTO'])) {
+ if ($_SERVER['HTTP_X_FORWARDED_PROTO'] == 'https') {
+ return true;
+ } else {
+ return false;
+ }
+ }
if (!isset($_SERVER['HTTPS']) ||
preg_match('/^(|off|false|disabled)$/i',$_SERVER['HTTPS'])){
return false;
diff --git a/inc/lang/ta/lang.php b/inc/lang/ta/lang.php
index 4a1da3531..a5b89527a 100644
--- a/inc/lang/ta/lang.php
+++ b/inc/lang/ta/lang.php
@@ -10,7 +10,7 @@ $lang['btn_show'] = 'பக்கத்தை காண்பி ';
$lang['btn_create'] = 'இந்த பக்கத்தை உருவாக்கு ';
$lang['btn_search'] = 'தேடு';
$lang['btn_save'] = 'சேமி ';
-$lang['btn_revs'] = 'old திருத்தங்கள்';
+$lang['btn_revs'] = 'பழைய திருத்தங்கள்';
$lang['btn_recent'] = 'சமீபத்திய மாற்றங்கள்';
$lang['btn_upload'] = 'பதிவேற்று';
$lang['btn_cancel'] = 'ரத்து';
@@ -30,3 +30,8 @@ $lang['fullname'] = 'உண்மையான பெயர்';
$lang['email'] = 'மின்னஞ்சல்';
$lang['profile'] = 'பயன்படுத்துபவர் விவரம்';
$lang['minoredit'] = 'சிறிய மாற்றங்கள்';
+$lang['media_historytab'] = 'வரலாறு';
+$lang['media_list_rows'] = 'வரிசைகள் ';
+$lang['media_sort_name'] = 'பெயர் ';
+$lang['media_sort_date'] = 'தேதி ';
+$lang['media_namespaces'] = 'பெயர்வெளியை தேர்வுசெய் ';
diff --git a/inc/lang/zh/lang.php b/inc/lang/zh/lang.php
index c8a76b66b..797a9b7a1 100644
--- a/inc/lang/zh/lang.php
+++ b/inc/lang/zh/lang.php
@@ -23,6 +23,7 @@
* @author Cupen <Cupenoruler@foxmail.com>
* @author xiqingongzi <Xiqingongzi@Gmail.com>
* @author qinghao <qingxianhao@gmail.com>
+ * @author Yuwei Sun <yuwei@hrz.tu-chemnitz.de>
*/
$lang['encoding'] = 'utf-8';
$lang['direction'] = 'ltr';
@@ -302,6 +303,7 @@ $lang['i_modified'] = '由于安全上的考虑,该脚本只能用
<a href="http://dokuwiki.org/install">Dokuwiki 安装指南</a>';
$lang['i_funcna'] = 'PHP 功能 <code>%s</code> 无法使用。也许您的服务器提供商因为某些原因禁用了它。';
$lang['i_phpver'] = '您的 PHP 版本 <code>%s</code> 低于最低要求的 <code>%s</code>。您需要升级您的 PHP 版本。';
+$lang['i_mbfuncoverload'] = '为了运行DocuWiki,您必须在php.ini中禁用mbstring.func_overload。';
$lang['i_permfail'] = 'DokuWiki 无法写入 <code>%s</code>。您需要修改该路径的权限设定!';
$lang['i_confexists'] = '<code>%s</code> 已经存在';
$lang['i_writeerr'] = '无法创建 <code>%s</code>。您需要检查该路径/文件的权限设定并手动创建该文件。';