/**
 * Get the URL of the activation page.
 *
 * @return string
 */
function bp_get_activation_page()
{
    if (bp_has_custom_activation_page()) {
        $page = trailingslashit(bp_get_root_domain() . '/' . bp_get_activate_slug());
    } else {
        $page = trailingslashit(bp_get_root_domain()) . 'wp-activate.php';
    }
    /**
     * Filters the URL of the activation page.
     *
     * @since 1.2.0
     *
     * @param string $page URL to the activation page.
     */
    return apply_filters('bp_get_activation_page', $page);
}
/**
 * Output the activation slug
 *
 * @package BuddyPress
 * @subpackage Members Template
 * @since 1.5
 *
 * @uses bp_get_activate_slug()
 */
function bp_activate_slug()
{
    echo bp_get_activate_slug();
}
 /**
  * Activates User account on Multisite based on the given key
  * 
  * 
  */
 public static function ms_activate_account($key)
 {
     //if doing ajax, return
     if (defined('DOING_AJAX')) {
         return false;
     }
     //mimic bp activation
     $bp = buddypress();
     $signup = apply_filters('bp_core_activate_account', wpmu_activate_signup($key));
     /* If there was errors, add a message and redirect */
     if ($signup->errors) {
         bp_core_add_message(__('There was an error activating your account, please try again.', 'buddypress'), 'error');
         bp_core_redirect($bp->root_domain . '/' . bp_get_activate_slug());
         //send the activation mail in this case
     }
     $user_id = $signup['user_id'];
     //should we pass password as a param instead of the dependency here?
     $pass = $_POST['signup_password'];
     $ud = get_userdata($user_id);
     $data = array('user_login' => $ud->user_login, 'user_email' => $ud->user_email, 'user_pass' => $pass, 'ID' => $user_id, 'display_name' => bp_core_get_user_displayname($user_id));
     //update password
     if (is_multisite()) {
         wp_update_user($data);
     }
     self::update_profile_fields($user_id, $signup);
     do_action('bp_core_activated_user', $user_id, $key, $signup);
     //let bp handle the new user registerd activity
     //do_action( 'bp_core_account_activated', &$signup, $_GET['key'] );
     bp_core_add_message(__('Your account is now active!'));
     $bp->activation_complete = true;
     self::login_redirect($ud->user_login, $pass);
 }
 /**
  * Determines if a specific Post/Page ID, or URI, is Systematic in any way.
  *
  * @package s2Member\Systematics
  * @since 3.5
  *
  * @param int|string $singular_id Optional. A numeric Post/Page ID in WordPress.
  * @param string $uri Optional. A request URI to test against.
  * @return bool True if Systematic, else false.
  *
  * @todo Test URIs against formulated links for Systematic Pages like the Membership Options Page?
  * 	Don't think this is required though; as it's already handled in other areas, correct?
  */
 public static function is_systematic_use_specific_page($singular_id = FALSE, $uri = FALSE)
 {
     global $bp;
     // If BuddyPress is installed, we'll need this global reference.
     $singular_id = $singular_id && is_numeric($singular_id) ? (int) $singular_id : false;
     // Force types.
     $uri = $uri && is_string($uri) && ($uri = c_ws_plugin__s2member_utils_urls::parse_uri($uri)) ? $uri : false;
     if (c_ws_plugin__s2member_systematics_sp::is_s2_systematic_use_specific_page($singular_id, $uri)) {
         return $is_systematic = apply_filters("ws_plugin__s2member_is_systematic_use_specific_page", true, get_defined_vars());
     } else {
         if (c_ws_plugin__s2member_systematics_sp::is_wp_systematic_use_specific_page($singular_id, $uri)) {
             return $is_systematic = apply_filters("ws_plugin__s2member_is_systematic_use_specific_page", true, get_defined_vars());
         } else {
             if ($uri && c_ws_plugin__s2member_utils_conds::bp_is_installed() && preg_match("/\\/(?:" . preg_quote(trim(function_exists("bp_get_signup_slug") ? bp_get_signup_slug() : BP_REGISTER_SLUG, "/"), "/") . "|" . preg_quote(trim(function_exists("bp_get_activate_slug") ? bp_get_activate_slug() : BP_ACTIVATION_SLUG, "/"), "/") . ")(?:\\/|\\?|\$)/", $uri)) {
                 return $is_systematic = apply_filters("ws_plugin__s2member_is_systematic_use_specific_page", true, get_defined_vars());
             } else {
                 if ($singular_id && c_ws_plugin__s2member_utils_conds::bp_is_installed() && (!empty($bp->pages->register->id) && $singular_id === (int) $bp->pages->register->id || !empty($bp->pages->activate->id) && $singular_id === (int) $bp->pages->activate->id)) {
                     return $is_systematic = apply_filters("ws_plugin__s2member_is_systematic_use_specific_page", true, get_defined_vars());
                 } else {
                     if ($singular_id && $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["login_welcome_page"] && $singular_id === (int) $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["login_welcome_page"]) {
                         return $is_systematic = apply_filters("ws_plugin__s2member_is_systematic_use_specific_page", true, get_defined_vars());
                     } else {
                         if ($singular_id && $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["membership_options_page"] && $singular_id === (int) $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["membership_options_page"]) {
                             return $is_systematic = apply_filters("ws_plugin__s2member_is_systematic_use_specific_page", true, get_defined_vars());
                         } else {
                             if ($singular_id && $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["file_download_limit_exceeded_page"] && $singular_id === (int) $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["file_download_limit_exceeded_page"]) {
                                 return $is_systematic = apply_filters("ws_plugin__s2member_is_systematic_use_specific_page", true, get_defined_vars());
                             } else {
                                 if ($uri && $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["login_redirection_override"] && ($_lro = c_ws_plugin__s2member_login_redirects::login_redirection_uri(false, "root-returns-false")) && preg_match("/^" . preg_quote($_lro, "/") . "\$/", $uri)) {
                                     return $is_systematic = apply_filters("ws_plugin__s2member_is_systematic_use_specific_page", true, get_defined_vars());
                                 } else {
                                     // Otherwise, we return false (i.e. it's NOT a Systematic Use Page in any way).
                                     return $is_systematic = apply_filters("ws_plugin__s2member_is_systematic_use_specific_page", false, get_defined_vars());
                                 }
                             }
                         }
                     }
                 }
             }
         }
     }
 }
예제 #5
0
/**
 * Get the URL of the activation page.
 *
 * @return string
 */
function bp_get_activation_page()
{
    if (bp_has_custom_activation_page()) {
        $page = trailingslashit(bp_get_root_domain() . '/' . bp_get_activate_slug());
    } else {
        $page = trailingslashit(bp_get_root_domain()) . 'wp-activate.php';
    }
    return apply_filters('bp_get_activation_page', $page);
}
예제 #6
0
 /**
  * Determines if a specific Post/Page ID, or URI, is Systematic in any way.
  *
  * @package s2Member\Systematics
  * @since 3.5
  *
  * @param int|string $singular_id Optional. A numeric Post/Page ID in WordPress.
  * @param string     $uri Optional. A request URI to test against.
  *
  * @return bool True if Systematic, else false.
  *
  * @todo Test URIs against formulated links for Systematic Pages like the Membership Options Page?
  *   Don't think this is required though; as it's already handled in other areas, correct?
  */
 public static function is_systematic_use_specific_page($singular_id = '', $uri = '')
 {
     global $bp;
     // If BuddyPress is installed, we'll need this global reference.
     $ci = $GLOBALS['WS_PLUGIN__']['s2member']['o']['ruris_case_sensitive'] ? '' : 'i';
     $singular_id = $singular_id && is_numeric($singular_id) ? (int) $singular_id : FALSE;
     // Force types.
     $uri = $uri && is_string($uri) && ($uri = c_ws_plugin__s2member_utils_urls::parse_uri($uri)) ? $uri : FALSE;
     if (c_ws_plugin__s2member_systematics_sp::is_s2_systematic_use_specific_page($singular_id, $uri)) {
         return $is_systematic = apply_filters('ws_plugin__s2member_is_systematic_use_specific_page', TRUE, get_defined_vars());
     }
     if (c_ws_plugin__s2member_systematics_sp::is_wp_systematic_use_specific_page($singular_id, $uri)) {
         return $is_systematic = apply_filters('ws_plugin__s2member_is_systematic_use_specific_page', TRUE, get_defined_vars());
     }
     if ($uri && c_ws_plugin__s2member_utils_conds::bp_is_installed() && preg_match('/\\/(?:' . preg_quote(trim(function_exists('bp_get_signup_slug') ? bp_get_signup_slug() : BP_REGISTER_SLUG, '/'), '/') . '|' . preg_quote(trim(function_exists('bp_get_activate_slug') ? bp_get_activate_slug() : BP_ACTIVATION_SLUG, '/'), '/') . ')(?:\\/|\\?|$)/' . $ci, $uri)) {
         return $is_systematic = apply_filters('ws_plugin__s2member_is_systematic_use_specific_page', TRUE, get_defined_vars());
     }
     if ($singular_id && c_ws_plugin__s2member_utils_conds::bp_is_installed() && (!empty($bp->pages->register->id) && $singular_id === (int) $bp->pages->register->id || !empty($bp->pages->activate->id) && $singular_id === (int) $bp->pages->activate->id)) {
         return $is_systematic = apply_filters('ws_plugin__s2member_is_systematic_use_specific_page', TRUE, get_defined_vars());
     }
     if ($singular_id && $GLOBALS['WS_PLUGIN__']['s2member']['o']['login_welcome_page'] && $singular_id === (int) $GLOBALS['WS_PLUGIN__']['s2member']['o']['login_welcome_page']) {
         return $is_systematic = apply_filters('ws_plugin__s2member_is_systematic_use_specific_page', TRUE, get_defined_vars());
     }
     if ($singular_id && $GLOBALS['WS_PLUGIN__']['s2member']['o']['membership_options_page'] && $singular_id === (int) $GLOBALS['WS_PLUGIN__']['s2member']['o']['membership_options_page']) {
         return $is_systematic = apply_filters('ws_plugin__s2member_is_systematic_use_specific_page', TRUE, get_defined_vars());
     }
     if ($singular_id && $GLOBALS['WS_PLUGIN__']['s2member']['o']['file_download_limit_exceeded_page'] && $singular_id === (int) $GLOBALS['WS_PLUGIN__']['s2member']['o']['file_download_limit_exceeded_page']) {
         return $is_systematic = apply_filters('ws_plugin__s2member_is_systematic_use_specific_page', TRUE, get_defined_vars());
     }
     if ($uri && $GLOBALS['WS_PLUGIN__']['s2member']['o']['login_redirection_override'] && ($_lro = c_ws_plugin__s2member_login_redirects::login_redirection_uri(NULL, 'root-returns-false')) && preg_match('/^' . preg_quote($_lro, '/') . '$/' . $ci, $uri)) {
         return $is_systematic = apply_filters('ws_plugin__s2member_is_systematic_use_specific_page', TRUE, get_defined_vars());
     }
     return $is_systematic = apply_filters('ws_plugin__s2member_is_systematic_use_specific_page', FALSE, get_defined_vars());
 }