PluginProbe
s2Member – Excellent for All Kinds of Memberships, Content Restriction Paywalls & Member Access Subscriptions / 110815
s2Member – Excellent for All Kinds of Memberships, Content Restriction Paywalls & Member Access Subscriptions v110815
260913 260909 260829 260814 260805 110710 110731 110812 110815 110912 110913 110915 110926 110927 111002 111003 111011 111017 111029 111105 111206 111216 111220 120213 120219 All 188 releases
s2member / includes / classes / security.inc.php

security.inc.php in s2Member – Excellent for All Kinds of Memberships, Content Restriction Paywalls & Member Access Subscriptions 110815, at includes/classes/security.inc.php

102 lines 3.1 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 /**
3 * s2Member's Security Gate.
4 *
5 * Copyright: © 2009-2011
6 * {@link http://www.websharks-inc.com/ WebSharks, Inc.}
7 * ( coded in the USA )
8 *
9 * Released under the terms of the GNU General Public License.
10 * You should have received a copy of the GNU General Public License,
11 * along with this software. In the main directory, see: /licensing/
12 * If not, see: {@link http://www.gnu.org/licenses/}.
13 *
14 * @package s2Member\Security
15 * @since 3.5
16 */
17 if (realpath (__FILE__) === realpath ($_SERVER["SCRIPT_FILENAME"]))
18 exit("Do not access this file directly.");
19 /**/
20 if (!class_exists ("c_ws_plugin__s2member_security"))
21 {
22 /**
23 * s2Member's Security Gate.
24 *
25 * @package s2Member\Security
26 * @since 3.5
27 */
28 class c_ws_plugin__s2member_security
29 {
30 /**
31 * s2Member's Security Gate ( protects WordPress® queries ).
32 *
33 * @package s2Member\Security
34 * @since 3.5
35 *
36 * @attaches-to: ``add_action("pre_get_posts");``
37 *
38 * @param obj $wp_query Global instance of ``$wp_query``, by reference.
39 * @return null
40 */
41 public static function security_gate_query (&$wp_query = FALSE)
42 {
43 do_action ("ws_plugin__s2member_before_security_gate_query", get_defined_vars ());
44 /**/
45 c_ws_plugin__s2member_querys::query_level_access ($wp_query); /* By reference. */
46 /**/
47 do_action ("ws_plugin__s2member_after_security_gate_query", get_defined_vars ());
48 /**/
49 return; /* Return for uniformity. */
50 }
51 /**
52 * s2Member's Security Gate ( protects WordPress® content ).
53 *
54 * @package s2Member\Security
55 * @since 3.5
56 *
57 * @attaches-to: ``add_action("template_redirect");``
58 *
59 * @return null
60 */
61 public static function security_gate () /* s2Member's Security Gate. */
62 {
63 do_action ("ws_plugin__s2member_before_security_gate", get_defined_vars ());
64 /*
65 Category Level Restrictions ( inclusively ).
66 - Including URI protections too.
67 */
68 if (is_category ()) /* Categories. */
69 c_ws_plugin__s2member_catgs::check_catg_level_access ();
70 /*
71 Tag Level Restrictions ( inclusively ).
72 - Including URI protections too.
73 */
74 else if (is_tag ()) /* Tags. */
75 c_ws_plugin__s2member_ptags::check_ptag_level_access ();
76 /*
77 Post Level Restrictions ( inclusively, even Custom Post Types ).
78 - Including Category, Tag, URI, Capability, and Specifics too.
79 */
80 else if (is_single ()) /* Posts & Custom Types. */
81 c_ws_plugin__s2member_posts::check_post_level_access ();
82 /*
83 Page Level Restrictions ( inclusively ).
84 - Including Category, Tag, URI, Capability, and Specifics too.
85 */
86 else if (is_page ()) /* Pages. */
87 c_ws_plugin__s2member_pages::check_page_level_access ();
88 /*
89 Else just apply URI Level Restrictions ( only URIs ).
90 */
91 else /* This optimizes things nicely. */
92 c_ws_plugin__s2member_ruris::check_ruri_level_access ();
93 /*
94 Hook after Security Gate.
95 */
96 do_action ("ws_plugin__s2member_after_security_gate", get_defined_vars ());
97 /**/
98 return; /* Return for uniformity. */
99 }
100 }
101 }
102 ?>