Added an option to disable redirection

This commit is contained in:
Simon DELAGE 2015-08-20 00:35:29 +02:00
parent 798861e9bc
commit 9b4bfd546d
5 changed files with 6 additions and 2 deletions

View File

@ -129,8 +129,8 @@ class action_plugin_userhomepage extends DokuWiki_Action_Plugin{
} elseif (($created['private']) && (page_exists($this->private_page)) && ($this->getConf('edit_before_create'))) {
// 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))) {
// Else if redirection is enabled and 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 (($this->getConf('redirection')) && (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, '', true));
}

View File

@ -23,6 +23,7 @@
$conf['acl_all_templates'] = '1';
$conf['acl_user_templates'] = '1';
$conf['no_acl'] = 0;
$conf['redirection'] = 1;
$conf['action'] = 'edit';
$conf['userlink_replace'] = 1;
$conf['userlink_classes'] = 'interwiki wikilink1';

View File

@ -23,6 +23,7 @@
$meta['acl_all_templates'] = array('multichoice','_choices'=>array('0','1','2','noacl'));
$meta['acl_user_templates'] = array('multichoice','_choices'=>array('0','1','2','noacl'));
$meta['no_acl'] = array('onoff');
$meta['redirection'] = array('onoff');
$meta['action'] = array('multichoice','_choices'=>array('edit','show'));
$meta['userlink_replace'] = array('onoff');
$meta['userlink_classes'] = array('string');

View File

@ -53,6 +53,7 @@
$lang['acl_user_templates_o_2'] = 'Edit';
$lang['acl_user_templates_o_noacl'] = 'No automatic ACL';
$lang['no_acl'] = 'No automated ACL setting at all but you\'ll have to remove those created so far manually. Don\'t forget to set some ACL on templates.';
$lang['redirection'] = 'Enable redirection (even if disabled, it will still occur on pages creation).';
$lang['action'] = 'Action on first redirection to public page after it\'s creation (or private namespace start page).';
$lang['action_o_edit'] = 'Edit (Default)';
$lang['action_o_show'] = 'Show';

View File

@ -53,6 +53,7 @@
$lang['acl_user_templates_o_2'] = 'Écriture';
$lang['acl_user_templates_o_noacl'] = 'Pas de gestion automatique des droits';
$lang['no_acl'] = 'Aucun règlage automatique des droits d\'accès mais vous devrez nettoyer manuellement les règles déjà créées. Pensez à protéger les modèles.';
$lang['redirection'] = 'Activer la redirection (même désactivée, elle aura tout de même lieu lors de la création des pages).';
$lang['action'] = 'Action à la première redirection vers la page publique après sa création (ou la page d\'accueil de l\'espace de nom privé).';
$lang['action_o_edit'] = 'Editer (Défaut)';
$lang['action_o_show'] = 'Afficher';