public function checkNewUser($username, $name, $surname, $email, $password) { switch (FALSE) { case check_valid_input($username, 6): throw new InvalidInputException("false Username Input = input needs to be minimum 6 long, only numbers, letters, capital letters and # @ . - or _"); case check_valid_input($name, 1): case check_no_numbers($name): throw new InvalidInputException("false name Input = input needs to be minimum 1 long, only letters, capital letters and # @ . - or _"); case check_valid_input($surname, 1): case check_no_numbers($surname): throw new InvalidInputException("false surname Input = input needs to be minimum 1 long, only letters, capital letters and # @ . - or _"); case check_valid_input($email, 6): case check_at($email): throw new InvalidInputException("false email Input = input needs to be minimum 6 long, only numbers, letters, capital letters and # @ . - or _"); case check_password($password): throw new InvalidInputException("false password Input = input needs to be minimum 6 long, only numbers, letters, capital letters and # @ . - or _"); } $hashedpwd = passwordEncrypt($username, $password); $userDAO = new UserDAO(); $userDAO->createUser($username, $name, $surname, $email, $hashedpwd); }
function check_password($string) { $passwordCheck = FALSE; $numberCount = 0; $capitalCount = 0; if (check_valid_input($string, 6)) { $asciiArray = string_to_ascii($string); foreach ($asciiArray as $ascii) { switch (TRUE) { case $ascii >= 48 && $ascii <= 57: //numbers $numberCount++; break; case $ascii >= 65 && $ascii <= 90: //UpperCase letters $capitalCount++; break; } } if ($numberCount > 0 && $capitalCount > 0) { $passwordCheck = TRUE; } } return $passwordCheck; }
echo $challengeId . "</br>"; } print "<pre>"; print_r($viewerLijst); print "</pre>"; ?> <?php $string = "foxbarrelinc"; $ascii = string_to_ascii($string); echo $string . "</br>"; var_dump($ascii); var_dump(string_to_ascii("!liesenborghs")); $check = check_valid_input($string, 6); var_dump($check); var_dump(check_valid_input($string, 6)); $fox = $userDAO->getByUsername("foxbarrelinc"); var_dump($fox); // $userSvc = new UserService(); // $service = $userSvc->checkLogin("foxbarrelinc", "adminpwd"); // var_dump($service); $par1 = $_SERVER['REMOTE_ADDR']; var_dump($par1); $par2 = gethostbyaddr($par1); var_dump($par2); var_dump(redirect_arrayName()); var_dump(redirect_par()); $_SESSION[redirect_arrayName()] = redirect_par(); var_dump($_SESSION[redirect_arrayName()]); var_dump($_SERVER['HTTP_USER_AGENT']); $hashValue = passwordEncrypt("fifafo", "schildp@d");