function wpmudev_chat_settings_screen_chat_proc()
{
    global $wpmudev_chat, $current_user, $bp;
    if (isset($_POST['wpmudev_chat_user_settings'])) {
        //echo "_POST<pre>"; print_r($_POST); echo "</pre>";
        //die();
        if (isset($_POST['wpmudev_chat_user_settings']['chat_user_status'])) {
            $chat_user_status = esc_attr($_POST['wpmudev_chat_user_settings']['chat_user_status']);
            if (isset($wpmudev_chat->_chat_options['user-statuses'][$chat_user_status])) {
                wpmudev_chat_update_user_status($bp->displayed_user->id, $chat_user_status);
            }
            unset($_POST['wpmudev_chat_user_settings']['chat_user_status']);
        }
        $user_meta = get_user_meta($bp->displayed_user->id, 'wpmudev-chat-user', true);
        if (!$user_meta) {
            $user_meta = array();
        }
        $user_meta = wp_parse_args($_POST['wpmudev_chat_user_settings'], $user_meta);
        update_user_meta($bp->displayed_user->id, 'wpmudev-chat-user', $user_meta);
        $wpmudev_chat->user_meta = $user_meta;
        // Show the standard BP green success message
        bp_core_add_message(__('Changes saved.', $wpmudev_chat->translation_domain));
    }
    add_action('bp_template_title', 'wpmudev_chat_settings_show_screen_title');
    add_action('bp_template_content', 'wpmudev_chat_settings_show_screen_content');
    bp_core_load_template(apply_filters('bp_core_template_plugin', 'members/single/plugins'));
    return;
}
Example #2
2
 /**
  * When the user decides to not have this show again save user meta to make it so.
  *
  * @param array $data Sanitized data to use for saving.
  *
  * @returns bool Always returns true
  */
 public function hide($data)
 {
     $user_id = get_current_user_ID();
     update_user_meta($user_id, 'lasso_hide_tour', true);
     do_action('lasso_tour_hidden', $user_id);
     return true;
 }
Example #3
2
function q_create_profilepage($userid)
{
    $quser = get_userdata($userid);
    $userpost = array('post_title' => $quser->display_name, 'post_content' => $quser->user_description, 'post_status' => 'publish', 'post_author' => $quser->ID, 'post_date' => $quser->registered, 'post_type' => 'quser');
    $postid = wp_insert_post($userpost);
    update_user_meta($userid, 'q_profilepage_id', $postid);
}
function restrict_save_data($user_id)
{
    if (!current_user_can('add_users')) {
        return false;
    }
    update_user_meta($user_id, '_access', $_POST['allow']);
}
Example #5
0
function upmeta($i)
{
    if (is_user_logged_in()) {
        global $f;
        update_user_meta($f, 'like-posts', serialize($i));
    }
}
Example #6
0
function tie_like_post()
{
    global $user_ID;
    $postID = $_REQUEST['post'];
    if (is_numeric($postID)) {
        $count = get_post_meta($postID, 'tie_likes', true);
        if (empty($count) || $count == '') {
            $count = 0;
        }
        $count++;
        if ($user_ID) {
            $user_liked = get_the_author_meta('liked', $user_ID);
            $user_liked_posts = explode(',', $user_liked);
            if (empty($user_liked)) {
                update_user_meta($user_ID, 'liked', $postID);
                update_post_meta($postID, 'tie_likes', $count);
            } else {
                if (!in_array($postID, $user_liked_posts)) {
                    update_post_meta($postID, 'tie_likes', $count);
                    $postID = $user_liked . ',' . $postID;
                    update_user_meta($user_ID, 'liked', $postID);
                }
            }
        } else {
            $user_liked = $_COOKIE["tie_likes_" . $postID];
            if (empty($user_liked)) {
                setcookie('tie_likes_' . $postID, $postID, time() + 7776000, '/');
                update_post_meta($postID, 'tie_likes', $count);
            }
        }
        echo $count;
    }
    die;
}
Example #7
0
function jr_handle_resume_subscriptions_ipn($posted)
{
    global $jr_log;
    $jr_log->write_log('Valid IPN response detected: ' . print_r($posted, true));
    // Custom holds post ID
    if (!empty($posted['txn_type']) && !empty($posted['custom']) && is_numeric($posted['custom']) && $posted['custom'] > 0) {
        $user_id = (int) $posted['custom'];
        switch (strtolower($posted['txn_type'])) {
            case "subscr_signup":
                update_user_meta($user_id, '_valid_resume_subscription', '1');
                do_action('user_resume_subscription_started', $user_id);
                exit;
                break;
            case "subscr_payment":
                exit;
                break;
            case "subscr_cancel":
            case "subscr_failed":
            case "subscr_eot":
                update_user_meta($user_id, '_valid_resume_subscription', '0');
                do_action('user_resume_subscription_ended', $user_id);
                exit;
                break;
        }
    }
}
 /**
  * @Given /^Users exist:$/
  */
 public function usersExist(TableNode $table)
 {
     $usersData = $table->getHash();
     add_filter('send_password_change_email', '__return_false');
     add_filter('send_email_change_email', '__return_false');
     foreach ($usersData as $userData) {
         if (empty($userData['login'])) {
             throw new \InvalidArgumentException('You must provide a user login!');
         }
         $user = get_user_by('login', $userData['login']);
         $data = $this->getUserDataFromTable($userData);
         if ($user) {
             $data['ID'] = $user->ID;
         }
         $result = $user ? wp_update_user($data) : wp_insert_user($data);
         if (is_wp_error($result)) {
             throw new \UnexpectedValueException('User could not be created: ' . $result->get_error_message());
         }
         foreach ($this->getUserMetaDataFromTable($userData) as $key => $value) {
             update_user_meta($user->ID, $key, $value);
         }
     }
     remove_filter('send_password_change_email', '__return_false');
     remove_filter('send_email_change_email', '__return_false');
 }
/**
 * @param string $success_message - '', if present, will return an clickable link
 * @param string $error_message - "You don’t have access to this RSS feed."
 * @param bool $return
 * @return string
 */
function memberful_private_rss_feed_link($success_message = '', $error_message = "You don’t have access to this RSS feed.", $return = false)
{
    $error_message = apply_filters('memberful_private_rss_feed_error_message', $error_message);
    if (!is_user_logged_in()) {
        return memberful_private_rss_feed_link_response_helper($error_message, $return);
    }
    $requiredPlan = memberful_private_user_feed_settings_get_required_plan();
    // We want to allow the private user feed only if the admin has configured it.
    if ($requiredPlan == false) {
        return memberful_private_rss_feed_link_response_helper($error_message, $return);
    }
    $current_user_id = get_current_user_id();
    if (!is_subscribed_to_memberful_plan($requiredPlan, $current_user_id)) {
        return memberful_private_rss_feed_link_response_helper($error_message, $return);
    }
    $feedToken = get_user_meta($current_user_id, 'memberful_private_user_feed_token', true);
    if ($feedToken == false || $feedToken == '') {
        $feedToken = substr(md5(uniqid(rand(1, 10000))), 2, 30);
        update_user_meta($current_user_id, 'memberful_private_user_feed_token', $feedToken);
    }
    $link = get_home_url() . '/' . memberful_private_user_feed_get_url_identifier($feedToken);
    if ($success_message != '') {
        $link = '<a href="' . $link . '">' . do_shortcode($success_message) . '</a>';
    }
    return memberful_private_rss_feed_link_response_helper($link, $return);
}
function update_user_meta_values($my_id = '', $metakey = '', $metavalue = '')
{
    global $bp;
    $my_id = $bp->displayed_user->id;
    $update_user_meta_values = update_user_meta($my_id, $metakey, $metavalue);
    return $get_user_meta_values;
}
Example #11
0
 function __construct($par = null)
 {
     $this->par = $par;
     /* excel  */
     if ($_GET['action'] == 'xls') {
         $this->excel = true;
     }
     /* search query */
     if ($_GET['src']) {
         $this->search_query = $_GET['src'];
     }
     /* filter by month */
     if ($_GET['mth'] && $_GET['yr']) {
         $this->mth = $_GET['mth'];
         $this->yr = $_GET['yr'];
     }
     /* determine max row per page */
     if ($_GET['max'] > 0) {
         $this->set_max($_GET['max']);
         update_user_meta(get_current_user_id(), get_query_var('pagename') . '_max', $_GET['max']);
     } else {
         $val = (int) get_user_meta(get_current_user_id(), get_query_var('pagename') . '_max', true);
         if ($val > 0) {
             $this->set_max($val);
         }
     }
     /* mysql limit start, max */
     $this->paged = $_GET['paged'] ? $_GET['paged'] - 1 : 0;
     $this->start = $this->paged * $this->get_max();
     if (method_exists($this, 'query')) {
         $this->data = $this->query();
         wp_enqueue_script('list-table');
     }
 }
 /**
  *
  * @TODO document
  *
  */
 function save_profile_admin($user_ID)
 {
     if (!isset($this->tabs) || empty($this->tabs)) {
         return;
     }
     // Loop through tabs
     foreach ($this->tabs as $tab => $t) {
         // Loop through tab options
         foreach ($t->options as $oid => $o) {
             // Note: If the value is null, then test to see if the option is already set to something
             // create and overwrite the option to null in that case (i.e. it is being set to empty)
             if (isset($o['selectvalues']) && pagelines_is_multi_option($oid, $o)) {
                 foreach ($o['selectvalues'] as $sid => $s) {
                     $option_value = isset($_POST[$sid]) ? $_POST[$sid] : null;
                     if (!empty($option_value) || pl_um($sid, $user_ID)) {
                         update_post_meta($user_ID, $sid, $option_value);
                     }
                 }
             } else {
                 $option_value = isset($_POST[$oid]) ? $_POST[$oid] : null;
                 if (!empty($option_value) || pl_um($oid, $user_ID)) {
                     update_user_meta($user_ID, $oid, $option_value);
                 }
             }
         }
     }
 }
 function tt_save_custom_user_profile_fields($user_id)
 {
     if (!current_user_can('edit_user', $user_id)) {
         return FALSE;
     }
     update_user_meta($user_id, 'enable_auto_publish', isset($_POST['enable_auto_publish']) ? $_POST['enable_auto_publish'] : 'false');
 }
Example #14
0
function qq_oauth()
{
    $code = $_GET['code'];
    $token_url = "https://graph.qq.com/oauth2.0/token?client_id=" . QQ_APPID . "&client_secret=" . QQ_APPSECRET . "&grant_type=authorization_code&redirect_uri=" . urlencode(home_url()) . "&code=" . $code;
    $response = wp_remote_get($token_url);
    $response = $response['body'];
    if (strpos($response, "callback") !== false) {
        wp_redirect(home_url());
    }
    $params = array();
    parse_str($response, $params);
    $qq_access_token = $params["access_token"];
    $graph_url = "https://graph.qq.com/oauth2.0/me?access_token=" . $qq_access_token;
    $str = wp_remote_get($graph_url);
    $str = $str['body'];
    if (strpos($str, "callback") !== false) {
        $lpos = strpos($str, "(");
        $rpos = strrpos($str, ")");
        $str = substr($str, $lpos + 1, $rpos - $lpos - 1);
    }
    $user = json_decode($str, true);
    if (isset($user->error)) {
        echo "<h3>错误代码:</h3>" . $user->error;
        echo "<h3>信息  :</h3>" . $user->error_description;
        exit;
    }
    $qq_openid = $user['openid'];
    if (!$qq_openid) {
        wp_redirect(home_url());
        exit;
    }
    $get_user_info = "https://graph.qq.com/user/get_user_info?" . "access_token=" . $qq_access_token . "&oauth_consumer_key=" . QQ_APPID . "&openid=" . $qq_openid . "&format=json";
    $data = wp_remote_get($get_user_info);
    $data = $data['body'];
    $data = json_decode($data, true);
    $username = $data['nickname'];
    $avatar = $data['figureurl_2'];
    if (is_user_logged_in()) {
        $this_user = wp_get_current_user();
        update_user_meta($this_user->ID, "qq_openid", $qq_openid);
        update_user_meta($this_user->ID, "qq_avatar", $avatar);
        fa_qq_oauth_redirect();
    } else {
        $user_qq = get_users(array("meta_key " => "qq_openid", "meta_value" => $qq_openid));
        if (is_wp_error($user_qq) || !count($user_qq)) {
            $login_name = wp_create_nonce($qq_openid);
            $random_password = wp_generate_password($length = 12, $include_standard_special_chars = false);
            $userdata = array('user_login' => $login_name, 'display_name' => $username, 'user_pass' => $random_password, 'nick_name' => $username);
            $user_id = wp_insert_user($userdata);
            wp_signon(array("user_login" => $login_name, "user_password" => $random_password), false);
            update_user_meta($user_id, "qq_openid", $qq_openid);
            update_user_meta($user_id, "qq_avatar", $avatar);
            fa_qq_oauth_redirect();
        } else {
            wp_set_auth_cookie($user_qq[0]->ID);
            update_user_meta($user_qq[0]->ID, "qq_avatar", $avatar);
            fa_qq_oauth_redirect();
        }
    }
}
 function um_admin_addon_hook($hook)
 {
     global $ultimatemember;
     switch ($hook) {
         case 'bp_avatar_transfer':
             if (class_exists('BuddyPress')) {
                 $path = bp_core_avatar_upload_path() . '/avatars';
                 $files = glob($path . '/*');
                 $i = 0;
                 foreach ($files as $key) {
                     $q = count(glob("{$key}/*")) === 0 ? 0 : 1;
                     if ($q == 1) {
                         $photo = glob($key . '/*');
                         foreach ($photo as $file) {
                             if (strstr($file, 'bpfull')) {
                                 $get_user_id = explode('/', $file);
                                 array_pop($get_user_id);
                                 $user_id = end($get_user_id);
                                 if (!file_exists($ultimatemember->files->upload_basedir . $user_id . '/profile_photo.jpg')) {
                                     $ultimatemember->files->new_user($user_id);
                                     copy($file, $ultimatemember->files->upload_basedir . $user_id . '/profile_photo.jpg');
                                     update_user_meta($user_id, 'profile_photo', 'profile_photo.jpg');
                                     $i++;
                                 }
                             }
                         }
                     }
                 }
                 $this->content = '<p><strong>Done. Process completed!</p>';
                 $this->content .= $i . ' user(s) changed.</strong></p>';
             }
             break;
     }
 }
/**
 * Upgrade routine for 3.2.1
 *
 * @since 3.2.1
 * @return void
 */
function wpas_upgrade_321()
{
    $agents = wpas_list_users('edit_ticket');
    foreach ($agents as $agent_id => $agent_name) {
        update_user_meta($agent_id, 'wpas_can_be_assigned', 'yes');
    }
}
function iul_get_time_data($type = "")
{
    $return_data = "";
    if (is_user_logged_in()) {
        $user = wp_get_current_user();
        $roles = $user->roles[0];
        $current_time = date('H:i:s');
        $last_active_time = get_user_meta(get_current_user_id(), 'last_active_time', true);
        update_user_meta(get_current_user_id(), 'last_active_time', date('H:i:s'));
        if ($last_active_time) {
            $iul_data = get_option('iul_data');
            $iul_behavior = get_option('iul_behavior');
            $timer = empty($iul_behavior[$roles]['idle_timer']) ? $iul_data['iul_idleTimeDuration'] : $iul_behavior[$roles]['idle_timer'];
            $diff = strtotime($current_time) - strtotime($last_active_time);
            $return_data = array('timer' => $timer, 'diff' => intval($diff), 'last_active_time' => strtotime($last_active_time), 'current_time' => strtotime($current_time));
        }
        if ($type) {
            if ($type == 'active') {
                update_user_meta(get_current_user_id(), 'last_active_time', $current_time);
                $return_data['last_active_time'] = strtotime($last_active_time);
                $return_data['diff'] = strtotime($current_time) - strtotime($last_active_time);
            }
        }
        return $return_data;
    }
    return false;
}
/**
 * @param int      $user_id
 * @param bool|int $timestamp
 */
function wskl_set_user_deactivated($user_id, $timestamp = FALSE)
{
    if (FALSE === $timestamp) {
        $timestamp = time();
    }
    update_user_meta($user_id, wskl_get_option_name('inactive-accounts_deactivated'), $timestamp);
}
 /**
  * {@inheritdoc }
  */
 public function saveConfig()
 {
     $options = (object) array('menu' => $this->getMenu(), 'metaboxes' => $this->getMetaboxes(), 'capabilities' => $this->getCapabilities(), 'menu_order' => $this->getMenuOrder(), 'restrictions' => $this->getRestrictions(), 'excludes' => $this->getExcludes());
     update_user_meta($this->getID(), WPACCESS_PREFIX . 'config', $options);
     mvb_Model_Cache::clearCache();
     do_action(WPACCESS_PREFIX . 'do_save');
 }
 public function hide()
 {
     if (isset($_GET['wpurp_hide_getting_started'])) {
         check_admin_referer('wpurp_hide_getting_started', 'wpurp_hide_getting_started');
         update_user_meta(get_current_user_id(), '_wpurp_hide_getting_started', get_option(WPUltimateRecipe::get()->pluginName . '_version'));
     }
 }
Example #21
0
function userFistLastName($user_id){
    $firstname=get_user_meta($user_id, 'first_name', true);
    if($firstname == ""){
        update_user_meta($user_id, 'first_name', 'Jhony');
        update_user_meta($user_id, 'last_name', 'Waker');
    }
}
 function saveUserProfileImageField($userId)
 {
     if (!current_user_can('edit_user', $userId)) {
         return false;
     }
     update_user_meta($userId, 'image', $_POST['image']);
 }
Example #23
0
 function setUp()
 {
     parent::setUp();
     $this->ticket_data = array('post_title' => 'Test Ticket', 'post_name' => 'Test Ticket', 'post_author' => 1, 'post_content' => 'In hac habitasse platea dictumst. Nulla neque dolor, sagittis eget, iaculis quis, molestie non, velit. Nullam cursus lacinia erat. Aenean leo ligula, porttitor eu, consequat vitae, eleifend ac, enim. Donec vitae orci sed dolor rutrum auctor.');
     $this->reply_data = array('post_content' => 'Vivamus aliquet elit ac nisl. Donec pede justo, fringilla vel, aliquet nec, vulputate eget, arcu. Nullam dictum felis eu pede mollis pretium. Nullam vel sem. Praesent nonummy mi in odio.');
     update_user_meta(1, 'wpas_can_be_assigned', 'yes');
 }
 function wp_new_user_notification($user_id, $plaintext_pass = '')
 {
     global $pagenow;
     global $register_plus_redux;
     //trigger_error( sprintf( __( 'Register Plus Redux DEBUG: wp_new_user_notification($user_id=%s, $plaintext_pass=%s) from %s', 'register-plus-redux' ), $user_id, $plaintext_pass, $pagenow ) );
     if ('1' === $register_plus_redux->rpr_get_option('user_set_password') && !empty($_POST['pass1'])) {
         $plaintext_pass = stripslashes((string) $_POST['pass1']);
     }
     if ('user-new.php' === $pagenow && !empty($_POST['pass1'])) {
         $plaintext_pass = stripslashes((string) $_POST['pass1']);
     }
     //TODO: Code now only forces users registering to verify email, may want to add settings to have admin created users verify email too
     $verification_code = '';
     if ('wp-login.php' === $pagenow && '1' === $register_plus_redux->rpr_get_option('verify_user_email')) {
         $verification_code = wp_generate_password(20, FALSE);
         update_user_meta($user_id, 'email_verification_code', $verification_code);
         update_user_meta($user_id, 'email_verification_sent', gmdate('Y-m-d H:i:s'));
         $register_plus_redux->send_verification_mail($user_id, $verification_code);
     }
     if ('wp-login.php' === $pagenow && '1' !== $register_plus_redux->rpr_get_option('disable_user_message_registered') || 'wp-login.php' !== $pagenow && '1' !== $register_plus_redux->rpr_get_option('disable_user_message_created')) {
         if ('1' !== $register_plus_redux->rpr_get_option('verify_user_email') && '1' !== $register_plus_redux->rpr_get_option('verify_user_admin')) {
             $register_plus_redux->send_welcome_user_mail($user_id, $plaintext_pass);
         }
     }
     if ('wp-login.php' === $pagenow && '1' !== $register_plus_redux->rpr_get_option('disable_admin_message_registered') || 'wp-login.php' !== $pagenow && '1' !== $register_plus_redux->rpr_get_option('disable_admin_message_created')) {
         $register_plus_redux->send_admin_mail($user_id, $plaintext_pass, $verification_code);
     }
 }
 /**
  *
  * 	Process the infoz
  *	@since 1.0
  */
 function user_info()
 {
     if (isset($_POST['action'])) {
         // bail out if this user isnt logged in
         if (!is_user_logged_in()) {
             return;
         }
         if (!wp_verify_nonce($_POST['nonce'], 'process-user-info')) {
             return;
         }
         $user_id = get_current_user_id();
         if ($_POST['action'] == 'process_user_info') {
             $gender = isset($_POST['gender']) ? sanitize_text_field($_POST['gender']) : false;
             $age = isset($_POST['age']) ? sanitize_text_field($_POST['age']) : false;
             $education = isset($_POST['education']) ? sanitize_text_field($_POST['education']) : false;
             $employment = isset($_POST['employment']) ? sanitize_text_field($_POST['employment']) : false;
             $data = array('gender' => $gender, 'age' => $age, 'education' => $education, 'employment' => $employment);
             update_user_meta($user_id, 'user_info', $data);
             update_user_meta($user_id, 'user_info_completed', 1);
             do_action('user_info_updated', $user_id, $data);
             wp_send_json_success();
         } else {
             wp_send_json_error();
         }
     } else {
         wp_send_json_error();
     }
 }
Example #26
0
/**
 * Set the options need by V2Press.
 *
 * @since 0.0.1
 */
function vp_init_options()
{
    // General
    update_option('users_can_register', '1');
    update_option('default_role', 'author');
    // Writing
    update_option('use_smiles', '0');
    // Reading
    update_option('posts_per_page', '15');
    update_option('posts_per_rss', '15');
    // Discussion
    update_option('default_pingback_flag', '0');
    update_option('comment_registration', '1');
    update_option('thread_comments', '0');
    update_option('page_comments', '1');
    update_option('comments_notify', '0');
    update_option('comment_whitelist', '0');
    // Permalink
    update_option('permalink_structure', '/t/%post_id%');
    update_option('category_base', 'go');
    global $wp_rewrite;
    $wp_rewrite->flush_rules();
    // Administrator
    update_user_meta('1', 'rich_editing', 'false');
}
function rcl_ajax_delete_post()
{
    global $user_ID;
    if (!$user_ID) {
        return false;
    }
    $post = get_post(intval($_POST['post_id']));
    $res = wp_delete_post($post->ID);
    if ($res) {
        $temp_gal = get_user_meta($user_ID, 'tempgallery', 1);
        if ($temp_gal) {
            $cnt = count($temp_gal);
            foreach ((array) $temp_gal as $key => $gal) {
                if ($gal['ID'] == $_POST['post_id']) {
                    unset($temp_gal[$key]);
                }
            }
            foreach ((array) $temp_gal as $t) {
                $new_temp[] = $t;
            }
            if ($new_temp) {
                update_user_meta($user_ID, 'tempgallery', $new_temp);
            } else {
                delete_user_meta($user_ID, 'tempgallery');
            }
        }
        $log['result'] = 100;
        $log['post_type'] = $post->post_type;
    } else {
        $log['result'] = 1;
    }
    echo json_encode($log);
    exit;
}
function save_cp_case_field_id($user_id)
{
    if (!current_user_can('edit_user', $user_id)) {
        return false;
    }
    update_user_meta($user_id, 'id_person', $_POST['person']);
}
 function hide_notice()
 {
     if (isset($_GET['wpupg_hide_new_notice'])) {
         check_admin_referer('wpupg_hide_new_notice', 'wpupg_hide_new_notice');
         update_user_meta(get_current_user_id(), '_wpupg_hide_new_notice', get_option(WPUltimatePostGrid::get()->pluginName . '_version'));
     }
 }
/**
 * Add member to an RCP subscription level when they purchase a specific product
 *
 */
function pw_edd_add_customer_to_level($payment_id = 0)
{
    $user_id = edd_get_payment_user_id($payment_id);
    if ($user_id <= 0) {
        return;
    }
    $downloads = edd_get_payment_meta_downloads($payment_id);
    if ($downloads) {
        $level = false;
        foreach ($downloads as $download) {
            // Set the subscription level based on the product ID(s) purchased
            switch ($download['id']) {
                case 45:
                    // Set the subscription level to add the user to
                    $level = 4;
                    break;
                case 742:
                    break;
            }
        }
        if (!empty($level) && function_exists('rcp_set_status')) {
            // Give user one month of access
            $expiration = date('Y-m-d H:i:s', strtotime('+1 month'));
            update_user_meta($user_id, 'rcp_subscription_level', $level);
            update_user_meta($user_id, 'rcp_expiration', $expiration);
            rcp_set_status($user_id, 'active');
        }
    }
}