diff --git a/action.php b/action.php index eeba8c1..4a49791 100644 --- a/action.php +++ b/action.php @@ -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)); } diff --git a/conf/default.php b/conf/default.php index ce21064..11e70da 100644 --- a/conf/default.php +++ b/conf/default.php @@ -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'; diff --git a/conf/metadata.php b/conf/metadata.php index 92ddd1b..5e063a7 100644 --- a/conf/metadata.php +++ b/conf/metadata.php @@ -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'); diff --git a/lang/en/settings.php b/lang/en/settings.php index ec3ba2e..ef352b0 100644 --- a/lang/en/settings.php +++ b/lang/en/settings.php @@ -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'; diff --git a/lang/fr/settings.php b/lang/fr/settings.php index f836f8a..b9fefeb 100644 --- a/lang/fr/settings.php +++ b/lang/fr/settings.php @@ -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';