Index: src/main/java/com/example/moviezone/config/CustomUsernamePasswordAuthenticationProvider.java
===================================================================
--- src/main/java/com/example/moviezone/config/CustomUsernamePasswordAuthenticationProvider.java	(revision cc88ec29a1a7d762f09c900242e3e7f9449783e0)
+++ src/main/java/com/example/moviezone/config/CustomUsernamePasswordAuthenticationProvider.java	(revision 54444094b45e0d3d9666c117ed0c957c2900bca0)
@@ -2,4 +2,5 @@
 
 
+import com.example.moviezone.model.exceptions.UserNotFoundException;
 import com.example.moviezone.service.UserService;
 import org.springframework.security.authentication.AuthenticationProvider;
@@ -35,4 +36,5 @@
 
         UserDetails userDetails = this.userService.findByUsername(username);
+
 //        String realPassword = userDetails.getPassword();
         if (!Objects.equals(password,userDetails.getPassword())) {
Index: src/main/java/com/example/moviezone/model/Worker.java
===================================================================
--- src/main/java/com/example/moviezone/model/Worker.java	(revision cc88ec29a1a7d762f09c900242e3e7f9449783e0)
+++ src/main/java/com/example/moviezone/model/Worker.java	(revision 54444094b45e0d3d9666c117ed0c957c2900bca0)
@@ -32,4 +32,11 @@
         super(password, first_name, last_name, address, contact_number, username);
     }
+    public Worker(String password, String first_name, String last_name, String address, String contact_number, String username,String position,String work_hours_from,String work_hours_to,Cinema cinema) {
+        super(password, first_name, last_name, address, contact_number, username);
+        this.position=position;
+        this.work_hours_from=work_hours_from;
+        this.work_hours_to=work_hours_to;
+        this.cinema=cinema;
+    }
 
     @Override
Index: src/main/java/com/example/moviezone/service/CinemaService.java
===================================================================
--- src/main/java/com/example/moviezone/service/CinemaService.java	(revision cc88ec29a1a7d762f09c900242e3e7f9449783e0)
+++ src/main/java/com/example/moviezone/service/CinemaService.java	(revision 54444094b45e0d3d9666c117ed0c957c2900bca0)
@@ -7,3 +7,4 @@
 public interface CinemaService {
     List<Cinema> findAllCinemas();
+    Cinema findCinemaById(Integer id_cinema);
 }
Index: src/main/java/com/example/moviezone/service/Impl/CinemaServiceImpl.java
===================================================================
--- src/main/java/com/example/moviezone/service/Impl/CinemaServiceImpl.java	(revision cc88ec29a1a7d762f09c900242e3e7f9449783e0)
+++ src/main/java/com/example/moviezone/service/Impl/CinemaServiceImpl.java	(revision 54444094b45e0d3d9666c117ed0c957c2900bca0)
@@ -20,3 +20,8 @@
         return cinemaRepository.findAll();
     }
+
+    @Override
+    public Cinema findCinemaById(Integer id_cinema) {
+        return cinemaRepository.findById(id_cinema).orElseThrow(RuntimeException::new);
+    }
 }
Index: src/main/java/com/example/moviezone/service/Impl/UserServiceImpl.java
===================================================================
--- src/main/java/com/example/moviezone/service/Impl/UserServiceImpl.java	(revision cc88ec29a1a7d762f09c900242e3e7f9449783e0)
+++ src/main/java/com/example/moviezone/service/Impl/UserServiceImpl.java	(revision 54444094b45e0d3d9666c117ed0c957c2900bca0)
@@ -1,8 +1,5 @@
 package com.example.moviezone.service.Impl;
 
-import com.example.moviezone.model.Customer;
-import com.example.moviezone.model.Role;
-import com.example.moviezone.model.User;
-import com.example.moviezone.model.Worker;
+import com.example.moviezone.model.*;
 import com.example.moviezone.model.exceptions.InvalidUsernameOrPasswordException;
 import com.example.moviezone.model.exceptions.PasswordsDoNotMatchException;
@@ -75,4 +72,10 @@
     }
 
+    @Override
+    public void registerWorker(String first_name, String last_name, String username, String email, String number, String password, String position, String work_hours_from, String work_hours_to, Cinema cinema) {
+        userRepository.save(new Worker(password,first_name,last_name,email,number,username,position,work_hours_from,work_hours_to,cinema));
+
+    }
+
 
 }
Index: src/main/java/com/example/moviezone/service/UserService.java
===================================================================
--- src/main/java/com/example/moviezone/service/UserService.java	(revision cc88ec29a1a7d762f09c900242e3e7f9449783e0)
+++ src/main/java/com/example/moviezone/service/UserService.java	(revision 54444094b45e0d3d9666c117ed0c957c2900bca0)
@@ -1,4 +1,5 @@
 package com.example.moviezone.service;
 
+import com.example.moviezone.model.Cinema;
 import com.example.moviezone.model.Role;
 import com.example.moviezone.model.User;
@@ -13,3 +14,4 @@
     void register(String first_name, String last_name,String username, String email, String number, String password, Role role);
     User login(String username,String password);
+    void registerWorker(String first_name, String last_name, String username, String email, String number, String password, String position, String work_hours_from, String work_hours_to, Cinema cinema);
 }
Index: src/main/java/com/example/moviezone/web/HomeController.java
===================================================================
--- src/main/java/com/example/moviezone/web/HomeController.java	(revision cc88ec29a1a7d762f09c900242e3e7f9449783e0)
+++ src/main/java/com/example/moviezone/web/HomeController.java	(revision 54444094b45e0d3d9666c117ed0c957c2900bca0)
@@ -17,9 +17,12 @@
 
 import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
 import javax.servlet.http.HttpSession;
 import javax.transaction.Transactional;
+import java.io.IOException;
 import java.time.LocalDate;
 import java.util.LinkedList;
 import java.util.List;
+import java.util.Objects;
 import java.util.stream.Collectors;
 
@@ -151,11 +154,11 @@
             model.addAttribute("hasError", true);
             model.addAttribute("error", e.getMessage());
-            return "/login";
-        }
-
-    }
-
-    @PostMapping()
-    public String register(@RequestParam String username,
+            return "login";
+        }
+
+    }
+
+    @PostMapping("/register")
+    public void register(@RequestParam String username,
                            @RequestParam String first_name,
                            @RequestParam String last_name,
@@ -164,16 +167,53 @@
                            @RequestParam String email,
                            @RequestParam String number,
-                           @RequestParam Role role)
-    {
+                           @RequestParam Role role,HttpServletResponse response, HttpSession session) throws IOException {
+
+        System.out.println(username + first_name+ last_name + password + repeatedPassword + email + number + role);
+        if(role.equals(Role.ROLE_ADMIN)){
+            session.setAttribute("username", username);
+            session.setAttribute("first_name", first_name);
+            session.setAttribute("last_name", last_name);
+            session.setAttribute("password", password);
+            session.setAttribute("repeatedPassword", repeatedPassword);
+            session.setAttribute("email", email);
+            session.setAttribute("number", number);
+            response.sendRedirect("/registerWorker");
+        }
+        else {
+            try {
+                userService.register(first_name,last_name,username,email,number,password,role);
+                response.sendRedirect( "redirect:/login");
+            }catch (PasswordsDoNotMatchException exception)
+            {
+//                return "redirect:/register?error=" + exception.getMessage();
+            }
+        }
+
+    }
+    @GetMapping("/registerWorker")
+    public String getRegisterWorkerPage(Model model){
+        model.addAttribute("cinemas",cinemaService.findAllCinemas());
+        model.addAttribute("bodyContent","registerWorker");
+        return "master-template";
+    }
+    @PostMapping("/finishRegister")
+    public void handleWorkerRegister(Model model, HttpServletResponse response, HttpSession session,
+                                     @RequestParam String position, @RequestParam String work_hours_from,
+                                     @RequestParam String work_hours_to,@RequestParam Integer id_cinema){
+        System.out.println("here?");
+        String username = (String) session.getAttribute("username");
+        String first_name = (String) session.getAttribute("first_name");
+        String last_name = (String) session.getAttribute("last_name");
+        String password = (String) session.getAttribute("password");
+        String email = (String) session.getAttribute("email");
+        String number = (String) session.getAttribute("number");
+        Cinema cinema=cinemaService.findCinemaById(id_cinema);
+        userService.registerWorker(first_name,last_name,username,email,number,password,position,work_hours_from,work_hours_to,cinema);
         try {
-           userService.register(first_name,last_name,username,email,number,password,role);
-            return "redirect:/login";
-        }catch (PasswordsDoNotMatchException exception)
-        {
-            return "redirect:/register?error=" + exception.getMessage();
-        }
-
-    }
-
+            response.sendRedirect("/login");
+        } catch (IOException e) {
+            throw new RuntimeException(e);
+        }
+    }
 
     @GetMapping("/films")
