function testAllUsers($filter) { $found = false; $offset = 0; $limit = 1000; do { $user = new User(); $user->orderBy('created'); $user->limit($offset, $limit); $found = $user->find(); if ($found) { while ($user->fetch()) { try { testUser($filter, $user); } catch (Exception $e) { printfnq("ERROR testing user %s\n: %s", $user->nickname, $e->getMessage()); } } $offset += $found; } } while ($found > 0); }
$error = true; if (!empty($_POST['emailFamily'])) { $emailFamily = $_POST['emailFamily']; $testFamily = testUser($emailFamily, "family"); } else { echo "Le champ famille ne doit pas être vide.<\\br>"; } if (!empty($_POST['emailDoctor'])) { $emailDoctor = $_POST['emailDoctor']; $testDoctor = testUser($emailDoctor, "doctor"); } else { echo "Le champ médecin ne doit pas être vide.</br>"; } if (!empty($_POST['emailTeacher'])) { $emailTeacher = $_POST['emailTeacher']; $testTeacher = testUser($emailTeacher, "teacher"); } else { echo "Le champ enseignant ne doit pas être vide.</br>"; } if (empty($testFamily) || $testFamily == false) { echo "L'email précisé dans le champ famille n'est pas le bon.</br>"; } else { if (empty($testDoctor) || $testDoctor == false) { echo "L'email précisé dans le champ médecin n'est pas le bon.</br>"; } else { if (empty($testTeacher) || $testTeacher == false) { echo "L'email précisé dans le champ enseignant n'est pas le bon.</br>"; } else { $error = false; $array['familyId'] = array('S' => $emailFamily); $array['teacherId'] = array('S' => $emailTeacher);
function testLogin() { $g = getValue('rememberMe'); $un = getValue('unCookie'); $pw = getValue('pwCookie'); $uID = getSession('userId'); $username = getByUserID($uID); $p = getParentStatus($uID); $y = testUserP($username, $pw, $p); $uID2 = getByUsername($un); $p2 = getParentStatus($uID2); $z = testUser($un, $pw); if ($g and $z and $p2 == 0) { //not here setSession('loggedIn', true); } else { } $ret = getSession('loggedIn', false); setSession('returnURL', $_SERVER['PHP_SELF']); if ($ret == true) { if ($p == 1) { header("Location: parent.php"); } return $ret; } else { header("Location: JobshadowLogin.php"); } }