From dd63a6a2ab7152ccdcc80bf19e401603606464d3 Mon Sep 17 00:00:00 2001 From: Sarjuuk Date: Thu, 4 May 2017 02:29:59 +0200 Subject: [PATCH] Accounts * added config option for external recovery & creation * fixed typos in contribute brick for locale 2 --- pages/account.php | 28 +++++++++++++++++++++++----- setup/updates/1493857753_01.sql | 3 +++ template/localized/contrib_2.tpl.php | 4 ++-- 3 files changed, 28 insertions(+), 7 deletions(-) create mode 100644 setup/updates/1493857753_01.sql diff --git a/pages/account.php b/pages/account.php index c3ff6835..707147f0 100644 --- a/pages/account.php +++ b/pages/account.php @@ -73,8 +73,13 @@ class AccountPage extends GenericPage switch ($this->category[0]) { case 'forgotpassword': - if (CFG_ACC_AUTH_MODE != AUTH_MODE_SELF) // only recover own accounts - $this->error(); + if (CFG_ACC_AUTH_MODE != AUTH_MODE_SELF) + { + if (CFG_ACC_EXT_RECOVER_URL) + header('Location: '.CFG_ACC_EXT_RECOVER_URL, true, 302); + else + $this->error(); + } $this->tpl = 'acc-recover'; $this->resetPass = false; @@ -85,8 +90,13 @@ class AccountPage extends GenericPage $this->head = sprintf(Lang::account('recoverPass'), $nStep); break; case 'forgotusername': - if (CFG_ACC_AUTH_MODE != AUTH_MODE_SELF) // only recover own accounts - $this->error(); + if (CFG_ACC_AUTH_MODE != AUTH_MODE_SELF) + { + if (CFG_ACC_EXT_RECOVER_URL) + header('Location: '.CFG_ACC_EXT_RECOVER_URL, true, 302); + else + $this->error(); + } $this->tpl = 'acc-recover'; $this->resetPass = false; @@ -123,9 +133,17 @@ class AccountPage extends GenericPage break; case 'signup': - if (!CFG_ACC_ALLOW_REGISTER || CFG_ACC_AUTH_MODE != AUTH_MODE_SELF) + if (!CFG_ACC_ALLOW_REGISTER) $this->error(); + if (CFG_ACC_AUTH_MODE != AUTH_MODE_SELF) + { + if (CFG_ACC_EXT_CREATE_URL) + header('Location: '.CFG_ACC_EXT_CREATE_URL, true, 302); + else + $this->error(); + } + $this->tpl = 'acc-signUp'; $nStep = 1; if ($this->_post['username'] || $this->_post['password'] || $this->_post['c_password'] || $this->_post['email']) diff --git a/setup/updates/1493857753_01.sql b/setup/updates/1493857753_01.sql new file mode 100644 index 00000000..0358020b --- /dev/null +++ b/setup/updates/1493857753_01.sql @@ -0,0 +1,3 @@ +REPLACE INTO aowow_config VALUES + ('acc_ext_create_url', '', 3, 0x88, 'default: - if auth mode is not self; link to external account creation'), + ('acc_ext_recover_url', '', 3, 0x88, 'default: - if auth mode is not self; link to external account recovery'); diff --git a/template/localized/contrib_2.tpl.php b/template/localized/contrib_2.tpl.php index 632daf71..51655aaa 100644 --- a/template/localized/contrib_2.tpl.php +++ b/template/localized/contrib_2.tpl.php @@ -56,7 +56,7 @@ endif; if (!User::$id): ?> - Vous n'êtes pas connecté(e). Veuillez vous connecter pour envoyer une capture d'écran. + Vous n'êtes pas connecté(e). Veuillez vous connecter pour envoyer une capture d'écran. @@ -83,7 +83,7 @@ endif; if (!User::$id): ?> - Vous n'êtes pas connecté(e). Veuillez vous connecter pour envoyer une vidéo. + Vous n'êtes pas connecté(e). Veuillez vous connecter pour envoyer une vidéo.