Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Koolapong Kongpitak
pms-server
Commits
a6f3a3c6
Commit
a6f3a3c6
authored
4 years ago
by
Koolapong Kongpitak
Browse files
Options
Download
Email Patches
Plain Diff
Add change password
parent
a4653c04
dev
Account
K9
MA
Release
master
v2.02
v2.0.1
v2.00
v1.13
v1.0
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
SYSCore/Controllers/SystemApiController.cs
+49
-0
SYSCore/Controllers/SystemApiController.cs
with
49 additions
and
0 deletions
+49
-0
SYSCore/Controllers/SystemApiController.cs
+
49
-
0
View file @
a6f3a3c6
...
...
@@ -155,6 +155,47 @@ namespace SYS_Core.Controllers
#
endregion
#
region
changePwd
[
HttpPost
,
Route
(
"ChangePwd"
)]
public
IHttpActionResult
ChangePwd
([
FromBody
]
ChangePwdModel
pCPwd
)
{
if
(
pCPwd
.
newpassword
!=
pCPwd
.
confirmpassword
)
{
return
ResponseMessage
(
Request
.
CreateResponse
(
HttpStatusCode
.
NotAcceptable
,
"Please check new password and confirm new password."
));
}
OracleCommand
cmd
=
new
OracleCommand
();
//check username & password
cmd
.
CommandText
=
"SP_NP_CH_PWD_CHK"
;
cmd
.
Parameters
.
Add
(
"P_SK_USER_ID"
,
OracleDbType
.
Varchar2
).
Value
=
pCPwd
.
username
;
cmd
.
Parameters
.
Add
(
"P_PASSWORD"
,
OracleDbType
.
Varchar2
).
Value
=
pCPwd
.
oldpassword
;
cmd
.
Parameters
.
Add
(
"P_NEW_PASSWORD"
,
OracleDbType
.
Varchar2
).
Value
=
pCPwd
.
newpassword
;
cmd
.
Parameters
.
Add
(
"R_STATUS"
,
OracleDbType
.
Varchar2
,
10
).
Direction
=
ParameterDirection
.
Output
;
cmd
=
oOracledb
.
SqlQueryReturnValue
(
cmd
);
if
(
cmd
.
Parameters
[
"R_STATUS"
].
Value
.
ToString
()
==
"Pass"
)
{
cmd
=
new
OracleCommand
();
cmd
.
CommandText
=
"SP_NP_CH_PWD"
;
cmd
.
Parameters
.
Add
(
"P_SK_USER_ID"
,
OracleDbType
.
Varchar2
).
Value
=
pCPwd
.
username
;
cmd
.
Parameters
.
Add
(
"P_NEW_PASSWORD"
,
OracleDbType
.
Varchar2
).
Value
=
pCPwd
.
newpassword
;
cmd
=
oOracledb
.
SqlQueryReturnValue
(
cmd
);
}
else
if
(
cmd
.
Parameters
[
"R_STATUS"
].
Value
.
ToString
()
==
"Fail"
)
{
return
ResponseMessage
(
Request
.
CreateResponse
(
HttpStatusCode
.
NotAcceptable
,
"Incorrect current password."
));
}
else
if
(
cmd
.
Parameters
[
"R_STATUS"
].
Value
.
ToString
()
==
"Used"
)
{
return
ResponseMessage
(
Request
.
CreateResponse
(
HttpStatusCode
.
NotAcceptable
,
"Password should not same with used password."
));
}
return
Ok
();
}
#
endregion
[
HttpGet
,
Route
(
"GetSystemMenu"
)]
[
Authorize
]
public
IHttpActionResult
GetSystemMenu
()
...
...
@@ -1107,5 +1148,13 @@ namespace SYS_Core.Controllers
public
string
FILE_NAME
{
get
;
set
;
}
public
string
FILE_LOCATION
{
get
;
set
;
}
}
public
class
ChangePwdModel
{
public
string
username
{
get
;
set
;
}
public
string
oldpassword
{
get
;
set
;
}
public
string
newpassword
{
get
;
set
;
}
public
string
confirmpassword
{
get
;
set
;
}
}
}
This diff is collapsed.
Click to expand it.
Write
Preview
Supports
Markdown
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
Menu
Projects
Groups
Snippets
Help