本文整理汇总了PHP中user_data函数的典型用法代码示例。如果您正苦于以下问题:PHP user_data函数的具体用法?PHP user_data怎么用?PHP user_data使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了user_data函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: is_admin
function is_admin()
{
if (is_in() && user_data('email') == 'courtaks@yahoo.com') {
return true;
}
return false;
}
示例2: logged_in_redirect
function logged_in_redirect()
{
if (logged_in() === true) {
$session_user_id = $_SESSION['user_id'];
$user_data = user_data($session_user_id, 'user_id', 'username', 'password');
if (admin_access($user_data['username']) === false) {
header('Location: index.php');
exit;
}
}
}
示例3: news_comment_form
function news_comment_form($News)
{
$form = '<form method="POST" action="' . get_link('Comments', 'Public') . '">';
$form .= call_bbcode_editor("Comment_Message");
//$form .= '<textarea name="Comment_Message" ID="message" rows="10" cols="50"></textarea><br/><br/>';
$form .= '<input type="hidden" name="Comment_News_ID" value="' . stripslashes_r($News['News_ID']) . '"/>';
$form .= '<input type="hidden" name="News_ID" value="' . stripslashes_r($News['News_ID']) . '"/>';
$form .= '<input type="hidden" name="Comment_Date" value="' . date('Y-m-d H:i:s') . '"/>';
$form .= '<input type="hidden" name="Comment_Account_Pseudo" value="' . user_data('Account_Pseudo') . '"/>';
$form .= '<input type="hidden" name="token" value="' . generer_token('Comment-' . $News['News_ID']) . '" />';
$form .= '<input type="submit" name="End_Add" value="Terminer">';
$form .= '</form>';
return $form;
}
示例4: recover
function recover($mode, $email)
{
$mode = sanitize($mode);
$email = sanitize($email);
$user_data = user_data(user_id_from_email($email), 'user_id', 'first_name', 'username');
if ($mode === 'username') {
email($email, 'Your username', "Hello " . $userdata['firstname'] . "\n\nYour username is " . $userdata['firstname'] . "\n\n-our company");
} elseif ($mode === 'password') {
$generated_password = substr(md5(rand(999, 999999)), 0, 8);
//change_password($user_data['user_id'], $generated_password);
//update_user($user_data['user_id'], array('password_recover' => '1'));
email($email, 'Your password recovery', "Hello " . $userdata['firstname'] . "\n\nYour new password is: " . $generated_password . "\n\n-our company");
}
}
示例5: recover
function recover($mode, $email)
{
$mode = sanitize($mode);
$email = sanitize($email);
$user_data = user_data(user_id_from_email($email), 'first_name', 'username');
if ($mode == 'username') {
email($email, 'Your username recvory', "Hello" . $user_data['first_name'] . ",\n\nYour username is:" . $user_data['username'] . "\n\n-stumbleupon");
} else {
if ($mode == 'password') {
$generated_password = substr(md5(rand(999, 999999)), 0, 8);
change_password($user_data['user_id'], $generated_password);
update_user($user_data['user_data'], array('password_recover' => '1'));
email($email, 'Your password recvory', "Hello" . $user_data['first_name'] . ",\n\nYour New Password is:" . $generated_password . "\n\n-StumbleUpon");
}
}
}
示例6: recover
function recover($mode, $email)
{
$mode = sanitize($mode);
$email = sanitize($email);
$user_data = user_data(user_id_from_email($email), 'user_id', 'first_name', 'username');
if ($mode == 'username') {
email($email, 'Your username', "Hello " . $user_data['first_name'] . ", \n \n Your username is: " . $user_data['username'] . ",\n\n -dwcl");
} else {
if ($mode == 'password') {
//password
$generated_password = substr(md5(rand(999, 999999)), 0, 8);
change_password($user_data['user_id'], $generated_password);
email($email, 'Your Password', "Hello " . $user_data['first_name'] . ", \n \n Your new is: " . $generated_password . ",\n\n -dwcl");
}
}
}
示例7: recover
function recover($mode, $email)
{
$user_data = user_data(user_id_from_email($email), 'user_id', 'first_name', 'username');
if ($mode == 'username') {
// recover username
email($email, 'Your username', "Hello " . $user_data['first_name'] . ",\n\nYour username is: " . $user_data['username'] . "\n\n-sparklet");
} else {
if ($mode == 'password') {
// recover password
$generated_password = substr(md5(rand(999, 999999)), 0, 8);
// die($generated_password);
change_password($user_data['user_id'], $generated_password);
update_user($user_data['user_id'], array('password_recover' => '1'));
email($email, 'Your password recovery', "Hello " . $user_data['first_name'] . ",\n\nYour new password is: " . $generated_password . "\n\n-sparklet");
}
}
}
示例8: recover
function recover($mode, $email)
{
$mode = sanitize($mode);
$email = sanitize($email);
$user_data = user_data(user_id_from_email($email), 'user_id', 'first_name');
if ($mode == 'username') {
email($email, 'Your username', " Hello " . $userdata['first_name'] . ",\n\nYour username is : " . $user_data['username'] . "\n\n-Utkal Placement");
} else {
if ($mode == 'password') {
$temp_password = substr(md5(rand(9999, 999999)), 0, 8);
change_password($user_data['user_id'], $temp_password);
update_user($user_data['user_id'], array('password_recover' => '1'));
email($email, 'Your password Recovery', " Hello " . $userdata['first_name'] . ",\n\nYour new password is : " . $temp_password . "\n\nPlease log in to change this.\n\n-Utkal Placement");
}
}
//$temp_pass= md5($temp_pass);
//mysql_query("UPDATE `users` SET `pass_temp` = '$temp_pass' WHERE `email` = '$email'");
}
示例9: recover
function recover($mode, $email)
{
// recupereaza numele de utilizator sau parola - $mode poate lua valoarea de 'username' sau 'password'
include 'core/db/db_connection.php';
$mode = sanitize($mode);
$email = sanitize($email);
$user_data = user_data(get_user_id_from_email($email), 'user_id', 'first_name', 'username');
if ($mode == 'username') {
email($email, 'Your username', "\n\t\t\t\tHello " . $user_data['first_name'] . ", <br><br>\n\t\t\t\tYour username is " . $user_data['username'] . " <br><br>\n\t\t\t\t-worldtour team\n\t\t\t");
} else {
if ($mode == 'password') {
$generated_password = substr(md5(rand(777, 7777)), 0, 7);
// generam o parola random de 7 caractere pe care o criptam cu md5
change_password($user_data['user_id'], $generated_password);
update_user($user_data['user_id'], array('pwd_recovery' => '1'));
// folosim un 'flag' asupra contului pentru a forta utilizatorul sa-si schimbe parola generata de noi prima oara cand se logheaza
email($email, 'Password recovery', "\n\t\t\t\tHello " . $user_data['first_name'] . ", <br><br>\n\t\t\t\tYour new password is " . $generated_password . "<br><br>\n\t\t\t\tKindly note that this is a temporary password and you are required to change it on your first log in. <br><br>\n\t\t\t\t-worldtour team\n\t\t\t");
}
}
}
示例10: recover
function recover($mode, $email)
{
$mode = sanitize($mode);
$email = sanitize($email);
$user_id = user_id_from_email($email);
$user_data = user_data($user_id, 'user_id', 'first_name', 'username');
if ($mode === 'username') {
//recover username
sendMail("{$email}", "MCA-website username recovery mail", "Hello " . $user_data['first_name'] . ", \n\n Your username for mca page is " . $user_data['username'] . "\n\n~MCA, IIT Bombay");
} else {
if ($mode === 'password') {
//recover password
$generated_password = substr(md5(rand(999, 999999)), 0, 8);
change_password($user_data['user_id'], $generated_password);
//changing password with new genrated password
//this is to force user to change password after resetting password
mysql_query("UPDATE `users` SET `password_recover` = 1 WHERE `user_id` = {$user_id}");
sendMail("{$email}", "MCA-website password reset mail", "Hello " . $user_data['first_name'] . ", \n\n Your password for mca page is reset and the new password is " . $generated_password . ". Please change your password after logging in.\n\n~MCA, IIT Bombay");
}
}
}
示例11: ajout_forum_form
function ajout_forum_form($map_cat)
{
$list_rank = list_db('guild_list_rank', array('Guild_ID' => user_data('Account_Guild_ID')));
foreach ($list_rank as $l) {
$values[$l['Rank_ID']] = $l['Rank_Name'];
}
set_values_db("Caranille_Forums", "Auth_View", $values);
set_values_db("Caranille_Forums", "Auth_Post", $values);
set_values_db("Caranille_Forums", "Auth_Topic", $values);
set_values_db("Caranille_Forums", "Auth_Annonce", $values);
set_values_db("Caranille_Forums", "Auth_Modo", $values);
if (has_guild_acces('forum')) {
$form = '<form method="POST" action="' . get_link("Main", "Guild") . '">';
$form .= '<h2>Ajout de Forum</h2>';
$form .= '<input type="hidden" name="Forum_Guild_ID" value="' . user_data('Account_Guild_ID') . '"/>';
$form .= '<table style="width:100%">';
$form .= '<tr>';
$form .= '<td style="width:50%">';
$form .= line_db("Caranille_Forums", "Forum_Name");
$form .= 'Catégorie : <select name="Forum_Cat_ID">';
foreach ($map_cat as $ID => $nom) {
$form .= '<option value="' . $ID . '">' . $nom . '</option>';
}
$form .= '</select>';
$form .= line_db("Caranille_Forums", "Auth_View");
$form .= line_db("Caranille_Forums", "Auth_Post");
$form .= line_db("Caranille_Forums", "Auth_Topic");
$form .= line_db("Caranille_Forums", "Auth_Annonce");
$form .= line_db("Caranille_Forums", "Auth_Modo");
$form .= '</td>';
$form .= '<td style="width:50%">' . call_bbcode_editor("Forum_Desc", "", "guild-forum") . '</td>';
$form .= '</tr>';
$form .= '<tr>';
$form .= '<td><input type="submit" name="End_Add_Forum" value="Terminer"/></td>';
$form .= '</tr>';
$form .= '</table>';
$form .= '</form>';
return $form;
}
}
示例12: array
?>
<!--<textarea cols="70" rows="7" id="message" name="message"></textarea></fieldset>-->
</fieldset>
<p>
<input type="submit" name="submit" value="Editer !" />
<input type="reset" name = "Effacer" value = "Effacer"/></p>
</form>
<?php
}
break;
//Fin de ce cas :o
?>
<?php
case "delete":
//Si on veut supprimer le post
//Ensuite on vérifie que le membre a le droit d'être ici (soit le créateur soit un modo/admin)
if (verif_Access($Auth_Modo, true) || $Post_Createur === user_data('Account_ID')) {
echo '<h1>Suppression</h1>';
echo '<p>Êtes vous certains de vouloir supprimer ce post ?</p>';
echo '<p><a href="' . get_link('Post', 'Forum', array('action' => 'delete', 'p' => $post)) . '">Oui</a> ou <a href="' . get_link('Main', 'Forum') . '">Non</a></p>';
}
break;
?>
<?php
default:
//Si jamais c'est aucun de ceux là c'est qu'il y a eu un problème :o
echo '<p>Cette action est impossible</p>';
}
//Fin du switch
示例13: getSession
}
}
require_once 'database/connect.php';
require_once 'function/general.php';
require_once 'function/users.php';
require_once 'function/cache.php';
require_once 'function/mail.php';
require_once 'function/token.php';
require_once 'function/itemparser/itemlistparser.php';
if (isset($_SESSION['token'])) {
$_SESSION['old_token'] = $_SESSION['token'];
}
Token::generate();
if (user_logged_in() === true) {
$session_user_id = getSession('user_id');
$user_data = user_data($session_user_id, 'id', 'name', 'password', 'email', 'premdays');
$user_znote_data = user_znote_account_data($session_user_id, 'ip', 'created', 'points', 'cooldown');
}
$errors = array();
// Log IP
if ($config['log_ip']) {
$visitor_config = $config['ip_security'];
$flush = $config['flush_ip_logs'];
if ($flush != false) {
$timef = $time - $flush;
if (getCache() < $timef) {
$timef = $time - $visitor_config['time_period'];
mysql_delete("DELETE FROM znote_visitors_details WHERE time <= '{$timef}'");
setCache($time);
}
}
示例14: intval
// How many replies?
$replies = intval(get_replies($row['reply']));
// Lets update it
$replies = $replies + 1;
// Woooo~ Last id for redirecting~
$page_numbers = $replies / 20 - 1;
$n = ceil($page_numbers);
if ($n == -1) {
$n = 0;
} else {
$n = abs($n);
}
// Build topic url
$post_url = "{$config['url_path']}/read.php?id={$row['reply']}&page={$n}";
// Topic starter data
$post_author = user_data($row['starter_id']);
?>
<tr>
<td nowrap="nowrap" width="40%" class="item">
<a href="<?php
echo $post_url;
?>
">
<?php
echo $content;
?>
</a>
</td>
<td nowrap="nowrap" align="center" class="item">
<?php
echo $post_author['styled_name'];
示例15: topic
if ($_GET['reply'] != 0) {
/**
* Validate reply with alpha
*/
if (alpha($_GET['reply'], 'numeric')) {
$reply = $_GET['reply'];
// Get topic data
$topic = topic($reply, 'subject');
if ($topic) {
// Title
$title = lang('replying_to') . ": {$topic['subject']}";
// Our Subject
$_POST['subject'] = "Re: {$topic['subject']}";
if ($_GET['q'] && alpha($_GET['q'], 'numeric')) {
$quote_data = topic($_GET['q'], 'message,starter_id');
$quote_user_data = user_data($quote_data['starter_id']);
$quote_data['message'] = br2nl(stripslashes(parse($quote_data['message'], false)));
$content = '[quote=' . $quote_user_data['username'] . ']' . $quote_data['message'] . '[/quote]';
}
} else {
$reply = 0;
// New topic
$title = lang('posting_new_topic');
}
} else {
$reply = 0;
// New topic
$title = lang('posting_new_topic');
}
} else {
$reply = 0;