diff --git a/admin_index.php b/admin_index.php index 2dcd7aae..a91bae05 100644 --- a/admin_index.php +++ b/admin_index.php @@ -193,8 +193,12 @@ if ($page == 'overview') { \Froxlor\UI\Response::standard_error('oldpasswordnotcorrect'); } - $new_password = \Froxlor\Validate\Validate::validate($_POST['new_password'], 'new password'); - $new_password_confirm = \Froxlor\Validate\Validate::validate($_POST['new_password_confirm'], 'new password confirm'); + try { + $new_password = \Froxlor\System\Crypt::validatePassword($_POST['new_password'], 'new password'); + $new_password_confirm = \Froxlor\System\Crypt::validatePassword($_POST['new_password_confirm'], 'new password confirm'); + } catch (Exception $e) { + \Froxlor\UI\Response::dynamic_error($e->getMessage()); + } if ($old_password == '') { \Froxlor\UI\Response::standard_error(array( diff --git a/customer_index.php b/customer_index.php index 96e533ed..56a9afc7 100644 --- a/customer_index.php +++ b/customer_index.php @@ -136,14 +136,20 @@ if ($page == 'overview') { eval("echo \"" . \Froxlor\UI\Template::getTemplate('index/index') . "\";"); } elseif ($page == 'change_password') { + if (isset($_POST['send']) && $_POST['send'] == 'send') { $old_password = \Froxlor\Validate\Validate::validate($_POST['old_password'], 'old password'); + if (! \Froxlor\System\Crypt::validatePasswordLogin($userinfo, $old_password, TABLE_PANEL_CUSTOMERS, 'customerid')) { \Froxlor\UI\Response::standard_error('oldpasswordnotcorrect'); } - $new_password = \Froxlor\System\Crypt::validatePassword($_POST['new_password'], 'new password'); - $new_password_confirm = \Froxlor\System\Crypt::validatePassword($_POST['new_password_confirm'], 'new password confirm'); + try { + $new_password = \Froxlor\System\Crypt::validatePassword($_POST['new_password'], 'new password'); + $new_password_confirm = \Froxlor\System\Crypt::validatePassword($_POST['new_password_confirm'], 'new password confirm'); + } catch (Exception $e) { + \Froxlor\UI\Response::dynamic_error($e->getMessage()); + } if ($old_password == '') { \Froxlor\UI\Response::standard_error(array(