<commit_before>package Mauro;

import java.util.Calendar;
import java.util.GregorianCalendar;
import javax.annotation.PostConstruct;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpSession;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.core.Authentication;
import org.springframework.security.core.context.SecurityContextHolder;
import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;

@Controller
public class ControladorUsuario {

	@Autowired
	private VideojuegoRepository repositorioVideojuegos;
	@Autowired
	private UsuarioRepository repositorioUsuarios;
	@Autowired
	private ValoracionRepository repositorioValoraciones;
	@Autowired
	private PedidoRepository repositorioPedidos;

	
	@RequestMapping("/")
	public String paginaInicial(Model model, HttpServletRequest request, HttpSession sesion){
		Authentication authentication = SecurityContextHolder.getContext().getAuthentication();
		String currentPrincipalName = authentication.getName();
		sesion = request.getSession();
		sesion.setAttribute("email", currentPrincipalName);
		boolean loged = false;
		if(currentPrincipalName==null){ //Nadie conectado
			loged = true;
			model.addAttribute("loged",loged);
		}
		model.addAttribute("user", request.isUserInRole("USER"));
		return "index";
	}
	
	@GetMapping("/login_usuario")<commit_msg>Update - Funcionamiento boton IniciarSesion<commit_after>package Mauro;

import java.util.Calendar;
import java.util.GregorianCalendar;
import javax.annotation.PostConstruct;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpSession;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.core.Authentication;
import org.springframework.security.core.context.SecurityContextHolder;
import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;

@Controller
public class ControladorUsuario {

	@Autowired
	private VideojuegoRepository repositorioVideojuegos;
	@Autowired
	private UsuarioRepository repositorioUsuarios;
	@Autowired
	private ValoracionRepository repositorioValoraciones;
	@Autowired
	private PedidoRepository repositorioPedidos;

	
	@RequestMapping("/")
	public String paginaInicial(Model model, HttpServletRequest request, HttpSession sesion){
		Authentication authentication = SecurityContextHolder.getContext().getAuthentication();
		String currentPrincipalName = authentication.getName();
		sesion = request.getSession();
		sesion.setAttribute("email", currentPrincipalName);
		boolean loged = true;
		if(currentPrincipalName!="anonymousUser"){ //Nadie conectado
			loged = false;
		}
		model.addAttribute("loged",loged);
		model.addAttribute("user", request.isUserInRole("USER"));
		return "index";
	}
	
	@GetMapping("/login_usuario")
{'fraction_non_alphanumeric': 0.09426934097421204, 'fraction_numerical': 0.0, 'mean_word_length': 7.371702637889689, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '130693', 'n_tokens_mistral': 977, 'n_tokens_neox': 950, 'n_words': 172}