diff --git a/signup/signup-handler.php b/signup/signup-handler.php index 0b3cecf..1ef839e 100644 --- a/signup/signup-handler.php +++ b/signup/signup-handler.php @@ -4,6 +4,8 @@ require __DIR__.'/../vendor/autoload.php'; if ($_SERVER["SERVER_NAME"] != "localhost") require_once "/home/ben/ultimate-email/support/smtp.php"; +$reserved_names = ['git', 'irc', 'mail', 'pad', 'sudo', 'root', 'admin', 'postmaster', 'paste', 'quotes']; + $message = ""; if (isset($_REQUEST["username"]) && isset($_REQUEST["email"])) { // Check the name. @@ -14,7 +16,7 @@ if (isset($_REQUEST["username"]) && isset($_REQUEST["email"])) { $message .= "
  • username too long (32 character max)
  • "; if (!preg_match('/^[A-Za-z][A-Za-z0-9]{2,31}$/', $name)) $message .= "
  • username contains invalid characters (lowercase only, must start with a letter)
  • "; - if (posix_getpwnam($name)) + if (posix_getpwnam($name) || in_array($name, $reserved_names)) $message .= "
  • sorry, the username $name is unavailable
  • "; // Check the e-mail address. diff --git a/wiki/index.php b/wiki/index.php index 5f1a463..3b8641f 100644 --- a/wiki/index.php +++ b/wiki/index.php @@ -22,7 +22,7 @@ if (!isset($_GET["page"]) || !file_exists("pages/{$_GET['page']}.md")) { - + ";