From 80bfc5e1b11694553ddaa48e3b181462cfadc9dd Mon Sep 17 00:00:00 2001 From: Jonathan Prykop Date: Sat, 17 Dec 2016 19:53:23 -0600 Subject: 73443: Selfservice NG Password reset page --- FS/FS/ClientAPI_XMLRPC.pm | 1 + .../elements/add_password_validation.php | 51 ++++++++++++ ng_selfservice/images/error.png | Bin 0 -> 666 bytes ng_selfservice/images/tick.png | Bin 0 -> 537 bytes ng_selfservice/password.php | 89 ++++++++++++++++++++- ng_selfservice/xmlrpc_validate_passwd.php | 15 ++++ 6 files changed, 155 insertions(+), 1 deletion(-) create mode 100644 ng_selfservice/elements/add_password_validation.php create mode 100644 ng_selfservice/images/error.png create mode 100644 ng_selfservice/images/tick.png create mode 100644 ng_selfservice/xmlrpc_validate_passwd.php diff --git a/FS/FS/ClientAPI_XMLRPC.pm b/FS/FS/ClientAPI_XMLRPC.pm index 3167aa0e3..e69a06e32 100644 --- a/FS/FS/ClientAPI_XMLRPC.pm +++ b/FS/FS/ClientAPI_XMLRPC.pm @@ -181,6 +181,7 @@ sub ss2clientapi { 'reset_passwd' => 'MyAccount/reset_passwd', 'check_reset_passwd' => 'MyAccount/check_reset_passwd', 'process_reset_passwd' => 'MyAccount/process_reset_passwd', + 'validate_passwd' => 'MyAccount/validate_passwd', 'list_tickets' => 'MyAccount/list_tickets', 'create_ticket' => 'MyAccount/create_ticket', 'get_ticket' => 'MyAccount/get_ticket', diff --git a/ng_selfservice/elements/add_password_validation.php b/ng_selfservice/elements/add_password_validation.php new file mode 100644 index 000000000..6938437eb --- /dev/null +++ b/ng_selfservice/elements/add_password_validation.php @@ -0,0 +1,51 @@ + diff --git a/ng_selfservice/images/error.png b/ng_selfservice/images/error.png new file mode 100644 index 000000000..628cf2dae Binary files /dev/null and b/ng_selfservice/images/error.png differ diff --git a/ng_selfservice/images/tick.png b/ng_selfservice/images/tick.png new file mode 100644 index 000000000..a9925a06a Binary files /dev/null and b/ng_selfservice/images/tick.png differ diff --git a/ng_selfservice/password.php b/ng_selfservice/password.php index 41296ed2d..a6e67951a 100644 --- a/ng_selfservice/password.php +++ b/ng_selfservice/password.php @@ -1,5 +1,92 @@ -Chagne password +myaccount_passwd(array( + 'session_id' => $_COOKIE['session_id'], + 'svcnum' => $_POST['svcnum'], + 'new_password' => $_POST['new_password'], + 'new_password2' => $_POST['new_password2'], + )); + + if ($pwd_change_result['error']) { + $error = $pwd_change_result['error']; + } else { + $pwd_change_success = true; + } +} + +if ($pwd_change_success) { +?> + +

Password changed for .

+ +list_svcs(array( + 'session_id' => $_COOKIE['session_id'], + 'svcdb' => 'svc_acct', + )); + if (isset($pwd_change_svcs['error'])) { + $error = $error || $pwd_change_svcs['error']; + } + if (!isset($pwd_change_svcs['svcs'])) { + $pwd_change_svcs['svcs'] = $pwd_change_svcs['svcs']; + $error = $error || 'Unknown error loading services'; + } + if ($error) { + include('elements/error.php'); + } +?> + +
+ + + + + + + + + + + + + + + + +
Change password for account: + +
New password: + +
+ + +
Re-enter new password:
+
+ + + +
+ + + diff --git a/ng_selfservice/xmlrpc_validate_passwd.php b/ng_selfservice/xmlrpc_validate_passwd.php new file mode 100644 index 000000000..5632dc3f1 --- /dev/null +++ b/ng_selfservice/xmlrpc_validate_passwd.php @@ -0,0 +1,15 @@ + $_POST['fieldid'], + check_password => $_POST['check_password'], + svcnum => $_POST['svcnum'], + session_id => $_COOKIE['session_id'] +); + +$result = $freeside->validate_passwd($xmlrpc_args); +echo json_encode($result); + +?> -- cgit v1.2.1