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

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

687 lines 44.1 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 /**
3 * Administrative menu pages.
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\Menu_Pages
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_menu_pages"))
21 {
22 /**
23 * Administrative menu pages.
24 *
25 * @package s2Member\Menu_Pages
26 * @since 3.5
27 */
28 class c_ws_plugin__s2member_menu_pages
29 {
30 /**
31 * Saves all options from any menu page.
32 *
33 * Can also be self-verified; and configured extensively with function parameters.
34 *
35 * @package s2Member\Menu_Pages
36 * @since 3.5
37 *
38 * @param array $new_options Optional. Force feed an array of new options. Defaults to ``$_POST`` vars.
39 * If ``$new_options`` are passed in, be SURE that you've already applied ``stripslashes_deep()``.
40 * @param bool $verified Optional. Defaults to false. If true, ``wp_verify_nonce()`` is skipped in this routine.
41 * @param bool $update_other Optional. Defaults to true. If false, other option-dependent routines will not be processed.
42 * @param bool|array $display_notices Optional. Defaults to true. Can be false, or an array of certain notices that can be displayed.
43 * @param bool|array $enqueue_notices Optional. Defaults to false. Can be true, or an array of certain notices that should be enqueued.
44 * @param bool $request_refresh Optional. Defaults to false. If true, resulting `success` notice will include a link to refresh the menu page.
45 * @return bool True if all s2Member options were updated successfully, else false.
46 */
47 public static function update_all_options ($new_options = FALSE, $verified = FALSE, $update_other = TRUE, $display_notices = TRUE, $enqueue_notices = FALSE, $request_refresh = FALSE)
48 {
49 $updated_all_options = false; /* Initialize this to a value of false. Initializing this variable here makes it an available reference-variable to Hooks/Filters. */
50 /**/
51 eval ('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
52 do_action ("ws_plugin__s2member_before_update_all_options", get_defined_vars ()); /* If you use this Hook, be sure to use ``wp_verify_nonce()``. */
53 unset ($__refs, $__v); /* Unset defined __refs, __v. */
54 /**/
55 if ($verified || (!empty ($_POST["ws_plugin__s2member_options_save"]) && ($nonce = $_POST["ws_plugin__s2member_options_save"]) && wp_verify_nonce ($nonce, "ws-plugin--s2member-options-save")))
56 {
57 $options = $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]; /* Acquire the full existing configuration options array here. */
58 /**/
59 $new_options = (is_array ($new_options)) ? $new_options : ((!empty ($_POST) && is_array ($_POST)) ? stripslashes_deep ($_POST) : array ());
60 $new_options = c_ws_plugin__s2member_utils_strings::trim_deep ($new_options);
61 /**/
62 foreach ($new_options as $key => $value) /* Find all keys contained within ``$new_options`` matching `^ws_plugin__s2member_`. */
63 if (strpos ($key, "ws_plugin__s2member_") === 0) /* A relevant ``$new_options`` key matching `^ws_plugin__s2member_`? */
64 /**/
65 if ($key === "ws_plugin__s2member_configured") /* s2Member is now configured ( according to these options )? */
66 ($GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["configured"] = $value) . update_option ("ws_plugin__s2member_configured", $value);
67 /**/
68 else if (!is_array ($value) || (is_array ($value) && /* Updating an array? */ array_shift ($value) === "update-signal"))
69 $options[preg_replace ("/^" . preg_quote ("ws_plugin__s2member_", "/") . "/", "", $key)] = $value;
70 /**/
71 unset ($key, $value); /* Unset these utility variables now. This prevents bleeding vars into Hooks/Filters that are of no use. */
72 /**/
73 eval ('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
74 do_action ("ws_plugin__s2member_during_update_all_options", get_defined_vars ()); /* If you use this Hook, be sure to use ``wp_verify_nonce()``. */
75 unset ($__refs, $__v); /* Unset defined __refs, __v. */
76 /**/
77 $options = ws_plugin__s2member_configure_options_and_their_defaults (($options = array_merge ($options, array ("options_version" => (string)($options["options_version"] + 0.001)))));
78 update_option ("ws_plugin__s2member_options", $options) . ((is_multisite () && is_main_site ()) ? update_site_option ("ws_plugin__s2member_options", $options) : null) . update_option ("ws_plugin__s2member_cache", array ());
79 /**/
80 if ($update_other === true || in_array ("auto_eot_system", (array)$update_other)) /* Handle the Auto-EOT System now ( enable/disable ). */
81 ($options["auto_eot_system_enabled"] == 1) ? c_ws_plugin__s2member_auto_eots::add_auto_eot_system () : c_ws_plugin__s2member_auto_eots::delete_auto_eot_system ();
82 /**/
83 if (($display_notices === true || in_array ("success", (array)$display_notices)) && ($notice = '<strong>Options saved.' . (($request_refresh) ? ' Please <a href="' . esc_attr ($_SERVER["REQUEST_URI"]) . '">refresh</a>.' : '') . '</strong>'))
84 ($enqueue_notices === true || in_array ("success", (array)$enqueue_notices)) ? c_ws_plugin__s2member_admin_notices::enqueue_admin_notice ($notice, "*:*") : c_ws_plugin__s2member_admin_notices::display_admin_notice ($notice);
85 /**/
86 if (empty ($_GET["page"]) || $_GET["page"] !== "ws-plugin--s2member-mms-ops") /* Do NOT display page-conflict-warnings on the Main Multisite Configuration panel. */
87 {
88 if (!$options["membership_options_page"] && ($display_notices === true || in_array ("page-conflict-warnings", (array)$display_notices)) && ($notice = '<strong>NOTE:</strong> s2Member security restrictions will NOT be enforced until you\'ve configured a Membership Options Page. See: <code>s2Member -> General Options -> Membership Options Page</code>.'))
89 ($enqueue_notices === true || in_array ("page-conflict-warnings", (array)$enqueue_notices)) ? c_ws_plugin__s2member_admin_notices::enqueue_admin_notice ($notice, "*:*", true) : c_ws_plugin__s2member_admin_notices::display_admin_notice ($notice, true);
90 /**/
91 if ($options["login_welcome_page"] && $options["login_welcome_page"] === $options["membership_options_page"] && ($display_notices === true || in_array ("page-conflict-warnings", (array)$display_notices)) && ($notice = '<strong>s2Member:</strong> Your Login Welcome Page is the same as your Membership Options Page. Please correct this. See: <code>s2Member -> General Options -> Login Welcome Page</code>.'))
92 ($enqueue_notices === true || in_array ("page-conflict-warnings", (array)$enqueue_notices)) ? c_ws_plugin__s2member_admin_notices::enqueue_admin_notice ($notice, "*:*", true) : c_ws_plugin__s2member_admin_notices::display_admin_notice ($notice, true);
93 /**/
94 if ($options["membership_options_page"] && (string)get_option ("page_on_front") === $options["membership_options_page"] && ($display_notices === true || in_array ("page-conflict-warnings", (array)$display_notices)) && ($notice = '<strong>s2Member:</strong> Your Membership Options Page is currently configured as your Home Page ( i.e. static page ) for WordPress®. This causes internal conflicts with s2Member. Your Membership Options Page MUST stand alone. Please correct this. See: <code>WordPress® -> Reading Options</code>. Or change: <code>s2Member -> General Options -> Membership Options Page</code>.'))
95 ($enqueue_notices === true || in_array ("page-conflict-warnings", (array)$enqueue_notices)) ? c_ws_plugin__s2member_admin_notices::enqueue_admin_notice ($notice, "*:*", true) : c_ws_plugin__s2member_admin_notices::display_admin_notice ($notice, true);
96 /**/
97 if ($options["login_welcome_page"] && (string)get_option ("page_on_front") === $options["login_welcome_page"] && ($display_notices === true || in_array ("page-conflict-warnings", (array)$display_notices)) && ($notice = '<strong>s2Member:</strong> Your Login Welcome Page is currently configured as your Home Page ( i.e. static page ) for WordPress®. This causes internal conflicts with s2Member. Your Login Welcome Page MUST stand alone. Please correct this. See: <code>WordPress® -> Reading Options</code>. Or change: <code>s2Member -> General Options -> Login Welcome Page</code>.'))
98 ($enqueue_notices === true || in_array ("page-conflict-warnings", (array)$enqueue_notices)) ? c_ws_plugin__s2member_admin_notices::enqueue_admin_notice ($notice, "*:*", true) : c_ws_plugin__s2member_admin_notices::display_admin_notice ($notice, true);
99 /**/
100 if ($options["membership_options_page"] && (string)get_option ("page_for_posts") === $options["membership_options_page"] && ($display_notices === true || in_array ("page-conflict-warnings", (array)$display_notices)) && ($notice = '<strong>s2Member:</strong> Your Membership Options Page is currently configured as your Posts Page ( i.e. static page ) for WordPress®. This causes internal conflicts with s2Member. Your Membership Options Page MUST stand alone. Please correct this. See: <code>WordPress® -> Reading Options</code>. Or change: <code>s2Member -> General Options -> Membership Options Page</code>.'))
101 ($enqueue_notices === true || in_array ("page-conflict-warnings", (array)$enqueue_notices)) ? c_ws_plugin__s2member_admin_notices::enqueue_admin_notice ($notice, "*:*", true) : c_ws_plugin__s2member_admin_notices::display_admin_notice ($notice, true);
102 /**/
103 if ($options["login_welcome_page"] && (string)get_option ("page_for_posts") === $options["login_welcome_page"] && ($display_notices === true || in_array ("page-conflict-warnings", (array)$display_notices)) && ($notice = '<strong>s2Member:</strong> Your Login Welcome Page is currently configured as your Posts Page ( i.e. static page ) for WordPress®. This causes internal conflicts with s2Member. Your Login Welcome Page MUST stand alone. Please correct this. See: <code>WordPress® -> Reading Options</code>. Or change: <code>s2Member -> General Options -> Login Welcome Page</code>.'))
104 ($enqueue_notices === true || in_array ("page-conflict-warnings", (array)$enqueue_notices)) ? c_ws_plugin__s2member_admin_notices::enqueue_admin_notice ($notice, "*:*", true) : c_ws_plugin__s2member_admin_notices::display_admin_notice ($notice, true);
105 /**/
106 if ($options["file_download_limit_exceeded_page"] && $options["file_download_limit_exceeded_page"] === $options["membership_options_page"] && ($display_notices === true || in_array ("page-conflict-warnings", (array)$display_notices)) && ($notice = '<strong>s2Member:</strong> Your Download Limit Exceeded Page is the same as your Membership Options Page. Please correct this. See: <code>s2Member -> Download Options</code>.'))
107 ($enqueue_notices === true || in_array ("page-conflict-warnings", (array)$enqueue_notices)) ? c_ws_plugin__s2member_admin_notices::enqueue_admin_notice ($notice, "*:*", true) : c_ws_plugin__s2member_admin_notices::display_admin_notice ($notice, true);
108 }
109 /**/
110 $updated_all_options = true; /* Flag indicating this routine was processed successfully; and that all s2Member options have been updated successfully.*/
111 }
112 /**/
113 eval ('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
114 do_action ("ws_plugin__s2member_after_update_all_options", get_defined_vars ()); /* If you use this Hook, be sure to use ``wp_verify_nonce()``. */
115 unset ($__refs, $__v); /* Unset defined __refs, __v. */
116 /**/
117 return apply_filters ("ws_plugin__s2member_update_all_options", (($updated_all_options) ? true : false), get_defined_vars ());
118 }
119 /**
120 * Adds option menus / sub-menus.
121 *
122 * @package s2Member\Menu_Pages
123 * @since 3.5
124 *
125 * @attaches-to: ``add_action("admin_menu");``
126 *
127 * @return null
128 */
129 public static function add_admin_options ()
130 {
131 do_action ("ws_plugin__s2member_before_add_admin_options", get_defined_vars ());
132 /**/
133 add_filter ("plugin_action_links", "c_ws_plugin__s2member_menu_pages::_add_settings_link", 10, 2);
134 /**/
135 if (apply_filters ("ws_plugin__s2member_during_add_admin_options_create_menu_items", true, get_defined_vars ()))
136 {
137 if ((is_multisite () && c_ws_plugin__s2member_utils_conds::is_multisite_farm () && !is_main_site ()) || apply_filters ("ws_plugin__s2member_during_add_admin_options_clear_right_side", false, get_defined_vars ()))
138 $GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["menu_pages"] = array (); /* Clear right side. */
139 /**/
140 $menu = apply_filters ("ws_plugin__s2member_during_add_admin_options_menu_slug", "ws-plugin--s2member-start", get_defined_vars ());
141 /**/
142 if (apply_filters ("ws_plugin__s2member_during_add_admin_options_add_menu_page", true, get_defined_vars ()))
143 add_menu_page ("s2Member®", "s2Member®", "create_users", $menu, "c_ws_plugin__s2member_menu_pages::start_page", $GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["dir_url"] . "/images/brand-favicon.png");
144 /**/
145 if (apply_filters ("ws_plugin__s2member_during_add_admin_options_add_start_page", true, get_defined_vars ()))
146 add_submenu_page ($menu, "s2Member Quick-Start Guide", "Quick-Start Guide", "create_users", "ws-plugin--s2member-start", "c_ws_plugin__s2member_menu_pages::start_page");
147 /**/
148 if (apply_filters ("ws_plugin__s2member_during_add_admin_options_add_divider_1", true, get_defined_vars ())) /* Divider. */
149 add_submenu_page ($menu, "-", '<div style="margin:1px 0 1px -5px; height:1px; line-height:1px; background:#CCCCCC;"></div>', "create_users", "#");
150 /**/
151 if (apply_filters ("ws_plugin__s2member_during_add_admin_options_add_mms_ops_page", (!is_multisite () || is_main_site ()), get_defined_vars ()))
152 add_submenu_page ($menu, "s2Member Multisite Configuration", "Multisite (Config)", "create_users", "ws-plugin--s2member-mms-ops", "c_ws_plugin__s2member_menu_pages::mms_ops_page");
153 /**/
154 if (apply_filters ("ws_plugin__s2member_during_add_admin_options_add_gen_ops_page", true, get_defined_vars ()))
155 add_submenu_page ($menu, "s2Member General Options", "General Options", "create_users", "ws-plugin--s2member-gen-ops", "c_ws_plugin__s2member_menu_pages::gen_ops_page");
156 /**/
157 if (apply_filters ("ws_plugin__s2member_during_add_admin_options_add_res_ops_page", true, get_defined_vars ()))
158 add_submenu_page ($menu, "s2Member Restriction Options", "Restriction Options", "create_users", "ws-plugin--s2member-res-ops", "c_ws_plugin__s2member_menu_pages::res_ops_page");
159 /**/
160 if (apply_filters ("ws_plugin__s2member_during_add_admin_options_add_down_ops_page", (!is_multisite () || !c_ws_plugin__s2member_utils_conds::is_multisite_farm () || is_main_site ()), get_defined_vars ()))
161 add_submenu_page ($menu, "s2Member Download Options", "Download Options", "create_users", "ws-plugin--s2member-down-ops", "c_ws_plugin__s2member_menu_pages::down_ops_page");
162 /**/
163 if (apply_filters ("ws_plugin__s2member_during_add_admin_options_add_divider_2", true, get_defined_vars ())) /* Divider. */
164 add_submenu_page ($menu, "-", '<div style="margin:1px 0 1px -5px; height:1px; line-height:1px; background:#CCCCCC;"></div>', "create_users", "#");
165 /**/
166 if (apply_filters ("ws_plugin__s2member_during_add_admin_options_add_new_user_page", true, get_defined_vars ())) /* Shortcut. */
167 add_submenu_page ($menu, "s2Member / Add A Member", "Add A Member", "create_users", "user-new.php");
168 /**/
169 if (apply_filters ("ws_plugin__s2member_during_add_admin_options_add_browse_users_page", true, get_defined_vars ())) /* Shortcut. */
170 add_submenu_page ($menu, "s2Member / Browse Members", "Browse Members", "create_users", "users.php");
171 /**/
172 if (apply_filters ("ws_plugin__s2member_during_add_admin_options_add_divider_3", true, get_defined_vars ())) /* Divider. */
173 add_submenu_page ($menu, "-", '<div style="margin:1px 0 1px -5px; height:1px; line-height:1px; background:#CCCCCC;"></div>', "create_users", "#");
174 /**/
175 if (apply_filters ("ws_plugin__s2member_during_add_admin_options_add_paypal_ops_page", true, get_defined_vars ()))
176 add_submenu_page ($menu, "s2Member PayPal Options", "PayPal® Options", "create_users", "ws-plugin--s2member-paypal-ops", "c_ws_plugin__s2member_menu_pages::paypal_ops_page");
177 /**/
178 if (apply_filters ("ws_plugin__s2member_during_add_admin_options_add_paypal_buttons_page", true, get_defined_vars ()))
179 add_submenu_page ($menu, "s2Member PayPal® Buttons", "PayPal® Buttons", "create_users", "ws-plugin--s2member-paypal-buttons", "c_ws_plugin__s2member_menu_pages::paypal_buttons_page");
180 /**/
181 if (apply_filters ("ws_plugin__s2member_during_add_admin_options_add_divider_4", true, get_defined_vars ())) /* Divider. */
182 add_submenu_page ($menu, "-", '<div style="margin:1px 0 1px -5px; height:1px; line-height:1px; background:#CCCCCC;"></div>', "create_users", "#");
183 /**/
184 if (apply_filters ("ws_plugin__s2member_during_add_admin_options_add_trk_ops_page", true, get_defined_vars ()))
185 add_submenu_page ($menu, "s2Member API / Tracking", "API / Tracking", "create_users", "ws-plugin--s2member-trk-ops", "c_ws_plugin__s2member_menu_pages::trk_ops_page");
186 /**/
187 if (apply_filters ("ws_plugin__s2member_during_add_admin_options_add_els_ops_page", true, get_defined_vars ()))
188 add_submenu_page ($menu, "s2Member API / List Servers", "API / List Servers", "create_users", "ws-plugin--s2member-els-ops", "c_ws_plugin__s2member_menu_pages::els_ops_page");
189 /**/
190 if (apply_filters ("ws_plugin__s2member_during_add_admin_options_add_api_ops_page", true, get_defined_vars ()))
191 add_submenu_page ($menu, "s2Member API / Notifications", "API / Notifications", "create_users", "ws-plugin--s2member-api-ops", "c_ws_plugin__s2member_menu_pages::api_ops_page");
192 /**/
193 if (apply_filters ("ws_plugin__s2member_during_add_admin_options_add_scripting_page", true, get_defined_vars ()))
194 add_submenu_page ($menu, "s2Member API / Scripting", "API / Scripting", "create_users", "ws-plugin--s2member-scripting", "c_ws_plugin__s2member_menu_pages::scripting_page");
195 /**/
196 if (apply_filters ("ws_plugin__s2member_during_add_admin_options_add_divider_5", true, get_defined_vars ())) /* Divider. */
197 add_submenu_page ($menu, "-", '<div style="margin:1px 0 1px -5px; height:1px; line-height:1px; background:#CCCCCC;"></div>', "create_users", "#");
198 /**/
199 if (apply_filters ("ws_plugin__s2member_during_add_admin_options_add_integrations_page", (!is_multisite () || !c_ws_plugin__s2member_utils_conds::is_multisite_farm () || is_main_site ()), get_defined_vars ()))
200 add_submenu_page ($menu, "s2Member / Other Integrations", "Other Integrations", "create_users", "ws-plugin--s2member-integrations", "c_ws_plugin__s2member_menu_pages::integrations_page");
201 /**/
202 if (apply_filters ("ws_plugin__s2member_during_add_admin_options_add_divider_6", true, get_defined_vars ())) /* Divider. */
203 add_submenu_page ($menu, "-", '<div style="margin:1px 0 1px -5px; height:1px; line-height:1px; background:#CCCCCC;"></div>', "create_users", "#");
204 /**/
205 if (apply_filters ("ws_plugin__s2member_during_add_admin_options_add_info_page", (!is_multisite () || !c_ws_plugin__s2member_utils_conds::is_multisite_farm () || is_main_site ()), get_defined_vars ()))
206 add_submenu_page ($menu, "s2Member Information", "s2Member Info", "create_users", "ws-plugin--s2member-info", "c_ws_plugin__s2member_menu_pages::info_page");
207 /**/
208 do_action ("ws_plugin__s2member_during_add_admin_options_additional_pages", get_defined_vars ());
209 }
210 /**/
211 do_action ("ws_plugin__s2member_after_add_admin_options", get_defined_vars ());
212 /**/
213 return; /* Return for uniformity. */
214 }
215 /**
216 * Adds network option menus / sub-menus.
217 *
218 * @package s2Member\Menu_Pages
219 * @since 3.5
220 *
221 * @attaches-to: ``add_action("network_admin_menu");``
222 *
223 * @return null
224 */
225 public static function add_network_admin_options ()
226 {
227 do_action ("ws_plugin__s2member_before_add_network_admin_options", get_defined_vars ());
228 /**/
229 if (apply_filters ("ws_plugin__s2member_during_add_network_admin_options_create_menu_items", true, get_defined_vars ()))
230 {
231 if ((is_multisite () && c_ws_plugin__s2member_utils_conds::is_multisite_farm () && !is_main_site ()) || apply_filters ("ws_plugin__s2member_during_add_network_admin_options_clear_right_side", false, get_defined_vars ()))
232 $GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["menu_pages"] = array (); /* Clear right side. */
233 /**/
234 $menu = "ws-plugin--s2member-mms-ops"; /* Used below for nesting additional sub-menu pages. */
235 /**/
236 add_menu_page ("s2Member®", "s2Member®", "create_users", $menu, "c_ws_plugin__s2member_menu_pages::mms_ops_page", $GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["dir_url"] . "/images/brand-favicon.png");
237 /**/
238 add_submenu_page ($menu, "s2Member Multisite ( Configuration )", "Multisite (Config)", "create_users", "ws-plugin--s2member-mms-ops", "c_ws_plugin__s2member_menu_pages::mms_ops_page");
239 /**/
240 if (apply_filters ("ws_plugin__s2member_during_add_network_admin_options_add_info_page", (!is_multisite () || !c_ws_plugin__s2member_utils_conds::is_multisite_farm () || is_main_site ()), get_defined_vars ()))
241 add_submenu_page ($menu, "s2Member Information", "s2Member Info", "create_users", "ws-plugin--s2member-info", "c_ws_plugin__s2member_menu_pages::info_page");
242 /**/
243 do_action ("ws_plugin__s2member_during_add_network_admin_options_additional_pages", get_defined_vars ());
244 }
245 /**/
246 do_action ("ws_plugin__s2member_after_add_network_admin_options", get_defined_vars ());
247 /**/
248 return; /* Return for uniformity. */
249 }
250 /**
251 * A sort of callback function to add the settings link.
252 *
253 * @package s2Member\Menu_Pages
254 * @since 3.5
255 *
256 * @attaches-to: ``add_filter("plugin_action_links");``
257 *
258 * @param array $actions Expects an existing array of actions links, passed in by the Filter.
259 * @param str $plugin_file Expects path to a plugin file. We need to test against this for s2Member.
260 * @return array An array of links, Filtered by this routine.
261 */
262 public static function _add_settings_link ($actions = FALSE, $plugin_file = FALSE)
263 {
264 eval ('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
265 do_action ("_ws_plugin__s2member_before_add_settings_link", get_defined_vars ());
266 unset ($__refs, $__v); /* Unset defined __refs, __v. */
267 /**/
268 if ($plugin_file === $GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["plugin_basename"] && is_array ($actions))
269 {
270 $settings = '<a href="' . esc_attr (admin_url ("/admin.php?page=ws-plugin--s2member-gen-ops")) . '">Settings</a>';
271 array_unshift ($actions, apply_filters ("ws_plugin__s2member_add_settings_link", $settings, get_defined_vars ()));
272 /**/
273 eval ('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
274 do_action ("_ws_plugin__s2member_during_add_settings_link", get_defined_vars ());
275 unset ($__refs, $__v); /* Unset defined __refs, __v. */
276 }
277 /**/
278 return apply_filters ("_ws_plugin__s2member_add_settings_link", $actions, get_defined_vars ());
279 }
280 /**
281 * Enqueue scripts for administrative menu pages.
282 *
283 * @package s2Member\Menu_Pages
284 * @since 3.5
285 *
286 * @attaches-to: ``add_action("admin_print_scripts");``
287 *
288 * @return null
289 */
290 public static function add_admin_scripts ()
291 {
292 do_action ("ws_plugin__s2member_before_add_admin_scripts", get_defined_vars ());
293 /**/
294 if (!empty ($_GET["page"]) && preg_match ("/ws-plugin--s2member-/", $_GET["page"]))
295 {
296 wp_enqueue_script ("jquery");
297 wp_enqueue_script ("thickbox");
298 wp_enqueue_script ("media-upload");
299 wp_enqueue_script ("jquery-ui-core");
300 wp_enqueue_script ("jquery-sprintf", $GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["dir_url"] . "/includes/jquery/jquery.sprintf/jquery.sprintf-min.js", array ("jquery"), c_ws_plugin__s2member_utilities::ver_checksum ());
301 wp_enqueue_script ("jquery-json-ps", $GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["dir_url"] . "/includes/jquery/jquery.json-ps/jquery.json-ps-min.js", array ("jquery"), c_ws_plugin__s2member_utilities::ver_checksum ());
302 wp_enqueue_script ("jquery-ui-effects", $GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["dir_url"] . "/includes/jquery/jquery.ui-effects/jquery.ui-effects-min.js", array ("jquery", "jquery-ui-core"), c_ws_plugin__s2member_utilities::ver_checksum ());
303 wp_enqueue_script ("ws-plugin--s2member-menu-pages", site_url ("/?ws_plugin__s2member_menu_pages_js=" . urlencode (mt_rand ())), array ("jquery", "thickbox", "media-upload", "jquery-sprintf", "jquery-json-ps", "jquery-ui-core", "jquery-ui-effects", "password-strength-meter"), c_ws_plugin__s2member_utilities::ver_checksum ());
304 /**/
305 do_action ("ws_plugin__s2member_during_add_admin_scripts", get_defined_vars ());
306 }
307 /**/
308 do_action ("ws_plugin__s2member_after_add_admin_scripts", get_defined_vars ());
309 /**/
310 return; /* Return for uniformity. */
311 }
312 /**
313 * Enqueue styles for administrative menu pages.
314 *
315 * @package s2Member\Menu_Pages
316 * @since 3.5
317 *
318 * @attaches-to: ``add_action("admin_print_styles");``
319 *
320 * @return null
321 */
322 public static function add_admin_styles ()
323 {
324 do_action ("ws_plugin__s2member_before_add_admin_styles", get_defined_vars ());
325 /**/
326 if (!empty ($_GET["page"]) && preg_match ("/ws-plugin--s2member-/", $_GET["page"]))
327 {
328 wp_enqueue_style ("thickbox");
329 wp_enqueue_style ("ws-plugin--s2member-menu-pages", site_url ("/?ws_plugin__s2member_menu_pages_css=" . urlencode (mt_rand ())), array ("thickbox"), c_ws_plugin__s2member_utilities::ver_checksum (), "all");
330 /**/
331 do_action ("ws_plugin__s2member_during_add_admin_styles", get_defined_vars ());
332 }
333 /**/
334 do_action ("ws_plugin__s2member_after_add_admin_styles", get_defined_vars ());
335 /**/
336 return; /* Return for uniformity. */
337 }
338 /**
339 * Builds and handles the Quick Start page.
340 *
341 * @package s2Member\Menu_Pages
342 * @since 3.5
343 *
344 * @return null
345 */
346 public static function start_page ()
347 {
348 do_action ("ws_plugin__s2member_before_start_page", get_defined_vars ());
349 /**/
350 include_once dirname (dirname (__FILE__)) . "/menu-pages/start.inc.php";
351 /**/
352 do_action ("ws_plugin__s2member_after_start_page", get_defined_vars ());
353 /**/
354 return; /* Return for uniformity. */
355 }
356 /**
357 * Builds and handles the Main Multisite Options page.
358 *
359 * @package s2Member\Menu_Pages
360 * @since 3.5
361 *
362 * @return null
363 */
364 public static function mms_ops_page ()
365 {
366 do_action ("ws_plugin__s2member_before_mms_ops_page", get_defined_vars ());
367 /**/
368 if (c_ws_plugin__s2member_menu_pages::update_all_options ())
369 c_ws_plugin__s2member_mms_patches::mms_patches (true);
370 /**/
371 include_once dirname (dirname (__FILE__)) . "/menu-pages/mms-ops.inc.php";
372 /**/
373 do_action ("ws_plugin__s2member_after_mms_ops_page", get_defined_vars ());
374 /**/
375 return; /* Return for uniformity. */
376 }
377 /**
378 * Builds and handles the General Options page.
379 *
380 * @package s2Member\Menu_Pages
381 * @since 3.5
382 *
383 * @return null
384 */
385 public static function gen_ops_page ()
386 {
387 do_action ("ws_plugin__s2member_before_gen_ops_page", get_defined_vars ());
388 /**/
389 c_ws_plugin__s2member_menu_pages::update_all_options ();
390 /**/
391 include_once dirname (dirname (__FILE__)) . "/menu-pages/gen-ops.inc.php";
392 /**/
393 do_action ("ws_plugin__s2member_after_gen_ops_page", get_defined_vars ());
394 /**/
395 return; /* Return for uniformity. */
396 }
397 /**
398 * Builds and handles the Restriction Options page.
399 *
400 * @package s2Member\Menu_Pages
401 * @since 3.5
402 *
403 * @return null
404 */
405 public static function res_ops_page ()
406 {
407 do_action ("ws_plugin__s2member_before_res_ops_page", get_defined_vars ());
408 /**/
409 c_ws_plugin__s2member_menu_pages::update_all_options ();
410 /**/
411 include_once dirname (dirname (__FILE__)) . "/menu-pages/res-ops.inc.php";
412 /**/
413 do_action ("ws_plugin__s2member_after_res_ops_page", get_defined_vars ());
414 /**/
415 return; /* Return for uniformity. */
416 }
417 /**
418 * Builds and handles the Paypal Options page.
419 *
420 * @package s2Member\Menu_Pages
421 * @since 3.5
422 *
423 * @return null
424 */
425 public static function paypal_ops_page ()
426 {
427 do_action ("ws_plugin__s2member_before_paypal_ops_page", get_defined_vars ());
428 /**/
429 c_ws_plugin__s2member_menu_pages::update_all_options ();
430 /**/
431 $logs_dir = $GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["logs_dir"];
432 /**/
433 if (!is_dir ($logs_dir) && is_writable (dirname (c_ws_plugin__s2member_utils_dirs::strip_dir_app_data ($logs_dir))))
434 mkdir ($logs_dir, 0777, true) . clearstatcache ();
435 /**/
436 $htaccess = $GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["logs_dir"] . "/.htaccess";
437 $htaccess_contents = trim (c_ws_plugin__s2member_utilities::evl (file_get_contents ($GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["logs_dir_htaccess"])));
438 /**/
439 if (is_dir ($logs_dir) && is_writable ($logs_dir) && !file_exists ($htaccess))
440 file_put_contents ($htaccess, $htaccess_contents) . clearstatcache ();
441 /**/
442 if ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["gateway_debug_logs"]) /* Logging enabled? */
443 {
444 if (!is_dir ($logs_dir)) /* If the security-enabled logs directory does not exist yet. */
445 c_ws_plugin__s2member_admin_notices::display_admin_notice ('The security-enabled logs directory ( <code>' . esc_html (c_ws_plugin__s2member_utils_dirs::doc_root_path ($logs_dir)) . '</code> ) does not exist. Please create this directory manually &amp; make it writable ( chmod 777 ).', true);
446 /**/
447 else if (!is_writable ($logs_dir)) /* If the logs directory is not writable yet. */
448 c_ws_plugin__s2member_admin_notices::display_admin_notice ('Permissions error. The security-enabled logs directory ( <code>' . esc_html (c_ws_plugin__s2member_utils_dirs::doc_root_path ($logs_dir)) . '</code> ) is not writable. Please make this directory writable ( chmod 777 ).', true);
449 /**/
450 if (!file_exists ($htaccess)) /* If the .htaccess file has not been created yet. */
451 c_ws_plugin__s2member_admin_notices::display_admin_notice ('The .htaccess protection file ( <code>' . esc_html (c_ws_plugin__s2member_utils_dirs::doc_root_path ($htaccess)) . '</code> ) does not exist. Please create this file manually. Inside your .htaccess file, add this:<br /><pre>' . esc_html ($htaccess_contents) . '</pre>', true);
452 /**/
453 else if (!preg_match ("/deny from all/i", file_get_contents ($htaccess))) /* Else if the .htaccess file does not offer the required protection. */
454 c_ws_plugin__s2member_admin_notices::display_admin_notice ('Unprotected. The .htaccess protection file ( <code>' . esc_html (c_ws_plugin__s2member_utils_dirs::doc_root_path ($htaccess)) . '</code> ) does not contain <code>deny from all</code>. Inside your .htaccess file, add this:<br /><pre>' . esc_html ($htaccess_contents) . '</pre>', true);
455 }
456 /**/
457 include_once dirname (dirname (__FILE__)) . "/menu-pages/paypal-ops.inc.php";
458 /**/
459 do_action ("ws_plugin__s2member_after_paypal_ops_page", get_defined_vars ());
460 /**/
461 return; /* Return for uniformity. */
462 }
463 /**
464 * Builds and handles the Download Options page.
465 *
466 * @package s2Member\Menu_Pages
467 * @since 3.5
468 *
469 * @return null
470 */
471 public static function down_ops_page ()
472 {
473 do_action ("ws_plugin__s2member_before_down_ops_page", get_defined_vars ());
474 /**/
475 c_ws_plugin__s2member_menu_pages::update_all_options ();
476 /**/
477 $files_dir = $GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["files_dir"];
478 /**/
479 if (!is_dir ($files_dir) && is_writable (dirname (c_ws_plugin__s2member_utils_dirs::strip_dir_app_data ($files_dir))))
480 mkdir ($files_dir, 0777, true) . clearstatcache ();
481 /**/
482 $htaccess = $GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["files_dir"] . "/.htaccess";
483 $htaccess_contents = trim (c_ws_plugin__s2member_utilities::evl (file_get_contents ($GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["files_dir_htaccess"])));
484 /**/
485 if (is_dir ($files_dir) && is_writable ($files_dir) && !file_exists ($htaccess))
486 file_put_contents ($htaccess, $htaccess_contents) . clearstatcache ();
487 /**/
488 if (!is_dir ($files_dir)) /* If the security-enabled files directory does not exist yet. */
489 c_ws_plugin__s2member_admin_notices::display_admin_notice ('The security-enabled files directory ( <code>' . esc_html (c_ws_plugin__s2member_utils_dirs::doc_root_path ($files_dir)) . '</code> ) does not exist. Please create this directory manually.', true);
490 /**/
491 if (!file_exists ($htaccess)) /* If the .htaccess file has not been created yet. */
492 c_ws_plugin__s2member_admin_notices::display_admin_notice ('The .htaccess protection file ( <code>' . esc_html (c_ws_plugin__s2member_utils_dirs::doc_root_path ($htaccess)) . '</code> ) does not exist. Please create this file manually. Inside your .htaccess file, add this:<br /><pre>' . esc_html ($htaccess_contents) . '</pre>', true);
493 /**/
494 else if (!preg_match ("/deny from all/i", file_get_contents ($htaccess))) /* Else if the .htaccess file does not offer the required protection. */
495 c_ws_plugin__s2member_admin_notices::display_admin_notice ('Unprotected. The .htaccess protection file ( <code>' . esc_html (c_ws_plugin__s2member_utils_dirs::doc_root_path ($htaccess)) . '</code> ) does not contain <code>deny from all</code>. Inside your .htaccess file, add this:<br /><pre>' . esc_html ($htaccess_contents) . '</pre>', true);
496 /**/
497 if (!empty ($_POST["ws_plugin__s2member_amazon_cf_files_auto_configure_distros"]) && ($nonce = $_POST["ws_plugin__s2member_amazon_cf_files_auto_configure_distros"]) && wp_verify_nonce ($nonce, "ws-plugin--s2member-amazon-cf-files-auto-configure-distros"))
498 /**/
499 if (($amazon_cf_auto_configure_distros = c_ws_plugin__s2member_files_in::amazon_cf_auto_configure_distros ()) && $amazon_cf_auto_configure_distros["success"]) /* CNAME instructions here too. */
500 c_ws_plugin__s2member_admin_notices::display_admin_notice ('Amazon® CloudFront Distributions auto-configured successfully. Please allow 30 minutes for propagation.' . (($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["amazon_cf_files_distro_downloads_cname"]) ? '<br /><em>Downloads Distribution CNAME: <code>' . esc_html ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["amazon_cf_files_distro_downloads_cname"]) . ' &mdash;&raquo; ' . esc_html ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["amazon_cf_files_distro_downloads_dname"]) . '</code></em>' : '') . (($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["amazon_cf_files_distro_streaming_cname"]) ? '<br /><em>Streaming Distribution CNAME: <code>' . esc_html ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["amazon_cf_files_distro_streaming_cname"]) . ' &mdash;&raquo; ' . esc_html ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["amazon_cf_files_distro_streaming_dname"]) . '</code></em>' : ''));
501 /**/
502 else /* Else there was an error. We need to report this back to the site owner so they can understand what's going on. */
503 ($GLOBALS["ws_plugin__s2member_cf_auto_configure_distros_error"] = true) . c_ws_plugin__s2member_admin_notices::display_admin_notice ('Unable to auto-configure Amazon® CloudFront Distributions.<br />Error code: <code>' . esc_html ($amazon_cf_auto_configure_distros["code"]) . '</code>. Error Message: <code>' . esc_html ($amazon_cf_auto_configure_distros["message"]) . '</code>', true);
504 /**/
505 include_once dirname (dirname (__FILE__)) . "/menu-pages/down-ops.inc.php";
506 /**/
507 do_action ("ws_plugin__s2member_after_down_ops_page", get_defined_vars ());
508 /**/
509 return; /* Return for uniformity. */
510 }
511 /**
512 * Builds and handles the API Tracking options page.
513 *
514 * @package s2Member\Menu_Pages
515 * @since 3.5
516 *
517 * @return null
518 */
519 public static function trk_ops_page ()
520 {
521 do_action ("ws_plugin__s2member_before_trk_ops_page", get_defined_vars ());
522 /**/
523 c_ws_plugin__s2member_menu_pages::update_all_options ();
524 /**/
525 include_once dirname (dirname (__FILE__)) . "/menu-pages/trk-ops.inc.php";
526 /**/
527 do_action ("ws_plugin__s2member_after_trk_ops_page", get_defined_vars ());
528 /**/
529 return; /* Return for uniformity. */
530 }
531 /**
532 * Builds and handles the API List Server options page.
533 *
534 * @package s2Member\Menu_Pages
535 * @since 3.5
536 *
537 * @return null
538 */
539 public static function els_ops_page ()
540 {
541 do_action ("ws_plugin__s2member_before_els_ops_page", get_defined_vars ());
542 /**/
543 c_ws_plugin__s2member_menu_pages::update_all_options ();
544 /**/
545 include_once dirname (dirname (__FILE__)) . "/menu-pages/els-ops.inc.php";
546 /**/
547 do_action ("ws_plugin__s2member_after_els_ops_page", get_defined_vars ());
548 /**/
549 return; /* Return for uniformity. */
550 }
551 /**
552 * Builds and handles the API Notifications page.
553 *
554 * @package s2Member\Menu_Pages
555 * @since 3.5
556 *
557 * @return null
558 */
559 public static function api_ops_page ()
560 {
561 do_action ("ws_plugin__s2member_before_api_ops_page", get_defined_vars ());
562 /**/
563 c_ws_plugin__s2member_menu_pages::update_all_options ();
564 /**/
565 include_once dirname (dirname (__FILE__)) . "/menu-pages/api-ops.inc.php";
566 /**/
567 do_action ("ws_plugin__s2member_after_api_ops_page", get_defined_vars ());
568 /**/
569 return; /* Return for uniformity. */
570 }
571 /**
572 * Builds and handles the PayPal Button Generator page.
573 *
574 * @package s2Member\Menu_Pages
575 * @since 3.5
576 *
577 * @return null
578 */
579 public static function paypal_buttons_page ()
580 {
581 do_action ("ws_plugin__s2member_before_paypal_buttons_page", get_defined_vars ());
582 /**/
583 if (!$GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["paypal_business"] || !$GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["paypal_api_username"] || !$GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["paypal_api_password"] || !$GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["paypal_api_signature"])
584 c_ws_plugin__s2member_admin_notices::display_admin_notice ('Please configure <code>s2Member -> PayPal® Options</code> first. Once all of your PayPal® Options are configured; including your Email Address, API Username, Password, and Signature; return to this page &amp; generate your PayPal® Button(s).', true);
585 /**/
586 include_once dirname (dirname (__FILE__)) . "/menu-pages/paypal-buttons.inc.php";
587 /**/
588 do_action ("ws_plugin__s2member_after_paypal_buttons_page", get_defined_vars ());
589 /**/
590 return; /* Return for uniformity. */
591 }
592 /**
593 * Builds and handles the API Scripting page.
594 *
595 * @package s2Member\Menu_Pages
596 * @since 3.5
597 *
598 * @return null
599 */
600 public static function scripting_page ()
601 {
602 do_action ("ws_plugin__s2member_before_scripting_page", get_defined_vars ());
603 /**/
604 include_once dirname (dirname (__FILE__)) . "/menu-pages/scripting.inc.php";
605 /**/
606 do_action ("ws_plugin__s2member_after_scripting_page", get_defined_vars ());
607 /**/
608 return; /* Return for uniformity. */
609 }
610 /**
611 * Builds and handles the Integrations page.
612 *
613 * @package s2Member\Menu_Pages
614 * @since 3.5
615 *
616 * @return null
617 */
618 public static function integrations_page ()
619 {
620 do_action ("ws_plugin__s2member_before_integrations_page", get_defined_vars ());
621 /**/
622 if (!empty ($_POST["ws_plugin__s2member_bridge_bbpress"]) && ($nonce = $_POST["ws_plugin__s2member_bridge_bbpress"]) && wp_verify_nonce ($nonce, "ws-plugin--s2member-bridge-bbpress") && ($_p = c_ws_plugin__s2member_utils_strings::trim_deep (stripslashes_deep ($_POST))))
623 {
624 if (!empty ($_p["ws_plugin__s2member_bridge_bbpress_plugins_dir"]) && is_dir ($plugins_dir = untrailingslashit ($_p["ws_plugin__s2member_bridge_bbpress_plugins_dir"])))
625 {
626 if (is_writable ($plugins_dir)) /* This directory MUST be writable. */
627 {
628 if (preg_match ("/^Install/i", $_p["ws_plugin__s2member_bridge_bbpress_action"]))
629 {
630 $min = (string)$_p["ws_plugin__s2member_bridge_bbpress_min_level"];
631 $ovg = (string)$_p["ws_plugin__s2member_bridge_bbpress_ovg"];
632 /**/
633 if (($file = file_get_contents (dirname (dirname (__FILE__)) . "/dropins/bridges/_s2member-bbpress-bridge.php")) && ($file = preg_replace ("/%%min%%/i", c_ws_plugin__s2member_utils_strings::esc_dq ($min), preg_replace ("/%%ovg%%/i", c_ws_plugin__s2member_utils_strings::esc_dq ($ovg), $file))) && file_put_contents ($plugins_dir . "/_s2member-bbpress-bridge.php", $file))
634 c_ws_plugin__s2member_admin_notices::display_admin_notice ('The bbPress® Bridge/plugin has been <strong>installed successfully</strong>.');
635 /**/
636 else /* Otherwise, something unexpected. The site owner will need to install the bbPress® plugin manually. */
637 c_ws_plugin__s2member_admin_notices::display_admin_notice ('Unknown error. Please try again, or install manually.', true);
638 }
639 /**/
640 else if (preg_match ("/^Un-Install/i", $_p["ws_plugin__s2member_bridge_bbpress_action"]))
641 {
642 if (file_exists ($plugins_dir . "/_s2member-bbpress-bridge.php"))
643 {
644 if (!unlink ($plugins_dir . "/_s2member-bbpress-bridge.php")) /* Test return value of unlink. */
645 c_ws_plugin__s2member_admin_notices::display_admin_notice ('Unknown error. Please try again, or un-install manually.', true);
646 /**/
647 else /* Otherwise, everything looks good. The plugin file has been removed successfully. */
648 c_ws_plugin__s2member_admin_notices::display_admin_notice ('The bbPress® Bridge/plugin has been successfully <strong>uninstalled</strong>.');
649 }
650 else
651 c_ws_plugin__s2member_admin_notices::display_admin_notice ('The bbPress® Bridge/plugin is already un-installed.', true);
652 }
653 }
654 else
655 c_ws_plugin__s2member_admin_notices::display_admin_notice ('The directory you specified is NOT writable. Please try again, or install manually.', true);
656 }
657 else
658 c_ws_plugin__s2member_admin_notices::display_admin_notice ('The directory you specified does NOT exist. Please try again, or install manually.', true);
659 }
660 /**/
661 include_once dirname (dirname (__FILE__)) . "/menu-pages/integrations.inc.php";
662 /**/
663 do_action ("ws_plugin__s2member_after_integrations_page", get_defined_vars ());
664 /**/
665 return; /* Return for uniformity. */
666 }
667 /**
668 * Builds and handles the s2Member Info page.
669 *
670 * @package s2Member\Menu_Pages
671 * @since 3.5
672 *
673 * @return null
674 */
675 public static function info_page ()
676 {
677 do_action ("ws_plugin__s2member_before_info_page", get_defined_vars ());
678 /**/
679 include_once dirname (dirname (__FILE__)) . "/menu-pages/info.inc.php";
680 /**/
681 do_action ("ws_plugin__s2member_after_info_page", get_defined_vars ());
682 /**/
683 return; /* Return for uniformity. */
684 }
685 }
686 }
687 ?>