当前位置: 首页>>代码示例>>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;未经允许,请勿转载。