Community Support Forums — WordPress® ( Users Helping Users ) — 2011-12-20T09:49:33-05:00 http://www.primothemes.com/forums/feed.php?f=40&t=13016 2011-12-20T09:49:33-05:00 http://www.primothemes.com/forums/viewtopic.php?t=13016&p=57726#p57726 <![CDATA[s2Member v111220 / Source Code: s2member\i...]]>
s2Member v111220
Source Code: s2member\includes\classes\ip-restrictions.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-08T06:52:23-05:00 http://www.primothemes.com/forums/viewtopic.php?t=13016&p=56053#p56053 <![CDATA[Re: s2Member v111206 / Source Code: s2member\i...]]>
may I change "30 days" into "same time"?

thanks

Statistics: Posted by hellboy78 — December 8th, 2011, 6:52 am


]]>
2011-12-07T01:02:33-05:00 http://www.primothemes.com/forums/viewtopic.php?t=13016&p=55408#p55408 <![CDATA[s2Member v111206 / Source Code: s2member\i...]]>
s2Member v111206
Source Code: s2member\includes\classes\ip-restrictions.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:40-05:00 http://www.primothemes.com/forums/viewtopic.php?t=13016&p=51782#p51782 <![CDATA[s2Member v111105 / Source Code: s2member\i...]]>
s2Member v111105
Source Code: s2member\includes\classes\ip-restrictions.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:32-05:00 http://www.primothemes.com/forums/viewtopic.php?t=13016&p=49877#p49877 <![CDATA[s2Member v111029 / Source Code: s2member\i...]]>
s2Member v111029
Source Code: s2member\includes\classes\ip-restrictions.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:39-05:00 http://www.primothemes.com/forums/viewtopic.php?t=13016&p=47671#p47671 <![CDATA[s2Member v111017 / Source Code: s2member\i...]]>
s2Member v111017
Source Code: s2member\includes\classes\ip-restrictions.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:29-05:00 http://www.primothemes.com/forums/viewtopic.php?t=13016&p=46071#p46071 <![CDATA[s2Member v111011 / Source Code: s2member\i...]]>
s2Member v111011
Source Code: s2member\includes\classes\ip-restrictions.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:54-05:00 http://www.primothemes.com/forums/viewtopic.php?t=13016&p=44202#p44202 <![CDATA[s2Member v111003 / Source Code: s2member\i...]]>
s2Member v111003
Source Code: s2member\includes\classes\ip-restrictions.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:24-05:00 http://www.primothemes.com/forums/viewtopic.php?t=13016&p=42909#p42909 <![CDATA[s2Member v111002 / Source Code: s2member\i...]]>
s2Member v111002
Source Code: s2member\includes\classes\ip-restrictions.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:50-05:00 http://www.primothemes.com/forums/viewtopic.php?t=13016&p=41155#p41155 <![CDATA[s2Member v110927 / Source Code: s2member\i...]]>
s2Member v110927
Source Code: s2member\includes\classes\ip-restrictions.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:42-05:00 http://www.primothemes.com/forums/viewtopic.php?t=13016&p=39911#p39911 <![CDATA[s2Member v110926 / Source Code: s2member\i...]]>
s2Member v110926
Source Code: s2member\includes\classes\ip-restrictions.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:31-05:00 http://www.primothemes.com/forums/viewtopic.php?t=13016&p=38055#p38055 <![CDATA[s2Member v110915 / Source Code: s2member\i...]]>
s2Member v110915
Source Code: s2member\includes\classes\ip-restrictions.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:23-05:00 http://www.primothemes.com/forums/viewtopic.php?t=13016&p=36636#p36636 <![CDATA[s2Member v110913 / Source Code: s2member\i...]]>
s2Member v110913
Source Code: s2member\includes\classes\ip-restrictions.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:25-05:00 http://www.primothemes.com/forums/viewtopic.php?t=13016&p=35364#p35364 <![CDATA[s2Member v110912 / Source Code: s2member\i...]]>
s2Member v110912
Source Code: s2member\includes\classes\ip-restrictions.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:44-05:00 http://www.primothemes.com/forums/viewtopic.php?t=13016&p=31471#p31471 <![CDATA[s2Member v110815 / Source Code: s2member\i...]]>
s2Member v110815
Source Code: s2member\includes\classes\ip-restrictions.inc.php
Docs updated: August 15, 2011, 3:11 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\ip-restrictions.inc.php ?php /** * IP Restrictions. * * 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\IP_Restrictions * @since 3.5 */ if ( realpath ( __FILE__ ) === realpath ( $_SERVER [ "SCRIPT_FILENAME" ] ) ) exit ( "Do not access this file directly." ) ; /**/ if ( ! class_exists ( "c_ws_plugin__s2member_ip_restrictions" ) ) { /** * IP Restrictions. * * @package s2Member\IP_Restrictions * @since 3.5 */ class c_ws_plugin__s2member_ip_restrictions { /** * Handles IP Restrictions. * * IP address details are stored in Transient fields. * * @package s2Member\IP_Restrictions * @since 3.5 * * @param str $ip IP Address. * @param str $restriction Unique IP Restriction name/identifier. Such as a Username, or a unique access code. * @return bool True if IP Restrictions are OK, otherwise this function will exit script execution after issuing a warning. */ public static function ip_restrictions_ok ( $ip = FALSE , $restriction = FALSE ) { eval ( 'foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;' ) ; do_action ( "ws_plugin__s2member_before_ip_restrictions_ok" , get_defined_vars ( ) ) ; unset ( $__refs , $__v ) ; /* Unset defined __refs, __v. */ /**/ if ( ! apply_filters ( "ws_plugin__s2member_disable_all_ip_restrictions" , false , get_defined_vars ( ) ) ) if ( $GLOBALS [ "WS_PLUGIN__" ] [ "s2member" ] [ "o" ] [ "max_ip_restriction" ] && $restriction ) { $prefix = "s2m_ipr_" ; /* s2Member Transient prefix for all IP Restrictions. */ $transient_entries = $prefix . md5 ( "s2member_ip_restrictions_" . $restriction . "_entries" ) ; $transient_security_breach = $prefix . md5 ( "s2member_ip_restrictions_" . $restriction . "_security_breach" ) ; /**/ /* If you add Filters, use a string compatible with PHP's strtotime() function. */ $concurrency = apply_filters ( "ws_plugin__s2member_ip_restrictions__concurrency_time_per_ip" , "30 days" ) ; /**/ $entries = ( is_array ( $entries = get_transient ( $transient_entries ) ) ) ? $entries : array ( ) ; /**/ foreach ( $entries as $_entry = $_time ) /* Auto-expire entries. */ if ( $_time strtotime ( "-" . $concurrency ) ) unset ( $entries [ $_entry ] ) ; /**/ $ip = ( $ip ) ? $ip : "empty" ; /* Allow empty IPs. */ $entries [ $ip ] = strtotime ( "now" ) ; /* Log this entry. */ set_transient ( $transient_entries , $entries , 2 * ( strtotime ( "+" . $concurrency ) - strtotime ( "now" ) ) ) ; /**/ if ( get_transient ( $transient_security_breach ) ) /* Has this restriction already been breached? */ { c_ws_plugin__s2member_no_cache:: no_cache_constants ( true ) . wp_clear_auth_cookie ( ) ; /**/ do_action ( "ws_plugin__s2member_during_ip_restrictions_ok_no" , get_defined_vars ( ) ) ; /**/ header ( "HTTP/1.0 503 Service Temporarily Unavailable" ) ; /* Sends a status header. */ /**/ echo 'strong503: Service Temporarily Unavailable/strongbr /' . "\n" ; echo 'Too many IP addresses accessing one secure areaem!/embr /' . "\n" ; echo 'Please contact Support if you require assistance.' ; /**/ exit ( ) ; /* Clean exit. */ } else if ( count ( $entries ) $GLOBALS [ "WS_PLUGIN__" ] [ "s2member" ] [ "o" ] [ "max_ip_restriction" ] ) { c_ws_plugin__s2member_no_cache:: no_cache_constants ( true ) . wp_clear_auth_cookie ( ) ; /**/ set_transient ( $transient_security_breach , 1 , $GLOBALS [ "WS_PLUGIN__" ] [ "s2member" ] [ "o" ] [ "max_ip_restriction_time" ] ) ; /**/ do_action ( "ws_plugin__s2member_during_ip_restrictions_ok_no" , get_defined_vars ( ) ) ; /**/ header ( "HTTP/1.0 503 Service Temporarily Unavailable" ) ; /* Sends a status header. */ /**/ echo 'strong503: Service Temporarily Unavailable/strongbr /' . "\n" ; echo 'Too many IP addresses accessing one secure areaem!/embr /' . "\n" ; echo 'Please contact Support if you require assistance.' ; /**/ exit ( ) ; /* Clean exit. */ } else /* OK, this looks legitimate. Apply Filters here and return true. */ { eval ( 'foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;' ) ; do_action ( "ws_plugin__s2member_during_ip_restrictions_ok_yes" , get_defined_vars ( ) ) ; unset ( $__refs , $__v ) ; /* Unset defined __refs, __v. */ /**/ return apply_filters ( "ws_plugin__s2member_ip_restrictions_ok" , true , get_defined_vars ( ) ) ; } } /**/ return apply_filters ( "ws_plugin__s2member_ip_restrictions_ok" , true , get_defined_vars ( ) ) ; } /** * Queries Transients for specific IP Restrictions associated with a security breach. * * @package s2Member\IP_Restrictions * @since 3.5 * * @param str $restriction Unique IP Restriction name/identifier. Such as a Username, or a unique access code. * @return bool True if the specific IP Restriction is associated with a security breach, else false. */ public static function specific_ip_restriction_breached_security ( $restriction = FALSE ) { do_action ( "ws_plugin__s2member_before_specific_ip_restriction_breached_security" , get_defined_vars ( ) ) ; /**/ $prefix = "s2m_ipr_" ; /* s2Member Transient prefix for all IP Restrictions. */ $transient_security_breach = $prefix . md5 ( "s2member_ip_restrictions_" . $restriction . "_security_breach" ) ; $associated_with_security_breach = ( get_transient ( $transient_security_breach ) ) ? true : false ; /**/ return apply_filters ( "ws_plugin__s2member_before_specific_ip_restriction_breached_security" , $associated_with_security_breach , get_defined_vars ( ) ) ; } /** * Resets/deletes specific IP Restrictions. * * @package s2Member\IP_Restrictions * @since 3.5 * * @param str $restriction Unique IP Restriction name/identifier. Such as a Username, or a unique access code. * @return null */ public static function delete_reset_specific_ip_restrictions ( $restriction = FALSE ) { global $wpdb ; /* Need global database object. */ /**/ do_action ( "ws_plugin__s2member_before_delete_reset_specific_ip_restrictions" , get_defined_vars ( ) ) ; /**/ $prefix = "s2m_ipr_" ; /* s2Member Transient prefix for all IP Restrictions. */ $transient_entries = $prefix . md5 ( "s2member_ip_restrictions_" . $restriction . "_entries" ) ; $transient_security_breach = $prefix . md5 ( "s2member_ip_restrictions_" . $restriction . "_security_breach" ) ; /**/ $wpdb - query ( "DELETE FROM `" . $wpdb - options . "` WHERE `option_name` LIKE '%" . esc_sql ( like_escape ( $transient_entries ) ) . "'" ) ; $wpdb - query ( "DELETE FROM `" . $wpdb - options . "` WHERE `option_name` LIKE '%" . esc_sql ( like_escape ( $transient_security_breach ) ) . "'" ) ; /**/ do_action ( "ws_plugin__s2member_after_delete_reset_specific_ip_restrictions" , get_defined_vars ( ) ) ; /**/ return ; /* Return for uniformity. */ } /** * Resets/deletes specific IP Restrictions via AJAX. * * @package s2Member\IP_Restrictions * @since 3.5 * * @attaches-to: ``add_action("wp_ajax_ws_plugin__s2member_delete_reset_specific_ip_restrictions_via_ajax");`` * * @return null Exits script execution after returning data for AJAX caller. */ public static function delete_reset_specific_ip_restrictions_via_ajax ( ) { do_action ( "ws_plugin__s2member_before_delete_reset_specific_ip_restrictions_via_ajax" , get_defined_vars ( ) ) ; /**/ if ( current_user_can ( "create_users" ) ) /* Check priveledges as well. */ /**/ if ( ! empty ( $_POST [ "ws_plugin__s2member_delete_reset_specific_ip_restrictions_via_ajax" ] ) ) if ( ( $nonce = $_POST [ "ws_plugin__s2member_delete_reset_specific_ip_restrictions_via_ajax" ] ) ) if ( wp_verify_nonce ( $nonce , "ws-plugin--s2member-delete-reset-specific-ip-restrictions-via-ajax" ) ) /**/ if ( ! empty ( $_POST [ "ws_plugin__s2member_delete_reset_specific_ip_restriction" ] ) ) if ( ( $restriction = trim ( stripslashes ( $_POST [ "ws_plugin__s2member_delete_reset_specific_ip_restriction" ] ) ) ) ) /**/ if (c_ws_plugin__s2member_ip_restrictions:: delete_reset_specific_ip_restrictions ( $restriction ) !== "nill" ) echo apply_filters ( "ws_plugin__s2member_delete_reset_specific_ip_restrictions_via_ajax" , 1 , get_defined_vars ( ) ) ; /**/ exit ( ) ; /* Clean exit. */ } /** * Resets/deletes all IP Restrictions. * * @package s2Member\IP_Restrictions * @since 3.5 * * @return null */ public static function delete_reset_all_ip_restrictions ( ) { global $wpdb ; /* Need global database object. */ /**/ do_action ( "ws_plugin__s2member_before_delete_reset_all_ip_restrictions" , get_defined_vars ( ) ) ; /**/ $wpdb - query ( "DELETE FROM `" . $wpdb - options . "` WHERE `option_name` LIKE '" . esc_sql ( like_escape ( "_transient_s2m_ipr_" ) ) . "%'" ) ; $wpdb - query ( "DELETE FROM `" . $wpdb - options . "` WHERE `option_name` LIKE '" . esc_sql ( like_escape ( "_transient_timeout_s2m_ipr_" ) ) . "%'" ) ; /**/ do_action ( "ws_plugin__s2member_after_delete_reset_all_ip_restrictions" , get_defined_vars ( ) ) ; /**/ return ; /* Return for uniformity. */ } /** * Resets/deletes all IP Restrictions via AJAX. * * @package s2Member\IP_Restrictions * @since 3.5 * * @attaches-to: ``add_action("wp_ajax_ws_plugin__s2member_delete_reset_all_ip_restrictions_via_ajax");`` * * @return null Exits script execution after returning data for AJAX caller. */ public static function delete_reset_all_ip_restrictions_via_ajax ( ) { do_action ( "ws_plugin__s2member_before_delete_reset_all_ip_restrictions_via_ajax" , get_defined_vars ( ) ) ; /**/ if ( current_user_can ( "create_users" ) ) /* Check priveledges as well. */ /**/ if ( ! empty ( $_POST [ "ws_plugin__s2member_delete_reset_all_ip_restrictions_via_ajax" ] ) ) if ( ( $nonce = $_POST [ "ws_plugin__s2member_delete_reset_all_ip_restrictions_via_ajax" ] ) ) if ( wp_verify_nonce ( $nonce , "ws-plugin--s2member-delete-reset-all-ip-restrictions-via-ajax" ) ) /**/ if (c_ws_plugin__s2member_ip_restrictions:: delete_reset_all_ip_restrictions ( ) !== "nill" ) echo apply_filters ( "ws_plugin__s2member_delete_reset_all_ip_restrictions_via_ajax" , 1 , get_defined_vars ( ) ) ; /**/ exit ( ) ; /* Clean exit. */ } } } ? [ full view ]s2member\includes\classes\ip-restrictions.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:13-05:00 http://www.primothemes.com/forums/viewtopic.php?t=13016&p=27679#p27679 <![CDATA[s2Member v110710 / Source Code: s2member\i...]]>
s2Member v110710
Source Code: s2member\includes\classes\ip-restrictions.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\ip-restrictions.inc.php ?php /** * IP Restrictions. * * 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\IP_Restrictions * @since 3.5 */ if ( realpath ( __FILE__ ) === realpath ( $_SERVER [ "SCRIPT_FILENAME" ] ) ) exit ( "Do not access this file directly." ) ; /**/ if ( ! class_exists ( "c_ws_plugin__s2member_ip_restrictions" ) ) { /** * IP Restrictions. * * @package s2Member\IP_Restrictions * @since 3.5 */ class c_ws_plugin__s2member_ip_restrictions { /** * Handles IP Restrictions. * * IP address details are stored in Transient fields. * * @package s2Member\IP_Restrictions * @since 3.5 * * @param str $ip IP Address. * @param str $restriction Unique IP Restriction name/identifier. Such as a Username, or a unique access code. * @return bool True if IP Restrictions are OK, otherwise this function will exit script execution after issuing a warning. */ public static function ip_restrictions_ok ( $ip = FALSE , $restriction = FALSE ) { eval ( 'foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;' ) ; do_action ( "ws_plugin__s2member_before_ip_restrictions_ok" , get_defined_vars ( ) ) ; unset ( $__refs , $__v ) ; /* Unset defined __refs, __v. */ /**/ if ( ! apply_filters ( "ws_plugin__s2member_disable_all_ip_restrictions" , false , get_defined_vars ( ) ) ) if ( $GLOBALS [ "WS_PLUGIN__" ] [ "s2member" ] [ "o" ] [ "max_ip_restriction" ] && $restriction ) { $prefix = "s2m_ipr_" ; /* s2Member Transient prefix for all IP Restrictions. */ $transient_entries = $prefix . md5 ( "s2member_ip_restrictions_" . $restriction . "_entries" ) ; $transient_security_breach = $prefix . md5 ( "s2member_ip_restrictions_" . $restriction . "_security_breach" ) ; /**/ /* If you add Filters, use a string compatible with PHP's strtotime() function. */ $concurrency = apply_filters ( "ws_plugin__s2member_ip_restrictions__concurrency_time_per_ip" , "30 days" ) ; /**/ $entries = ( is_array ( $entries = get_transient ( $transient_entries ) ) ) ? $entries : array ( ) ; /**/ foreach ( $entries as $_entry = $_time ) /* Auto-expire entries. */ if ( $_time strtotime ( "-" . $concurrency ) ) unset ( $entries [ $_entry ] ) ; /**/ $ip = ( $ip ) ? $ip : "empty" ; /* Allow empty IPs. */ $entries [ $ip ] = strtotime ( "now" ) ; /* Log this entry. */ set_transient ( $transient_entries , $entries , 2 * ( strtotime ( "+" . $concurrency ) - strtotime ( "now" ) ) ) ; /**/ if ( get_transient ( $transient_security_breach ) ) /* Has this restriction already been breached? */ { c_ws_plugin__s2member_no_cache:: no_cache_constants ( true ) . wp_clear_auth_cookie ( ) ; /**/ do_action ( "ws_plugin__s2member_during_ip_restrictions_ok_no" , get_defined_vars ( ) ) ; /**/ header ( "HTTP/1.0 503 Service Temporarily Unavailable" ) ; /* Sends a status header. */ /**/ echo 'strong503: Service Temporarily Unavailable/strongbr /' . "\n" ; echo 'Too many IP addresses accessing one secure areaem!/embr /' . "\n" ; echo 'Please contact Support if you require assistance.' ; /**/ exit ( ) ; /* Clean exit. */ } else if ( count ( $entries ) $GLOBALS [ "WS_PLUGIN__" ] [ "s2member" ] [ "o" ] [ "max_ip_restriction" ] ) { c_ws_plugin__s2member_no_cache:: no_cache_constants ( true ) . wp_clear_auth_cookie ( ) ; /**/ set_transient ( $transient_security_breach , 1 , $GLOBALS [ "WS_PLUGIN__" ] [ "s2member" ] [ "o" ] [ "max_ip_restriction_time" ] ) ; /**/ do_action ( "ws_plugin__s2member_during_ip_restrictions_ok_no" , get_defined_vars ( ) ) ; /**/ header ( "HTTP/1.0 503 Service Temporarily Unavailable" ) ; /* Sends a status header. */ /**/ echo 'strong503: Service Temporarily Unavailable/strongbr /' . "\n" ; echo 'Too many IP addresses accessing one secure areaem!/embr /' . "\n" ; echo 'Please contact Support if you require assistance.' ; /**/ exit ( ) ; /* Clean exit. */ } else /* OK, this looks legitimate. Apply Filters here and return true. */ { eval ( 'foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;' ) ; do_action ( "ws_plugin__s2member_during_ip_restrictions_ok_yes" , get_defined_vars ( ) ) ; unset ( $__refs , $__v ) ; /* Unset defined __refs, __v. */ /**/ return apply_filters ( "ws_plugin__s2member_ip_restrictions_ok" , true , get_defined_vars ( ) ) ; } } /**/ return apply_filters ( "ws_plugin__s2member_ip_restrictions_ok" , true , get_defined_vars ( ) ) ; } /** * Queries Transients for specific IP Restrictions associated with a security breach. * * @package s2Member\IP_Restrictions * @since 3.5 * * @param str $restriction Unique IP Restriction name/identifier. Such as a Username, or a unique access code. * @return bool True if the specific IP Restriction is associated with a security breach, else false. */ public static function specific_ip_restriction_breached_security ( $restriction = FALSE ) { do_action ( "ws_plugin__s2member_before_specific_ip_restriction_breached_security" , get_defined_vars ( ) ) ; /**/ $prefix = "s2m_ipr_" ; /* s2Member Transient prefix for all IP Restrictions. */ $transient_security_breach = $prefix . md5 ( "s2member_ip_restrictions_" . $restriction . "_security_breach" ) ; $associated_with_security_breach = ( get_transient ( $transient_security_breach ) ) ? true : false ; /**/ return apply_filters ( "ws_plugin__s2member_before_specific_ip_restriction_breached_security" , $associated_with_security_breach , get_defined_vars ( ) ) ; } /** * Resets/deletes specific IP Restrictions. * * @package s2Member\IP_Restrictions * @since 3.5 * * @param str $restriction Unique IP Restriction name/identifier. Such as a Username, or a unique access code. * @return null */ public static function delete_reset_specific_ip_restrictions ( $restriction = FALSE ) { global $wpdb ; /* Need global database object. */ /**/ do_action ( "ws_plugin__s2member_before_delete_reset_specific_ip_restrictions" , get_defined_vars ( ) ) ; /**/ $prefix = "s2m_ipr_" ; /* s2Member Transient prefix for all IP Restrictions. */ $transient_entries = $prefix . md5 ( "s2member_ip_restrictions_" . $restriction . "_entries" ) ; $transient_security_breach = $prefix . md5 ( "s2member_ip_restrictions_" . $restriction . "_security_breach" ) ; /**/ $wpdb - query ( "DELETE FROM `" . $wpdb - options . "` WHERE `option_name` LIKE '%" . esc_sql ( like_escape ( $transient_entries ) ) . "'" ) ; $wpdb - query ( "DELETE FROM `" . $wpdb - options . "` WHERE `option_name` LIKE '%" . esc_sql ( like_escape ( $transient_security_breach ) ) . "'" ) ; /**/ do_action ( "ws_plugin__s2member_after_delete_reset_specific_ip_restrictions" , get_defined_vars ( ) ) ; /**/ return ; /* Return for uniformity. */ } /** * Resets/deletes specific IP Restrictions via AJAX. * * @package s2Member\IP_Restrictions * @since 3.5 * * @attaches-to: ``add_action("wp_ajax_ws_plugin__s2member_delete_reset_specific_ip_restrictions_via_ajax");`` * * @return null Exits script execution after returning data for AJAX caller. */ public static function delete_reset_specific_ip_restrictions_via_ajax ( ) { do_action ( "ws_plugin__s2member_before_delete_reset_specific_ip_restrictions_via_ajax" , get_defined_vars ( ) ) ; /**/ if ( current_user_can ( "create_users" ) ) /* Check priveledges as well. */ /**/ if ( ! empty ( $_POST [ "ws_plugin__s2member_delete_reset_specific_ip_restrictions_via_ajax" ] ) ) if ( ( $nonce = $_POST [ "ws_plugin__s2member_delete_reset_specific_ip_restrictions_via_ajax" ] ) ) if ( wp_verify_nonce ( $nonce , "ws-plugin--s2member-delete-reset-specific-ip-restrictions-via-ajax" ) ) /**/ if ( ! empty ( $_POST [ "ws_plugin__s2member_delete_reset_specific_ip_restriction" ] ) ) if ( ( $restriction = trim ( stripslashes ( $_POST [ "ws_plugin__s2member_delete_reset_specific_ip_restriction" ] ) ) ) ) /**/ if (c_ws_plugin__s2member_ip_restrictions:: delete_reset_specific_ip_restrictions ( $restriction ) !== "nill" ) echo apply_filters ( "ws_plugin__s2member_delete_reset_specific_ip_restrictions_via_ajax" , 1 , get_defined_vars ( ) ) ; /**/ exit ( ) ; /* Clean exit. */ } /** * Resets/deletes all IP Restrictions. * * @package s2Member\IP_Restrictions * @since 3.5 * * @return null */ public static function delete_reset_all_ip_restrictions ( ) { global $wpdb ; /* Need global database object. */ /**/ do_action ( "ws_plugin__s2member_before_delete_reset_all_ip_restrictions" , get_defined_vars ( ) ) ; /**/ $wpdb - query ( "DELETE FROM `" . $wpdb - options . "` WHERE `option_name` LIKE '" . esc_sql ( like_escape ( "_transient_s2m_ipr_" ) ) . "%'" ) ; $wpdb - query ( "DELETE FROM `" . $wpdb - options . "` WHERE `option_name` LIKE '" . esc_sql ( like_escape ( "_transient_timeout_s2m_ipr_" ) ) . "%'" ) ; /**/ do_action ( "ws_plugin__s2member_after_delete_reset_all_ip_restrictions" , get_defined_vars ( ) ) ; /**/ return ; /* Return for uniformity. */ } /** * Resets/deletes all IP Restrictions via AJAX. * * @package s2Member\IP_Restrictions * @since 3.5 * * @attaches-to: ``add_action("wp_ajax_ws_plugin__s2member_delete_reset_all_ip_restrictions_via_ajax");`` * * @return null Exits script execution after returning data for AJAX caller. */ public static function delete_reset_all_ip_restrictions_via_ajax ( ) { do_action ( "ws_plugin__s2member_before_delete_reset_all_ip_restrictions_via_ajax" , get_defined_vars ( ) ) ; /**/ if ( current_user_can ( "create_users" ) ) /* Check priveledges as well. */ /**/ if ( ! empty ( $_POST [ "ws_plugin__s2member_delete_reset_all_ip_restrictions_via_ajax" ] ) ) if ( ( $nonce = $_POST [ "ws_plugin__s2member_delete_reset_all_ip_restrictions_via_ajax" ] ) ) if ( wp_verify_nonce ( $nonce , "ws-plugin--s2member-delete-reset-all-ip-restrictions-via-ajax" ) ) /**/ if (c_ws_plugin__s2member_ip_restrictions:: delete_reset_all_ip_restrictions ( ) !== "nill" ) echo apply_filters ( "ws_plugin__s2member_delete_reset_all_ip_restrictions_via_ajax" , 1 , get_defined_vars ( ) ) ; /**/ exit ( ) ; /* Clean exit. */ } } } ? [ full view ]s2member\includes\classes\ip-restrictions.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:19-05:00 http://www.primothemes.com/forums/viewtopic.php?t=13016&p=25311#p25311 <![CDATA[s2Member v111220 / Source Code: s2member\i...]]>
s2Member v111220
Source Code: s2member\includes\classes\ip-restrictions.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


]]>