本文整理汇总了PHP中um_reset_user函数的典型用法代码示例。如果您正苦于以下问题:PHP um_reset_user函数的具体用法?PHP um_reset_user怎么用?PHP um_reset_user使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了um_reset_user函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: um_after_changing_user_password
function um_after_changing_user_password($user_id)
{
global $ultimatemember;
um_fetch_user($user_id);
$ultimatemember->mail->send(um_user('user_email'), 'changedpw_email');
um_reset_user();
}
示例2: um_submit_form_errors_hook_logincheck
function um_submit_form_errors_hook_logincheck($args)
{
global $ultimatemember;
// Logout if logged in
if (is_user_logged_in()) {
wp_logout();
}
$user_id = isset($ultimatemember->login->auth_id) ? $ultimatemember->login->auth_id : '';
um_fetch_user($user_id);
$status = um_user('account_status');
// account status
switch ($status) {
// If user can't login to site...
case 'inactive':
case 'awaiting_admin_review':
case 'awaiting_email_confirmation':
case 'rejected':
um_reset_user();
exit(wp_redirect(add_query_arg('err', esc_attr($status), $ultimatemember->permalinks->get_current_url())));
break;
}
if (isset($args['form_id']) && $args['form_id'] == $ultimatemember->shortcodes->core_login_form() && $ultimatemember->form->errors && !isset($_POST[$ultimatemember->honeypot])) {
exit(wp_redirect(um_get_core_page('login')));
}
}
示例3: um_send_password_change_email
/**
* Overrides password changed notification
*
*/
function um_send_password_change_email($args)
{
global $ultimatemember;
um_fetch_user($user_id);
$ultimatemember->user->password_changed();
um_reset_user();
return false;
}
示例4: um_dynamic_user_profile_pagetitle
function um_dynamic_user_profile_pagetitle($title, $sep = '')
{
global $paged, $page, $ultimatemember;
$profile_title = um_get_option('profile_title');
if (um_is_core_page('user') && um_get_requested_user()) {
um_fetch_user(um_get_requested_user());
$profile_title = $ultimatemember->mail->convert_tags($profile_title);
$title = $profile_title;
um_reset_user();
}
return $title;
}
示例5: um_add_custom_message_to_menu
function um_add_custom_message_to_menu($items, $args)
{
global $ultimatemember;
// this feature required logged in user
if (!is_user_logged_in()) {
return $items;
}
um_fetch_user(get_current_user_id());
$items = $ultimatemember->shortcodes->convert_user_tags($items);
um_reset_user();
return $items;
}
示例6: listen_to_password_reset_uri
function listen_to_password_reset_uri()
{
global $ultimatemember;
if (isset($_REQUEST['act']) && $_REQUEST['act'] == 'reset_password' && isset($_REQUEST['hash']) && strlen($_REQUEST['hash']) == 40 && isset($_REQUEST['user_id']) && is_numeric($_REQUEST['user_id'])) {
um_fetch_user($_REQUEST['user_id']);
if ($_REQUEST['hash'] != um_user('reset_pass_hash')) {
wp_die(__('This is not a valid hash, or it has expired.', 'ultimatemember'));
}
$ultimatemember->user->profile['reset_pass_hash_token'] = current_time('timestamp');
$ultimatemember->user->update_usermeta_info('reset_pass_hash_token');
$this->change_password = true;
um_reset_user();
}
}
示例7: um_comment_link_to_profile
function um_comment_link_to_profile($return)
{
global $comment, $ultimatemember;
if (isset($comment->user_id) && !empty($comment->user_id)) {
if (isset($ultimatemember->user->cached_user[$comment->user_id]) && $ultimatemember->user->cached_user[$comment->user_id]) {
$return = '<a href="' . $ultimatemember->user->cached_user[$comment->user_id]['url'] . '">' . $ultimatemember->user->cached_user[$comment->user_id]['name'] . '</a>';
} else {
um_fetch_user($comment->user_id);
$ultimatemember->user->cached_user[$comment->user_id] = array('url' => um_user_profile_url(), 'name' => um_user('display_name'));
$return = '<a href="' . $ultimatemember->user->cached_user[$comment->user_id]['url'] . '">' . $ultimatemember->user->cached_user[$comment->user_id]['name'] . '</a>';
um_reset_user();
}
}
return $return;
}
示例8: um_shortcode_args_filter
function um_shortcode_args_filter($args)
{
global $ultimatemember;
if ($ultimatemember->shortcodes->message_mode == true) {
$args['template'] = 'message';
$ultimatemember->shortcodes->custom_message = um_user(um_user('status') . '_message');
um_reset_user();
}
foreach ($args as $k => $v) {
if ($ultimatemember->validation->is_serialized($args[$k])) {
if (!empty($args[$k])) {
$args[$k] = unserialize($args[$k]);
}
}
}
return $args;
}
示例9: activate_account_via_email_link
function activate_account_via_email_link()
{
global $ultimatemember;
if (isset($_REQUEST['act']) && $_REQUEST['act'] == 'activate_via_email' && isset($_REQUEST['hash']) && strlen($_REQUEST['hash']) == 40 && isset($_REQUEST['user_id']) && is_numeric($_REQUEST['user_id'])) {
// valid token
um_fetch_user($_REQUEST['user_id']);
if (um_user('account_status') != 'awaiting_email_confirmation') {
wp_die('The activation link you used is invalid or has expired.');
}
if ($_REQUEST['hash'] != um_user('account_secret_hash')) {
wp_die('The secret key provided does not match this one for the user.');
}
$ultimatemember->user->approve();
$redirect = um_user('url_email_activate') ? um_user('url_email_activate') : um_get_core_page('login', 'account_active');
um_reset_user();
exit(wp_redirect($redirect));
}
}
示例10: activate_account_via_email_link
function activate_account_via_email_link()
{
global $ultimatemember;
if (isset($_REQUEST['act']) && $_REQUEST['act'] == 'activate_via_email' && isset($_REQUEST['hash']) && strlen($_REQUEST['hash']) == 40 && isset($_REQUEST['user_id']) && is_numeric($_REQUEST['user_id'])) {
// valid token
$user_id = absint($_REQUEST['user_id']);
delete_option("um_cache_userdata_{$user_id}");
um_fetch_user($user_id);
if (um_user('account_status') != 'awaiting_email_confirmation') {
wp_die('The activation link you used is invalid or has expired.');
}
if (strtolower($_REQUEST['hash']) !== strtolower(um_user('account_secret_hash'))) {
wp_die('The secret key provided does not match this one for the user.');
}
$ultimatemember->user->approve();
$redirect = um_user('url_email_activate') ? um_user('url_email_activate') : um_get_core_page('login', 'account_active');
$login = (bool) um_user('login_email_activate');
// log in automatically
if (!is_user_logged_in() && $login) {
$user = get_userdata($user_id);
$user_id = $user->ID;
// update wp user
wp_set_current_user($user_id, $user_login);
wp_set_auth_cookie($user_id);
ob_start();
do_action('wp_login', $user_login);
ob_end_clean();
}
um_reset_user();
do_action('um_after_email_confirmation', $user_id);
exit(wp_redirect($redirect));
}
}
示例11: load
function load($args)
{
global $ultimatemember;
ob_start();
$defaults = array();
$args = wp_parse_args($args, $defaults);
// when to not continue
$this->form_id = isset($args['form_id']) ? $args['form_id'] : null;
if (!$this->form_id) {
return;
}
$this->form_status = get_post_status($this->form_id);
if ($this->form_status != 'publish') {
return;
}
// get data into one global array
$post_data = $ultimatemember->query->post_data($this->form_id);
$args = apply_filters('um_pre_args_setup', $post_data);
if (!isset($args['template'])) {
$args['template'] = '';
}
if (isset($post_data['template']) && $post_data['template'] != $args['template']) {
$args['template'] = $post_data['template'];
}
if (!$this->template_exists($args['template'])) {
$args['template'] = $post_data['mode'];
}
if (!isset($post_data['template'])) {
$post_data['template'] = $post_data['mode'];
}
$args = array_merge($post_data, $args);
if (isset($args['use_globals']) && $args['use_globals'] == 1) {
$args = array_merge($args, $this->get_css_args($args));
} else {
$args = array_merge($this->get_css_args($args), $args);
}
// filter for arguments
$args = apply_filters('um_shortcode_args_filter', $args);
extract($args, EXTR_SKIP);
// for profiles only
if ($mode == 'profile' && um_profile_id() && isset($args['role']) && $args['role'] && $args['role'] != $ultimatemember->query->get_role_by_userid(um_profile_id())) {
return;
}
// start loading the template here
do_action("um_pre_{$mode}_shortcode", $args);
do_action("um_before_form_is_loaded", $args);
do_action("um_before_{$mode}_form_is_loaded", $args);
$this->template_load($template, $args);
$this->dynamic_css($args);
if (um_get_requested_user() || $mode == 'logout') {
um_reset_user();
}
do_action('um_after_everything_output');
$output = ob_get_contents();
ob_end_clean();
return $output;
}
示例12: um_force_admin_bar
function um_force_admin_bar()
{
um_reset_user();
}
示例13: um_reset_user_clean
</div>
<?php
}
?>
</div>
<div class="um-member-less"><a href="#"><i class="um-faicon-angle-up"></i></a></div>
</div>
<?php
}
?>
</div>
</div>
<?php
um_reset_user_clean();
}
// end foreach
um_reset_user();
?>
<div class="um-clear"></div>
</div>
示例14: um_get_display_name
function um_get_display_name($user_id)
{
um_fetch_user($user_id);
$name = um_user('display_name');
um_reset_user();
return $name;
}
示例15: um_members_directory_display
//.........这里部分代码省略.........
if ($key && um_filtered_value($key)) {
$value = um_filtered_value($key);
?>
<div class="um-member-tagline"><?php
echo $value;
?>
</div>
<?php
}
}
}
?>
<?php
if ($show_userinfo) {
?>
<div class="um-member-meta-main">
<?php
if ($userinfo_animate) {
?>
<div class="um-member-more"><a href="#"><i class="um-faicon-angle-down"></i></a></div>
<?php
}
?>
<div class="um-member-meta <?php
if (!$userinfo_animate) {
echo 'no-animate';
}
?>
">
<?php
foreach ($reveal_fields as $key) {
if ($key && um_filtered_value($key)) {
$value = um_filtered_value($key);
?>
<div class="um-member-metaline um-member-metaline-<?php
echo $key;
?>
"><span><strong><?php
echo $ultimatemember->fields->get_label($key);
?>
:</strong> <?php
echo $value;
?>
</span></div>
<?php
}
}
?>
<?php
if ($show_social) {
?>
<div class="um-member-connect">
<?php
$ultimatemember->fields->show_social_urls();
?>
</div>
<?php
}
?>
</div>
<div class="um-member-less"><a href="#"><i class="um-faicon-angle-up"></i></a></div>
</div>
<?php
}
?>
</div>
</div>
<?php
um_reset_user_clean();
}
// end foreach
um_reset_user();
?>
<div class="um-clear"></div>
</div>
<?php
}
}