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
4dd283e1
authored
May 24, 2018
by
Prasong Putichanchai
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update user
parent
68b33d4e
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
25 additions
and
16 deletions
+25
-16
www/src/Controller/ProfilesController.php
+4
-5
www/src/Controller/UserCardsController.php
+2
-3
www/src/Controller/UsersController.php
+19
-8
No files found.
www/src/Controller/ProfilesController.php
View file @
4dd283e1
...
...
@@ -14,7 +14,7 @@ class ProfilesController extends AppController
/*******************************/
$id
=
$this
->
Auth
->
user
(
'id'
);
$id
=
$this
->
Auth
->
user
(
'id'
);
$this
->
loadModel
(
'Users'
);
$responseUserProfile
=
$this
->
Users
->
get
(
$id
,
[
...
...
@@ -28,6 +28,7 @@ class ProfilesController extends AppController
'user_id'
=>
$id
]
])
->
first
();
//********DropdownCountry********
$this
->
loadModel
(
'MasterCountries'
);
$Country
=
$this
->
MasterCountries
->
find
(
'list'
,
[
...
...
@@ -46,8 +47,8 @@ class ProfilesController extends AppController
'keyField'
=>
'id'
,
'valueField'
=>
'province_name_th'
])
->
where
([
'master_country_id ='
=>
$responseUserPersonal
[
'master_country_id'
]])
->
order
([
'province_name_th'
]);
->
where
([
'master_country_id ='
=>
$responseUserPersonal
[
'master_country_id'
]])
->
order
([
'province_name_th'
]);
// pr($Province);die;
if
(
!
empty
(
$Province
))
$Province
=
$Province
->
toArray
();
...
...
@@ -55,8 +56,6 @@ class ProfilesController extends AppController
$dateNow
=
$res
->
i18nFormat
(
'dd/MM/yyyy'
);
if
(
$this
->
request
->
is
([
'patch'
,
'post'
,
'put'
]))
{
// pr($this->request->data['email']);die;
$data
=
$this
->
request
->
data
;
// pr($this->request->data);die;
...
...
www/src/Controller/UserCardsController.php
View file @
4dd283e1
...
...
@@ -306,7 +306,6 @@ class UserCardsController extends AppController
$userCard
[
'user_id'
]
=
$this
->
Auth
->
user
(
'id'
);
// pr($userCard);die;
if
(
$this
->
UserCards
->
save
(
$userCard
))
{
// pr('sdsd');die;
$TempUserCards
[
'is_used'
]
=
0
;
$this
->
TempUserCards
->
save
(
$TempUserCards
);
$this
->
loadModel
(
'UserEntities'
);
...
...
@@ -321,8 +320,8 @@ class UserCardsController extends AppController
$UserEntities
=
$this
->
UserEntities
->
newEntity
();
$UserEntities
[
'entity_code'
]
=
$TempUserCards
[
'organize_id'
];
$UserEntities
[
'user_id'
]
=
$this
->
Auth
->
user
(
'id'
);
$UserEntities
[
'create
d_by
'
]
=
$this
->
Auth
->
user
(
'id'
);
$UserEntities
[
'
modified_by
'
]
=
$this
->
Auth
->
user
(
'id'
);
$UserEntities
[
'create
_uid
'
]
=
$this
->
Auth
->
user
(
'id'
);
$UserEntities
[
'
update_uid
'
]
=
$this
->
Auth
->
user
(
'id'
);
$this
->
UserEntities
->
save
(
$UserEntities
);
}
...
...
www/src/Controller/UsersController.php
View file @
4dd283e1
...
...
@@ -117,12 +117,13 @@ class UsersController extends AppController {
'keyField'
=>
'id'
,
'valueField'
=>
'province_name_th'
]
);
);
if
(
!
empty
(
$provinces
))
$provinces
=
$provinces
->
toArray
();
$this
->
set
(
compact
(
'provinces'
,
'countries'
));
$this
->
viewBuilder
()
->
layout
(
'blank'
);
}
$this
->
viewBuilder
()
->
layout
(
'blank'
);
}
#---------------------------------------------------------------------------------------------------
#Signup
...
...
@@ -421,11 +422,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