Changed redirections to hopefully fix infinite loop

This commit is contained in:
Simon DELAGE 2015-06-18 09:14:39 +02:00
parent a8323791cf
commit f97060f118
2 changed files with 7 additions and 4 deletions

View file

@ -121,13 +121,16 @@ class action_plugin_userhomepage extends DokuWiki_Action_Plugin{
}
// If Public page was just created, redirect to it and edit (or show)
if ($created['public']) {
send_redirect(wl($this->public_page, 'do='.$this->getConf('action'), false, '&'));
// send_redirect(wl($this->public_page, 'do='.$this->getConf('action'), false, '&'));
send_redirect(wl($this->public_page, array('do='.$this->getConf('action')), true));
// Else if private start page was just created and edit option is set, redirect to it and edit
} elseif (($created['private']) && ($this->getConf('edit_before_create'))) {
send_redirect(wl($this->private_page, 'do='.$this->getConf('action'), false, '&'));
// send_redirect(wl($this->private_page, 'do='.$this->getConf('action'), false, '&'));
send_redirect(wl($this->private_page, array('do='.$this->getConf('action')), true));
// Else if user's private page exists AND [(user isn't requesting a specific page OR he's requesting wiki start page) AND logged in 2sec ago max]
} elseif ((page_exists($this->private_page)) && (((!isset($_GET['id'])) or (in_array($_GET['id'], $wikistart))) && (time()-$_SESSION["uhptimestamp"] <= 2))) {
send_redirect(wl($this->private_page));
// send_redirect(wl($this->private_page));
send_redirect(wl($this->private_page, '', true));
}
}
}

View file

@ -1,7 +1,7 @@
base userhomepage
author Simon Delage
email simon.geekitude@gmail.com
date 2015-06-13
date 2015-06-18
name User Homepage
desc Automatically create user's private namespace and/or public page and redirects users to private namespace on login.
url https://www.dokuwiki.org/plugin:userhomepage