Commit ddbb232a by Félicie

Merge branch '3242-password-removed' into 'main'

3242 password removed

See merge request !6
parents cbcc4c1d 03f80549
...@@ -9,6 +9,7 @@ ...@@ -9,6 +9,7 @@
define('QA_MYSQL_PASSWORD', 'cagette2015'); define('QA_MYSQL_PASSWORD', 'cagette2015');
define('QA_MYSQL_DATABASE', 'openbarlacagette'); define('QA_MYSQL_DATABASE', 'openbarlacagette');
define('COOPERATIC_DJANGO_ODOO_URL', 'https://domaine.accueil/members/external_login'); define('COOPERATIC_DJANGO_ODOO_URL', 'https://domaine.accueil/members/external_login');
define('OFFICIAL_WEBSITE', 'https://my-website.fr/');
``` ```
Créer une database mySQL Créer une database mySQL
......
...@@ -416,65 +416,70 @@ $qa_content['raw']['points'] = $userpoints; ...@@ -416,65 +416,70 @@ $qa_content['raw']['points'] = $userpoints;
// Change password form // Change password form
$qa_content['form_password'] = array( if (!$haspassword && !$haspasswordold) {
'tags' => 'method="post" action="' . qa_self_html() . '"', $qa_content['form_password'] = [];
} else {
'style' => 'wide', $qa_content['form_password'] = array(
'tags' => 'method="post" action="' . qa_self_html() . '"',
'title' => qa_lang_html('users/change_password'),
'style' => 'wide',
'fields' => array(
'old' => array( 'title' => qa_lang_html('users/change_password'),
'label' => qa_lang_html('users/old_password'),
'tags' => 'name="oldpassword"', 'fields' => array(
'value' => qa_html(@$inoldpassword), 'old' => array(
'type' => 'password', 'label' => qa_lang_html('users/old_password'),
'error' => qa_html(@$errors['oldpassword']), 'tags' => 'name="oldpassword"',
'value' => qa_html(@$inoldpassword),
'type' => 'password',
'error' => qa_html(@$errors['oldpassword']),
),
'new_1' => array(
'label' => qa_lang_html('users/new_password_1'),
'tags' => 'name="newpassword1"',
'type' => 'password',
'error' => qa_html(@$errors['password']),
),
'new_2' => array(
'label' => qa_lang_html('users/new_password_2'),
'tags' => 'name="newpassword2"',
'type' => 'password',
'error' => qa_html(@$errors['newpassword2']),
),
), ),
'new_1' => array( 'buttons' => array(
'label' => qa_lang_html('users/new_password_1'), 'change' => array(
'tags' => 'name="newpassword1"', 'label' => qa_lang_html('users/change_password'),
'type' => 'password', ),
'error' => qa_html(@$errors['password']),
), ),
'new_2' => array( 'hidden' => array(
'label' => qa_lang_html('users/new_password_2'), 'dochangepassword' => array(
'tags' => 'name="newpassword2"', 'tags' => 'name="dochangepassword"',
'type' => 'password', 'value' => '1',
'error' => qa_html(@$errors['newpassword2']), ),
'code' => array(
'tags' => 'name="code"',
'value' => qa_get_form_security_code('password'),
),
), ),
), );
'buttons' => array(
'change' => array(
'label' => qa_lang_html('users/change_password'),
),
),
'hidden' => array(
'dochangepassword' => array(
'tags' => 'name="dochangepassword"',
'value' => '1',
),
'code' => array(
'tags' => 'name="code"',
'value' => qa_get_form_security_code('password'),
),
),
);
if (!$haspassword && !$haspasswordold) {
$qa_content['form_password']['fields']['old']['type'] = 'static';
$qa_content['form_password']['fields']['old']['value'] = qa_lang_html('users/password_none');
}
if (qa_get_state() == 'password-changed') if (!$haspassword && !$haspasswordold) {
$qa_content['form_profile']['ok'] = qa_lang_html('users/password_changed'); $qa_content['form_password']['fields']['old']['type'] = 'static';
$qa_content['form_password']['fields']['old']['value'] = qa_lang_html('users/password_none');
}
if (qa_get_state() == 'password-changed')
$qa_content['form_profile']['ok'] = qa_lang_html('users/password_changed');
$qa_content['navigation']['sub'] = qa_user_sub_navigation($useraccount['handle'], 'account', true);
$qa_content['navigation']['sub'] = qa_user_sub_navigation($useraccount['handle'], 'account', true);
}
return $qa_content; return $qa_content;
...@@ -140,7 +140,7 @@ if (empty($inemailhandle) || isset($errors['emailhandle'])) ...@@ -140,7 +140,7 @@ if (empty($inemailhandle) || isset($errors['emailhandle']))
else else
$forgotpath = qa_path('forgot', array('e' => $inemailhandle)); $forgotpath = qa_path('forgot', array('e' => $inemailhandle));
$forgothtml = '<a href="' . qa_html($forgotpath) . '">' . qa_lang_html('users/forgot_link') . '</a>'; // $forgothtml = '<a href="' . qa_html($forgotpath) . '">' . qa_lang_html('users/forgot_link') . '</a>';
$qa_content['form'] = array( $qa_content['form'] = array(
'tags' => 'method="post" action="' . qa_self_html() . '"', 'tags' => 'method="post" action="' . qa_self_html() . '"',
...@@ -163,8 +163,8 @@ $qa_content['form'] = array( ...@@ -163,8 +163,8 @@ $qa_content['form'] = array(
'label' => qa_lang_html('users/password_label'), 'label' => qa_lang_html('users/password_label'),
'tags' => 'name="password" id="password" dir="auto"', 'tags' => 'name="password" id="password" dir="auto"',
'value' => qa_html(@$inpassword), 'value' => qa_html(@$inpassword),
'error' => empty($errors['password']) ? '' : (qa_html(@$errors['password']) . ' - ' . $forgothtml), 'error' => empty($errors['password']) ? '' : (qa_html(@$errors['password'])),
'note' => $passwordsent ? qa_lang_html('users/password_sent') : $forgothtml, // 'note' => $passwordsent ? qa_lang_html('users/password_sent') : $forgothtml,
), ),
'remember' => array( 'remember' => array(
......
...@@ -61,9 +61,11 @@ foreach ($userfields as $index => $userfield) { ...@@ -61,9 +61,11 @@ foreach ($userfields as $index => $userfield) {
// Check we haven't suspended registration, and this IP isn't blocked // Check we haven't suspended registration, and this IP isn't blocked
$findoutmore = '<a href="' . qa_html(OFFICIAL_WEBSITE) . '">' . qa_lang_html('users/find_out_more') . '</a>';
if (qa_opt('suspend_register_users')) { if (qa_opt('suspend_register_users')) {
$qa_content = qa_content_prepare(); $qa_content = qa_content_prepare();
$qa_content['error'] = qa_lang_html('users/register_suspended'); $qa_content['error'] = qa_lang_html('users/register_suspended') .' '. $findoutmore;
return $qa_content; return $qa_content;
} }
......
...@@ -115,7 +115,8 @@ ...@@ -115,7 +115,8 @@
'profile_saved' => 'Profil sauvé', 'profile_saved' => 'Profil sauvé',
'register_button' => 'Inscription', 'register_button' => 'Inscription',
'register_limit' => 'Trop d\'inscriptions - essayez à nouveau dans une heure', 'register_limit' => 'Trop d\'inscriptions - essayez à nouveau dans une heure',
'register_suspended' => "Pour participer au forum, utilise ton identifiant utilisé pour accéder à ton espace membre. Il faut être coopérateurice de La Cagette pour participer au forum.\n\nEn savoir plus sur La Cagette", 'register_suspended' => "Pour rejoindre le forum, utilise ton identifiant utilisé pour accéder à ton espace membre. Il faut être coopérateurice de La Cagette pour participer au forum.",
'find_out_more' => "En savoir plus sur La Cagette",
'register_title' => 'Enregistrement d\'un nouvel utilisateur', 'register_title' => 'Enregistrement d\'un nouvel utilisateur',
'registered_label' => 'Enregistré', 'registered_label' => 'Enregistré',
'registered_user' => 'coopérateurice', 'registered_user' => 'coopérateurice',
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment