本文整理匯總了PHP中session::update_visitor_log方法的典型用法代碼示例。如果您正苦於以下問題:PHP session::update_visitor_log方法的具體用法?PHP session::update_visitor_log怎麽用?PHP session::update_visitor_log使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類session
的用法示例。
在下文中一共展示了session::update_visitor_log方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: logon_perform
function logon_perform()
{
// Check to see if the user is logging in as a guest or a normal user.
if (isset($_POST['guest_logon'])) {
// Check the Guest account is enabled.
if (!user_guest_enabled()) {
return false;
}
// Initialise Guest user session.
session::start(0);
// Generate new CSRF token
session::refresh_csrf_token();
// Update the visitor log
session::update_visitor_log(0, true);
// Success
return true;
} else {
if (isset($_POST['user_logon']) && isset($_POST['user_password'])) {
// Extract the submitted username
$user_logon = $_POST['user_logon'];
// Extract the submitted password
$user_password = $_POST['user_password'];
// Try and login the user.
if (($uid = user_logon($user_logon, $user_password)) !== false) {
// Initialise a user session.
session::start($uid);
// Generate new CSRF token
session::refresh_csrf_token();
// Update User's last forum visit
forum_update_last_visit($uid);
// Update the visitor log
session::update_visitor_log($uid, true);
// Check if we should save a token to allow auto logon,
if (isset($_POST['user_remember']) && $_POST['user_remember'] == 'Y') {
// Get a token for the entered password.
$user_token = user_generate_token($uid);
// Set a cookie with the logon and the token.
html_set_cookie('user_logon', $user_logon, time() + YEAR_IN_SECONDS);
html_set_cookie('user_token', $user_token, time() + YEAR_IN_SECONDS);
} else {
// Remove the cookie.
html_set_cookie('user_logon', '', time() - YEAR_IN_SECONDS);
html_set_cookie('user_token', '', time() - YEAR_IN_SECONDS);
}
// Success
return true;
}
}
}
// Failed
return false;
}
示例2: gettext
$error_msg_array[] = gettext("The username or password you supplied is not valid.");
$valid = false;
}
}
if ($valid) {
if (($new_uid = user_create($logon, $password, $nickname, $email)) !== false) {
// Save the new user preferences
user_update_prefs($new_uid, $new_user_prefs);
// Save the new user signature
user_update_sig($new_uid, $sig_content, true);
// Initialise the new user session.
session::start($new_uid);
// Update User's last forum visit
forum_update_last_visit($new_uid);
// Update the visitor log
session::update_visitor_log($new_uid, true);
// Check to see if the user is going somewhere after they have registered.
$final_uri = isset($final_uri) ? rawurlencode($final_uri) : '';
// If User Confirmation is enabled send the forum owners an email.
if (forum_get_setting('require_user_approval', 'Y')) {
admin_send_user_approval_notification($new_uid);
}
// If New User Notification is enabled send the forum owners an email.
if (forum_get_setting('send_new_user_email', 'Y')) {
admin_send_new_user_notification($new_uid);
}
// Display final success / confirmation page.
if (forum_get_setting('require_email_confirmation', 'Y')) {
if (email_send_user_confirmation($new_uid)) {
perm_user_apply_email_confirmation($new_uid);
light_html_draw_top(array('title' => gettext("User Registration")));
示例3: ban_check
require_once BH_INCLUDE_PATH . 'format.inc.php';
require_once BH_INCLUDE_PATH . 'header.inc.php';
require_once BH_INCLUDE_PATH . 'html.inc.php';
require_once BH_INCLUDE_PATH . 'lang.inc.php';
require_once BH_INCLUDE_PATH . 'session.inc.php';
// End Required includes
// Initialise the session
session::init();
// Populate the session store.
session::start($_SESSION['UID']);
// Perform ban check
ban_check($_SESSION);
// Update User's last forum visit
forum_update_last_visit($_SESSION['UID']);
// Update the visitor log
session::update_visitor_log($_SESSION['UID']);
// Initialise gettext
lang_init();
// Enable the word filter ob filter
ob_start('word_filter_ob_callback');
// Check to see if user account has been banned.
if (session::user_banned()) {
html_user_banned();
exit;
}
// Check to see if the user has been approved.
if (!session::user_approved()) {
html_user_require_approval();
exit;
}
// Get the webtag for the current forum
示例4: create
public static function create($uid)
{
if (!($forum_fid = get_forum_fid())) {
$forum_fid = 0;
}
session::refresh($uid);
session::update_visitor_log($uid, $forum_fid);
forum_update_last_visit($uid);
}