Archived
1
0
Disbranĉigi 0
Ĉi tiu deponejo arĥiviĝis je 2024-01-28. Vi povas vidi kaj elŝuti dosierojn, sed ne povas puŝi nek raporti problemojn nek tirpeti.
blagoblag/u/new/private/user_create.php
2019-02-23 01:15:14 -06:00

47 lines
1.4 KiB
PHP

<?php
/* This file is free software: you can redistribute it and/or modify
it under the terms of version 3 of the GNU Affero General Public
License as published by the Free Software Foundation.
This file is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Affero General Public License for more details. */
$depth = "../../../";
include "../../../res/lib/load.php";
$name = scrub($_POST['name']);
$full = scrub($_POST['full_name']);
$bio = scrub($_POST['bio']);
$email = scrub($_POST['email']);
$url = scrub($_POST['url']);
$pass = scrub($_POST['password']);
// -------------------------------------
input_enforce(array($name, $full, $bio, $email, $url, $pass),
array("Username", "Full name", "Biography", "E-mail",
"URL", "Password"),
array("free_user_name", "string", "string",
"email", "url", "ne_string"));
// -------------------------------------
switch (1) {
case (user_logged_in() != false):
general_error("You can't make an account… while logged in to
another account. LOL");
break;
case ($GLOBALS['registration'] != true):
general_error("Sorry, registration's disabled on this server!");
break;
default:
user_create($name, $pass, "contributor", $full, $email, $url,
$bio);
root_redirect("u/index.php?name=" . $name);
break;
}
?>