mirror of
				https://gitlab.com/animath/si/plateforme.git
				synced 2025-11-04 10:22:11 +01:00 
			
		
		
		
	Correction de bugs concernant les classes et écoles
This commit is contained in:
		@@ -300,7 +300,7 @@ class User
 | 
				
			|||||||
	{
 | 
						{
 | 
				
			||||||
		global $DB;
 | 
							global $DB;
 | 
				
			||||||
		$this->school = $school;
 | 
							$this->school = $school;
 | 
				
			||||||
		$DB->prepare("UPDATE `users` SET `school` = ? WHERE `id` = ?;")->execute([SchoolClass::getName($school), $this->getId()]);
 | 
							$DB->prepare("UPDATE `users` SET `school` = ? WHERE `id` = ?;")->execute([$school, $this->getId()]);
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	public function getClass()
 | 
						public function getClass()
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -72,6 +72,9 @@ class NewUser
 | 
				
			|||||||
				ensure(filter_var($this->responsible_email, FILTER_VALIDATE_EMAIL), "Veuillez spécifier un responsable légal.");
 | 
									ensure(filter_var($this->responsible_email, FILTER_VALIDATE_EMAIL), "Veuillez spécifier un responsable légal.");
 | 
				
			||||||
			}
 | 
								}
 | 
				
			||||||
		}
 | 
							}
 | 
				
			||||||
 | 
							else {
 | 
				
			||||||
 | 
								$this->class = SchoolClass::ADULT;
 | 
				
			||||||
 | 
							}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
		if (count(User::getAllUsers()) == 0)
 | 
							if (count(User::getAllUsers()) == 0)
 | 
				
			||||||
			$this->role = Role::ADMIN;
 | 
								$this->role = Role::ADMIN;
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -83,7 +83,7 @@ class MyAccount
 | 
				
			|||||||
		$keys = ["email", "surname", "first_name", "birth_date", "gender", "address", "postal_code", "city", "country", "phone_number",
 | 
							$keys = ["email", "surname", "first_name", "birth_date", "gender", "address", "postal_code", "city", "country", "phone_number",
 | 
				
			||||||
			"school", "class", "responsible_name", "responsible_phone", "responsible_email", "description"];
 | 
								"school", "class", "responsible_name", "responsible_phone", "responsible_email", "description"];
 | 
				
			||||||
 | 
					
 | 
				
			||||||
		if ($this->user->getRole() != Role::PARTICIPANT)
 | 
							if ($this->user->getRole() == Role::PARTICIPANT)
 | 
				
			||||||
			$this->class = SchoolClass::fromName(strtoupper($this->class));
 | 
								$this->class = SchoolClass::fromName(strtoupper($this->class));
 | 
				
			||||||
		else
 | 
							else
 | 
				
			||||||
		    $this->class = SchoolClass::ADULT;
 | 
							    $this->class = SchoolClass::ADULT;
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user