Skip to content

Commit

Permalink
Merge pull request #310 from AntoineLemarchand/main
Browse files Browse the repository at this point in the history
Lost password page
  • Loading branch information
minzords committed Jun 10, 2024
2 parents 52d9a35 + a459e31 commit 26c6054
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 21 deletions.
2 changes: 0 additions & 2 deletions inc/html.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -1467,8 +1467,6 @@ static function includeHeader($title = '', $sector = 'none', $item = 'none', $op
}


Html::requireJs('hotkeys');

if (Session::getCurrentInterface() == "helpdesk") {
echo Html::css('public/lib/jquery.rateit.css');
Html::requireJs('rateit');
Expand Down
44 changes: 26 additions & 18 deletions inc/user.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -4630,24 +4630,32 @@ static function showPasswordForgetChangeForm($token) {
static function showPasswordForgetRequestForm() {
global $CFG_GLPI;

echo "<div class='center'>";
echo "<form aria-label='Password Forget Request' method='post' name='forgetpassword' action='".$CFG_GLPI['root_doc'].
"/front/lostpassword.php'>";
echo "<table class='tab_cadre' aria-label='Forgot Password'>";
echo "<tr><th colspan='2'>" . __('Forgotten password?')."</th></tr>";

echo "<tr class='tab_bg_1'><td colspan='2'>" .
__('Please enter your email address. An email will be sent to you and you will be able to choose a new password.').
"</td></tr>";

echo "<tr class='tab_bg_2 center'>";
echo "<td><input type='text' size='60' name='email' value=''></td>";
echo "<td><input type='submit' name='update' value=\"".__s('Save')."\" class='submit'>";
echo "</td></tr>";

echo "</table>";
Html::closeForm();
echo "</div>";
$form = [
'action' => $CFG_GLPI['root_doc'] . '/front/lostpassword.php',
'buttons' => [
[
'name' => 'update',
'value' => __s('Save'),
'class' => 'btn btn-secondary'
],
],
'content' => [
__('Forgotten password?') => [
'visible' => true,
'inputs' => [
__('Please enter your email address. An email will be sent to you and you will be able to choose a new password.') => [
'type' => 'text',
'name' => 'email',
'value' => '',
'size' => 60,
'col_lg' => 12,
'col_md' => 12,
]
],
]
]
];
renderTwigForm($form);
}


Expand Down
4 changes: 3 additions & 1 deletion src/twig/twig.utils.php
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,9 @@ function renderTwigForm($form, $additionnalHtml = '', $fields = [])
]
], $form['content'][array_key_first($form['content'])]['inputs']);
};
if (count($_SESSION['glpiactiveentities']) > 1 && isset($fields['entities_id'])) {
if (isset($_SESSION['glpiactiveentities']) &&
count($_SESSION['glpiactiveentities']) > 1 &&
isset($fields['entities_id'])) {
$form['content'] = [Entity::getTypeName() => [
'visible' => true,
'inputs' => [
Expand Down

0 comments on commit 26c6054

Please sign in to comment.