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
f2e72c36
authored
May 24, 2018
by
Teeradone-PIM
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'integration' into teeradone
parents
8f72160e
7d48d6ba
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
26 additions
and
19 deletions
+26
-19
www/src/Controller/ProfilesController.php
+7
-10
www/src/Controller/UserCardsController.php
+0
-1
www/src/Controller/UsersController.php
+19
-8
No files found.
www/src/Controller/ProfilesController.php
View file @
f2e72c36
...
@@ -14,7 +14,7 @@ class ProfilesController extends AppController
...
@@ -14,7 +14,7 @@ class ProfilesController extends AppController
/*******************************/
/*******************************/
$id
=
$this
->
Auth
->
user
(
'id'
);
$id
=
$this
->
Auth
->
user
(
'id'
);
$this
->
loadModel
(
'Users'
);
$this
->
loadModel
(
'Users'
);
$responseUserProfile
=
$this
->
Users
->
get
(
$id
,
[
$responseUserProfile
=
$this
->
Users
->
get
(
$id
,
[
...
@@ -28,6 +28,7 @@ class ProfilesController extends AppController
...
@@ -28,6 +28,7 @@ class ProfilesController extends AppController
'user_id'
=>
$id
]
'user_id'
=>
$id
]
])
->
first
();
])
->
first
();
//********DropdownCountry********
//********DropdownCountry********
$this
->
loadModel
(
'MasterCountries'
);
$this
->
loadModel
(
'MasterCountries'
);
$Country
=
$this
->
MasterCountries
->
find
(
'list'
,
[
$Country
=
$this
->
MasterCountries
->
find
(
'list'
,
[
...
@@ -46,8 +47,8 @@ class ProfilesController extends AppController
...
@@ -46,8 +47,8 @@ class ProfilesController extends AppController
'keyField'
=>
'id'
,
'keyField'
=>
'id'
,
'valueField'
=>
'province_name_th'
'valueField'
=>
'province_name_th'
])
])
->
where
([
'master_country_id ='
=>
$responseUserPersonal
[
'master_country_id'
]])
->
where
([
'master_country_id ='
=>
$responseUserPersonal
[
'master_country_id'
]])
->
order
([
'province_name_th'
]);
->
order
([
'province_name_th'
]);
// pr($Province);die;
// pr($Province);die;
if
(
!
empty
(
$Province
))
$Province
=
$Province
->
toArray
();
if
(
!
empty
(
$Province
))
$Province
=
$Province
->
toArray
();
...
@@ -55,8 +56,6 @@ class ProfilesController extends AppController
...
@@ -55,8 +56,6 @@ class ProfilesController extends AppController
$dateNow
=
$res
->
i18nFormat
(
'dd/MM/yyyy'
);
$dateNow
=
$res
->
i18nFormat
(
'dd/MM/yyyy'
);
if
(
$this
->
request
->
is
([
'patch'
,
'post'
,
'put'
]))
{
if
(
$this
->
request
->
is
([
'patch'
,
'post'
,
'put'
]))
{
// pr($this->request->data['email']);die;
$data
=
$this
->
request
->
data
;
$data
=
$this
->
request
->
data
;
// pr($this->request->data);die;
// pr($this->request->data);die;
...
@@ -97,8 +96,8 @@ class ProfilesController extends AppController
...
@@ -97,8 +96,8 @@ class ProfilesController extends AppController
$birthdate
=
explode
(
"/"
,
$this
->
request
->
data
[
'UserPersonals'
][
'birthdate'
]);
$birthdate
=
explode
(
"/"
,
$this
->
request
->
data
[
'UserPersonals'
][
'birthdate'
]);
$birthdate
=
$birthdate
[
2
]
.
'-'
.
$birthdate
[
1
]
.
'-'
.
$birthdate
[
0
];
$birthdate
=
$birthdate
[
2
]
.
'-'
.
$birthdate
[
1
]
.
'-'
.
$birthdate
[
0
];
// pr($userPersonals);die;
// pr($userPersonals);die;
//
$userPersonals = $this->UserPersonals->patchEntity($userPersonals, $data['UserPersonals']);
$userPersonals
=
$this
->
UserPersonals
->
patchEntity
(
$userPersonals
,
$data
[
'UserPersonals'
]);
$userPersonals
[
'firstname_th'
]
=
$this
->
request
->
data
[
'UserPersonals'
][
'firstname_th'
];
$userPersonals
[
'firstname_th'
]
=
$this
->
request
->
data
[
'UserPersonals'
][
'firstname_th'
];
$userPersonals
[
'lastname_th'
]
=
$this
->
request
->
data
[
'UserPersonals'
][
'lastname_th'
];
$userPersonals
[
'lastname_th'
]
=
$this
->
request
->
data
[
'UserPersonals'
][
'lastname_th'
];
$userPersonals
[
'email'
]
=
$this
->
request
->
data
[
'email'
];
$userPersonals
[
'email'
]
=
$this
->
request
->
data
[
'email'
];
...
@@ -107,9 +106,7 @@ class ProfilesController extends AppController
...
@@ -107,9 +106,7 @@ class ProfilesController extends AppController
$userPersonals
[
'master_country_id'
]
=
$this
->
request
->
data
[
'master_country_id'
];
$userPersonals
[
'master_country_id'
]
=
$this
->
request
->
data
[
'master_country_id'
];
$userPersonals
[
'master_province_id'
]
=
$this
->
request
->
data
[
'master_province_id'
];
$userPersonals
[
'master_province_id'
]
=
$this
->
request
->
data
[
'master_province_id'
];
$userPersonals
[
'modified_by'
]
=
$id
;
$userPersonals
[
'modified_by'
]
=
$id
;
// $userPersonals = $this->UserPersonals->patchEntity($userPersonals, $data['UserPersonals']);
// pr($userPersonals);die;
$userPersonals
=
$this
->
Users
->
patchEntity
(
$userPersonals
,
$this
->
request
->
getData
());
// pr($userPersonals);die;
if
(
$this
->
UserPersonals
->
save
(
$userPersonals
))
{
if
(
$this
->
UserPersonals
->
save
(
$userPersonals
))
{
$this
->
Flash
->
success
(
__
(
'Update Complete.'
));
$this
->
Flash
->
success
(
__
(
'Update Complete.'
));
...
...
www/src/Controller/UserCardsController.php
View file @
f2e72c36
...
@@ -306,7 +306,6 @@ class UserCardsController extends AppController
...
@@ -306,7 +306,6 @@ class UserCardsController extends AppController
$userCard
[
'user_id'
]
=
$this
->
Auth
->
user
(
'id'
);
$userCard
[
'user_id'
]
=
$this
->
Auth
->
user
(
'id'
);
// pr($userCard);die;
// pr($userCard);die;
if
(
$this
->
UserCards
->
save
(
$userCard
))
{
if
(
$this
->
UserCards
->
save
(
$userCard
))
{
// pr('sdsd');die;
$TempUserCards
[
'is_used'
]
=
0
;
$TempUserCards
[
'is_used'
]
=
0
;
$this
->
TempUserCards
->
save
(
$TempUserCards
);
$this
->
TempUserCards
->
save
(
$TempUserCards
);
$this
->
loadModel
(
'UserEntities'
);
$this
->
loadModel
(
'UserEntities'
);
...
...
www/src/Controller/UsersController.php
View file @
f2e72c36
...
@@ -117,12 +117,13 @@ class UsersController extends AppController {
...
@@ -117,12 +117,13 @@ class UsersController extends AppController {
'keyField'
=>
'id'
,
'keyField'
=>
'id'
,
'valueField'
=>
'province_name_th'
'valueField'
=>
'province_name_th'
]
]
);
);
if
(
!
empty
(
$provinces
))
$provinces
=
$provinces
->
toArray
();
if
(
!
empty
(
$provinces
))
$provinces
=
$provinces
->
toArray
();
$this
->
set
(
compact
(
'provinces'
,
'countries'
));
$this
->
set
(
compact
(
'provinces'
,
'countries'
));
$this
->
viewBuilder
()
->
layout
(
'blank'
);
$this
->
viewBuilder
()
->
layout
(
'blank'
);
}
}
#---------------------------------------------------------------------------------------------------
#---------------------------------------------------------------------------------------------------
#Signup
#Signup
...
@@ -414,11 +415,21 @@ class UsersController extends AppController {
...
@@ -414,11 +415,21 @@ class UsersController extends AppController {
#---------------------------------------------------------------------------------------------------
#---------------------------------------------------------------------------------------------------
public
function
signout
()
/**
{
*
$this
->
checkToken
();
* Function user logout / signout
* @author sarawutt.b
}
* @since 2018/05/22 16:44:20
* @license PAKGON
* @return void
*/
public
function
signout
()
{
$http
=
new
Client
();
$result
=
$http
->
delete
(
Configure
::
read
(
'OAUTH2_PROVIDER.TOKEN_DETETE'
)
.
'/'
.
$this
->
Auth
->
user
(
'id'
))
->
body
();
$this
->
Flash
->
success
(
__
(
'You are now logged out.'
));
return
$this
->
redirect
(
$this
->
Auth
->
logout
());
}
...
...
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