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
45e2be8a
Commit
45e2be8a
authored
Jun 18, 2018
by
Alina Habibulina
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix 4
parent
3342249e
Changes
11
Show whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
17 additions
and
111 deletions
+17
-111
.classpath
.classpath
+0
-12
.project
.project
+0
-31
.settings/.jsdtscope
.settings/.jsdtscope
+0
-12
.settings/org.eclipse.jdt.core.prefs
.settings/org.eclipse.jdt.core.prefs
+0
-7
.settings/org.eclipse.wst.common.component
.settings/org.eclipse.wst.common.component
+0
-8
.settings/org.eclipse.wst.common.project.facet.core.xml
.settings/org.eclipse.wst.common.project.facet.core.xml
+0
-7
.settings/org.eclipse.wst.jsdt.ui.superType.container
.settings/org.eclipse.wst.jsdt.ui.superType.container
+0
-1
.settings/org.eclipse.wst.jsdt.ui.superType.name
.settings/org.eclipse.wst.jsdt.ui.superType.name
+0
-1
WebContent/META-INF/MANIFEST.MF
WebContent/META-INF/MANIFEST.MF
+0
-3
src/main/java/kz/arta/ext/sap/db/UserManager.java
src/main/java/kz/arta/ext/sap/db/UserManager.java
+13
-13
src/main/java/kz/arta/ext/sap/service/UnsecuredProxyService.java
...n/java/kz/arta/ext/sap/service/UnsecuredProxyService.java
+4
-16
No files found.
.classpath
deleted
100644 → 0
View file @
3342249e
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry
kind=
"src"
path=
"src"
/>
<classpathentry
kind=
"con"
path=
"org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.7"
>
<attributes>
<attribute
name=
"owner.project.facets"
value=
"java"
/>
</attributes>
</classpathentry>
<classpathentry
kind=
"con"
path=
"org.eclipse.jst.j2ee.internal.web.container"
/>
<classpathentry
kind=
"con"
path=
"org.eclipse.jst.j2ee.internal.module.container"
/>
<classpathentry
kind=
"output"
path=
"build/classes"
/>
</classpath>
.project
deleted
100644 → 0
View file @
3342249e
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>
synergy-api-proxy
</name>
<comment></comment>
<projects>
</projects>
<buildSpec>
<buildCommand>
<name>
org.eclipse.jdt.core.javabuilder
</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>
org.eclipse.wst.common.project.facet.core.builder
</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>
org.eclipse.wst.validation.validationbuilder
</name>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>
org.eclipse.jem.workbench.JavaEMFNature
</nature>
<nature>
org.eclipse.wst.common.modulecore.ModuleCoreNature
</nature>
<nature>
org.eclipse.wst.common.project.facet.core.nature
</nature>
<nature>
org.eclipse.jdt.core.javanature
</nature>
<nature>
org.eclipse.wst.jsdt.core.jsNature
</nature>
</natures>
</projectDescription>
.settings/.jsdtscope
deleted
100644 → 0
View file @
3342249e
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry
excluding=
"**/bower_components/*|**/node_modules/*|**/*.min.js"
kind=
"src"
path=
"WebContent"
/>
<classpathentry
kind=
"con"
path=
"org.eclipse.wst.jsdt.launching.JRE_CONTAINER"
/>
<classpathentry
kind=
"con"
path=
"org.eclipse.wst.jsdt.launching.WebProject"
>
<attributes>
<attribute
name=
"hide"
value=
"true"
/>
</attributes>
</classpathentry>
<classpathentry
kind=
"con"
path=
"org.eclipse.wst.jsdt.launching.baseBrowserLibrary"
/>
<classpathentry
kind=
"output"
path=
""
/>
</classpath>
.settings/org.eclipse.jdt.core.prefs
deleted
100644 → 0
View file @
3342249e
eclipse.preferences.version=1
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.7
org.eclipse.jdt.core.compiler.compliance=1.7
org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
org.eclipse.jdt.core.compiler.source=1.7
.settings/org.eclipse.wst.common.component
deleted
100644 → 0
View file @
3342249e
<?xml version="1.0" encoding="UTF-8"?>
<project-modules
id=
"moduleCoreId"
project-version=
"1.5.0"
>
<wb-module
deploy-name=
"synergy-api-proxy"
>
<wb-resource
deploy-path=
"/"
source-path=
"/WebContent"
tag=
"defaultRootSource"
/>
<wb-resource
deploy-path=
"/WEB-INF/classes"
source-path=
"/src"
/>
<property
name=
"context-root"
value=
"synergy-api-proxy"
/>
<property
name=
"java-output-path"
value=
"/synergy-api-proxy/build/classes"
/>
</wb-module>
</project-modules>
.settings/org.eclipse.wst.common.project.facet.core.xml
deleted
100644 → 0
View file @
3342249e
<?xml version="1.0" encoding="UTF-8"?>
<faceted-project>
<fixed
facet=
"wst.jsdt.web"
/>
<installed
facet=
"java"
version=
"1.7"
/>
<installed
facet=
"jst.web"
version=
"3.0"
/>
<installed
facet=
"wst.jsdt.web"
version=
"1.0"
/>
</faceted-project>
.settings/org.eclipse.wst.jsdt.ui.superType.container
deleted
100644 → 0
View file @
3342249e
org.eclipse.wst.jsdt.launching.baseBrowserLibrary
\ No newline at end of file
.settings/org.eclipse.wst.jsdt.ui.superType.name
deleted
100644 → 0
View file @
3342249e
Window
\ No newline at end of file
WebContent/META-INF/MANIFEST.MF
deleted
100644 → 0
View file @
3342249e
Manifest-Version: 1.0
Class-Path:
src/main/java/kz/arta/ext/sap/db/
Client
Manager.java
→
src/main/java/kz/arta/ext/sap/db/
User
Manager.java
View file @
45e2be8a
...
...
@@ -14,30 +14,30 @@ import java.sql.SQLException;
* Date: 04.10.2015
* Time: 12:49
*
*
Пример класса для работы
с СУБД
*
работа
с СУБД
* использует соединение, указанное в @{@link ConnectionPool}
*/
public
class
Client
Manager
{
public
class
User
Manager
{
private
static
final
Logger
LOGGER
=
LoggerFactory
.
getLogger
(
ClientManager
.
class
);
private
static
final
Logger
LOGGER
=
LoggerFactory
.
getLogger
(
UserManager
.
class
);
public
static
String
set_pass
(
String
login
,
String
new_pass
)
{
public
static
void
log
(
Object
logItem
,
String
oldPass
,
String
NewPass
,
String
Login
)
{
Connection
con
=
null
;
try
{
con
=
ConnectionPool
.
getConnection
();
PreparedStatement
st
=
con
.
prepareStatement
(
"INSERT INTO log(logged, clientid, hostname, extip, localip) VALUES (CURRENT_TIMESTAMP, ?, ?, ?, ?)"
);
// PreparedStatement st = con.prepareStatement("UPDATE users SET password= ");
st
.
setString
(
1
,
"clientId"
);
st
.
setString
(
2
,
"hostname"
);
st
.
setString
(
3
,
"extip"
);
st
.
setString
(
4
,
"localip"
);
st
.
execute
();
PreparedStatement
updatePassword
=
con
.
prepareStatement
(
"UPDATE users SET password = MD5( ? ) WHERE login = ? "
);
updatePassword
.
setString
(
1
,
new_pass
);
updatePassword
.
setString
(
2
,
login
);
updatePassword
.
executeUpdate
();
return
"{\"result\":\"success\", \"errorCode\":\"0\"}"
;
}
catch
(
SQLException
|
NamingException
e
)
{
LOGGER
.
error
(
""
,
e
);
return
"{\"status\":\"something gone wrong\", \"error\":\""
+
e
+
"\", \"errorCode\": \"500\"}"
;
}
finally
{
ConnectionPool
.
close
(
con
);
}
}
}
src/main/java/kz/arta/ext/sap/service/UnsecuredProxyService.java
View file @
45e2be8a
...
...
@@ -13,6 +13,8 @@ import org.slf4j.Logger;
import
org.slf4j.LoggerFactory
;
import
kz.arta.ext.sap.util.ConnectionPool
;
import
kz.arta.ext.sap.db.UserManager
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
...
...
@@ -57,20 +59,6 @@ public class UnsecuredProxyService {
@Path
(
"/set_password"
)
@Produces
(
MediaType
.
APPLICATION_JSON
+
"; charset=utf-8"
)
public
String
setPassword
(
@QueryParam
(
"login"
)
String
login
,
@QueryParam
(
"new_password"
)
String
new_pass
){
Connection
con
=
null
;
try
{
con
=
ConnectionPool
.
getConnection
();
String
update_passwordSQL
=
"UPDATE users SET password=MD5(\""
+
new_pass
+
"\") WHERE login =\""
+
login
+
"\";"
;
PreparedStatement
UpdatePassword
=
con
.
prepareStatement
(
update_passwordSQL
);
UpdatePassword
.
execute
();
return
"{\"result\":\"success\", \"errorCode\":\"0\"}"
;
}
catch
(
SQLException
|
NamingException
e
)
{
LOGGER
.
error
(
""
,
e
);
return
"{\"status\":\"something gone wrong\", \"error\":\""
+
e
+
"\", \"errorCode\": \"500\"}"
;
}
finally
{
ConnectionPool
.
close
(
con
);
}
return
UserManager
.
set_pass
(
login
,
new_pass
);
}
}
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