本文整理汇总了PHP中Registration::form方法的典型用法代码示例。如果您正苦于以下问题:PHP Registration::form方法的具体用法?PHP Registration::form怎么用?PHP Registration::form使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Registration
的用法示例。
在下文中一共展示了Registration::form方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: main
public static function main($argv)
{
// Module registered main function.
global $settings;
if (!$settings['allow_registration']) {
die("Registration is currently disabled.");
}
$form = "";
if (isset($_GET['form'])) {
$form = $_GET['form'];
}
if (isset($_POST['new_name']) && isset($_POST['new_mail']) && isset($_POST['new_passwd'])) {
$username = $_POST['new_name'];
$password = $_POST['new_passwd'];
$email = $_POST['new_mail'];
$isCommissioner = isset($_POST['is_commissioner']);
$league = $_POST['new_league'];
self::submitForm($username, $password, $email, $isCommissioner, $league);
return true;
}
if ($form == "forgot") {
if (isset($_POST['new_name'])) {
$username = $_POST['new_name'];
self::forgotsubmitForm($username);
} else {
print "<html><body>";
print Registration::forgotform();
print "</body></html>";
}
}
if ($form == "activate") {
if (!isset($_SESSION['coach_id'])) {
print "You must be logged in to use this page.";
return false;
}
if (!isset($_POST['activate_name'])) {
print "<html><body>";
print Registration::activateform();
print "</body></html>";
} else {
$coachToActivate = Coach::getByName($_POST['activate_name']);
$myCoach = new Coach($_SESSION['coach_id']);
if (!$myCoach->mayManageObj(T_OBJ_COACH, $coachToActivate->coach_id)) {
print "You must be an administrator to access this page.";
return;
}
$username = $_POST['activate_name'];
self::activatesubmitForm($username);
}
} else {
print "<html><body>";
print Registration::form();
print "</body></html>";
}
}
示例2: main
public static function main($argv)
{
// Module registered main function.
global $settings;
if (!$settings['allow_registration']) {
die("Registration is currently disabled.");
}
$form = "";
if (isset($_GET['form'])) {
$form = $_GET['form'];
}
if (isset($_POST['new_name']) && isset($_POST['new_mail']) && isset($_POST['new_passwd'])) {
$username = $_POST['new_name'];
$password = $_POST['new_passwd'];
$email = $_POST['new_mail'];
self::submitForm($username, $password, $email);
return true;
}
if ($form == "forgot") {
if (isset($_POST['new_name'])) {
$username = $_POST['new_name'];
self::forgotsubmitForm($username);
} else {
print "<html><body>";
print Registration::forgotform();
print "</body></html>";
}
}
if ($form == "activate") {
if (!isset($_SESSION['coach_id'])) {
print "You must be logged in to use this page.";
return false;
}
$coach_id = $_SESSION['coach_id'];
$c = new Coach($coach_id);
if ($c->ring != Coach::T_RING_GLOBAL_ADMIN) {
print "You must be an administrator to access this page.";
}
if (isset($_POST['activate_name'])) {
$username = $_POST['activate_name'];
self::activatesubmitForm($username);
} else {
print "<html><body>";
print Registration::activateform();
print "</body></html>";
}
} else {
print "<html><body>";
print Registration::form();
print "</body></html>";
}
}