Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
S
set_password_api
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Alina Habibulina
set_password_api
Commits
e0815b0d
Commit
e0815b0d
authored
Jun 20, 2018
by
Alina Habibulina
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix 6
parent
c33568c5
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
28 deletions
+9
-28
src/main/java/kz/arta/ext/sap/db/UserManager.java
src/main/java/kz/arta/ext/sap/db/UserManager.java
+9
-28
No files found.
src/main/java/kz/arta/ext/sap/db/UserManager.java
View file @
e0815b0d
...
...
@@ -31,16 +31,9 @@ public class UserManager {
chechExistance
.
setString
(
1
,
login
);
ResultSet
res
=
chechExistance
.
executeQuery
();
int
columns
=
res
.
getMetaData
().
getColumnCount
();
StringBuilder
message
=
new
StringBuilder
();
while
(
res
.
next
())
{
for
(
int
i
=
1
;
i
<=
columns
;
i
++){
message
.
append
(
res
.
getString
(
i
)
+
" "
);
}
}
if
(
message
.
toString
().
length
()
>
0
)
return
200
;
if
(
res
.
next
())
{
return
200
;
}
else
return
404
;
}
catch
(
SQLException
|
NamingException
e
)
{
...
...
@@ -80,16 +73,10 @@ public class UserManager {
searchUser
.
setString
(
1
,
login
);
searchUser
.
setString
(
2
,
password
);
ResultSet
rs
=
searchUser
.
executeQuery
();
int
columns
=
rs
.
getMetaData
().
getColumnCount
();
StringBuilder
message
=
new
StringBuilder
();
while
(
rs
.
next
())
{
for
(
int
i
=
1
;
i
<=
columns
;
i
++){
message
.
append
(
rs
.
getString
(
i
)
+
" "
);
}
}
if
(
message
.
toString
().
length
()
>
0
)
return
200
;
if
(
rs
.
next
())
{
return
200
;
}
return
401
;
...
...
@@ -108,16 +95,10 @@ public class UserManager {
PreparedStatement
isAdminCheck
=
con
.
prepareStatement
(
"SELECT * FROM users WHERE login = ? AND isadmin = 1"
);
isAdminCheck
.
setString
(
1
,
login
);
ResultSet
rs
=
isAdminCheck
.
executeQuery
();
int
columns
=
rs
.
getMetaData
().
getColumnCount
();
StringBuilder
message
=
new
StringBuilder
();
while
(
rs
.
next
())
{
for
(
int
i
=
1
;
i
<=
columns
;
i
++){
message
.
append
(
rs
.
getString
(
i
)
+
" "
);
}
}
if
(
message
.
toString
().
length
()
>
0
)
return
1
;
if
(
rs
.
next
())
{
return
1
;
}
return
0
;
...
...
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