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


PHP Authenticate::createUser方法代碼示例

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


在下文中一共展示了Authenticate::createUser方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: isset

    if ($view == "addAUser") {
        //grab the feed back info if it is set already
        $fbk = isset($_GET['feedback']) ? $_GET["feedback"] : "";
        $smarty->assign("feedback", $fbk);
        $smarty->assign("mainContent", $smarty->fetch("addAUser.tpl"));
    } else {
        if ($view == "adminView") {
        } else {
            $smarty->assign("mainContent", "<p>Welcome to the admin main page where the admin can make the following changes listed in the menu by the side!</p>\n\t\t  <p>Select one fo the options by the side menu and carry out the function.</p>");
        }
    }
} else {
    $smarty->assign("mainContent", "<p>Welcome to the admin main page where the admin can make the following changes listed in the menu by the side!</p>\n\t<p>Select one fo the options by the side menu and carry out the function.</p>\t\n");
}
$smarty->display("admin.tpl");
if (isset($_POST["addUserAction"])) {
    //start grabing useful values
    $username = htmlentities(htmlspecialchars($_POST["userName"]));
    $password = htmlentities(htmlspecialchars($_POST["password"]));
    $email = htmlentities(htmlspecialchars($_POST["email"]));
    $loginType = htmlentities(htmlspecialchars($_POST["loginType"]));
    if ($loginType == "") {
        header("Location:../admin/index.php?view=addAUser&feedback=You must choose a privelege for the user you wish to add!");
    } else {
        if ($auth->createUser($email, $username, $password, $loginType)) {
            header("Location:../admin/index.php?view=addAUser&feedback=User added succesfully! You can now login'");
        } else {
            header("Location:../admin/index.php?view=addAUser&feedback='An Error ocured trying to add the user!'");
        }
    }
}
開發者ID:jerryhanks,項目名稱:Melnet,代碼行數:31,代碼來源:index.php


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