Community Support Forums — WordPress® ( Users Helping Users ) — 2011-12-20T09:49:36-05:00 http://www.primothemes.com/forums/feed.php?f=40&t=13021 2011-12-20T09:49:36-05:00 http://www.primothemes.com/forums/viewtopic.php?t=13021&p=57731#p57731 <![CDATA[s2Member v111220 / Source Code: s2member\i...]]>
s2Member v111220
Source Code: s2member\includes\classes\login-redirects.inc.php
Docs updated: December 20, 2011, 9:49 am

Open for public discussion.
(!-- s-words :: --)n/a(!-- :: s-words --)

Statistics: Posted by System Robot — December 20th, 2011, 9:49 am


]]>
2011-12-07T01:02:38-05:00 http://www.primothemes.com/forums/viewtopic.php?t=13021&p=55413#p55413 <![CDATA[s2Member v111206 / Source Code: s2member\i...]]>
s2Member v111206
Source Code: s2member\includes\classes\login-redirects.inc.php
Docs updated: December 7, 2011, 1:02 am

Open for public discussion.
(!-- s-words :: --)n/a(!-- :: s-words --)

Statistics: Posted by System Robot — December 7th, 2011, 1:02 am


]]>
2011-11-05T19:25:43-05:00 http://www.primothemes.com/forums/viewtopic.php?t=13021&p=51787#p51787 <![CDATA[s2Member v111105 / Source Code: s2member\i...]]>
s2Member v111105
Source Code: s2member\includes\classes\login-redirects.inc.php
Docs updated: November 5, 2011, 8:25 pm

Open for public discussion.
(!-- s-words :: --)n/a(!-- :: s-words --)

Statistics: Posted by System Robot — November 5th, 2011, 7:25 pm


]]>
2011-10-29T20:34:35-05:00 http://www.primothemes.com/forums/viewtopic.php?t=13021&p=49882#p49882 <![CDATA[s2Member v111029 / Source Code: s2member\i...]]>
s2Member v111029
Source Code: s2member\includes\classes\login-redirects.inc.php
Docs updated: October 29, 2011, 9:34 pm

Open for public discussion.
(!-- s-words :: --)n/a(!-- :: s-words --)

Statistics: Posted by System Robot — October 29th, 2011, 8:34 pm


]]>
2011-10-17T15:38:41-05:00 http://www.primothemes.com/forums/viewtopic.php?t=13021&p=47676#p47676 <![CDATA[s2Member v111017 / Source Code: s2member\i...]]>
s2Member v111017
Source Code: s2member\includes\classes\login-redirects.inc.php
Docs updated: October 17, 2011, 1:38 pm

Open for public discussion.
(!-- s-words :: --)n/a(!-- :: s-words --)

Statistics: Posted by System Robot — October 17th, 2011, 3:38 pm


]]>
2011-10-11T14:34:32-05:00 http://www.primothemes.com/forums/viewtopic.php?t=13021&p=46076#p46076 <![CDATA[s2Member v111011 / Source Code: s2member\i...]]>
s2Member v111011
Source Code: s2member\includes\classes\login-redirects.inc.php
Docs updated: October 11, 2011, 12:34 pm

Open for public discussion.
(!-- s-words :: --)n/a(!-- :: s-words --)

Statistics: Posted by System Robot — October 11th, 2011, 2:34 pm


]]>
2011-10-03T15:46:58-05:00 http://www.primothemes.com/forums/viewtopic.php?t=13021&p=44207#p44207 <![CDATA[s2Member v111003 / Source Code: s2member\i...]]>
s2Member v111003
Source Code: s2member\includes\classes\login-redirects.inc.php
Docs updated: October 3, 2011, 1:46 pm

Open for public discussion.
(!-- s-words :: --)n/a(!-- :: s-words --)

Statistics: Posted by System Robot — October 3rd, 2011, 3:46 pm


]]>
2011-10-03T03:40:27-05:00 http://www.primothemes.com/forums/viewtopic.php?t=13021&p=42914#p42914 <![CDATA[s2Member v111002 / Source Code: s2member\i...]]>
s2Member v111002
Source Code: s2member\includes\classes\login-redirects.inc.php
Docs updated: October 3, 2011, 1:40 am

Open for public discussion.
(!-- s-words :: --)n/a(!-- :: s-words --)

Statistics: Posted by System Robot — October 3rd, 2011, 3:40 am


]]>
2011-09-27T05:25:53-05:00 http://www.primothemes.com/forums/viewtopic.php?t=13021&p=41160#p41160 <![CDATA[s2Member v110927 / Source Code: s2member\i...]]>
s2Member v110927
Source Code: s2member\includes\classes\login-redirects.inc.php
Docs updated: September 27, 2011, 3:25 am

Open for public discussion.
(!-- s-words :: --)n/a(!-- :: s-words --)

Statistics: Posted by System Robot — September 27th, 2011, 5:25 am


]]>
2011-09-26T21:02:44-05:00 http://www.primothemes.com/forums/viewtopic.php?t=13021&p=39916#p39916 <![CDATA[s2Member v110926 / Source Code: s2member\i...]]>
s2Member v110926
Source Code: s2member\includes\classes\login-redirects.inc.php
Docs updated: September 26, 2011, 7:03 pm

Open for public discussion.
(!-- s-words :: --)n/a(!-- :: s-words --)

Statistics: Posted by System Robot — September 26th, 2011, 9:02 pm


]]>
2011-09-17T16:19:34-05:00 http://www.primothemes.com/forums/viewtopic.php?t=13021&p=38060#p38060 <![CDATA[s2Member v110915 / Source Code: s2member\i...]]>
s2Member v110915
Source Code: s2member\includes\classes\login-redirects.inc.php
Docs updated: September 17, 2011, 2:19 pm

Open for public discussion.
(!-- s-words :: --)n/a(!-- :: s-words --)

Statistics: Posted by System Robot — September 17th, 2011, 4:19 pm


]]>
2011-09-14T01:27:25-05:00 http://www.primothemes.com/forums/viewtopic.php?t=13021&p=36641#p36641 <![CDATA[s2Member v110913 / Source Code: s2member\i...]]>
s2Member v110913
Source Code: s2member\includes\classes\login-redirects.inc.php
Docs updated: September 13, 2011, 11:27 pm

Open for public discussion.
(!-- s-words :: --)n/a(!-- :: s-words --)

Statistics: Posted by System Robot — September 14th, 2011, 1:27 am


]]>
2011-09-13T12:02:28-05:00 http://www.primothemes.com/forums/viewtopic.php?t=13021&p=35369#p35369 <![CDATA[s2Member v110912 / Source Code: s2member\i...]]>
s2Member v110912
Source Code: s2member\includes\classes\login-redirects.inc.php
Docs updated: September 13, 2011, 10:02 am

Open for public discussion.
(!-- s-words :: --)n/a(!-- :: s-words --)

Statistics: Posted by System Robot — September 13th, 2011, 12:02 pm


]]>
2011-08-15T14:11:53-05:00 http://www.primothemes.com/forums/viewtopic.php?t=13021&p=31476#p31476 <![CDATA[s2Member v110815 / Source Code: s2member\i...]]>
s2Member v110815
Source Code: s2member\includes\classes\login-redirects.inc.php
Docs updated: August 15, 2011, 3:12 pm

Open for public discussion.
(!-- s-words :: --)Source Code Documentation Packages ( Overview ) Classes Deprecated Todo Index Source Code jQuery(window).load(function(){ if(typeof location.hash === 'string' && location.hash.match(/^#/)) jQuery('olli'+location.hash).addClass('hilite'); }); jQuery(window).bind('hashchange', function(){ if(typeof location.hash === 'string' && location.hash.match(/^#/)) jQuery('olli').removeClass('hilite'); jQuery('olli'+location.hash).addClass('hilite'); }); [ full view ]s2member\includes\classes\login-redirects.inc.php ?php /** * Login redirections. * * Copyright: © 2009-2011 * {@link http://www.websharks-inc.com/ WebSharks, Inc.} * ( coded in the USA ) * * Released under the terms of the GNU General Public License. * You should have received a copy of the GNU General Public License, * along with this software. In the main directory, see: /licensing/ * If not, see: {@link http://www.gnu.org/licenses/}. * * @package s2Member\Login_Redirects * @since 3.5 */ if ( realpath ( __FILE__ ) === realpath ( $_SERVER [ "SCRIPT_FILENAME" ] ) ) exit ( "Do not access this file directly." ) ; /**/ if ( ! class_exists ( "c_ws_plugin__s2member_login_redirects" ) ) { /** * Login redirections. * * @package s2Member\Login_Redirects * @since 3.5 */ class c_ws_plugin__s2member_login_redirects { /** * Handles login redirections. * * @package s2Member\Login_Redirects * @since 3.5 * * @attaches-to: ``add_action("wp_login");`` * * @param str $username Expects Username to be passed in by the Action Hook. * @return null Or exits script execution after a redirection takes place. */ public static function login_redirect ( $username = FALSE ) { eval ( 'foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;' ) ; do_action ( "ws_plugin__s2member_before_login_redirect" , get_defined_vars ( ) ) ; unset ( $__refs , $__v ) ; /* Unset defined __refs, __v. */ /**/ $username = ( ! $username && is_object ( $user = wp_get_current_user ( ) ) ) ? strtolower ( $user - user_login ) : strtolower ( $username ) ; /**/ if ( $username && ( is_object ( $user ) || is_object ( $user = new WP_User ( $username ) ) ) && ( $user_id = $user - ID ) ) { if ( ! get_user_option ( "s2member_registration_ip" , $user_id ) ) /* Have we got this yet? */ update_user_option ( $user_id , "s2member_registration_ip" , $_SERVER [ "REMOTE_ADDR" ] ) ; /**/ if ( ( $logins = (int) get_user_option ( "s2member_login_counter" , $user_id ) + 1 ) = 1 || ( $logins = 1 ) ) update_user_option ( $user_id , "s2member_login_counter" , $logins ) ; /**/ if ( $GLOBALS [ "WS_PLUGIN__" ] [ "s2member" ] [ "o" ] [ "custom_reg_password" ] ) /* Nag em? */ delete_user_setting ( "default_password_nag" ) . update_user_option ( $user_id , "default_password_nag" , false , true ) ; /**/ $disable_login_ip_restrictions = apply_filters ( "ws_plugin__s2member_disable_login_ip_restrictions" , false , get_defined_vars ( ) ) ; /**/ if ( ( $ok = true ) && ! is_super_admin ( $user_id ) && $username !== "demo" && ! $disable_login_ip_restrictions ) $ok = c_ws_plugin__s2member_ip_restrictions:: ip_restrictions_ok ( $_SERVER [ "REMOTE_ADDR" ] , $username ) ; /**/ if ( ( $redirect = apply_filters ( "ws_plugin__s2member_login_redirect" , ( ( $user - has_cap ( "edit_posts" ) ) ? false : true ) , get_defined_vars ( ) ) ) ) { $obey_redirect_to = apply_filters ( "ws_plugin__s2member_obey_login_redirect_to" , /* By default, we obey this. */ true , get_defined_vars ( ) ) ; /**/ if ( ! $obey_redirect_to || empty ( $_REQUEST [ "redirect_to" ] ) || $_REQUEST [ "redirect_to" ] === "wp-admin/" || $_REQUEST [ "redirect_to" ] === admin_url ( ) ) { eval ( 'foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;' ) ; do_action ( "ws_plugin__s2member_during_login_redirect" , get_defined_vars ( ) ) ; unset ( $__refs , $__v ) ; /* Unset defined __refs, __v. */ /**/ if ( $redirect && is_string ( $redirect ) ) /* Is this a string? */ wp_redirect ( $redirect ) ; /* Dynamic URL introduced by a Filter. */ /**/ else if ( $special_redirection_url = c_ws_plugin__s2member_login_redirects:: login_redirection_url ( $user ) ) wp_redirect ( $special_redirection_url ) ; /* Special Redirection URL configured with s2Member. */ /**/ else /* Else we use the Login Welcome Page configured for s2Member. */ wp_redirect ( get_page_link ( $GLOBALS [ "WS_PLUGIN__" ] [ "s2member" ] [ "o" ] [ "login_welcome_page" ] ) ) ; /**/ exit ( ) ; /* Clean exit. */ } } } /**/ eval ( 'foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;' ) ; do_action ( "ws_plugin__s2member_after_login_redirect" , get_defined_vars ( ) ) ; unset ( $__refs , $__v ) ; /* Unset defined __refs, __v. */ /**/ return ; /* Return for uniformity. */ } /** * Parses a Special Login Redirection URL. * * @package s2Member\Login_Redirects * @since 3.5 * * @param obj $user Optional. A WP_User object. Defaults to the current User, if logged-in. * @param bool $root_returns_false Defaults to false. True if the function should return false when a URL is reduced to the site root. * @return str|bool A Special Login Redirection URL with Replacement Codes having been parsed, or false if ``$root_returns_false = true`` and the URL is the site root. */ public static function login_redirection_url ( $user = FALSE , $root_returns_false = FALSE ) { eval ( 'foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;' ) ; do_action ( "ws_plugin__s2member_before_login_redirection_url" , get_defined_vars ( ) ) ; unset ( $__refs , $__v ) ; /* Unset defined __refs, __v. */ /**/ $url = $GLOBALS [ "WS_PLUGIN__" ] [ "s2member" ] [ "o" ] [ "login_redirection_override" ] ; $url = c_ws_plugin__s2member_login_redirects:: fill_login_redirect_rc_vars ( $url , $user , $root_returns_false ) ; /**/ return apply_filters ( "ws_plugin__s2member_login_redirection_url" , $url , get_defined_vars ( ) ) ; } /** * Parses a Special Login Redirection URI. * * @package s2Member\Login_Redirects * @since 3.5 * * @param obj $user Optional. A WP_User object. Defaults to the current User, if logged-in. * @param bool $root_returns_false Defaults to false. True if the function should return false when a URI is reduced to the site root. * @return str|bool A Special Login Redirection URI with Replacement Codes having been parsed, or false if ``$root_returns_false = true`` and the URI is the site root. */ public static function login_redirection_uri ( $user = FALSE , $root_returns_false = FALSE ) { eval ( 'foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;' ) ; do_action ( "ws_plugin__s2member_before_login_redirection_uri" , get_defined_vars ( ) ) ; unset ( $__refs , $__v ) ; /* Unset defined __refs, __v. */ /**/ if ( ( $url = c_ws_plugin__s2member_login_redirects:: login_redirection_url ( $user , $root_returns_false ) ) ) $uri = c_ws_plugin__s2member_utils_urls:: parse_uri ( $url ) ; /**/ return apply_filters ( "ws_plugin__s2member_login_redirection_uri" , ( ( ! empty ( $uri ) ) ? $uri : false ) , get_defined_vars ( ) ) ; } /** * Fills Replacement Codes in Special Redirection URLs. * * @package s2Member\Login_Redirects * @since 3.5 * * @param str $url A URL with possible Replacement Codes in it. * @param obj $user Optional. A WP_User object. Defaults to the current User, if logged-in. * @param bool $root_returns_false Defaults to false. True if the function should return false when a URL is reduced to the site root. * @return str|bool A Special Login Redirection URL with Replacement Codes having been parsed, or false if ``$root_returns_false = true`` and the URL is the site root. */ public static function fill_login_redirect_rc_vars ( $url = FALSE , $user = FALSE , $root_returns_false = FALSE ) { eval ( 'foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;' ) ; do_action ( "ws_plugin__s2member_before_fill_login_redirect_rc_vars" , get_defined_vars ( ) ) ; unset ( $__refs , $__v ) ; /* Unset defined __refs, __v. */ /**/ $orig_url = $url ; /* Record the original URL that was passed in. */ /**/ $user = ( ( is_object ( $user ) || is_object ( $user = ( is_user_logged_in ( ) ) ? wp_get_current_user ( ) : false ) ) && ! empty ( $user - ID ) ) ? $user : false ; /**/ $user_login = ( $user ) ? (string) strtolower ( $user - user_login ) : "" ; $user_id = ( $user ) ? (string) $user - ID : "" ; /**/ $user_level = (string)c_ws_plugin__s2member_user_access:: user_access_level ( $user ) ; $user_role = (string)c_ws_plugin__s2member_user_access:: user_access_role ( $user ) ; $user_ccaps = (string) implode ( "-" , c_ws_plugin__s2member_user_access:: user_access_ccaps ( $user ) ) ; $user_logins = ( $user ) ? (string) (int) get_user_option ( "s2member_login_counter" , $user_id ) : "-1" ; /**/ $url = preg_replace ( "/%%current_user_login%%/i" , c_ws_plugin__s2member_utils_strings:: esc_ds ( $user_login ) , $url ) ; $url = preg_replace ( "/%%current_user_id%%/i" , c_ws_plugin__s2member_utils_strings:: esc_ds ( $user_id ) , $url ) ; $url = preg_replace ( "/%%current_user_level%%/i" , c_ws_plugin__s2member_utils_strings:: esc_ds ( $user_level ) , $url ) ; $url = preg_replace ( "/%%current_user_role%%/i" , c_ws_plugin__s2member_utils_strings:: esc_ds ( $user_role ) , $url ) ; $url = preg_replace ( "/%%current_user_ccaps%%/i" , c_ws_plugin__s2member_utils_strings:: esc_ds ( $user_ccaps ) , $url ) ; $url = preg_replace ( "/%%current_user_logins%%/i" , c_ws_plugin__s2member_utils_strings:: esc_ds ( $user_logins ) , $url ) ; /**/ if ( /* Only if s2Member's fault » */ $url !== $orig_url && ( ! ( $parse = @ parse_url ( $url ) ) || strpos ( $parse [ "path" ] , "//" ) !== false ) ) $url = site_url ( "/" ) ; /* Defaults to home page. We don't return invalid URLs produced by empty Replacement Codes ( i.e. // ). */ /**/ if ( $root_returns_false /* Used by s2Member's security gate. */ && c_ws_plugin__s2member_utils_conds:: is_site_root ( $url ) ) $url = false ; /* In case we need to return false on root URLs ( i.e. don't protect the Home Page inadvertently ). */ /**/ return apply_filters ( "ws_plugin__s2member_fill_login_redirect_rc_vars" , $url , get_defined_vars ( ) ) ; } } } ? [ full view ]s2member\includes\classes\login-redirects.inc.php Source Code Documentation Packages ( Overview ) Classes Deprecated Todo Index Source Code(!-- :: s-words --)

Statistics: Posted by System Robot — August 15th, 2011, 2:11 pm


]]>
2011-07-11T17:28:21-05:00 http://www.primothemes.com/forums/viewtopic.php?t=13021&p=27684#p27684 <![CDATA[s2Member v110710 / Source Code: s2member\i...]]>
s2Member v110710
Source Code: s2member\includes\classes\login-redirects.inc.php
Docs updated: July 11, 2011, 6:28 pm

Open for public discussion.
(!-- s-words :: --)Source Code Documentation Packages ( Overview ) Classes Deprecated Todo Index Source Code jQuery(window).load(function(){ if(typeof location.hash === 'string' && location.hash.match(/^#/)) jQuery('olli'+location.hash).addClass('hilite'); }); jQuery(window).bind('hashchange', function(){ if(typeof location.hash === 'string' && location.hash.match(/^#/)) jQuery('olli').removeClass('hilite'); jQuery('olli'+location.hash).addClass('hilite'); }); [ full view ]s2member\includes\classes\login-redirects.inc.php ?php /** * Login redirections. * * Copyright: © 2009-2011 * {@link http://www.websharks-inc.com/ WebSharks, Inc.} * ( coded in the USA ) * * Released under the terms of the GNU General Public License. * You should have received a copy of the GNU General Public License, * along with this software. In the main directory, see: /licensing/ * If not, see: {@link http://www.gnu.org/licenses/}. * * @package s2Member\Login_Redirects * @since 3.5 */ if ( realpath ( __FILE__ ) === realpath ( $_SERVER [ "SCRIPT_FILENAME" ] ) ) exit ( "Do not access this file directly." ) ; /**/ if ( ! class_exists ( "c_ws_plugin__s2member_login_redirects" ) ) { /** * Login redirections. * * @package s2Member\Login_Redirects * @since 3.5 */ class c_ws_plugin__s2member_login_redirects { /** * Handles login redirections. * * @package s2Member\Login_Redirects * @since 3.5 * * @attaches-to: ``add_action("wp_login");`` * * @param str $username Expects Username to be passed in by the Action Hook. * @return null Or exits script execution after a redirection takes place. */ public static function login_redirect ( $username = FALSE ) { eval ( 'foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;' ) ; do_action ( "ws_plugin__s2member_before_login_redirect" , get_defined_vars ( ) ) ; unset ( $__refs , $__v ) ; /* Unset defined __refs, __v. */ /**/ $username = ( ! $username && is_object ( $user = wp_get_current_user ( ) ) ) ? strtolower ( $user - user_login ) : strtolower ( $username ) ; /**/ if ( $username && ( is_object ( $user ) || is_object ( $user = new WP_User ( $username ) ) ) && ( $user_id = $user - ID ) ) { if ( ! get_user_option ( "s2member_registration_ip" , $user_id ) ) /* Have we got this yet? */ update_user_option ( $user_id , "s2member_registration_ip" , $_SERVER [ "REMOTE_ADDR" ] ) ; /**/ if ( $GLOBALS [ "WS_PLUGIN__" ] [ "s2member" ] [ "o" ] [ "custom_reg_password" ] ) /* Nag em? */ delete_user_setting ( "default_password_nag" ) . update_user_option ( $user_id , "default_password_nag" , false , true ) ; /**/ $disable_login_ip_restrictions = apply_filters ( "ws_plugin__s2member_disable_login_ip_restrictions" , false , get_defined_vars ( ) ) ; /**/ if ( ( $ok = true ) && ! is_super_admin ( $user_id ) && $username !== "demo" && ! $disable_login_ip_restrictions ) $ok = c_ws_plugin__s2member_ip_restrictions:: ip_restrictions_ok ( $_SERVER [ "REMOTE_ADDR" ] , $username ) ; /**/ if ( ( $redirect = apply_filters ( "ws_plugin__s2member_login_redirect" , ( ( $user - has_cap ( "edit_posts" ) ) ? false : true ) , get_defined_vars ( ) ) ) ) { $obey_redirect_to = apply_filters ( "ws_plugin__s2member_obey_login_redirect_to" , /* By default, we obey this. */ true , get_defined_vars ( ) ) ; /**/ if ( ! $obey_redirect_to || empty ( $_REQUEST [ "redirect_to" ] ) || $_REQUEST [ "redirect_to" ] === "wp-admin/" || $_REQUEST [ "redirect_to" ] === admin_url ( ) ) { eval ( 'foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;' ) ; do_action ( "ws_plugin__s2member_during_login_redirect" , get_defined_vars ( ) ) ; unset ( $__refs , $__v ) ; /* Unset defined __refs, __v. */ /**/ if ( $redirect && is_string ( $redirect ) ) /* Is this a string? */ wp_redirect ( $redirect ) ; /* Dynamic URL introduced by a Filter. */ /**/ else if ( $special_redirection_url = c_ws_plugin__s2member_login_redirects:: login_redirection_url ( $user ) ) wp_redirect ( $special_redirection_url ) ; /* Special Redirection URL configured with s2Member. */ /**/ else /* Else we use the Login Welcome Page configured for s2Member. */ wp_redirect ( get_page_link ( $GLOBALS [ "WS_PLUGIN__" ] [ "s2member" ] [ "o" ] [ "login_welcome_page" ] ) ) ; /**/ exit ( ) ; /* Clean exit. */ } } } /**/ eval ( 'foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;' ) ; do_action ( "ws_plugin__s2member_after_login_redirect" , get_defined_vars ( ) ) ; unset ( $__refs , $__v ) ; /* Unset defined __refs, __v. */ /**/ return ; /* Return for uniformity. */ } /** * Parses a Special Login Redirection URL. * * @package s2Member\Login_Redirects * @since 3.5 * * @param obj $user Optional. A WP_User object. Defaults to the current User, if logged-in. * @param bool $root_returns_false Defaults to false. True if the function should return false when a URL is reduced to the site root. * @return str|bool A Special Login Redirection URL with Replacement Codes having been parsed, or false if ``$root_returns_false = true`` and the URL is the site root. */ public static function login_redirection_url ( $user = FALSE , $root_returns_false = FALSE ) { eval ( 'foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;' ) ; do_action ( "ws_plugin__s2member_before_login_redirection_url" , get_defined_vars ( ) ) ; unset ( $__refs , $__v ) ; /* Unset defined __refs, __v. */ /**/ $url = $GLOBALS [ "WS_PLUGIN__" ] [ "s2member" ] [ "o" ] [ "login_redirection_override" ] ; $url = c_ws_plugin__s2member_login_redirects:: fill_login_redirect_rc_vars ( $url , $user , $root_returns_false ) ; /**/ return apply_filters ( "ws_plugin__s2member_login_redirection_url" , $url , get_defined_vars ( ) ) ; } /** * Parses a Special Login Redirection URI. * * @package s2Member\Login_Redirects * @since 3.5 * * @param obj $user Optional. A WP_User object. Defaults to the current User, if logged-in. * @param bool $root_returns_false Defaults to false. True if the function should return false when a URI is reduced to the site root. * @return str|bool A Special Login Redirection URI with Replacement Codes having been parsed, or false if ``$root_returns_false = true`` and the URI is the site root. */ public static function login_redirection_uri ( $user = FALSE , $root_returns_false = FALSE ) { eval ( 'foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;' ) ; do_action ( "ws_plugin__s2member_before_login_redirection_uri" , get_defined_vars ( ) ) ; unset ( $__refs , $__v ) ; /* Unset defined __refs, __v. */ /**/ if ( ( $url = c_ws_plugin__s2member_login_redirects:: login_redirection_url ( $user , $root_returns_false ) ) ) $uri = c_ws_plugin__s2member_utils_urls:: parse_uri ( $url ) ; /**/ return apply_filters ( "ws_plugin__s2member_login_redirection_uri" , ( ( ! empty ( $uri ) ) ? $uri : false ) , get_defined_vars ( ) ) ; } /** * Fills Replacement Codes in Special Redirection URLs. * * @package s2Member\Login_Redirects * @since 3.5 * * @param str $url A URL with possible Replacement Codes in it. * @param obj $user Optional. A WP_User object. Defaults to the current User, if logged-in. * @param bool $root_returns_false Defaults to false. True if the function should return false when a URL is reduced to the site root. * @return str|bool A Special Login Redirection URL with Replacement Codes having been parsed, or false if ``$root_returns_false = true`` and the URL is the site root. */ public static function fill_login_redirect_rc_vars ( $url = FALSE , $user = FALSE , $root_returns_false = FALSE ) { eval ( 'foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;' ) ; do_action ( "ws_plugin__s2member_before_fill_login_redirect_rc_vars" , get_defined_vars ( ) ) ; unset ( $__refs , $__v ) ; /* Unset defined __refs, __v. */ /**/ $orig_url = $url ; /* Record the original URL that was passed in. */ /**/ $user = ( ( is_object ( $user ) || is_object ( $user = ( is_user_logged_in ( ) ) ? wp_get_current_user ( ) : false ) ) && ! empty ( $user - ID ) ) ? $user : false ; /**/ $user_login = ( $user ) ? (string) strtolower ( $user - user_login ) : "" ; $user_id = ( $user ) ? (string) $user - ID : "" ; /**/ $user_level = (string)c_ws_plugin__s2member_user_access:: user_access_level ( $user ) ; $user_role = (string)c_ws_plugin__s2member_user_access:: user_access_role ( $user ) ; $user_ccaps = (string) implode ( "-" , c_ws_plugin__s2member_user_access:: user_access_ccaps ( $user ) ) ; /**/ $url = preg_replace ( "/%%current_user_login%%/i" , c_ws_plugin__s2member_utils_strings:: esc_ds ( $user_login ) , $url ) ; $url = preg_replace ( "/%%current_user_id%%/i" , c_ws_plugin__s2member_utils_strings:: esc_ds ( $user_id ) , $url ) ; $url = preg_replace ( "/%%current_user_level%%/i" , c_ws_plugin__s2member_utils_strings:: esc_ds ( $user_level ) , $url ) ; $url = preg_replace ( "/%%current_user_role%%/i" , c_ws_plugin__s2member_utils_strings:: esc_ds ( $user_role ) , $url ) ; $url = preg_replace ( "/%%current_user_ccaps%%/i" , c_ws_plugin__s2member_utils_strings:: esc_ds ( $user_ccaps ) , $url ) ; /**/ if ( /* Only if s2Member's fault » */ $url !== $orig_url && ( ! ( $parse = @ parse_url ( $url ) ) || strpos ( $parse [ "path" ] , "//" ) !== false ) ) $url = site_url ( "/" ) ; /* Defaults to home page. We don't return invalid URLs produced by empty Replacement Codes ( i.e. // ). */ /**/ if ( $root_returns_false /* Used by s2Member's security gate. */ && c_ws_plugin__s2member_utils_conds:: is_site_root ( $url ) ) $url = false ; /* In case we need to return false on root URLs ( i.e. don't protect the Home Page inadvertently ). */ /**/ return apply_filters ( "ws_plugin__s2member_fill_login_redirect_rc_vars" , $url , get_defined_vars ( ) ) ; } } } ? [ full view ]s2member\includes\classes\login-redirects.inc.php Source Code Documentation Packages ( Overview ) Classes Deprecated Todo Index Source Code(!-- :: s-words --)

Statistics: Posted by System Robot — July 11th, 2011, 5:28 pm


]]>
2011-07-09T06:08:27-05:00 http://www.primothemes.com/forums/viewtopic.php?t=13021&p=25316#p25316 <![CDATA[s2Member v111220 / Source Code: s2member\i...]]>
s2Member v111220
Source Code: s2member\includes\classes\login-redirects.inc.php
Docs updated: December 20, 2011, 9:49 am

Open for public discussion.
(!-- s-words :: --)n/a(!-- :: s-words --)

Statistics: Posted by System Robot — July 9th, 2011, 6:08 am


]]>