Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
S
SooonerHotel
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
吴贤德
SooonerHotel
Commits
cf4e58ba
Commit
cf4e58ba
authored
Jul 31, 2019
by
吴贤德
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改用户时如果没有GA秘钥则生成保存
parent
4eff2193
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
1 deletion
+10
-1
UserAction.class.php
SooonerHotel/App/Lib/Action/System/UserAction.class.php
+9
-1
adduser.html
SooonerHotel/App/Tpl/System/zh-cn/User/adduser.html
+1
-0
No files found.
SooonerHotel/App/Lib/Action/System/UserAction.class.php
View file @
cf4e58ba
...
@@ -56,6 +56,7 @@ class UserAction extends CommonAction{
...
@@ -56,6 +56,7 @@ class UserAction extends CommonAction{
$this
->
display
();
$this
->
display
();
}
}
public
function
addUserHandle
(){
public
function
addUserHandle
(){
$ga
=
new
PHPGangsta_GoogleAuthenticator
();
$UserModel
=
D
(
"User"
);
$UserModel
=
D
(
"User"
);
$RoleUserModel
=
D
(
"RoleUser"
);
$RoleUserModel
=
D
(
"RoleUser"
);
$SpUserMapModel
=
D
(
"SpUserMap"
);
$SpUserMapModel
=
D
(
"SpUserMap"
);
...
@@ -86,6 +87,13 @@ class UserAction extends CommonAction{
...
@@ -86,6 +87,13 @@ class UserAction extends CommonAction{
}
}
unset
(
$user
[
'account'
]);
unset
(
$user
[
'account'
]);
unset
(
$user
[
'password'
]);
unset
(
$user
[
'password'
]);
$user
[
"secret"
]
=
$_POST
[
"secret"
];
if
(
$user
[
"secret"
]
==
""
){
$secret
=
$ga
->
createSecret
();
$user
[
"secret"
]
=
$secret
;
}
if
(
$UserModel
->
save
(
$user
)){
if
(
$UserModel
->
save
(
$user
)){
if
(
$RoleUserModel
->
where
(
"user_id="
.
$uid
)
->
delete
()){
if
(
$RoleUserModel
->
where
(
"user_id="
.
$uid
)
->
delete
()){
$role
[
"role_id"
]
=
I
(
"role_id"
,
""
,
int
);
$role
[
"role_id"
]
=
I
(
"role_id"
,
""
,
int
);
...
@@ -107,7 +115,7 @@ class UserAction extends CommonAction{
...
@@ -107,7 +115,7 @@ class UserAction extends CommonAction{
$user
[
"update_time"
]
=
time
();
$user
[
"update_time"
]
=
time
();
$user
[
"remark"
]
=
''
;
$user
[
"remark"
]
=
''
;
$ga
=
new
PHPGangsta_GoogleAuthenticator
();
$secret
=
$ga
->
createSecret
();
$secret
=
$ga
->
createSecret
();
$user
[
"secret"
]
=
$secret
;
$user
[
"secret"
]
=
$secret
;
...
...
SooonerHotel/App/Tpl/System/zh-cn/User/adduser.html
View file @
cf4e58ba
...
@@ -71,6 +71,7 @@ $().ready(function(){
...
@@ -71,6 +71,7 @@ $().ready(function(){
</div>
</div>
<div><label
class=
"label_s"
>
GA秘钥:
</label>
<div><label
class=
"label_s"
>
GA秘钥:
</label>
{$user.secret}
{$user.secret}
<input
type=
"hidden"
name=
"secret"
value=
"{$user.secret}"
>
</div>
</div>
</if>
</if>
<div><label
class=
"label_s"
>
昵称:
</label>
<div><label
class=
"label_s"
>
昵称:
</label>
...
...
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