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
3cd64980
authored
May 25, 2018
by
Teeradone-PIM
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
teeradone: validate change and email sent username
parent
e9e87d00
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
108 additions
and
62 deletions
+108
-62
www/src/Controller/UsersController.php
+2
-2
www/src/Template/Users/change_forgotpassword.ctp
+19
-0
www/src/Template/Users/change_password.ctp
+28
-0
www/src/Template/Users/signup.ctp
+59
-60
No files found.
www/src/Controller/UsersController.php
View file @
3cd64980
...
...
@@ -331,12 +331,12 @@ class UsersController extends AppController {
$digits
=
4
;
$users
[
'pin_pass'
]
=
str_pad
(
rand
(
0
,
pow
(
10
,
$digits
)
-
1
),
$digits
,
'0'
,
STR_PAD_LEFT
);
$token
=
$users
[
'token'
];
//--------------------ตัวส่ง Email ---------------------------------------------------------
//pr($user_personals);die;
$data_notification
=
[];
$data_notification
[
'email'
]
=
$this
->
request
->
data
[
'email'
];
$data_notification
[
'pin_code'
]
=
$users
[
'pin_pass'
];
$data_notification
[
'pin_code'
]
=
$users
[
'pin_pass'
]
.
'<br>'
.
" Username: "
.
$users
[
'username'
]
;
$this
->
notification
(
$data_notification
);
//----------------------------------------------------------------------------------------
$this
->
Users
->
save
(
$users
);
...
...
www/src/Template/Users/change_forgotpassword.ctp
View file @
3cd64980
...
...
@@ -42,6 +42,25 @@
<!-- ------------------------------- popup ----------------------------------- -->
<script>
$("#password").on('change',function(){
var elem = document.getElementById('password').value;
// console.log(elem);
if(!elem.match(/^([A-Za-z0-9])+$/i)){
alert("กรุณาใส่ข้อมูลที่เป็นตัวอักษรภาษาอังกฤษและตัวเลขเท่านั้น");
return false;
}
})
$("#confirm_password").on('change',function(){
var elem = document.getElementById('confirm_password').value;
// console.log(elem);
if(!elem.match(/^([A-Za-z0-9])+$/i)){
alert("กรุณาใส่ข้อมูลที่เป็นตัวอักษรภาษาอังกฤษและตัวเลขเท่านั้น");
return false;
}
})
function validateForm() {
var password = document.forms["changeForgotpassword"]["password"].value;
...
...
www/src/Template/Users/change_password.ctp
View file @
3cd64980
...
...
@@ -49,6 +49,34 @@
<!-- ------------------------------- popup ----------------------------------- -->
<script>
$("#oldpassword").on('change',function(){
var elem = document.getElementById('oldpassword').value;
// console.log(elem);
if(!elem.match(/^([A-Za-z0-9])+$/i)){
alert("กรุณาใส่ข้อมูลที่เป็นตัวอักษรภาษาอังกฤษและตัวเลขเท่านั้น");
return false;
}
})
$("#password").on('change',function(){
var elem = document.getElementById('password').value;
// console.log(elem);
if(!elem.match(/^([A-Za-z0-9])+$/i)){
alert("กรุณาใส่ข้อมูลที่เป็นตัวอักษรภาษาอังกฤษและตัวเลขเท่านั้น");
return false;
}
})
$("#confirm_password").on('change',function(){
var elem = document.getElementById('confirm_password').value;
// console.log(elem);
if(!elem.match(/^([A-Za-z0-9])+$/i)){
alert("กรุณาใส่ข้อมูลที่เป็นตัวอักษรภาษาอังกฤษและตัวเลขเท่านั้น");
return false;
}
})
function validateForm() {
var password = document.forms["changePressword"]["oldpassword"].value;
...
...
www/src/Template/Users/signup.ctp
View file @
3cd64980
This diff is collapsed.
Click to expand it.
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