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
42d0f3f6
Commit
42d0f3f6
authored
Sep 06, 2022
by
Milovan Samardzic
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
newOglasFront
parent
20c53dbf
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
17 additions
and
7 deletions
+17
-7
SkuciSe/src/main/java/com/example/SkuciSe/configuration/WebSecurityConfig.java
+2
-1
SkuciSe/src/main/java/com/example/SkuciSe/repository/KorisnikRepository.java
+1
-0
SkuciSe/src/main/resources/application.properties
+3
-0
SkuciSe/src/main/resources/templates/index.html
+2
-1
SkuciSe/src/main/resources/templates/lista-korisnika.html
+2
-1
SkuciSe/src/main/resources/templates/login.html
+3
-2
SkuciSe/src/main/resources/templates/novi-oglas-form.html
+0
-0
SkuciSe/src/main/resources/templates/profile-edit.html
+2
-1
SkuciSe/src/main/resources/templates/profile.html
+2
-1
No files found.
SkuciSe/src/main/java/com/example/SkuciSe/configuration/WebSecurityConfig.java
View file @
42d0f3f6
...
@@ -47,6 +47,7 @@ public class WebSecurityConfig extends WebSecurityConfigurerAdapter
...
@@ -47,6 +47,7 @@ public class WebSecurityConfig extends WebSecurityConfigurerAdapter
.
usernameParameter
(
"email"
)
.
usernameParameter
(
"email"
)
.
defaultSuccessUrl
(
"/index"
)
.
defaultSuccessUrl
(
"/index"
)
.
permitAll
()
.
permitAll
()
.
and
().
logout
().
logoutSuccessUrl
(
"/index"
).
permitAll
();
.
and
().
logout
().
logoutSuccessUrl
(
"/index"
).
permitAll
()
.
and
().
csrf
().
disable
();;
}
}
}
}
SkuciSe/src/main/java/com/example/SkuciSe/repository/KorisnikRepository.java
View file @
42d0f3f6
...
@@ -24,6 +24,7 @@ public class KorisnikRepository
...
@@ -24,6 +24,7 @@ public class KorisnikRepository
{
{
try
{
try
{
String
slika
=
Base64
.
getEncoder
().
encodeToString
(
multipartFile
.
getBytes
());
String
slika
=
Base64
.
getEncoder
().
encodeToString
(
multipartFile
.
getBytes
());
System
.
out
.
println
(
slika
.
length
());
String
sql
=
"insert into korisnik( ime, prezime, telefon, email, sifra, tipId, slika, gradid, enabled) values('"
+
korisnik
.
getIme
()+
"','"
+
korisnik
.
getPrezime
()+
"','"
+
korisnik
.
getTelefon
()+
"','"
+
korisnik
.
getEmail
()+
"','"
+
new
BCryptPasswordEncoder
().
encode
(
korisnik
.
getSifra
())+
"',1, '"
+
slika
+
"', "
+
korisnik
.
getGradId
()+
",false)"
;
String
sql
=
"insert into korisnik( ime, prezime, telefon, email, sifra, tipId, slika, gradid, enabled) values('"
+
korisnik
.
getIme
()+
"','"
+
korisnik
.
getPrezime
()+
"','"
+
korisnik
.
getTelefon
()+
"','"
+
korisnik
.
getEmail
()+
"','"
+
new
BCryptPasswordEncoder
().
encode
(
korisnik
.
getSifra
())+
"',1, '"
+
slika
+
"', "
+
korisnik
.
getGradId
()+
",false)"
;
dataBase
.
statement
.
executeUpdate
(
sql
);
dataBase
.
statement
.
executeUpdate
(
sql
);
}
catch
(
IOException
e
)
{
}
catch
(
IOException
e
)
{
...
...
SkuciSe/src/main/resources/application.properties
View file @
42d0f3f6
spring.servlet.multipart.max-file-size
=
16MB
spring.servlet.multipart.max-file-size
=
16MB
spring.servlet.multipart.max-request-size
=
16MB
spring.servlet.multipart.max-request-size
=
16MB
spring.servlet.multipart.max-file-size
=
16MB
spring.servlet.multipart.max-request-size
=
16MB
\ No newline at end of file
SkuciSe/src/main/resources/templates/index.html
View file @
42d0f3f6
...
@@ -42,9 +42,10 @@
...
@@ -42,9 +42,10 @@
</li>
</li>
</ul>
</ul>
<form
class=
"form-inline my-2 my-lg-0"
th:if=
"${loggedUser != null}"
>
<form
class=
"form-inline my-2 my-lg-0"
th:if=
"${loggedUser != null}"
>
<button
type=
"button"
class=
"btn btn-primary btn-md mr-2"
><i
class=
"fa-solid fa-plus"
></i>
Postavite
<
a
th:href=
"@{/novi-oglas}"
><
button
type=
"button"
class=
"btn btn-primary btn-md mr-2"
><i
class=
"fa-solid fa-plus"
></i>
Postavite
novi oglas
novi oglas
</button>
</button>
</a>
</form>
</form>
<ul
class=
"navbar-nav"
>
<ul
class=
"navbar-nav"
>
<li
class=
"nav-item"
th:if=
"${loggedUser == null}"
>
<li
class=
"nav-item"
th:if=
"${loggedUser == null}"
>
...
...
SkuciSe/src/main/resources/templates/lista-korisnika.html
View file @
42d0f3f6
...
@@ -41,9 +41,10 @@
...
@@ -41,9 +41,10 @@
</li>
</li>
</ul>
</ul>
<form
class=
"form-inline my-2 my-lg-0"
th:if=
"${loggedUser != null}"
>
<form
class=
"form-inline my-2 my-lg-0"
th:if=
"${loggedUser != null}"
>
<button
type=
"button"
class=
"btn btn-primary btn-md mr-2"
><i
class=
"fa-solid fa-plus"
></i>
Postavite
<
a
th:href=
"@{/novi-oglas}"
><
button
type=
"button"
class=
"btn btn-primary btn-md mr-2"
><i
class=
"fa-solid fa-plus"
></i>
Postavite
novi oglas
novi oglas
</button>
</button>
</a>
</form>
</form>
<ul
class=
"navbar-nav"
>
<ul
class=
"navbar-nav"
>
<li
class=
"nav-item"
th:if=
"${loggedUser == null}"
>
<li
class=
"nav-item"
th:if=
"${loggedUser == null}"
>
...
...
SkuciSe/src/main/resources/templates/login.html
View file @
42d0f3f6
...
@@ -41,9 +41,10 @@
...
@@ -41,9 +41,10 @@
</li>
</li>
</ul>
</ul>
<form
class=
"form-inline my-2 my-lg-0"
th:if=
"${loggedUser != null}"
>
<form
class=
"form-inline my-2 my-lg-0"
th:if=
"${loggedUser != null}"
>
<button
type=
"button"
class=
"btn btn-primary btn-md mr-2"
><i
class=
"fa-solid fa-plus"
></i>
Postavite
<
a
th:href=
"@{/novi-oglas}"
><
button
type=
"button"
class=
"btn btn-primary btn-md mr-2"
><i
class=
"fa-solid fa-plus"
></i>
Postavite
novi oglas
novi oglas
</button>
</button>
</a>
</form>
</form>
<ul
class=
"navbar-nav"
>
<ul
class=
"navbar-nav"
>
<li
class=
"nav-item"
th:if=
"${loggedUser == null}"
>
<li
class=
"nav-item"
th:if=
"${loggedUser == null}"
>
...
@@ -96,7 +97,7 @@
...
@@ -96,7 +97,7 @@
<div
class=
"invalid-feedback"
>
Sifra ne sme biti prazna!
</div>
<div
class=
"invalid-feedback"
>
Sifra ne sme biti prazna!
</div>
</div>
</div>
<div
class=
"invalid-feedback"
id=
"losaSifra"
>
Uneli ste pogresne podatke
!
</div>
<div
class=
"invalid-feedback"
id=
"losaSifra"
>
Nepostojeca kombinacija
!
</div>
<div
class=
"form-button mt-3"
>
<div
class=
"form-button mt-3"
>
<button
id=
"submit"
type=
"submit"
class=
"btn btn-primary"
>
Prijavi se
</button>
<button
id=
"submit"
type=
"submit"
class=
"btn btn-primary"
>
Prijavi se
</button>
...
...
SkuciSe/src/main/resources/templates/novi-oglas-form.html
0 → 100644
View file @
42d0f3f6
This diff is collapsed.
Click to expand it.
SkuciSe/src/main/resources/templates/profile-edit.html
View file @
42d0f3f6
...
@@ -39,9 +39,10 @@
...
@@ -39,9 +39,10 @@
</li>
</li>
</ul>
</ul>
<form
class=
"form-inline my-2 my-lg-0"
th:if=
"${loggedUser != null}"
>
<form
class=
"form-inline my-2 my-lg-0"
th:if=
"${loggedUser != null}"
>
<button
type=
"button"
class=
"btn btn-primary btn-md mr-2"
><i
class=
"fa-solid fa-plus"
></i>
Postavite
<
a
th:href=
"@{/novi-oglas}"
><
button
type=
"button"
class=
"btn btn-primary btn-md mr-2"
><i
class=
"fa-solid fa-plus"
></i>
Postavite
novi oglas
novi oglas
</button>
</button>
</a>
</form>
</form>
<ul
class=
"navbar-nav"
>
<ul
class=
"navbar-nav"
>
<li
class=
"nav-item"
th:if=
"${loggedUser == null}"
>
<li
class=
"nav-item"
th:if=
"${loggedUser == null}"
>
...
...
SkuciSe/src/main/resources/templates/profile.html
View file @
42d0f3f6
...
@@ -41,9 +41,10 @@
...
@@ -41,9 +41,10 @@
</li>
</li>
</ul>
</ul>
<form
class=
"form-inline my-2 my-lg-0"
th:if=
"${loggedUser != null}"
>
<form
class=
"form-inline my-2 my-lg-0"
th:if=
"${loggedUser != null}"
>
<button
type=
"button"
class=
"btn btn-primary btn-md mr-2"
><i
class=
"fa-solid fa-plus"
></i>
Postavite
<
a
th:href=
"@{/novi-oglas}"
><
button
type=
"button"
class=
"btn btn-primary btn-md mr-2"
><i
class=
"fa-solid fa-plus"
></i>
Postavite
novi oglas
novi oglas
</button>
</button>
</a>
</form>
</form>
<ul
class=
"navbar-nav"
>
<ul
class=
"navbar-nav"
>
<li
class=
"nav-item"
th:if=
"${loggedUser == null}"
>
<li
class=
"nav-item"
th:if=
"${loggedUser == null}"
>
...
...
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