Community Support Forums — WordPress® ( Users Helping Users ) — 2011-12-20T09:49:38-05:00 http://www.primothemes.com/forums/feed.php?f=40&t=13027 2011-12-20T09:49:38-05:00 http://www.primothemes.com/forums/viewtopic.php?t=13027&p=57737#p57737 <![CDATA[s2Member v111220 / Source Code: s2member\i...]]>
s2Member v111220
Source Code: s2member\includes\classes\mms-patches.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:42-05:00 http://www.primothemes.com/forums/viewtopic.php?t=13027&p=55419#p55419 <![CDATA[s2Member v111206 / Source Code: s2member\i...]]>
s2Member v111206
Source Code: s2member\includes\classes\mms-patches.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:45-05:00 http://www.primothemes.com/forums/viewtopic.php?t=13027&p=51793#p51793 <![CDATA[s2Member v111105 / Source Code: s2member\i...]]>
s2Member v111105
Source Code: s2member\includes\classes\mms-patches.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:38-05:00 http://www.primothemes.com/forums/viewtopic.php?t=13027&p=49888#p49888 <![CDATA[s2Member v111029 / Source Code: s2member\i...]]>
s2Member v111029
Source Code: s2member\includes\classes\mms-patches.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:45-05:00 http://www.primothemes.com/forums/viewtopic.php?t=13027&p=47682#p47682 <![CDATA[s2Member v111017 / Source Code: s2member\i...]]>
s2Member v111017
Source Code: s2member\includes\classes\mms-patches.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:36-05:00 http://www.primothemes.com/forums/viewtopic.php?t=13027&p=46082#p46082 <![CDATA[s2Member v111011 / Source Code: s2member\i...]]>
s2Member v111011
Source Code: s2member\includes\classes\mms-patches.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:47:01-05:00 http://www.primothemes.com/forums/viewtopic.php?t=13027&p=44213#p44213 <![CDATA[s2Member v111003 / Source Code: s2member\i...]]>
s2Member v111003
Source Code: s2member\includes\classes\mms-patches.inc.php
Docs updated: October 3, 2011, 1:47 pm

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

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


]]>
2011-10-03T03:40:31-05:00 http://www.primothemes.com/forums/viewtopic.php?t=13027&p=42920#p42920 <![CDATA[s2Member v111002 / Source Code: s2member\i...]]>
s2Member v111002
Source Code: s2member\includes\classes\mms-patches.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:55-05:00 http://www.primothemes.com/forums/viewtopic.php?t=13027&p=41166#p41166 <![CDATA[s2Member v110927 / Source Code: s2member\i...]]>
s2Member v110927
Source Code: s2member\includes\classes\mms-patches.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:47-05:00 http://www.primothemes.com/forums/viewtopic.php?t=13027&p=39922#p39922 <![CDATA[s2Member v110926 / Source Code: s2member\i...]]>
s2Member v110926
Source Code: s2member\includes\classes\mms-patches.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:38-05:00 http://www.primothemes.com/forums/viewtopic.php?t=13027&p=38066#p38066 <![CDATA[s2Member v110915 / Source Code: s2member\i...]]>
s2Member v110915
Source Code: s2member\includes\classes\mms-patches.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:27-05:00 http://www.primothemes.com/forums/viewtopic.php?t=13027&p=36647#p36647 <![CDATA[s2Member v110913 / Source Code: s2member\i...]]>
s2Member v110913
Source Code: s2member\includes\classes\mms-patches.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:31-05:00 http://www.primothemes.com/forums/viewtopic.php?t=13027&p=35375#p35375 <![CDATA[s2Member v110912 / Source Code: s2member\i...]]>
s2Member v110912
Source Code: s2member\includes\classes\mms-patches.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:12:05-05:00 http://www.primothemes.com/forums/viewtopic.php?t=13027&p=31482#p31482 <![CDATA[s2Member v110815 / Source Code: s2member\i...]]>
s2Member v110815
Source Code: s2member\includes\classes\mms-patches.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\mms-patches.inc.php ?php /** * Main Multisite patches. * * 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\Main_Multisite_Patches * @since 3.5 */ if ( realpath ( __FILE__ ) === realpath ( $_SERVER [ "SCRIPT_FILENAME" ] ) ) exit ( "Do not access this file directly." ) ; /**/ if ( ! class_exists ( "c_ws_plugin__s2member_mms_patches" ) ) { /** * Main Multisite patches. * * @package s2Member\Main_Multisite_Patches * @since 3.5 */ class c_ws_plugin__s2member_mms_patches { /** * Synchronizes Multisite patches with WordPress® core upgrades. * * @package s2Member\Main_Multisite_Patches * @since 3.5 * * @attaches-to: ``add_filter("update_feedback");`` * * @param str $message Expects message string passed through by the Filter. * @return str Message after having been Filtered by this routine. */ public static function sync_mms_patches ( $message = FALSE ) { global $pagenow ; /* Need access to this global var. */ /**/ eval ( 'foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;' ) ; do_action ( "ws_plugin__s2member_before_sync_mms_patches" , get_defined_vars ( ) ) ; unset ( $__refs , $__v ) ; /* Unset defined __refs, __v. */ /**/ if ( is_multisite ( ) && is_network_admin ( ) && $pagenow === "update-core.php" ) if ( $message === "Upgrading database…" && c_ws_plugin__s2member_mms_patches:: mms_patches ( ) ) apply_filters ( "update_feedback" , "s2 Multisite patches applied…" ) ; /**/ return apply_filters ( "ws_plugin__s2member_sync_mms_patches" , $message , get_defined_vars ( ) ) ; } /** * Handles patches on a Multisite Network installation. * * @package s2Member\Main_Multisite_Patches * @since 3.5 * * @param bool $display_notices Defaults to false. If true, notices are displayed. * @return bool True if Multisite patches were processed, else false. */ public static function mms_patches ( $display_notices = FALSE ) { eval ( 'foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;' ) ; do_action ( "ws_plugin__s2member_before_mms_patches" , get_defined_vars ( ) ) ; unset ( $__refs , $__v ) ; /* Unset defined __refs, __v. */ /**/ if ( is_multisite ( ) && is_admin ( ) && is_main_site ( ) && $GLOBALS [ "WS_PLUGIN__" ] [ "s2member" ] [ "c" ] [ "configured" ] ) if ( $GLOBALS [ "WS_PLUGIN__" ] [ "s2member" ] [ "o" ] [ "mms_auto_patch" ] && ( ! defined ( "DISALLOW_FILE_MODS" ) || !DISALLOW_FILE_MODS) ) { do_action ( "ws_plugin__s2member_during_mms_patches_before" , get_defined_vars ( ) ) ; /**/ $wp_login_file = ABSPATH . "wp-login.php" ; /* This works for both WordPress® 3.1 and 3.0. WordPress® 3.1+ uses: `site_url('wp-signup.php')`. */ $wp_login_section = "/([\r \n \t\s ]+)(wp_redirect( *?)\(( *?)apply_filters( *?)\(( *?)['\"]wp_signup_location['\"],( *?)(site_url( *?)\(( *?)['\"]wp-signup\.php['\"]( *?)\)|get_bloginfo( *?)\(['\"]wpurl['\"]\)( *?)\.( *?)['\"]\/wp-signup\.php['\"])( *?)\)( *?)\);)([\r \n \t\s ]+)(exit;)/" ; $wp_login_replace = "\n \t \t// Modified for full plugin compatiblity.\n \t \t//wp_redirect( apply_filters( 'wp_signup_location', site_url('wp-signup.php') ) );\n \t \t//exit;" ; /**/ if ( file_exists ( $wp_login_file ) && ( $wp_login = file_get_contents ( $wp_login_file ) ) && is_writable ( $wp_login_file ) ) { if ( ( ( $wp_login_written = file_put_contents ( $wp_login_file , preg_replace ( $wp_login_section , $wp_login_replace , $wp_login , 1 , $wp_login_patched ) ) ) && $wp_login_patched ) || ( $wp_login_patched_already = $wp_login_patched = strpos ( $wp_login , $wp_login_replace ) ) ) ( $display_notices ) ? c_ws_plugin__s2member_admin_notices:: display_admin_notice ( 'Your code/wp-login.php/code file ' . ( ( $wp_login_patched_already ) ? 'is patched' : 'has been patched successfully' ) . '.' ) : null ; else if ( ! $wp_login_written ) /* Otherwise, we need to report that /wp-login.php could NOT be updated. Possibly a permissions error. */ ( $display_notices ) ? c_ws_plugin__s2member_admin_notices:: display_admin_notice ( 'Your code/wp-login.php/code file could NOT be patched. Patch NOT written.' , true ) : null ; else if ( ! $wp_login_patched ) /* Otherwise, we need to report that /wp-login.php could NOT be updated. Wrong WordPress® version? */ ( $display_notices ) ? c_ws_plugin__s2member_admin_notices:: display_admin_notice ( 'Your code/wp-login.php/code file could NOT be patched. Unverifiable.' , true ) : null ; } else /* Otherwise, we need to report that /wp-login.php could NOT be updated. Possibly a permissions error. */ ( $display_notices ) ? c_ws_plugin__s2member_admin_notices:: display_admin_notice ( 'Your code/wp-login.php/code file could NOT be patched. File NOT writable.' , true ) : null ; /**/ $load_file = ABSPATH . WPINC . "/load.php" ; $load_section = "/([\r \n \t\s ]+)(if( *?)\(( *?)empty( *?)\(( *?)\\ \$active_plugins( *?)\)( *?)\|\|( *?)defined( *?)\(( *?)['\"]WP_INSTALLING['\"]( *?)\)( *?)\))/" ; $load_replace = "\n \n \t// Modified for full plugin compatiblity.\n \t//if ( empty( \$active_plugins ) || defined( 'WP_INSTALLING' ) )\n \tif ( empty( \$active_plugins ) || ( defined( 'WP_INSTALLING' ) && !preg_match(\"/\/wp-activate\.php/\", \$_SERVER[\"REQUEST_URI\"]) ) )" ; /**/ if ( file_exists ( $load_file ) && ( $load = file_get_contents ( $load_file ) ) && is_writable ( $load_file ) ) { if ( ( ( $load_written = file_put_contents ( $load_file , preg_replace ( $load_section , $load_replace , $load , 1 , $load_patched ) ) ) && $load_patched ) || ( $load_patched_already = $load_patched = strpos ( $load , $load_replace ) ) ) ( $display_notices ) ? c_ws_plugin__s2member_admin_notices:: display_admin_notice ( 'Your code/wp-includes/load.php/code file ' . ( ( $load_patched_already ) ? 'is patched' : 'has been patched successfully' ) . '.' ) : null ; else if ( ! $load_written ) /* Otherwise, we need to report that /wp-includes/load.php could NOT be updated. Possibly a permissions error. */ ( $display_notices ) ? c_ws_plugin__s2member_admin_notices:: display_admin_notice ( 'Your code/wp-includes/load.php/code file could NOT be patched. Patch NOT written.' , true ) : null ; else if ( ! $load_patched ) /* Otherwise, we need to report that /wp-includes/load.php could NOT be updated. Wrong WordPress® version? */ ( $display_notices ) ? c_ws_plugin__s2member_admin_notices:: display_admin_notice ( 'Your code/wp-includes/load.php/code file could NOT be patched. Unverifiable.' , true ) : null ; } else /* Otherwise, we need to report that /wp-includes/load.php could NOT be updated. Possibly a permissions error. */ ( $display_notices ) ? c_ws_plugin__s2member_admin_notices:: display_admin_notice ( 'Your code/wp-includes/load.php/code file could NOT be patched. File NOT writable.' , true ) : null ; /**/ $user_new_file = ABSPATH . "wp-admin/user-new.php" ; $user_new_section = "/([\r \n \t\s ]+)(wpmu_signup_user( *?)\(( *?)\\ \$new_user_login,( *?)\\ \$_REQUEST\[( *?)'email'( *?)\],( *?)array( *?)\(( *?)'add_to_blog'( *?)\=\( *?)\\ \$wpdb-blogid,( *?)'new_role'( *?)\=\( *?)\\ \$_REQUEST\[( *?)'role'( *?)\]( *?)\)( *?)\);)/" ; $user_new_replace = "\n \t \t \t// Modified for full plugin compatiblity.\n \t \t \t//wpmu_signup_user( \$new_user_login, \$_REQUEST[ 'email' ], array( 'add_to_blog' = \$wpdb-blogid, 'new_role' = \$_REQUEST[ 'role' ] ) );\n \t \t \twpmu_signup_user( \$new_user_login, \$_REQUEST[ 'email' ], apply_filters( 'add_signup_meta', array( 'add_to_blog' = \$wpdb-blogid, 'new_role' = \$_REQUEST[ 'role' ] ) ) );" ; /**/ if ( file_exists ( $user_new_file ) && ( $user_new = file_get_contents ( $user_new_file ) ) && is_writable ( $user_new_file ) ) { if ( ( ( $user_new_written = file_put_contents ( $user_new_file , preg_replace ( $user_new_section , $user_new_replace , $user_new , 1 , $user_new_patched ) ) ) && $user_new_patched ) || ( $user_new_patched_already = $user_new_patched = strpos ( $user_new , $user_new_replace ) ) ) ( $display_notices ) ? c_ws_plugin__s2member_admin_notices:: display_admin_notice ( 'Your code/wp-admin/user-new.php/code file ' . ( ( $user_new_patched_already ) ? 'is patched' : 'has been patched successfully' ) . '.' ) : null ; else if ( ! $user_new_written ) /* Otherwise, we need to report that /wp-admin/user-new.php could NOT be updated. Possibly a permissions error. */ ( $display_notices ) ? c_ws_plugin__s2member_admin_notices:: display_admin_notice ( 'Your code/wp-admin/user-new.php/code file could NOT be patched. Patch NOT written.' , true ) : null ; else if ( ! $user_new_patched ) /* Otherwise, we need to report that /wp-admin/user-new.php could NOT be updated. Wrong WordPress® version? */ ( $display_notices ) ? c_ws_plugin__s2member_admin_notices:: display_admin_notice ( 'Your code/wp-admin/user-new.php/code file could NOT be patched. Unverifiable.' , true ) : null ; } else /* Otherwise, we need to report that /wp-admin/user-new.php could NOT be updated. Possibly a permissions error. */ ( $display_notices ) ? c_ws_plugin__s2member_admin_notices:: display_admin_notice ( 'Your code/wp-admin/user-new.php/code file could NOT be patched. File NOT writable.' , true ) : null ; /**/ $ms_functions_file = ABSPATH . "wp-includes/ms-functions.php" ; $ms_functions_section = "/([\r \n \t\s ]+)(return new WP_Error( *?)\(( *?)'user_already_exists'( *?),( *?)__( *?)\(( *?)'That username is already activated.'( *?)\),( *?)\\ \$signup( *?)\);)/" ; $ms_functions_replace = "\n \t \t \t// Modified for full plugin compatiblity.\n \t \t \t//return new WP_Error( 'user_already_exists', __( 'That username is already activated.' ), \$signup);\n \t \t \treturn apply_filters('_wpmu_activate_existing_error_', new WP_Error( 'user_already_exists', __( 'That username is already activated.' ), \$signup), get_defined_vars());" ; /**/ if ( file_exists ( $ms_functions_file ) && ( $ms_functions = file_get_contents ( $ms_functions_file ) ) && is_writable ( $ms_functions_file ) ) { if ( ( ( $ms_functions_written = file_put_contents ( $ms_functions_file , preg_replace ( $ms_functions_section , $ms_functions_replace , $ms_functions , 1 , $ms_functions_patched ) ) ) && $ms_functions_patched ) || ( $ms_functions_patched_already = $ms_functions_patched = strpos ( $ms_functions , $ms_functions_replace ) ) ) ( $display_notices ) ? c_ws_plugin__s2member_admin_notices:: display_admin_notice ( 'Your code/wp-includes/ms-functions.php/code file ' . ( ( $ms_functions_patched_already ) ? 'is patched' : 'has been patched successfully' ) . '.' ) : null ; else if ( ! $ms_functions_written ) /* Otherwise, we need to report that /wp-includes/ms-functions.php could NOT be updated. Possibly a permissions error. */ ( $display_notices ) ? c_ws_plugin__s2member_admin_notices:: display_admin_notice ( 'Your code/wp-includes/ms-functions.php/code file could NOT be patched. Patch NOT written.' , true ) : null ; else if ( ! $ms_functions_patched ) /* Otherwise, we need to report that /wp-includes/ms-functions.php could NOT be updated. Wrong WordPress® version? */ ( $display_notices ) ? c_ws_plugin__s2member_admin_notices:: display_admin_notice ( 'Your code/wp-includes/ms-functions.php/code file could NOT be patched. Unverifiable.' , true ) : null ; } else /* Otherwise, we need to report that /wp-includes/ms-functions.php could NOT be updated. Possibly a permissions error. */ ( $display_notices ) ? c_ws_plugin__s2member_admin_notices:: display_admin_notice ( 'Your code/wp-includes/ms-functions.php/code file could NOT be patched. File NOT writable.' , true ) : null ; /**/ $ran_mms_patches = true ; /* Flag indicating this routine was indeed processed. */ /**/ do_action ( "ws_plugin__s2member_during_mms_patches_after" , get_defined_vars ( ) ) ; } /**/ do_action ( "ws_plugin__s2member_after_mms_patches" , get_defined_vars ( ) ) ; /**/ return ! empty ( $ran_mms_patches ) ? $ran_mms_patches : false ; } } } ? [ full view ]s2member\includes\classes\mms-patches.inc.php Source Code Documentation Packages ( Overview ) Classes Deprecated Todo Index Source Code(!-- :: s-words --)

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


]]>
2011-07-11T17:28:35-05:00 http://www.primothemes.com/forums/viewtopic.php?t=13027&p=27690#p27690 <![CDATA[s2Member v110710 / Source Code: s2member\i...]]>
s2Member v110710
Source Code: s2member\includes\classes\mms-patches.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\mms-patches.inc.php ?php /** * Main Multisite patches. * * 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\Main_Multisite_Patches * @since 3.5 */ if ( realpath ( __FILE__ ) === realpath ( $_SERVER [ "SCRIPT_FILENAME" ] ) ) exit ( "Do not access this file directly." ) ; /**/ if ( ! class_exists ( "c_ws_plugin__s2member_mms_patches" ) ) { /** * Main Multisite patches. * * @package s2Member\Main_Multisite_Patches * @since 3.5 */ class c_ws_plugin__s2member_mms_patches { /** * Synchronizes Multisite patches with WordPress® core upgrades. * * @package s2Member\Main_Multisite_Patches * @since 3.5 * * @attaches-to: ``add_filter("update_feedback");`` * * @param str $message Expects message string passed through by the Filter. * @return str Message after having been Filtered by this routine. */ public static function sync_mms_patches ( $message = FALSE ) { global $pagenow ; /* Need access to this global var. */ /**/ eval ( 'foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;' ) ; do_action ( "ws_plugin__s2member_before_sync_mms_patches" , get_defined_vars ( ) ) ; unset ( $__refs , $__v ) ; /* Unset defined __refs, __v. */ /**/ if ( is_multisite ( ) && is_network_admin ( ) && $pagenow === "update-core.php" ) if ( $message === "Upgrading database…" && c_ws_plugin__s2member_mms_patches:: mms_patches ( ) ) apply_filters ( "update_feedback" , "s2 Multisite patches applied…" ) ; /**/ return apply_filters ( "ws_plugin__s2member_sync_mms_patches" , $message , get_defined_vars ( ) ) ; } /** * Handles patches on a Multisite Network installation. * * @package s2Member\Main_Multisite_Patches * @since 3.5 * * @param bool $display_notices Defaults to false. If true, notices are displayed. * @return bool True if Multisite patches were processed, else false. */ public static function mms_patches ( $display_notices = FALSE ) { eval ( 'foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;' ) ; do_action ( "ws_plugin__s2member_before_mms_patches" , get_defined_vars ( ) ) ; unset ( $__refs , $__v ) ; /* Unset defined __refs, __v. */ /**/ if ( is_multisite ( ) && is_admin ( ) && is_main_site ( ) && $GLOBALS [ "WS_PLUGIN__" ] [ "s2member" ] [ "c" ] [ "configured" ] ) if ( $GLOBALS [ "WS_PLUGIN__" ] [ "s2member" ] [ "o" ] [ "mms_auto_patch" ] && ( ! defined ( "DISALLOW_FILE_MODS" ) || !DISALLOW_FILE_MODS) ) { do_action ( "ws_plugin__s2member_during_mms_patches_before" , get_defined_vars ( ) ) ; /**/ $wp_login_file = ABSPATH . "wp-login.php" ; /* This works for both WordPress® 3.1 and 3.0. WordPress® 3.1+ uses: `site_url('wp-signup.php')`. */ $wp_login_section = "/([\r \n \t\s ]+)(wp_redirect( *?)\(( *?)apply_filters( *?)\(( *?)['\"]wp_signup_location['\"],( *?)(site_url( *?)\(( *?)['\"]wp-signup\.php['\"]( *?)\)|get_bloginfo( *?)\(['\"]wpurl['\"]\)( *?)\.( *?)['\"]\/wp-signup\.php['\"])( *?)\)( *?)\);)([\r \n \t\s ]+)(exit;)/" ; $wp_login_replace = "\n \t \t// Modified for full plugin compatiblity.\n \t \t//wp_redirect( apply_filters( 'wp_signup_location', site_url('wp-signup.php') ) );\n \t \t//exit;" ; /**/ if ( file_exists ( $wp_login_file ) && ( $wp_login = file_get_contents ( $wp_login_file ) ) && is_writable ( $wp_login_file ) ) { if ( ( ( $wp_login_written = file_put_contents ( $wp_login_file , preg_replace ( $wp_login_section , $wp_login_replace , $wp_login , 1 , $wp_login_patched ) ) ) && $wp_login_patched ) || ( $wp_login_patched_already = $wp_login_patched = strpos ( $wp_login , $wp_login_replace ) ) ) ( $display_notices ) ? c_ws_plugin__s2member_admin_notices:: display_admin_notice ( 'Your code/wp-login.php/code file ' . ( ( $wp_login_patched_already ) ? 'is patched' : 'has been patched successfully' ) . '.' ) : null ; else if ( ! $wp_login_written ) /* Otherwise, we need to report that /wp-login.php could NOT be updated. Possibly a permissions error. */ ( $display_notices ) ? c_ws_plugin__s2member_admin_notices:: display_admin_notice ( 'Your code/wp-login.php/code file could NOT be patched. Patch NOT written.' , true ) : null ; else if ( ! $wp_login_patched ) /* Otherwise, we need to report that /wp-login.php could NOT be updated. Wrong WordPress® version? */ ( $display_notices ) ? c_ws_plugin__s2member_admin_notices:: display_admin_notice ( 'Your code/wp-login.php/code file could NOT be patched. Unverifiable.' , true ) : null ; } else /* Otherwise, we need to report that /wp-login.php could NOT be updated. Possibly a permissions error. */ ( $display_notices ) ? c_ws_plugin__s2member_admin_notices:: display_admin_notice ( 'Your code/wp-login.php/code file could NOT be patched. File NOT writable.' , true ) : null ; /**/ $load_file = ABSPATH . WPINC . "/load.php" ; $load_section = "/([\r \n \t\s ]+)(if( *?)\(( *?)empty( *?)\(( *?)\\ \$active_plugins( *?)\)( *?)\|\|( *?)defined( *?)\(( *?)['\"]WP_INSTALLING['\"]( *?)\)( *?)\))/" ; $load_replace = "\n \n \t// Modified for full plugin compatiblity.\n \t//if ( empty( \$active_plugins ) || defined( 'WP_INSTALLING' ) )\n \tif ( empty( \$active_plugins ) || ( defined( 'WP_INSTALLING' ) && !preg_match(\"/\/wp-activate\.php/\", \$_SERVER[\"REQUEST_URI\"]) ) )" ; /**/ if ( file_exists ( $load_file ) && ( $load = file_get_contents ( $load_file ) ) && is_writable ( $load_file ) ) { if ( ( ( $load_written = file_put_contents ( $load_file , preg_replace ( $load_section , $load_replace , $load , 1 , $load_patched ) ) ) && $load_patched ) || ( $load_patched_already = $load_patched = strpos ( $load , $load_replace ) ) ) ( $display_notices ) ? c_ws_plugin__s2member_admin_notices:: display_admin_notice ( 'Your code/wp-includes/load.php/code file ' . ( ( $load_patched_already ) ? 'is patched' : 'has been patched successfully' ) . '.' ) : null ; else if ( ! $load_written ) /* Otherwise, we need to report that /wp-includes/load.php could NOT be updated. Possibly a permissions error. */ ( $display_notices ) ? c_ws_plugin__s2member_admin_notices:: display_admin_notice ( 'Your code/wp-includes/load.php/code file could NOT be patched. Patch NOT written.' , true ) : null ; else if ( ! $load_patched ) /* Otherwise, we need to report that /wp-includes/load.php could NOT be updated. Wrong WordPress® version? */ ( $display_notices ) ? c_ws_plugin__s2member_admin_notices:: display_admin_notice ( 'Your code/wp-includes/load.php/code file could NOT be patched. Unverifiable.' , true ) : null ; } else /* Otherwise, we need to report that /wp-includes/load.php could NOT be updated. Possibly a permissions error. */ ( $display_notices ) ? c_ws_plugin__s2member_admin_notices:: display_admin_notice ( 'Your code/wp-includes/load.php/code file could NOT be patched. File NOT writable.' , true ) : null ; /**/ $user_new_file = ABSPATH . "wp-admin/user-new.php" ; $user_new_section = "/([\r \n \t\s ]+)(wpmu_signup_user( *?)\(( *?)\\ \$new_user_login,( *?)\\ \$_REQUEST\[( *?)'email'( *?)\],( *?)array( *?)\(( *?)'add_to_blog'( *?)\=\( *?)\\ \$wpdb-blogid,( *?)'new_role'( *?)\=\( *?)\\ \$_REQUEST\[( *?)'role'( *?)\]( *?)\)( *?)\);)/" ; $user_new_replace = "\n \t \t \t// Modified for full plugin compatiblity.\n \t \t \t//wpmu_signup_user( \$new_user_login, \$_REQUEST[ 'email' ], array( 'add_to_blog' = \$wpdb-blogid, 'new_role' = \$_REQUEST[ 'role' ] ) );\n \t \t \twpmu_signup_user( \$new_user_login, \$_REQUEST[ 'email' ], apply_filters( 'add_signup_meta', array( 'add_to_blog' = \$wpdb-blogid, 'new_role' = \$_REQUEST[ 'role' ] ) ) );" ; /**/ if ( file_exists ( $user_new_file ) && ( $user_new = file_get_contents ( $user_new_file ) ) && is_writable ( $user_new_file ) ) { if ( ( ( $user_new_written = file_put_contents ( $user_new_file , preg_replace ( $user_new_section , $user_new_replace , $user_new , 1 , $user_new_patched ) ) ) && $user_new_patched ) || ( $user_new_patched_already = $user_new_patched = strpos ( $user_new , $user_new_replace ) ) ) ( $display_notices ) ? c_ws_plugin__s2member_admin_notices:: display_admin_notice ( 'Your code/wp-admin/user-new.php/code file ' . ( ( $user_new_patched_already ) ? 'is patched' : 'has been patched successfully' ) . '.' ) : null ; else if ( ! $user_new_written ) /* Otherwise, we need to report that /wp-admin/user-new.php could NOT be updated. Possibly a permissions error. */ ( $display_notices ) ? c_ws_plugin__s2member_admin_notices:: display_admin_notice ( 'Your code/wp-admin/user-new.php/code file could NOT be patched. Patch NOT written.' , true ) : null ; else if ( ! $user_new_patched ) /* Otherwise, we need to report that /wp-admin/user-new.php could NOT be updated. Wrong WordPress® version? */ ( $display_notices ) ? c_ws_plugin__s2member_admin_notices:: display_admin_notice ( 'Your code/wp-admin/user-new.php/code file could NOT be patched. Unverifiable.' , true ) : null ; } else /* Otherwise, we need to report that /wp-admin/user-new.php could NOT be updated. Possibly a permissions error. */ ( $display_notices ) ? c_ws_plugin__s2member_admin_notices:: display_admin_notice ( 'Your code/wp-admin/user-new.php/code file could NOT be patched. File NOT writable.' , true ) : null ; /**/ $ms_functions_file = ABSPATH . "wp-includes/ms-functions.php" ; $ms_functions_section = "/([\r \n \t\s ]+)(return new WP_Error( *?)\(( *?)'user_already_exists'( *?),( *?)__( *?)\(( *?)'That username is already activated.'( *?)\),( *?)\\ \$signup( *?)\);)/" ; $ms_functions_replace = "\n \t \t \t// Modified for full plugin compatiblity.\n \t \t \t//return new WP_Error( 'user_already_exists', __( 'That username is already activated.' ), \$signup);\n \t \t \treturn apply_filters('_wpmu_activate_existing_error_', new WP_Error( 'user_already_exists', __( 'That username is already activated.' ), \$signup), get_defined_vars());" ; /**/ if ( file_exists ( $ms_functions_file ) && ( $ms_functions = file_get_contents ( $ms_functions_file ) ) && is_writable ( $ms_functions_file ) ) { if ( ( ( $ms_functions_written = file_put_contents ( $ms_functions_file , preg_replace ( $ms_functions_section , $ms_functions_replace , $ms_functions , 1 , $ms_functions_patched ) ) ) && $ms_functions_patched ) || ( $ms_functions_patched_already = $ms_functions_patched = strpos ( $ms_functions , $ms_functions_replace ) ) ) ( $display_notices ) ? c_ws_plugin__s2member_admin_notices:: display_admin_notice ( 'Your code/wp-includes/ms-functions.php/code file ' . ( ( $ms_functions_patched_already ) ? 'is patched' : 'has been patched successfully' ) . '.' ) : null ; else if ( ! $ms_functions_written ) /* Otherwise, we need to report that /wp-includes/ms-functions.php could NOT be updated. Possibly a permissions error. */ ( $display_notices ) ? c_ws_plugin__s2member_admin_notices:: display_admin_notice ( 'Your code/wp-includes/ms-functions.php/code file could NOT be patched. Patch NOT written.' , true ) : null ; else if ( ! $ms_functions_patched ) /* Otherwise, we need to report that /wp-includes/ms-functions.php could NOT be updated. Wrong WordPress® version? */ ( $display_notices ) ? c_ws_plugin__s2member_admin_notices:: display_admin_notice ( 'Your code/wp-includes/ms-functions.php/code file could NOT be patched. Unverifiable.' , true ) : null ; } else /* Otherwise, we need to report that /wp-includes/ms-functions.php could NOT be updated. Possibly a permissions error. */ ( $display_notices ) ? c_ws_plugin__s2member_admin_notices:: display_admin_notice ( 'Your code/wp-includes/ms-functions.php/code file could NOT be patched. File NOT writable.' , true ) : null ; /**/ $ran_mms_patches = true ; /* Flag indicating this routine was indeed processed. */ /**/ do_action ( "ws_plugin__s2member_during_mms_patches_after" , get_defined_vars ( ) ) ; } /**/ do_action ( "ws_plugin__s2member_after_mms_patches" , get_defined_vars ( ) ) ; /**/ return ! empty ( $ran_mms_patches ) ? $ran_mms_patches : false ; } } } ? [ full view ]s2member\includes\classes\mms-patches.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:39-05:00 http://www.primothemes.com/forums/viewtopic.php?t=13027&p=25322#p25322 <![CDATA[s2Member v111220 / Source Code: s2member\i...]]>
s2Member v111220
Source Code: s2member\includes\classes\mms-patches.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


]]>