Advertisement
Guest User

Untitled

a guest
Aug 22nd, 2018
87
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.00 KB | None | 0 0
  1. <?php
  2.   include 'func/core.php';
  3.  
  4.   if(User::isAuthorized())
  5.     Utils::redirect("/index.php");
  6.  
  7.   if(Utils::hasArgument("do")) {
  8.     Utils::validateArguments(array("login", "password"));
  9.  
  10.     $login = Utils::getArgument("login");
  11.     $password = Utils::getArgument("password");
  12.  
  13.     if(Utils::maskedSearch($login, "=;',/\\="))
  14.       Utils::redirect("/login.php?message=Обнаружены запрещенные символы");
  15.  
  16.     if(strlen($login) < 4 || strlen($password) < 4)
  17.       Utils::redirect("/login.php?message=Логин или пароль слишком короткий");
  18.  
  19.     if(strlen($login) > 16 || strlen($password) > 16)
  20.       Utils::redirect("/login.php?message=Логин или пароль слишком длинные");
  21.  
  22.     User::register($login, $password, array());
  23.     User::login($login, $password);
  24.  
  25.     Utils::redirect("/index.php");
  26.   }
  27.  
  28.   Page::render("register.php", "Регистрация", array("message" => Utils::getArgument("message")));
  29. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement