diff --git a/src/messenger/webim/locales/en/properties b/src/messenger/webim/locales/en/properties index 64b238fc..7cc707e3 100644 --- a/src/messenger/webim/locales/en/properties +++ b/src/messenger/webim/locales/en/properties @@ -142,9 +142,9 @@ form.field.groupname.description=Name to identify the group. form.field.groupname=Name form.field.login.description=Login can consist of small Latin letters and underscore. form.field.login=Login -form.field.message=Message form.field.mail.description=For notifications and password retrieval. form.field.mail=E-mail +form.field.message=Message form.field.name=Your name form.field.password.description=Enter new password or leave the field empty to keep previous one. form.field.password=Password @@ -373,16 +373,22 @@ report.byoperator.4=Average message length (in chars) report.byoperator.title=Threads by operator report.no_items=Not enough data report.total=Total: -restore.pwd.message=Forgot your password? -restore.title=Trouble Accessing Your Account? -restore.intro=You can't retrieve your password, but you can set a new one by following a link sent to you by email. -restore.emailorlogin=Login or E-mail: +resetpwd.changed.title=Your password has been changed! +resetpwd.changed=Login using your new password. +resetpwd.intro=Please choose a password to use with your Mibew account. +resetpwd.login=Proceed to login +resetpwd.submit=Change +resetpwd.title=Change your Mibew password restore.back_to_login=Back to login -restore.submit=Reset password -restore.sent.title=Password retrieval -restore.sent=We've sent the instructions to your email. Please, check it! +restore.emailorlogin=Login or E-mail: +restore.intro=You can't retrieve your password, but you can set a new one by following a link sent to you by email. restore.mailsubj=Reset your Mibew password restore.mailtext=Hi, {0}\n\nPlease click on the link below or copy and paste the URL into your browser:\n{1}\n\nThis will let you choose another password.\n\nMibew Messenger. +restore.pwd.message=Forgot your password? +restore.sent.title=Password retrieval +restore.sent=We've sent the instructions to your email. Please, check it! +restore.submit=Reset password +restore.title=Trouble Accessing Your Account? right.administration=Administration right.main=Main right.other=Other diff --git a/src/messenger/webim/operator/resetpwd.php b/src/messenger/webim/operator/resetpwd.php new file mode 100644 index 00000000..fb7a01e0 --- /dev/null +++ b/src/messenger/webim/operator/resetpwd.php @@ -0,0 +1,71 @@ + $version, 'showform' => true); + +$opId = verifyparam( "id", "/^\d{1,9}$/"); +$token = verifyparam("token", "/^[\dabcdef]+$/"); + +$operator = operator_by_id($opId); + +if(!$operator) { + $errors[] = "No such operator"; + $page['showform'] = false; +} else if($token != $operator['vcrestoretoken']) { + $errors[] = "Wrong token"; + $page['showform'] = false; +} + +if (count($errors) == 0 && isset($_POST['password'])) { + $password = getparam('password'); + $passwordConfirm = getparam('passwordConfirm'); + + if( !$password ) + $errors[] = no_field("form.field.password"); + + if( $password != $passwordConfirm ) + $errors[] = getlocal("my_settings.error.password_match"); + + if (count($errors) == 0) { + $page['isdone'] = true; + + $link = connect(); + $query = "update chatoperator set vcpassword = '".md5($password)."', vcrestoretoken = '' where operatorid = ".$opId; + perform_query($query, $link); + mysql_close($link); + + start_html_output(); + require('../view/resetpwd.php'); + exit; + } +} + +$page['id'] = $opId; +$page['token'] = $token; +$page['isdone'] = false; +start_html_output(); +require('../view/resetpwd.php'); +?> \ No newline at end of file diff --git a/src/messenger/webim/view/resetpwd.php b/src/messenger/webim/view/resetpwd.php new file mode 100644 index 00000000..c0ef0e1c --- /dev/null +++ b/src/messenger/webim/view/resetpwd.php @@ -0,0 +1,114 @@ + +
+ + + + + + \ No newline at end of file