fix to check is parent

This commit is contained in:
mckmonster 2024-09-04 16:19:03 +02:00
parent b7998009a0
commit 84c2e7a3ad
2 changed files with 7 additions and 1 deletions

View file

@ -69,8 +69,10 @@ class Eleve {
} }
public function isParent($username) { public function isParent($username) {
// echo "<p>username :".$username."</p>";
foreach ($this->parents as $parent) { foreach ($this->parents as $parent) {
if ($parent->getNom() == $username) { // echo "<p>parent :".var_dump($parent)."</p>";
if ($parent->getUserId() == $username) {
return true; return true;
} }
} }

View file

@ -17,6 +17,10 @@ class ParentEleve {
// echo "<p>".var_dump($this)."</p>"; // echo "<p>".var_dump($this)."</p>";
} }
public function getUserId() {
return $this->user['bf_titre'];
}
public function getNom() { public function getNom() {
if (empty($this->user['bf_nom'])) { if (empty($this->user['bf_nom'])) {
return $this->user['bf_titre']; return $this->user['bf_titre'];