Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
S
SkuciSe
Overview
Overview
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
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Tim 2 - 2022
SkuciSe
Commits
c4f6c25c
Commit
c4f6c25c
authored
Sep 04, 2022
by
Bogdan Andjelkovic
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
edit password - back finished
parent
147aaa1d
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
3 additions
and
3 deletions
+3
-3
SkuciSe/src/main/java/com/example/SkuciSe/controller/ProfileController.java
+1
-1
SkuciSe/src/main/java/com/example/SkuciSe/repository/KorisnikRepository.java
+2
-2
No files found.
SkuciSe/src/main/java/com/example/SkuciSe/controller/ProfileController.java
View file @
c4f6c25c
...
@@ -75,7 +75,7 @@ public class ProfileController
...
@@ -75,7 +75,7 @@ public class ProfileController
public
String
postPasswordEditSave
(
Model
model
,
@ModelAttribute
Korisnik
korisnik
,
@AuthenticationPrincipal
KorisnikDetails
loggedUser
)
public
String
postPasswordEditSave
(
Model
model
,
@ModelAttribute
Korisnik
korisnik
,
@AuthenticationPrincipal
KorisnikDetails
loggedUser
)
{
{
System
.
out
.
println
(
korisnik
.
toString
());
System
.
out
.
println
(
korisnik
.
toString
());
kRepo
.
updateSifra
(
korisnik
);
kRepo
.
updateSifra
(
korisnik
,
loggedUser
.
getKorisnik
().
getKorisnikId
()
);
loggedUser
.
setKorisnikSifra
(
korisnik
.
getSifra
());
loggedUser
.
setKorisnikSifra
(
korisnik
.
getSifra
());
return
"redirect:/index"
;
return
"redirect:/index"
;
}
}
...
...
SkuciSe/src/main/java/com/example/SkuciSe/repository/KorisnikRepository.java
View file @
c4f6c25c
...
@@ -153,11 +153,11 @@ public class KorisnikRepository
...
@@ -153,11 +153,11 @@ public class KorisnikRepository
}
}
}
}
public
void
updateSifra
(
Korisnik
korisnik
)
public
void
updateSifra
(
Korisnik
korisnik
,
int
korisnikId
)
{
{
String
sql
=
" update korisnik "
+
String
sql
=
" update korisnik "
+
" set sifra = '"
+
new
BCryptPasswordEncoder
().
encode
(
korisnik
.
getSifra
())
+
" set sifra = '"
+
new
BCryptPasswordEncoder
().
encode
(
korisnik
.
getSifra
())
+
"' where korisnikid = "
+
korisnik
.
getKorisnikId
()
;
"' where korisnikid = "
+
korisnik
Id
;
try
{
try
{
dataBase
.
statement
.
executeUpdate
(
sql
);
dataBase
.
statement
.
executeUpdate
(
sql
);
}
catch
(
SQLException
e
)
{
}
catch
(
SQLException
e
)
{
...
...
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