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 @@
define('QA_MYSQL_PASSWORD', 'cagette2015');
define('QA_MYSQL_DATABASE', 'openbarlacagette');
define('COOPERATIC_DJANGO_ODOO_URL', 'https://domaine.accueil/members/external_login');
define('OFFICIAL_WEBSITE', 'https://my-website.fr/');
```
Créer une database mySQL
......
......@@ -416,65 +416,70 @@ $qa_content['raw']['points'] = $userpoints;
// Change password form
$qa_content['form_password'] = array(
'tags' => 'method="post" action="' . qa_self_html() . '"',
'style' => 'wide',
'title' => qa_lang_html('users/change_password'),
'fields' => array(
'old' => array(
'label' => qa_lang_html('users/old_password'),
'tags' => 'name="oldpassword"',
'value' => qa_html(@$inoldpassword),
'type' => 'password',
'error' => qa_html(@$errors['oldpassword']),
if (!$haspassword && !$haspasswordold) {
$qa_content['form_password'] = [];
} else {
$qa_content['form_password'] = array(
'tags' => 'method="post" action="' . qa_self_html() . '"',
'style' => 'wide',
'title' => qa_lang_html('users/change_password'),
'fields' => array(
'old' => array(
'label' => qa_lang_html('users/old_password'),
'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(
'label' => qa_lang_html('users/new_password_1'),
'tags' => 'name="newpassword1"',
'type' => 'password',
'error' => qa_html(@$errors['password']),
'buttons' => array(
'change' => array(
'label' => qa_lang_html('users/change_password'),
),
),
'new_2' => array(
'label' => qa_lang_html('users/new_password_2'),
'tags' => 'name="newpassword2"',
'type' => 'password',
'error' => qa_html(@$errors['newpassword2']),
'hidden' => array(
'dochangepassword' => array(
'tags' => 'name="dochangepassword"',
'value' => '1',
),
'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')
$qa_content['form_profile']['ok'] = qa_lang_html('users/password_changed');
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')
$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;
......@@ -140,7 +140,7 @@ if (empty($inemailhandle) || isset($errors['emailhandle']))
else
$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(
'tags' => 'method="post" action="' . qa_self_html() . '"',
......@@ -163,8 +163,8 @@ $qa_content['form'] = array(
'label' => qa_lang_html('users/password_label'),
'tags' => 'name="password" id="password" dir="auto"',
'value' => qa_html(@$inpassword),
'error' => empty($errors['password']) ? '' : (qa_html(@$errors['password']) . ' - ' . $forgothtml),
'note' => $passwordsent ? qa_lang_html('users/password_sent') : $forgothtml,
'error' => empty($errors['password']) ? '' : (qa_html(@$errors['password'])),
// 'note' => $passwordsent ? qa_lang_html('users/password_sent') : $forgothtml,
),
'remember' => array(
......
......@@ -61,9 +61,11 @@ foreach ($userfields as $index => $userfield) {
// 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')) {
$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;
}
......
......@@ -115,7 +115,8 @@
'profile_saved' => 'Profil sauvé',
'register_button' => 'Inscription',
'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',
'registered_label' => 'Enregistré',
'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