summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--conf/dokuwiki.php1
-rw-r--r--inc/auth.php3
-rw-r--r--lib/plugins/config/lang/en/lang.php1
-rw-r--r--lib/plugins/config/settings/config.metadata.php1
4 files changed, 6 insertions, 0 deletions
diff --git a/conf/dokuwiki.php b/conf/dokuwiki.php
index f6c595e18..d0ad4f4f7 100644
--- a/conf/dokuwiki.php
+++ b/conf/dokuwiki.php
@@ -68,6 +68,7 @@ $conf['manager'] = '!!not set!!'; //The manager can be user or @group
$conf['profileconfirm'] = '1'; //Require current password to confirm changes to user profile
$conf['disableactions'] = ''; //comma separated list of actions to disable
$conf['sneaky_index'] = 0; //check for namespace read permission in index view (0|1) (1 might cause unexpected behavior)
+$conf['auth_security_timeout'] = 900; //time (seconds) auth data is considered valid, set to 0 to recheck on every page view
/* Advanced Options */
diff --git a/inc/auth.php b/inc/auth.php
index 7b3f23bf3..6e9a2908f 100644
--- a/inc/auth.php
+++ b/inc/auth.php
@@ -138,6 +138,8 @@ function auth_login($user,$pass,$sticky=false,$silent=false){
$_SESSION[DOKU_COOKIE]['auth']['pass'] = $pass;
$_SESSION[DOKU_COOKIE]['auth']['buid'] = auth_browseruid();
$_SESSION[DOKU_COOKIE]['auth']['info'] = $USERINFO;
+ $_SESSION[DOKU_COOKIE]['auth']['time'] = time();
+
return true;
}else{
//invalid credentials - log off
@@ -154,6 +156,7 @@ function auth_login($user,$pass,$sticky=false,$silent=false){
if($user && $pass){
// we got a cookie - see if we can trust it
if(isset($session) &&
+ ($session['time'] >= time()-$conf['auth_security_timeout']) &&
($session['user'] == $user) &&
($session['pass'] == $pass) && //still crypted
($session['buid'] == auth_browseruid()) ){
diff --git a/lib/plugins/config/lang/en/lang.php b/lib/plugins/config/lang/en/lang.php
index 815d4a9cc..ad03c95d1 100644
--- a/lib/plugins/config/lang/en/lang.php
+++ b/lib/plugins/config/lang/en/lang.php
@@ -97,6 +97,7 @@ $lang['disableactions_subscription'] = 'Subscribe/Unsubscribe';
$lang['disableactions_wikicode'] = 'View source/Export Raw';
$lang['disableactions_other'] = 'Other actions (comma separated)';
$lang['sneaky_index'] = 'By default, DokuWiki will show all namespaces in the index view. Enabling this option will hide those where the user doesn\'t have read permissions. This might result in hiding of accessable subnamespaces. This may make the index unusable with certain ACL setups.';
+$lang['auth_security_timeout'] = 'Authentication Security Timeout (seconds)';
/* Advanced Options */
$lang['updatecheck'] = 'Check for updates and security warnings? DokuWiki needs to contact splitbrain.org for this feature.';
diff --git a/lib/plugins/config/settings/config.metadata.php b/lib/plugins/config/settings/config.metadata.php
index dd7a6c874..7aecf43ef 100644
--- a/lib/plugins/config/settings/config.metadata.php
+++ b/lib/plugins/config/settings/config.metadata.php
@@ -118,6 +118,7 @@ $meta['disableactions'] = array('disableactions',
'_choices' => array('backlink','index','recent','revisions','search','subscription','register','resendpwd','profile','edit','wikicode','check'),
'_combine' => array('subscription' => array('subscribe','unsubscribe'), 'wikicode' => array('source','export_raw')));
$meta['sneaky_index'] = array('onoff');
+$meta['auth_security_timeout'] = array('numeric');
$meta['_anti_spam'] = array('fieldset');
$meta['usewordblock']= array('onoff');