Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
smart_core_connect
/
core-connect
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Members
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
f0730d60
authored
May 30, 2018
by
Zen-PC\Zen
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'integration' into kraikrit
parents
88e3c9fb
62526bbc
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
14 additions
and
20 deletions
+14
-20
www/src/Controller/UsersController.php
+3
-7
www/src/Template/Users/change_forgotpassword.ctp
+6
-7
www/src/Template/Users/forgot_password.ctp
+1
-2
www/src/Template/Users/signup.ctp
+4
-4
No files found.
www/src/Controller/UsersController.php
View file @
f0730d60
...
...
@@ -411,17 +411,13 @@ class UsersController extends AppController {
if
(
$this
->
request
->
is
(
'post'
))
{
$hasher
=
new
DefaultPasswordHasher
();
$password
=
$this
->
request
->
data
[
'password'
];
//
$confirm_password = $this->request->data['confirm_password'];
$confirm_password
=
$this
->
request
->
data
[
'confirm_password'
];
$this
->
request
->
data
[
'password'
]
=
$hasher
->
hash
(
$this
->
request
->
data
[
'password'
]);
//------- เทียบ password ที่เข้ารหัส ---------------password_verify($password,hashed_password)---------------------------
$users
=
$this
->
Users
->
patchEntity
(
$users
,
$this
->
request
->
getData
());
if
(
$this
->
Users
->
save
(
$users
)){
$this
->
Flash
->
success
(
__
(
'change password success'
));
$this
->
Flash
->
success
(
__
(
'You are now logout'
));
$this
->
Users
->
save
(
$users
);
$this
->
Flash
->
success
(
__
(
'You are now logged out.'
));
return
$this
->
redirect
([
'action'
=>
'signin'
]);
}
$this
->
Flash
->
error
(
__
(
'Invalid password.'
));
return
$this
->
redirect
([
'action'
=>
'change_forgotpassword'
]);
}
$this
->
set
(
array
(
'token'
=>
$token
,
'_serialize'
=>
array
(
'token'
)));
}
...
...
www/src/Template/Users/change_forgotpassword.ctp
View file @
f0730d60
...
...
@@ -6,9 +6,8 @@
<!-- <div class="alert alert-warning" role="alert" style="margin: 10px 0px 10px 0px;font-size: 17px;text-align: center;">
<strong><?php echo __('กรุณา! ตรวจสอบอีเมลล์ของท่าน');?></strong>
</div>-->
<?php echo $this->Form->create(null, ['url' => ['controller' => 'Users','action' => 'changeForgotpassword/'.$token],'class' => 'form-horizontal','id' => '','name' => 'change
Forgotpa
ssword','role' => 'form', 'onsubmit' => 'return validateForm()']);?>
<?php echo $this->Form->create(null, ['url' => ['controller' => 'Users','action' => 'changeForgotpassword/'.$token],'class' => 'form-horizontal','id' => '','name' => 'change
Pre
ssword','role' => 'form', 'onsubmit' => 'return validateForm()']);?>
<?php echo $this->Flash->render(); ?>
</div>
<div>
<div class="form-group has-feedback">
<div class="col-md-12">
...
...
@@ -63,27 +62,27 @@
function validateForm() {
var password = document.forms["change
Forgotpa
ssword"]["password"].value;
var password = document.forms["change
Pre
ssword"]["password"].value;
if (password == null || password == "") {
alert("กรุณากรอก รหัสผ่านใหม่");
return false;
}
if(document.forms["change
Forgotpa
ssword"]["password"].value.length < 8)
if(document.forms["change
Pre
ssword"]["password"].value.length < 8)
{
alert('กรุณาระบุรหัสผ่านใหม่อย่างน้อย 8 ตัวอักษร');
return false;
}
var confirm_password = document.forms["change
Forgotpa
ssword"][["confirm_password"]].value;
var confirm_password = document.forms["change
Pre
ssword"][["confirm_password"]].value;
if (confirm_password == null || confirm_password == "") {
alert("กรุณากรอก ยืนยันรหัสผ่าน");
return false;
}
if(document.forms["change
Forgotpa
ssword"]["confirm_password"].value.length < 8)
if(document.forms["change
Pre
ssword"]["confirm_password"].value.length < 8)
{
alert('กรุณาระบุยืนยันรหัสผ่านอย่างน้อย 8 ตัวอักษร');
return false;
}
if(document.forms["change
Forgotpassword"]["password"].value != document.forms["changeForgotpa
ssword"]["confirm_password"].value){
if(document.forms["change
Pressword"]["password"].value != document.forms["changePre
ssword"]["confirm_password"].value){
alert('กรุณาระบุรหัสผ่านให้ตรงกัน');
//document.createAccount.confirm_password.focus();
return false;
...
...
www/src/Template/Users/forgot_password.ctp
View file @
f0730d60
...
...
@@ -11,9 +11,8 @@
<div>
<div class="form-group has-feedback">
<div class="col-md-12">
<label class="label-text-sub"><?php echo __('อีเมล
ล์
');?><em>* </em></label>
<label class="label-text-sub"><?php echo __('อีเมล');?><em>* </em></label>
<input type="text" value="" name="email" placeholder="mail@xxx.com" class="form-control-reg border-bottom-from" id="fremail">
</div>
</div>
</div>
...
...
www/src/Template/Users/signup.ctp
View file @
f0730d60
...
...
@@ -99,7 +99,7 @@
<div>
<div class="form-group has-feedback">
<div class="col-md-12">
<label class="label-text-sub"><?php echo __('อีเมล
ล์
');?><em>* </em></label>
<label class="label-text-sub"><?php echo __('อีเมล');?><em>* </em></label>
<input type="text" name="email" id="fremail" value="" placeholder="mail@xxx.com" class="form-control-reg border-bottom-from">
</div>
...
...
@@ -230,7 +230,7 @@
// console.log(data);
data = jQuery.parseJSON(data);
if(data['chk'] == 'false'){
alert("อีเมล
ล์
นี้มีในระบบแล้ว");
alert("อีเมลนี้มีในระบบแล้ว");
return false;
}
});
...
...
@@ -324,13 +324,13 @@ function check_notnum() {
var email = document.getElementById("fremail").value;
if (email == null || email == "") {
alert("กรุณากรอกอีเมล
ล์
");
alert("กรุณากรอกอีเมล");
return false;
}
// Validate Email
var email = $("#fremail").val();
if (/(.+)@(.+){2,}\.(.+){2,}/.test(email)) { } else {
alert("รูปแบบที่อยู่อีเมล
ล์
ผิด กรุณากรอกให้ถูกต้อง");
alert("รูปแบบที่อยู่อีเมลผิด กรุณากรอกให้ถูกต้อง");
return false;
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment