mirror of
				https://gitlab.com/animath/si/plateforme.git
				synced 2025-11-04 09:42:10 +01:00 
			
		
		
		
	Correction de problèmes mineurs
This commit is contained in:
		@@ -289,7 +289,7 @@ class Tournament
 | 
				
			|||||||
		global $DB;
 | 
							global $DB;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
		$req = $DB->query("SELECT * FROM `documents` AS `t1` "
 | 
							$req = $DB->query("SELECT * FROM `documents` AS `t1` "
 | 
				
			||||||
			. "INNER JOIN (SELECT `user`, `type`, `tournament`, MAX(`uploaded_at`) AS `last_upload`, COUNT(`team`) AS `version` FROM `documents` GROUP BY `tournament`, `team`, `type`) `t2` "
 | 
								. "INNER JOIN (SELECT `user`, `type`, `tournament`, MAX(`uploaded_at`) AS `last_upload`, COUNT(`team`) AS `version` FROM `documents` GROUP BY `tournament`, `team`, `type`, `user`) `t2` "
 | 
				
			||||||
			. "ON `t1`.`user` = `t2`.`user` AND `t1`.`type` = `t2`.`type` AND `t1`.`tournament` = `t2`.`tournament` "
 | 
								. "ON `t1`.`user` = `t2`.`user` AND `t1`.`type` = `t2`.`type` AND `t1`.`tournament` = `t2`.`tournament` "
 | 
				
			||||||
			. "WHERE `t1`.`uploaded_at` = `t2`.`last_upload` AND `t1`.`tournament` = $this->id " . ($team_id == -1 ? "" : "AND `t1`.`team` = $team_id") . " ORDER BY `t1`.`team`, `t1`.`type`;");
 | 
								. "WHERE `t1`.`uploaded_at` = `t2`.`last_upload` AND `t1`.`tournament` = $this->id " . ($team_id == -1 ? "" : "AND `t1`.`team` = $team_id") . " ORDER BY `t1`.`team`, `t1`.`type`;");
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -364,7 +364,7 @@ class User
 | 
				
			|||||||
	{
 | 
						{
 | 
				
			||||||
		global $DB;
 | 
							global $DB;
 | 
				
			||||||
		$req = $DB->query("SELECT * FROM `documents` AS `t1` "
 | 
							$req = $DB->query("SELECT * FROM `documents` AS `t1` "
 | 
				
			||||||
				. "INNER JOIN (SELECT `user`, `type`, `tournament`, MAX(`uploaded_at`) AS `last_upload`, COUNT(`team`) AS `version` FROM `documents` GROUP BY `tournament`, `type`) `t2` "
 | 
								. "INNER JOIN (SELECT `user`, `type`, `tournament`, MAX(`uploaded_at`) AS `last_upload`, COUNT(`team`) AS `version` FROM `documents` GROUP BY `tournament`, `type`, `user`) `t2` "
 | 
				
			||||||
				. "ON `t1`.`user` = `t2`.`user` AND `t1`.`type` = `t2`.`type` AND `t1`.`tournament` = `t2`.`tournament` "
 | 
									. "ON `t1`.`user` = `t2`.`user` AND `t1`.`type` = `t2`.`type` AND `t1`.`tournament` = `t2`.`tournament` "
 | 
				
			||||||
				. "WHERE `t1`.`uploaded_at` = `t2`.`last_upload` AND `t1`.`tournament` = $tournament_id AND `t1`.`user` = $this->id ORDER BY `t1`.`type`;");
 | 
									. "WHERE `t1`.`uploaded_at` = `t2`.`last_upload` AND `t1`.`tournament` = $tournament_id AND `t1`.`user` = $this->id ORDER BY `t1`.`type`;");
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -50,7 +50,7 @@ class NewUser
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
		ensure(filter_var($this->email, FILTER_VALIDATE_EMAIL), "L'adresse e-mail entrée est invalide.");
 | 
							ensure(filter_var($this->email, FILTER_VALIDATE_EMAIL), "L'adresse e-mail entrée est invalide.");
 | 
				
			||||||
		$this->email = strtolower($this->email);
 | 
							$this->email = strtolower($this->email);
 | 
				
			||||||
		ensure(userExists($this->email), "Un compte existe déjà avec cette adresse e-mail.");
 | 
							ensure(!userExists($this->email), "Un compte existe déjà avec cette adresse e-mail.");
 | 
				
			||||||
		ensure(strlen($this->password) >= 8, "Le mot de passe doit comporter au moins 8 caractères.");
 | 
							ensure(strlen($this->password) >= 8, "Le mot de passe doit comporter au moins 8 caractères.");
 | 
				
			||||||
		ensure($this->password == $this->confirm_password, "Les deux mots de passe sont différents.");
 | 
							ensure($this->password == $this->confirm_password, "Les deux mots de passe sont différents.");
 | 
				
			||||||
		ensure($this->surname != "", "Le nom de famille est obligatoire.");
 | 
							ensure($this->surname != "", "Le nom de famille est obligatoire.");
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -57,7 +57,7 @@ function quitTeam() {
 | 
				
			|||||||
	if ($role == Role::ADMIN || $role == Role::ORGANIZER)
 | 
						if ($role == Role::ADMIN || $role == Role::ORGANIZER)
 | 
				
			||||||
		return;
 | 
							return;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	for ($i = 1; $i <= ($role == Role::ENCADRANT ? 6 : 2); ++$i)
 | 
						for ($i = 1; $i <= ($role == Role::ENCADRANT ? 2 : 6); ++$i)
 | 
				
			||||||
		/** @noinspection SqlResolve */
 | 
							/** @noinspection SqlResolve */
 | 
				
			||||||
		$DB->exec("UPDATE `teams` SET `" . strtolower(Role::getName($role)) . "_$i` = NULL WHERE `" . strtolower(Role::getName($role)) . "_$i` = $user_id;");
 | 
							$DB->exec("UPDATE `teams` SET `" . strtolower(Role::getName($role)) . "_$i` = NULL WHERE `" . strtolower(Role::getName($role)) . "_$i` = $user_id;");
 | 
				
			||||||
	$user->setTeamId(null);
 | 
						$user->setTeamId(null);
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user