本文整理汇总了PHP中users::createUser方法的典型用法代码示例。如果您正苦于以下问题:PHP users::createUser方法的具体用法?PHP users::createUser怎么用?PHP users::createUser使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类users
的用法示例。
在下文中一共展示了users::createUser方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: autoGenerateUser
public static function autoGenerateUser($pack)
{
if (isset($pack->group_name) && strlen($pack->group_name)) {
//derive from group_name
$exists = true;
while ($exists) {
$pack->user_name = $pack->group_name . util::rand_string(5);
$exists = dbconnection::queryObject("SELECT * FROM users WHERE user_name = '{$pack->user_name}'");
}
$pack->password = $pack->group_name;
} else {
//populate with garbage
$exists = true;
while ($exists) {
$pack->user_name = util::rand_string(10);
$exists = dbconnection::queryObject("SELECT * FROM users WHERE user_name = '{$pack->user_name}'");
}
$pack->password = util::rand_string(10);
//this is legit probably never going to be recoverable...
}
if (!isset($pack->display_name)) {
$pack->display_name = "";
}
//explicitly set display_name so default doesn't get set to the gibberish user_name
$pack->transient = 1;
return users::createUser($pack);
}
示例2: users
<?php
include "src/common/header.php";
?>
</div>
<div id="main">
<div class="col">
<?php
$users = new users();
if (isset($_POST['submit'])) {
$prenom = ucfirst(strtolower($_POST['prenom']));
$nom = strtoupper($_POST['nom']);
$mail = strtolower($_POST['mail']);
$login = strtolower($_POST['login']);
$password = $_POST['password'];
$users->createUser($nom, $prenom, $mail, $login, $password);
if ($id = $users->verif($login, $password)) {
$_SESSION['id'] = $id;
echo "<script>window.location='cadeaux.php';</script>";
}
}
?>
<form method="post">
<table>
<tr><td colspan="2">Nouveau utilisateur</td></tr>
<tr>
<td>Mail : </td>
<td><input type="text" name="mail"/></td>
</tr>
<tr>
<td>Prénom : </td>