From c445a9f547914a952902d2ad2c7320e490e1f050 Mon Sep 17 00:00:00 2001 From: Renato Botelho Date: Tue, 16 Dec 2014 17:09:59 -0200 Subject: Use provided function to change user's password --- usr/local/www/system_usermanager_passwordmg.php | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'usr/local') diff --git a/usr/local/www/system_usermanager_passwordmg.php b/usr/local/www/system_usermanager_passwordmg.php index 9f069df..c3dba2a 100644 --- a/usr/local/www/system_usermanager_passwordmg.php +++ b/usr/local/www/system_usermanager_passwordmg.php @@ -38,6 +38,7 @@ ##|*MATCH=system_usermanager_passwordmg.php* ##|-PRIV +require_once("auth.inc"); require_once("certs.inc"); require_once("guiconfig.inc"); @@ -58,8 +59,11 @@ if (isset($_POST['save'])) { if (!session_id()) session_start(); // all values are okay --> saving changes - $config['system']['user'][$userindex[$_SESSION['Username']]]['password'] = crypt(trim($_POST['passwordfld1'])); - local_user_set($config['system']['user'][$userindex[$_SESSION['Username']]]); + + $userent =& $config['system']['user'][$userindex[$_SESSION['Username']]]; + local_user_set_password($userent, $_POST['passwordfld1']); + local_user_set($userent); + unset($userent); session_commit(); write_config(); -- cgit v1.1