Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enable to keep current page after logout instead of redirect to login #3566

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
1 change: 1 addition & 0 deletions conf/dokuwiki.php
Expand Up @@ -66,6 +66,7 @@
$conf['securecookie'] = 1; //never send HTTPS cookies via HTTP
$conf['remote'] = 0; //Enable/disable remote interfaces
$conf['remoteuser'] = '!!not set!!'; //user/groups that have access to remote interface (comma separated). leave empty to allow all users
$conf['redirect_to_login_after_logout'] = 1; //Redirect to login page (1) or keep current page (0) after logout

/* Antispam Features */
$conf['usewordblock']= 1; //block spam based on words? 0|1
Expand Down
7 changes: 6 additions & 1 deletion inc/Action/Logout.php
Expand Up @@ -32,6 +32,7 @@ public function checkPreconditions() {
public function preProcess() {
global $ID;
global $INPUT;
global $conf;

if (!checkSecurityToken()) throw new ActionException();

Expand All @@ -43,7 +44,11 @@ public function preProcess() {

// do the logout stuff and redirect to login
auth_logoff();
send_redirect(wl($ID, array('do' => 'login'), true, '&'));
$parameters = array();
if ($conf['redirect_to_login_after_logout']) {
$parameters['do'] = 'login';
}
send_redirect(wl($ID, $parameters, true, '&'));

// should never be reached
throw new ActionException('login');
Expand Down
1 change: 1 addition & 0 deletions lib/plugins/config/lang/en/lang.php
Expand Up @@ -108,6 +108,7 @@
$lang['securecookie'] = 'Should cookies set via HTTPS only be sent via HTTPS by the browser? Disable this option when only the login of your wiki is secured with SSL but browsing the wiki is done unsecured.';
$lang['remote'] = 'Enable the remote API system. This allows other applications to access the wiki via XML-RPC or other mechanisms.';
$lang['remoteuser'] = 'Restrict remote API access to the comma separated groups or users given here. Leave empty to give access to everyone.';
$lang['redirect_to_login_after_logout'] = 'Redirect to login page after logout, otherwise keep current page.';

/* Anti-Spam Settings */
$lang['usewordblock']= 'Block spam based on wordlist';
Expand Down
1 change: 1 addition & 0 deletions lib/plugins/config/settings/config.metadata.php
Expand Up @@ -160,6 +160,7 @@
$meta['securecookie'] = array('onoff');
$meta['remote'] = array('onoff','_caution' => 'security');
$meta['remoteuser'] = array('string');
$meta['redirect_to_login_after_logout'] = array('onoff');

$meta['_anti_spam'] = array('fieldset');
$meta['usewordblock']= array('onoff');
Expand Down