Commit 4227047e authored by Côme Bernigaud's avatar Côme Bernigaud Committed by Benoit Mortier
Browse files

Fixes #3753 Removed method related code from password recovery

Showing with 3 additions and 31 deletions
+3 -31
...@@ -29,7 +29,6 @@ class passwordRecovery { ...@@ -29,7 +29,6 @@ class passwordRecovery {
var $uid; var $uid;
var $message = array(); var $message = array();
var $email_address; var $email_address;
var $method;
var $directory; var $directory;
var $step = 1; var $step = 1;
...@@ -119,20 +118,6 @@ class passwordRecovery { ...@@ -119,20 +118,6 @@ class passwordRecovery {
$ssl = $this->checkForSSL(); $ssl = $this->checkForSSL();
/* Check for selected password method */
$this->method = $this->config->get_cfg_value("passwordDefaultHash", "ssha");
if (isset($_GET['method'])) {
$this->method = validate($_GET['method']);
$tmp = new passwordMethod($this->config);
$available = $tmp->get_available_methods();
if (!isset($available[$this->method])) {
msg_dialog::display(_("Password method"),
_("Error: Password method not available!"),
FATAL_ERROR_DIALOG);
exit();
}
}
if (isset($_GET['email_address']) && $_GET['email_address'] != "") { if (isset($_GET['email_address']) && $_GET['email_address'] != "") {
$this->email_address = validate($_GET['email_address']); $this->email_address = validate($_GET['email_address']);
$smarty->assign('email_address', $this->email_address); $smarty->assign('email_address', $this->email_address);
...@@ -292,7 +277,6 @@ class passwordRecovery { ...@@ -292,7 +277,6 @@ class passwordRecovery {
$smarty->assign('params', ""); $smarty->assign('params', "");
$smarty->assign('message', ""); $smarty->assign('message', "");
$smarty->assign('changed', FALSE); $smarty->assign('changed', FALSE);
$smarty->assign('other_method', FALSE);
} }
static function generateRandomHash() static function generateRandomHash()
...@@ -456,7 +440,6 @@ class passwordRecovery { ...@@ -456,7 +440,6 @@ class passwordRecovery {
/* find the uid of for the given email address */ /* find the uid of for the given email address */
function step2() function step2()
{ {
/* Ask for the method */
if ($_POST['email_address'] == "") { if ($_POST['email_address'] == "") {
$this->message[] = msgPool::required(_("Email address")); $this->message[] = msgPool::required(_("Email address"));
return; return;
...@@ -491,7 +474,7 @@ class passwordRecovery { ...@@ -491,7 +474,7 @@ class passwordRecovery {
$smarty->assign('uid', $this->uid); $smarty->assign('uid', $this->uid);
$smarty->assign('email_address', $this->email_address); $smarty->assign('email_address', $this->email_address);
$this->step = 2; $this->step = 2;
$params = $this->encodeParams(array('uid', 'method', 'directory', 'email_address')); $params = $this->encodeParams(array('uid', 'directory', 'email_address'));
$smarty->assign('params', $params); $smarty->assign('params', $params);
} }
...@@ -550,7 +533,7 @@ class passwordRecovery { ...@@ -550,7 +533,7 @@ class passwordRecovery {
$this->uniq = $uniq_id_from_mail; $this->uniq = $uniq_id_from_mail;
$this->step = 4; $this->step = 4;
$smarty->assign('uid', $this->uid); $smarty->assign('uid', $this->uid);
$params = $this->encodeParams(array('uid', 'method', 'directory', 'email_address', 'uniq')); $params = $this->encodeParams(array('uid', 'directory', 'email_address', 'uniq'));
$smarty->assign('params', $params); $smarty->assign('params', $params);
if (isset($_POST['change'])) { if (isset($_POST['change'])) {
...@@ -581,7 +564,7 @@ class passwordRecovery { ...@@ -581,7 +564,7 @@ class passwordRecovery {
return; return;
} }
} }
if (!change_password($dn, $_POST['new_password'], 0, $this->method)) { if (!change_password($dn, $_POST['new_password'])) {
return; return;
} }
fusiondirectory_log("User ".$this->uid." password has been changed"); fusiondirectory_log("User ".$this->uid." password has been changed");
......
...@@ -35,9 +35,6 @@ ...@@ -35,9 +35,6 @@
</p> </p>
<p class="infotext"> <p class="infotext">
{if $other_method}
{t}Available methods{/t}
{/if}
<ul> <ul>
<li>{t}Receive by email a link that allows you to reset your password{/t} : <li>{t}Receive by email a link that allows you to reset your password{/t} :
<input type="submit" name="send" value="{t}Send{/t}" <input type="submit" name="send" value="{t}Send{/t}"
...@@ -45,14 +42,6 @@ ...@@ -45,14 +42,6 @@
<input type="hidden" id="email_address" maxlength="60" value="{$email_address}"> <input type="hidden" id="email_address" maxlength="60" value="{$email_address}">
<input type="hidden" id="uid" maxlength="60" value="{$uid}"> <input type="hidden" id="uid" maxlength="60" value="{$uid}">
</li> </li>
{if $other_method}
<li>
Dummy recuperation method
</li>
<li>
<div style="color:red;">{t}If none of the above methods suits you, contact your administrator to change your password{/t}</div>
</li>
{/if}
</ul> </ul>
</p> </p>
{elseif $step==3} {elseif $step==3}
......
  • bmortier @bmortier

    mentioned in issue #1237

    By Jonathan Swaelens on 2017-09-02T15:18:55 (imported from GitLab)

    ·

    mentioned in issue #1237

    By Jonathan Swaelens on 2017-09-02T15:18:55 (imported from GitLab)

    Toggle commit list
Supports Markdown
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