當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Registration::activateform方法代碼示例

本文整理匯總了PHP中Registration::activateform方法的典型用法代碼示例。如果您正苦於以下問題:PHP Registration::activateform方法的具體用法?PHP Registration::activateform怎麽用?PHP Registration::activateform使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Registration的用法示例。


在下文中一共展示了Registration::activateform方法的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>";
     }
 }
開發者ID:TheNAF,項目名稱:naflm,代碼行數:55,代碼來源:class_registration.php

示例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>";
     }
 }
開發者ID:nicholasmr,項目名稱:obblm,代碼行數:52,代碼來源:class_registration.php


注:本文中的Registration::activateform方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。