s2Member Framework (Member Roles, Capabilities, Membership, PayPal Members) - Version 3.5

Version Description

  • (s2Member/s2Member Pro). WordPress 3.1. Updated for full compatibility with WordPress 3.1 ( s2Member also remains compatible with the WordPress 3.0.x series ).
  • (s2Member/s2Member Pro). Speed Optimizations. s2Member's entire codebase has been re-organized into PHP classes containing s2Member's static functions ( dev note: all of s2Member's Hooks/Filters remain as they were ). This new infrastructure allows s2Member to take full advantage of PHP's built-in SPL Autoload extension. This means s2Member's source code is loaded ( only on-demand ) as function calls are made within core routines. So instead of loading s2Member's entire codebase into WordPress; only the objects/methods needed during the processing of particular page will be included. Long story short, this release of s2Member is much faster than previous versions. For advanced site owners, this will make it more feasible to run s2Member in concert many other plugins; even on shared hosting.
  • (s2Member). New feature. You can now force WordPress to use your Membership Labels instead of referencing them by s2Member Level #. For further details on this topic, check your Dashboard under s2Member -> General Options -> Membership Levels/Labels.
  • (s2Member). Profile Shortcode. s2Member now provides a built-in Shortcode ( [s2Member-Profile /] ) that generates an inline Profile Modification Form; which can be inserted into any Post/Page ( such as your Login Welcome Page ) or even into a Text Widget if you like. This feature is ( in addition to ) the existing /?s2member_profile=1 stand-alone version that has always been available with s2Member.
  • (s2Member). New feature. s2Member now supports Remote Header Authorization on File Downloads ( optional ). Remote Header Authorization allows access to file downloads through an entirely different approach ( again, using this is 100% optional ). Instead of asking the Member to log into your site through a browser, a Member can be prompted automatically, to log in through HTTP Header Authorization prompts; which is the same technique used in more traditional security systems via .htaccess files. In other words, Remote Header Authorization makes it possible for your Members to access files through remote applications that may NOT use a browser. This is often the case when a Member needs to access protected files through a software client like iTunes; typical with podcasts. For further details, please check your Dashboard under s2Member -> Download Options -> Remote Auth / Podcasting.
  • (s2Member). New feature. s2Member now supports a new option in its Login/Registration Design panel. If you have WordPress 3.1+ installed, you can add your own raw HTML/PHP code to the very bottom of your default Login/Registration Forms with s2Member. Please check your Dashboard under: s2Member -> General Options -> Login/Registration Design.
  • (s2Member). New feature. You can now tell s2Member to encrypt your PayPal Buttons automatically for added security. When this feature is enabled, all of your PayPal Button Shortcodes will produce encrypted PayPal Buttons. This improves security against fraudulent transactions. To turn this feature on, please log into your Dashboard and navigate to s2Member -> PayPal Options -> Account Details. You'll need to provide s2Member with your PayPal API Username/Password/Signature; and then enable Button Encryption. Additional instructions are provided in your WordPress Dashboard. NOTE: This feature does NOT require you to have a PayPal Pro account. If you do, that's fine, but it's not a requirement. Also, this particular feature is ONLY applicable to PayPal Buttons ( it does NOT work with Pro Forms, nor does it need to ).
  • (s2Member Pro). CSV Exportation. s2Member now provides two different export formats. 1. Default CSV ( for easy re-importation ). 2. Easy-Read CSV ( improved readability; CANNOT be re-imported ). In addition to these new options, ALL CSV export formats now include column headers too. This makes CSV files easier to read inside applications like MS Excel or OpenOffice/Calc.
  • (s2Member Pro). Authorize.Net. s2Member Pro now provides support for Authorize.Net integrations. Authorize.Net is a leading provider of payment gateway services, managing the submission of billions of transactions to processing networks on behalf of merchant customers. Authorize.Net is a solution offered by the CyberSource Corporation, a wholly owned subsidiary of Visa (NYSE: V).
  • (s2Member Pro). ccBill. s2Member Pro now provides support for ccBill integration. ccBill is a great choice when you need to process transactions discreetly on an adult-oriented site. Drawing on its years of experience and proven payment processing platform, ccBill has a solution that will not only meet the requirements of your consumers, it will also help address the specific needs of your business.
  • (s2Member Pro). New feature. s2Member now allows for the inclusion of the Pro Login Widget directly into a theme/plugin file ( optional ). Example usage: <?php echo s2member_pro_login_widget(); ?>. It is also possible to configure widget options dynamically. For further details, please check the documentation inside this file: /s2member-pro/includes/functions/api-functions.inc.php.
  • (s2Member/s2Member Pro). Optimization. If/when s2Member's logging/debugging mechanisms are enabled through the Dashboard, s2Member is now capable of archiving its own log files. Oversize log files ( i.e. larger than 2MB ) are automatically renamed with ...-ARCHIVED-{time}.log to prevent s2Member from creating ridiculously large log files that may have otherwise built up over a longer period of time.
  • (s2Member/s2Member Pro). New Profile field. A new drop-down menu has been added to the administration editing panel for User/Member Profiles. This new drop-down menu allows a site owner to specify which Payment Gateway a Member's payments are associated with. s2Member will automatically configure this field for you, but it is editable none the less. NOTE: If you are upgrading from a previous version of s2Member, you may notice that s2Member will NOT have this information on file for any existing Members that you obtained prior to installing s2Member v3.5+. You may want to go through and update the value of this field for each Member after upgrading. That being said, this new field is only provided for clarity; and for future compatibility. In other words, there is no functionality lost if the Payment Gateway field is left blank for previously existing Members.
  • (s2Member). New feature. s2Member now supports a new Replacement Code for Login Redirection URLs, and also for URI Restrictions ( %%current_user_ccaps%% ). This is the current User's set of Custom Capabilities. If the current User has multiple Custom Capabilities, they will be separated by hyphens; allowing this string to be used in the formulation of slugs for a Special Login Redirection URL; which could be configured differently for each Custom Capability Package that you offer.
  • (s2Member). New feature. s2Member can now automate un-subscribe/opt-out removals for any List Servers that you've integrated ( i.e. MailChimp, AWeber ). s2Member is also capable of handling everything based on your own personal configuration preferences. You can choose which Events you consider grounds for List Removal. For further details, please check your Dashboard under: s2Member -> API / List Servers -> Automate Un-Subscribes. During a paid Subscription Modification, it also possible to have Members un-subscribed from Lists at their existing Membership Level#, while at the same time; subscribing them to Lists you've configured at the Membership Level they are upgrading/downgrading to.
  • (s2Member). New feature. Brute Force IP/Login Restrictions. As with any Membership system, it is possible for someone to try and guess Username/Password combinations by attempting a Brute Force Attack; whereby multiple/repeated logins are strategically attempted with various Username/Password combinations until a correct guess is made. It is NOT likely that you'll be attacked in this way, but it's still a good idea to protect your system; just in case somebody tries this. s2Member thwarts this behavior by monitoring failed login attempts that occur within a short period of time. Whenever s2Member detects an IP address ( i.e. a remote user ) that is consistently failing to enter a valid Username/Password, a temporary ban is created; preventing additional attempts from taking place for 30 minutes. This temporary ban, will ONLY affect the offending IP address. For further details and configuration of this new feature, please check your Dashboard under: s2Member -> General Options -> Brute Force IP/Login Restrictions.
  • (s2Member Pro). New feature. The s2Member (Pro) Login Widget now includes Login/Logout Redirection options. For further details, please check your Dashboard under: Appearance -> Widgets -> s2Member (Pro) Login Widget.
  • (s2Member/s2Member Pro). Compatibility. s2Member now precedes all of its calls to these two functions with an @ sign ( @ini_get and @ini_set ). This suppresses errors generated by PHP whenever these functions are disabled on the installation server. This is a very minor issue, as most hosting companies DO allow these functions to be called through PHP. At any rate, the preceding @ sign now puts s2Member inline with WordPress standards in this regard.
  • (s2Member). WP 3.1 Compatibility. When "Redirect Members away from the Default Profile Panel?" is set to ( Yes ), s2Member will take an initiative to further safeguard ALL /wp-admin/ areas of your installation; not just the Default Profile Panel. Also, starting with WordPress 3.1+, setting this to ( Yes ) tells s2Member to dynamically modify links/titles in the new Admin Bar that can be enabled on WordPress 3.1+. s2Member will force links to your Login Welcome Page instead of the Default Profile Panel; and Dashboard links are removed for non-Admin accounts ( as they should be ).
  • (s2Member). New feature. It is now possible to delete/reset IP Restrictions ( i.e. temporary bans ) caused by a security breach in your configuration of s2Member's IP Restrictions. Some site owners have reported complaints from their Customers about the error 503 / Too Many IP Addresses. This is not a bug; it is the result of a temporary ban that s2Member imposes automatically; based on your IP Restriction configuration in the General Options panel for s2Member. Improving upon this functionality in s2Member v3.5+, you can now pull up a Users account in your Dashboard and delete/reset temporary bans on a per-User basis; as needed for customer service. For further details, or to delete/reset ALL IP Restrictions at once, please check your Dashboard under: s2Member -> General Options -> IP Restrictions.
  • (s2Member). Multisite bug fix. When s2Member is installed on a Multisite Network, it is now capable of dealing with centralized Users accounts that are being shared across multiple sites in the Network. In other words, s2Member v3.5+ prevents WordPress from generating username/email exists errors through front-end forms whenever a User that exists on one site attempts to register on another. In order to accomplish this, s2Member v3.5 introduces one additional Multisite patch for your /wp-includes/ms-functions.php file, making it possible for WordPress to add/remove existing User accounts from one site to another (gracefully); just like that which is supported natively in the WordPress Dashboard already. NOTE: after updating to s2Member v3.5+, please be sure to re-run your Multisite (Config) patches. You will find these patches in your Dashboard under: s2Member -> Multisite (Config). And yes, this is also compatible with WordPress v3.1.
  • (s2Member). Multisite auto-patcher. When running on a Multisite Network with `Automatically Patch WordPress
Download this release

Release Info

Developer PriMoThemes
Plugin Icon 128x128 s2Member Framework (Member Roles, Capabilities, Membership, PayPal Members)
Version 3.5
Comparing to
See all releases

Code changes from version 3.3.2 to 3.5

Files changed (244) hide show
  1. images/promos/150x150.jpg +0 -0
  2. images/promos/300x225.jpg +0 -0
  3. images/promos/590x300.jpg +0 -0
  4. images/promos/80x80.jpg +0 -0
  5. images/promos/900x285.jpg +0 -0
  6. images/promos/900x385.jpg +0 -0
  7. images/promos/shots/00_preview-590x300.jpg +0 -0
  8. images/promos/shots/00_preview-900x285.jpg +0 -0
  9. images/promos/shots/00_preview-900x385.jpg +0 -0
  10. images/promos/shots/01_screenshot-1200x.jpg +0 -0
  11. images/promos/shots/02_screenshot-1200x.jpg +0 -0
  12. images/promos/shots/03_screenshot-1200x.jpg +0 -0
  13. images/promos/shots/04_screenshot-1200x.jpg +0 -0
  14. images/promos/shots/05_screenshot-1200x.jpg +0 -0
  15. images/promos/shots/06_screenshot-1200x.jpg +0 -0
  16. images/promos/shots/07_screenshot-1200x.jpg +0 -0
  17. images/promos/shots/08_screenshot-1200x.jpg +0 -0
  18. images/promos/shots/09_screenshot-1200x.jpg +0 -0
  19. images/promos/shots/10_screenshot-1200x.jpg +0 -0
  20. images/promos/shots/11_screenshot-1200x.jpg +0 -0
  21. images/promos/shots/12_screenshot-1200x.jpg +0 -0
  22. images/promos/shots/13_screenshot-1200x.jpg +0 -0
  23. images/promos/shots/14_screenshot-1200x.jpg +0 -0
  24. images/promos/shots/15_screenshot-1200x.jpg +0 -0
  25. images/promos/shots/16_screenshot-1200x.jpg +0 -0
  26. images/promos/shots/17_screenshot-1200x.jpg +0 -0
  27. images/promos/shots/18_screenshot-1200x.jpg +0 -0
  28. images/promos/shots/19_screenshot-1200x.jpg +0 -0
  29. images/promos/shots/20_screenshot-1200x.jpg +0 -0
  30. images/promos/shots/21_screenshot-1200x.jpg +0 -0
  31. images/promos/shots/22_screenshot-1200x.jpg +0 -0
  32. images/promos/shots/23_screenshot-1200x.jpg +0 -0
  33. images/promos/shots/24_screenshot-1200x.jpg +0 -0
  34. images/promos/shots/25_screenshot-1200x.jpg +0 -0
  35. images/promos/shots/26_screenshot-1200x.jpg +0 -0
  36. images/promos/shots/27_screenshot-1200x.jpg +0 -0
  37. images/promos/shots/index.php +0 -0
  38. images/small-icon.png +0 -0
  39. includes/classes/admin-css-js.inc.php +89 -0
  40. includes/classes/admin-lockouts.inc.php +92 -0
  41. includes/classes/admin-notices.inc.php +138 -0
  42. includes/classes/auto-eots.inc.php +258 -0
  43. includes/classes/brute-force.inc.php +77 -0
  44. includes/classes/catgs-sp.inc.php +86 -0
  45. includes/classes/catgs.inc.php +100 -0
  46. includes/classes/check-activation.inc.php +48 -0
  47. includes/classes/constants.inc.php +197 -0
  48. includes/classes/cron-jobs.inc.php +62 -0
  49. includes/classes/css-js.inc.php +205 -0
  50. includes/classes/custom-reg-fields.inc.php +445 -0
  51. includes/classes/email-configs.inc.php +105 -0
  52. includes/classes/files-in.inc.php +211 -0
  53. includes/classes/files.inc.php +160 -0
  54. {images/promos → includes/classes}/index.php +0 -0
  55. includes/classes/installation.inc.php +328 -0
  56. includes/classes/ip-restrictions.inc.php +175 -0
  57. includes/classes/labels.inc.php +57 -0
  58. includes/classes/list-servers.inc.php +165 -0
  59. includes/classes/login-customizations.inc.php +137 -0
  60. includes/classes/login-redirects.inc.php +135 -0
  61. includes/classes/menu-pages.inc.php +554 -0
  62. includes/classes/meta-box-saves.inc.php +148 -0
  63. includes/classes/meta-box-security.inc.php +113 -0
  64. includes/classes/meta-boxes.inc.php +39 -0
  65. includes/classes/misc-redirects.inc.php +50 -0
  66. includes/classes/mms-patches.inc.php +128 -0
  67. includes/classes/nocache.inc.php +123 -0
  68. includes/classes/op-notices.inc.php +123 -0
  69. includes/classes/option-forces.inc.php +194 -0
  70. includes/classes/pages-sp.inc.php +107 -0
  71. includes/classes/pages.inc.php +133 -0
  72. includes/classes/paypal-notify-in.inc.php +1775 -0
  73. includes/classes/paypal-notify.inc.php +44 -0
  74. includes/classes/paypal-return-in.inc.php +518 -0
  75. includes/{functions → classes}/paypal-return.inc.php +12 -11
  76. includes/classes/paypal-utilities.inc.php +378 -0
  77. includes/classes/posts-sp.inc.php +110 -0
  78. includes/classes/posts.inc.php +138 -0
  79. includes/classes/profile-mods-in.inc.php +112 -0
  80. includes/classes/profile-mods.inc.php +34 -0
  81. includes/classes/profile.inc.php +42 -0
  82. includes/classes/ptags-sp.inc.php +104 -0
  83. includes/classes/ptags.inc.php +91 -0
  84. includes/classes/querys.inc.php +232 -0
  85. includes/classes/readmes.inc.php +190 -0
  86. includes/classes/register-access.inc.php +59 -0
  87. includes/classes/register-in.inc.php +69 -0
  88. includes/classes/register.inc.php +34 -0
  89. includes/classes/registration-times.inc.php +96 -0
  90. includes/classes/registrations.inc.php +839 -0
  91. includes/classes/ruris-sp.inc.php +74 -0
  92. includes/classes/ruris.inc.php +98 -0
  93. includes/classes/sc-gets-in.inc.php +62 -0
  94. includes/classes/sc-gets.inc.php +35 -0
  95. includes/classes/sc-if-conds-in.inc.php +241 -0
  96. includes/classes/sc-if-conds.inc.php +41 -0
  97. includes/classes/sc-paypal-button-e.inc.php +73 -0
  98. includes/classes/sc-paypal-button-in.inc.php +165 -0
  99. includes/classes/sc-paypal-button.inc.php +31 -0
  100. includes/classes/sc-profile-in.inc.php +270 -0
  101. includes/classes/sc-profile.inc.php +31 -0
  102. includes/classes/security.inc.php +84 -0
  103. includes/classes/sp-access.inc.php +134 -0
  104. includes/classes/ssl.inc.php +115 -0
  105. includes/classes/systematics-sp.inc.php +67 -0
  106. includes/classes/systematics.inc.php +75 -0
  107. includes/classes/tracking-codes.inc.php +104 -0
  108. includes/classes/tracking-cookies.inc.php +61 -0
  109. includes/classes/translations.inc.php +102 -0
  110. includes/classes/user-access.inc.php +111 -0
  111. includes/classes/user-deletions.inc.php +180 -0
  112. includes/classes/user-new-in.inc.php +249 -0
  113. includes/classes/user-new.inc.php +45 -0
  114. includes/classes/user-notes.inc.php +73 -0
  115. includes/classes/user-securities.inc.php +87 -0
  116. includes/classes/users-list-in.inc.php +469 -0
  117. includes/classes/users-list.inc.php +230 -0
  118. includes/classes/utilities.inc.php +62 -0
  119. includes/classes/utils-arrays.inc.php +78 -0
  120. includes/classes/utils-captchas.inc.php +44 -0
  121. includes/classes/utils-conds.inc.php +76 -0
  122. includes/classes/utils-css.inc.php +60 -0
  123. includes/classes/utils-dirs.inc.php +44 -0
  124. includes/classes/utils-encryption.inc.php +129 -0
  125. includes/classes/utils-forms.inc.php +78 -0
  126. includes/classes/utils-gets.inc.php +155 -0
  127. includes/classes/utils-logs.inc.php +77 -0
  128. includes/classes/utils-strings.inc.php +103 -0
  129. includes/classes/utils-time.inc.php +256 -0
  130. includes/classes/utils-urls.inc.php +86 -0
  131. includes/classes/utils-users.inc.php +187 -0
  132. includes/codes.inc.php +8 -6
  133. includes/funcs.inc.php +6 -5
  134. includes/functions/activate-deactivate.inc.php +0 -337
  135. includes/functions/admin-lockout.inc.php +0 -43
  136. includes/functions/admin-notices.inc.php +0 -117
  137. includes/functions/api-functions.inc.php +28 -28
  138. includes/functions/auto-eots.inc.php +0 -259
  139. includes/functions/catg-level-access.inc.php +0 -162
  140. includes/functions/class-autoloader.inc.php +58 -0
  141. includes/functions/config-user-registration.inc.php +0 -654
  142. includes/functions/constants.inc.php +0 -187
  143. includes/functions/css-js-w-globals.inc.php +0 -208
  144. includes/functions/custom-reg-fields.inc.php +0 -453
  145. includes/functions/demo-users.inc.php +0 -39
  146. includes/functions/deprecated.inc.php +30 -0
  147. includes/functions/email-configs.inc.php +0 -116
  148. includes/functions/extend-cron.inc.php +0 -33
  149. includes/functions/file-download-access.inc.php +0 -311
  150. includes/functions/force-options.inc.php +0 -271
  151. includes/functions/force-ssl.inc.php +0 -111
  152. includes/functions/ip-restrictions.inc.php +0 -129
  153. includes/functions/is-systematic.inc.php +0 -118
  154. includes/functions/list-servers.inc.php +0 -82
  155. includes/functions/login-customizations.inc.php +0 -116
  156. includes/functions/login-redirection.inc.php +0 -124
  157. includes/functions/membership-options.inc.php +0 -46
  158. includes/functions/menu-pages.inc.php +0 -655
  159. includes/functions/meta-boxes.inc.php +0 -257
  160. includes/functions/ms-meta-caps.inc.php +0 -62
  161. includes/functions/nocache.inc.php +0 -118
  162. includes/functions/page-level-access.inc.php +0 -216
  163. includes/functions/passwords.inc.php +0 -47
  164. includes/functions/paypal-button.inc.php +0 -159
  165. includes/functions/paypal-notify.inc.php +0 -42
  166. includes/functions/paypal-utilities.inc.php +0 -633
  167. includes/functions/post-level-access.inc.php +0 -224
  168. includes/functions/profile-modifications.inc.php +0 -120
  169. includes/functions/ptag-level-access.inc.php +0 -171
  170. includes/functions/query-level-access.inc.php +0 -233
  171. includes/functions/readme-parsing.inc.php +0 -192
  172. includes/functions/register-access.inc.php +0 -89
  173. includes/functions/registration-times.inc.php +0 -66
  174. includes/functions/ruri-level-access.inc.php +0 -149
  175. includes/functions/sc-get-details.inc.php +0 -58
  176. includes/functions/sc-if-conditionals.inc.php +0 -237
  177. includes/functions/security-gate.inc.php +0 -83
  178. includes/functions/separates/paypal-notify.inc.php +0 -1693
  179. includes/functions/separates/paypal-return.inc.php +0 -462
  180. includes/functions/sp-access.inc.php +0 -139
  181. includes/functions/tracking-codes.inc.php +0 -148
  182. includes/functions/translations.inc.php +0 -98
  183. includes/functions/user-access-level.inc.php +0 -67
  184. includes/functions/user-access-role.inc.php +0 -36
  185. includes/functions/user-deletions.inc.php +0 -171
  186. includes/functions/user-new.inc.php +0 -249
  187. includes/functions/user-notes.inc.php +0 -72
  188. includes/functions/users-list.inc.php +0 -589
  189. includes/functions/utilities.inc.php +0 -751
  190. includes/hooks.inc.php +115 -90
  191. includes/mailchimp/nc-mcapi.inc.php +2 -2
  192. includes/menu-pages/api-ops.inc.php +110 -22
  193. includes/menu-pages/bridges.inc.php +6 -6
  194. includes/menu-pages/code-samples/api-mop-vars.php +89 -0
  195. includes/menu-pages/code-samples/current-user-access-label.php +1 -1
  196. includes/menu-pages/code-samples/current-user-downloads-allowed.php +1 -1
  197. includes/menu-pages/code-samples/current-user-fields.php +1 -0
  198. includes/menu-pages/code-samples/current-user-paid-registration-days-dripping.php +8 -14
  199. includes/menu-pages/code-samples/current-user-paid-registration-days.php +8 -14
  200. includes/menu-pages/code-samples/current-user-profile-modification-page-url-2-ops.php +1 -5
  201. includes/menu-pages/code-samples/current-user-profile-modification-page-url-2.php +3 -5
  202. includes/menu-pages/code-samples/current-user-profile-modification-page-url-3.php +2 -1
  203. includes/menu-pages/code-samples/current-user-registration-days.php +8 -14
  204. includes/menu-pages/code-samples/current-user-subscr-gateway.php +8 -0
  205. includes/menu-pages/code-samples/idev-signup-tracking-code.php +3 -4
  206. includes/menu-pages/code-samples/idev-sp-tracking-code.php +4 -5
  207. includes/menu-pages/code-samples/mms-patch-ms-functions.php +3 -0
  208. includes/menu-pages/code-samples/paypal-api-endpoint.php +7 -0
  209. includes/menu-pages/code-samples/paypal-api-password.php +7 -0
  210. includes/menu-pages/code-samples/paypal-api-signature.php +7 -0
  211. includes/menu-pages/code-samples/paypal-api-username.php +7 -0
  212. includes/menu-pages/code-samples/paypal-endpoint.php +1 -1
  213. includes/menu-pages/code-samples/sas-signup-tracking-code.php +3 -4
  214. includes/menu-pages/code-samples/sas-sp-tracking-code.php +3 -4
  215. includes/menu-pages/code-samples/sc-current-user-can-full-access-farm.php +7 -0
  216. includes/menu-pages/code-samples/sc-current-user-is-specific-content-farm.php +23 -0
  217. includes/menu-pages/code-samples/sc-is-user-logged-in-farm.php +8 -0
  218. includes/menu-pages/code-samples/sc-s2-conditional-supplements-1-farm.php +29 -0
  219. includes/menu-pages/code-samples/sc-s2-conditional-supplements-1.php +3 -3
  220. includes/menu-pages/code-samples/sc-s2-conditional-supplements-2-farm.php +29 -0
  221. includes/menu-pages/code-samples/sc-s2-conditional-supplements-2.php +3 -4
  222. includes/menu-pages/code-samples/sc-s2-conditional-supplements-3-farm.php +36 -0
  223. includes/menu-pages/down-ops.inc.php +35 -21
  224. includes/menu-pages/els-ops.inc.php +64 -20
  225. includes/menu-pages/info.inc.php +9 -9
  226. includes/menu-pages/menu-pages-s-min.js +1 -1
  227. includes/menu-pages/menu-pages-s.js +76 -26
  228. includes/menu-pages/menu-pages.css +13 -13
  229. includes/menu-pages/mms-options.inc.php +57 -36
  230. includes/menu-pages/options.inc.php +207 -83
  231. includes/menu-pages/paypal-buttons.inc.php +152 -123
  232. includes/menu-pages/paypal-ops.inc.php +119 -32
  233. includes/menu-pages/scripting.inc.php +783 -420
  234. includes/menu-pages/start.inc.php +30 -14
  235. includes/menu-pages/trk-ops.inc.php +43 -21
  236. includes/profile.inc.php +6 -9
  237. includes/s2member-min.js +1 -1
  238. includes/s2member.css +19 -5
  239. includes/s2member.js +8 -8
  240. includes/syscon.inc.php +60 -70
  241. includes/templates/buttons/paypal-checkout-button.html +1 -1
  242. includes/templates/shortcodes/paypal-checkout-button-shortcode.html +1 -1
  243. readme.txt +94 -415
  244. s2member.php +10 -9
images/promos/150x150.jpg DELETED
Binary file
images/promos/300x225.jpg DELETED
Binary file
images/promos/590x300.jpg DELETED
Binary file
images/promos/80x80.jpg DELETED
Binary file
images/promos/900x285.jpg DELETED
Binary file
images/promos/900x385.jpg DELETED
Binary file
images/promos/shots/00_preview-590x300.jpg DELETED
Binary file
images/promos/shots/00_preview-900x285.jpg DELETED
Binary file
images/promos/shots/00_preview-900x385.jpg DELETED
Binary file
images/promos/shots/01_screenshot-1200x.jpg DELETED
Binary file
images/promos/shots/02_screenshot-1200x.jpg DELETED
Binary file
images/promos/shots/03_screenshot-1200x.jpg DELETED
Binary file
images/promos/shots/04_screenshot-1200x.jpg DELETED
Binary file
images/promos/shots/05_screenshot-1200x.jpg DELETED
Binary file
images/promos/shots/06_screenshot-1200x.jpg DELETED
Binary file
images/promos/shots/07_screenshot-1200x.jpg DELETED
Binary file
images/promos/shots/08_screenshot-1200x.jpg DELETED
Binary file
images/promos/shots/09_screenshot-1200x.jpg DELETED
Binary file
images/promos/shots/10_screenshot-1200x.jpg DELETED
Binary file
images/promos/shots/11_screenshot-1200x.jpg DELETED
Binary file
images/promos/shots/12_screenshot-1200x.jpg DELETED
Binary file
images/promos/shots/13_screenshot-1200x.jpg DELETED
Binary file
images/promos/shots/14_screenshot-1200x.jpg DELETED
Binary file
images/promos/shots/15_screenshot-1200x.jpg DELETED
Binary file
images/promos/shots/16_screenshot-1200x.jpg DELETED
Binary file
images/promos/shots/17_screenshot-1200x.jpg DELETED
Binary file
images/promos/shots/18_screenshot-1200x.jpg DELETED
Binary file
images/promos/shots/19_screenshot-1200x.jpg DELETED
Binary file
images/promos/shots/20_screenshot-1200x.jpg DELETED
Binary file
images/promos/shots/21_screenshot-1200x.jpg DELETED
Binary file
images/promos/shots/22_screenshot-1200x.jpg DELETED
Binary file
images/promos/shots/23_screenshot-1200x.jpg DELETED
Binary file
images/promos/shots/24_screenshot-1200x.jpg DELETED
Binary file
images/promos/shots/25_screenshot-1200x.jpg DELETED
Binary file
images/promos/shots/26_screenshot-1200x.jpg DELETED
Binary file
images/promos/shots/27_screenshot-1200x.jpg DELETED
Binary file
images/promos/shots/index.php DELETED
File without changes
images/small-icon.png ADDED
Binary file
includes/classes/admin-css-js.inc.php ADDED
@@ -0,0 +1,89 @@
1
+ <?php
2
+ /*
3
+ Copyright: © 2009 WebSharks, Inc. ( coded in the USA )
4
+ <mailto:support@websharks-inc.com> <http://www.websharks-inc.com/>
5
+
6
+ Released under the terms of the GNU General Public License.
7
+ You should have received a copy of the GNU General Public License,
8
+ along with this software. In the main directory, see: /licensing/
9
+ If not, see: <http://www.gnu.org/licenses/>.
10
+ */
11
+ /*
12
+ Direct access denial.
13
+ */
14
+ if (realpath (__FILE__) === realpath ($_SERVER["SCRIPT_FILENAME"]))
15
+ exit ("Do not access this file directly.");
16
+ /**/
17
+ if (!class_exists ("c_ws_plugin__s2member_admin_css_js"))
18
+ {
19
+ class c_ws_plugin__s2member_admin_css_js
20
+ {
21
+ /*
22
+ Function that outputs the CSS for menu pages.
23
+ Attach to: add_action("init");
24
+ */
25
+ public static function menu_pages_css ()
26
+ {
27
+ do_action ("ws_plugin__s2member_before_menu_pages_css", get_defined_vars ());
28
+ /**/
29
+ if ($_GET["ws_plugin__s2member_menu_pages_css"] && is_user_logged_in () && current_user_can ("create_users"))
30
+ {
31
+ header ("Content-Type: text/css; charset=utf-8");
32
+ header ("Expires: " . gmdate ("D, d M Y H:i:s", strtotime ("-1 week")) . " GMT");
33
+ header ("Last-Modified: " . gmdate ("D, d M Y H:i:s") . " GMT");
34
+ header ("Cache-Control: no-cache, must-revalidate, max-age=0");
35
+ header ("Pragma: no-cache");
36
+ /**/
37
+ $u = $GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["dir_url"];
38
+ $i = $GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["dir_url"] . "/images";
39
+ /**/
40
+ ob_start ("c_ws_plugin__s2member_utils_css::compress_css"); /* Compress. */
41
+ /**/
42
+ include_once dirname (dirname (__FILE__)) . "/menu-pages/menu-pages.css";
43
+ /**/
44
+ echo "\n"; /* Add a line break before inclusion of this file. */
45
+ /**/
46
+ @include_once dirname (dirname (__FILE__)) . "/menu-pages/menu-pages-s.css";
47
+ /**/
48
+ do_action ("ws_plugin__s2member_during_menu_pages_css", get_defined_vars ());
49
+ /**/
50
+ exit ();
51
+ }
52
+ /**/
53
+ do_action ("ws_plugin__s2member_after_menu_pages_css", get_defined_vars ());
54
+ }
55
+ /*
56
+ Function that outputs the JS for menu pages.
57
+ Attach to: add_action("init");
58
+ */
59
+ public static function menu_pages_js ()
60
+ {
61
+ do_action ("ws_plugin__s2member_before_menu_pages_js", get_defined_vars ());
62
+ /**/
63
+ if ($_GET["ws_plugin__s2member_menu_pages_js"] && is_user_logged_in () && current_user_can ("create_users"))
64
+ {
65
+ header ("Content-Type: text/javascript; charset=utf-8");
66
+ header ("Expires: " . gmdate ("D, d M Y H:i:s", strtotime ("-1 week")) . " GMT");
67
+ header ("Last-Modified: " . gmdate ("D, d M Y H:i:s") . " GMT");
68
+ header ("Cache-Control: no-cache, must-revalidate, max-age=0");
69
+ header ("Pragma: no-cache");
70
+ /**/
71
+ $u = $GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["dir_url"];
72
+ $i = $GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["dir_url"] . "/images";
73
+ /**/
74
+ include_once dirname (dirname (__FILE__)) . "/menu-pages/menu-pages-min.js";
75
+ /**/
76
+ echo "\n"; /* Add a line break before inclusion of this file. */
77
+ /**/
78
+ @include_once dirname (dirname (__FILE__)) . "/menu-pages/menu-pages-s-min.js";
79
+ /**/
80
+ do_action ("ws_plugin__s2member_during_menu_pages_js", get_defined_vars ());
81
+ /**/
82
+ exit ();
83
+ }
84
+ /**/
85
+ do_action ("ws_plugin__s2member_after_menu_pages_js", get_defined_vars ());
86
+ }
87
+ }
88
+ }
89
+ ?>
includes/classes/admin-lockouts.inc.php ADDED
@@ -0,0 +1,92 @@
1
+ <?php
2
+ /*
3
+ Copyright: © 2009 WebSharks, Inc. ( coded in the USA )
4
+ <mailto:support@websharks-inc.com> <http://www.websharks-inc.com/>
5
+
6
+ Released under the terms of the GNU General Public License.
7
+ You should have received a copy of the GNU General Public License,
8
+ along with this software. In the main directory, see: /licensing/
9
+ If not, see: <http://www.gnu.org/licenses/>.
10
+ */
11
+ /*
12
+ Direct access denial.
13
+ */
14
+ if (realpath (__FILE__) === realpath ($_SERVER["SCRIPT_FILENAME"]))
15
+ exit ("Do not access this file directly.");
16
+ /**/
17
+ if (!class_exists ("c_ws_plugin__s2member_admin_lockouts"))
18
+ {
19
+ class c_ws_plugin__s2member_admin_lockouts
20
+ {
21
+ /*
22
+ Function for handling admin lockouts.
23
+ Attach to: add_action("admin_init");
24
+ */
25
+ public static function admin_lockout () /* Prevents admin access. */
26
+ {
27
+ do_action ("ws_plugin__s2member_before_admin_lockouts", get_defined_vars ());
28
+ /**/
29
+ if ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["force_admin_lockouts"] && /* Now checks for special request methods too. */
30
+ (!defined ("XMLRPC_REQUEST") || !XMLRPC_REQUEST) && (!defined ("APP_REQUEST") || !APP_REQUEST) && (!defined ("DOING_AJAX") || !DOING_AJAX)/**/
31
+ && !current_user_can ("edit_posts")) /* And only if the current User is unable to edit Posts; otherwise we allow them in. */
32
+ if (apply_filters ("ws_plugin__s2member_admin_lockout", true, get_defined_vars ())) /* Give Filters a chance too. */
33
+ {
34
+ if ($special_redirection_url = c_ws_plugin__s2member_login_redirects::login_redirection_url ())
35
+ wp_redirect ($special_redirection_url); /* Special Redirection. */
36
+ /**/
37
+ else /* Else we use the Login Welcome Page configured for s2Member. */
38
+ wp_redirect (get_page_link ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["login_welcome_page"]));
39
+ /**/
40
+ exit (); /* Clean exit. */
41
+ }
42
+ /**/
43
+ do_action ("ws_plugin__s2member_after_admin_lockouts", get_defined_vars ());
44
+ /**/
45
+ return; /* Return for uniformity. */
46
+ }
47
+ /*
48
+ Function for modifying Admin Menu Bars.
49
+ Attach to: add_action("admin_bar_menu");
50
+ */
51
+ public static function filter_admin_menu_bar (&$wp_admin_bar = FALSE)
52
+ {
53
+ do_action ("ws_plugin__s2member_before_filter_admin_menu_bar", get_defined_vars ());
54
+ /**/
55
+ if ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["force_admin_lockouts"] && (!defined ("DOING_AJAX") || !DOING_AJAX) && !current_user_can ("edit_posts"))
56
+ if (is_object ($wp_admin_bar) && apply_filters ("ws_plugin__s2member_admin_lockout", true, get_defined_vars ())) /* Give Filters a chance. */
57
+ {
58
+ if ($special_redirection_url = c_ws_plugin__s2member_login_redirects::login_redirection_url ())
59
+ $lwp = $special_redirection_url; /* Use Special Redirection URL. */
60
+ /**/
61
+ else /* Else we use the Login Welcome Page configured for s2Member. */
62
+ $lwp = get_page_link ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["login_welcome_page"]);
63
+ /**/
64
+ if (isset ($wp_admin_bar->menu->{"my-account-with-avatar"}) && is_array ($wp_admin_bar->menu->{"my-account-with-avatar"}))
65
+ if ($wp_admin_bar->menu->{"my-account-with-avatar"}["href"] && is_object ($wp_admin_bar->menu->{"my-account-with-avatar"}["children"]))
66
+ {
67
+ $wp_admin_bar->menu->{"my-account-with-avatar"}["href"] = $lwp;
68
+ $wp_admin_bar->menu->{"my-account-with-avatar"}["children"]->{"edit-my-profile"}["href"] = $lwp;
69
+ unset ($wp_admin_bar->menu->{"my-account-with-avatar"}["children"]->{"dashboard"});
70
+ }
71
+ /**/
72
+ if (isset ($wp_admin_bar->menu->{"my-blogs"}) && is_array ($wp_admin_bar->menu->{"my-blogs"}))
73
+ if ($wp_admin_bar->menu->{"my-blogs"}["href"] && is_object ($wp_admin_bar->menu->{"my-blogs"}["children"]))
74
+ {
75
+ $wp_admin_bar->menu->{"my-blogs"}["href"] = "#"; /* Void this link by converting to #. */
76
+ /**/
77
+ foreach ($wp_admin_bar->menu->{"my-blogs"}["children"] as &$blog)
78
+ if (is_array ($blog) && $blog["href"] && is_object ($blog["children"]))
79
+ {
80
+ $blog["href"] = preg_replace ("/\/wp-admin/", "", $blog["href"]);
81
+ unset ($blog["children"]); /* Cause all we need is the link. */
82
+ }
83
+ }
84
+ }
85
+ /**/
86
+ do_action ("ws_plugin__s2member_after_filter_admin_menu_bar", get_defined_vars ());
87
+ /**/
88
+ return; /* Return for uniformity. */
89
+ }
90
+ }
91
+ }
92
+ ?>
includes/classes/admin-notices.inc.php ADDED
@@ -0,0 +1,138 @@
1
+ <?php
2
+ /*
3
+ Copyright: © 2009 WebSharks, Inc. ( coded in the USA )
4
+ <mailto:support@websharks-inc.com> <http://www.websharks-inc.com/>
5
+
6
+ Released under the terms of the GNU General Public License.
7
+ You should have received a copy of the GNU General Public License,
8
+ along with this software. In the main directory, see: /licensing/
9
+ If not, see: <http://www.gnu.org/licenses/>.
10
+ */
11
+ /*
12
+ Direct access denial.
13
+ */
14
+ if (realpath (__FILE__) === realpath ($_SERVER["SCRIPT_FILENAME"]))
15
+ exit ("Do not access this file directly.");
16
+ /**/
17
+ if (!class_exists ("c_ws_plugin__s2member_admin_notices"))
18
+ {
19
+ class c_ws_plugin__s2member_admin_notices
20
+ {
21
+ /*
22
+ Function that enqueues Admin Notices.
23
+ */
24
+ public static function enqueue_admin_notice ($notice = FALSE, $on_pages = FALSE, $error = FALSE, $time = FALSE, $dismiss = FALSE)
25
+ {
26
+ eval ('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$__v;');
27
+ do_action ("ws_plugin__s2member_before_enqueue_admin_notice", get_defined_vars ());
28
+ unset ($__refs, $__v); /* Unset defined __refs, __v. */
29
+ /**/
30
+ if ($notice && is_string ($notice)) /* If we have a valid string. */
31
+ {
32
+ $notices = (array)get_option ("ws_plugin__s2member_notices");
33
+ /**/
34
+ array_push ($notices, array ("notice" => $notice, "on_pages" => $on_pages, "error" => $error, "time" => $time, "dismiss" => $dismiss));
35
+ /**/
36
+ eval ('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$__v;');
37
+ do_action ("ws_plugin__s2member_during_enqueue_admin_notice", get_defined_vars ());
38
+ unset ($__refs, $__v); /* Unset defined __refs, __v. */
39
+ /**/
40
+ update_option ("ws_plugin__s2member_notices", c_ws_plugin__s2member_utils_arrays::array_unique ($notices));
41
+ }
42
+ /**/
43
+ do_action ("ws_plugin__s2member_after_enqueue_admin_notice", get_defined_vars ());
44
+ /**/
45
+ return; /* Return for uniformity. */
46
+ }
47
+ /*
48
+ Function displays an Admin Notice immediately.
49
+ */
50
+ public static function display_admin_notice ($notice = FALSE, $error = FALSE, $dismiss = FALSE)
51
+ {
52
+ eval ('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$__v;');
53
+ do_action ("ws_plugin__s2member_before_display_admin_notice", get_defined_vars ());
54
+ unset ($__refs, $__v); /* Unset defined __refs, __v. */
55
+ /**/
56
+ if ($notice && $error) /* Special format for errors. */
57
+ {
58
+ $notice .= ($dismiss) ? ' [ <a href="' . add_query_arg ("ws-plugin--s2member-dismiss-admin-notice", urlencode (md5 ($notice)), $_SERVER["REQUEST_URI"]) . '">dismiss message</a> ]' : '';
59
+ /**/
60
+ echo '<div class="error fade"><p>' . $notice . '</p></div>'; /* Displays the error message. */
61
+ }
62
+ else if ($notice) /* Otherwise, we send it as an update notice. */
63
+ {
64
+ $notice .= ($dismiss) ? ' [ <a href="' . add_query_arg ("ws-plugin--s2member-dismiss-admin-notice", urlencode (md5 ($notice)), $_SERVER["REQUEST_URI"]) . '">dismiss message</a> ]' : '';
65
+ /**/
66
+ echo '<div class="updated fade"><p>' . $notice . '</p></div>'; /* Displays info message. */
67
+ }
68
+ /**/
69
+ do_action ("ws_plugin__s2member_after_display_admin_notice", get_defined_vars ());
70
+ /**/
71
+ return; /* Return for uniformity. */
72
+ }
73
+ /*
74
+ Function that displays Admin Notices.
75
+ Attach to: add_action("admin_notices");
76
+ Attach to: add_action("user_admin_notices");
77
+ Attach to: add_action("network_admin_notices");
78
+ */
79
+ public static function admin_notices ()
80
+ {
81
+ global $pagenow; /* This holds the current page filename. */
82
+ /**/
83
+ do_action ("ws_plugin__s2member_before_admin_notices", get_defined_vars ());
84
+ /**/
85
+ if (is_admin () && is_array ($notices = get_option ("ws_plugin__s2member_notices")) && !empty ($notices))
86
+ {
87
+ $a = (c_ws_plugin__s2member_utils_conds::is_blog_admin ()) ? "blog" : $a;
88
+ $a = (c_ws_plugin__s2member_utils_conds::is_user_admin ()) ? "user" : $a;
89
+ $a = (c_ws_plugin__s2member_utils_conds::is_network_admin ()) ? "network" : $a;
90
+ $a = (!$a) ? "blog" : $a; /* Default Blog Admin. */
91
+ /**/
92
+ foreach ($notices as $i => $notice) /* Check several things about each Notice. */
93
+ foreach (( (!$notice["on_pages"]) ? array ("*"): (array)$notice["on_pages"]) as $page)
94
+ {
95
+ if (!preg_match ("/^(.+?)\:/", $page)) /* NO prefix? */
96
+ $page = "blog:" . ltrim ($page, ":"); /* `blog:` */
97
+ /**/
98
+ $adms = preg_split ("/\|/", preg_replace ("/\:(.*)#x2F;i", "", $page));
99
+ $page = preg_replace ("/^([^\:]*)\:/i", "", $page);
100
+ /**/
101
+ if (empty ($adms) || in_array ("*", $adms) || in_array ($a, $adms) || !version_compare (get_bloginfo ("version"), "3.1-RC", ">="))
102
+ if (!$page || "*" === $page || $pagenow === $page || $_GET["page"] === $page)
103
+ {
104
+ if (strtotime ("now") >= (int)$notice["time"]) /* Time to show it? */
105
+ {
106
+ eval ('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$__v;');
107
+ do_action ("ws_plugin__s2member_during_admin_notices_before_display", get_defined_vars ());
108
+ unset ($__refs, $__v); /* Unset defined __refs, __v. */
109
+ /**/
110
+ if (!$notice["dismiss"] || $_GET["ws-plugin--s2member-dismiss-admin-notice"] === md5 ($notice["notice"]))
111
+ unset ($notices[$i]); /* Clear this administrative notice now? */
112
+ /**/
113
+ if (!$notice["dismiss"] || $_GET["ws-plugin--s2member-dismiss-admin-notice"] !== md5 ($notice["notice"]))
114
+ c_ws_plugin__s2member_admin_notices::display_admin_notice ($notice["notice"], $notice["error"], $notice["dismiss"]);
115
+ /**/
116
+ do_action ("ws_plugin__s2member_during_admin_notices_after_display", get_defined_vars ());
117
+ }
118
+ /**/
119
+ continue 2; /* This Notice processed; continue to next. */
120
+ }
121
+ }
122
+ /**/
123
+ $notices = array_merge ($notices); /* Re-index array. */
124
+ /**/
125
+ eval ('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$__v;');
126
+ do_action ("ws_plugin__s2member_during_admin_notices", get_defined_vars ());
127
+ unset ($__refs, $__v); /* Unset defined __refs, __v. */
128
+ /**/
129
+ update_option ("ws_plugin__s2member_notices", $notices);
130
+ }
131
+ /**/
132
+ do_action ("ws_plugin__s2member_after_admin_notices", get_defined_vars ());
133
+ /**/
134
+ return; /* Return for uniformity. */
135
+ }
136
+ }
137
+ }
138
+ ?>
includes/classes/auto-eots.inc.php ADDED
@@ -0,0 +1,258 @@
1
+ <?php
2
+ /*
3
+ Copyright: © 2009 WebSharks, Inc. ( coded in the USA )
4
+ <mailto:support@websharks-inc.com> <http://www.websharks-inc.com/>
5
+
6
+ Released under the terms of the GNU General Public License.
7
+ You should have received a copy of the GNU General Public License,
8
+ along with this software. In the main directory, see: /licensing/
9
+ If not, see: <http://www.gnu.org/licenses/>.
10
+ */
11
+ /*
12
+ Direct access denial.
13
+ */
14
+ if (realpath (__FILE__) === realpath ($_SERVER["SCRIPT_FILENAME"]))
15
+ exit ("Do not access this file directly.");
16
+ /**/
17
+ if (!class_exists ("c_ws_plugin__s2member_auto_eots"))
18
+ {
19
+ class c_ws_plugin__s2member_auto_eots
20
+ {
21
+ /*
22
+ Adds a scheduled task for s2Member's Auto-EOT System.
23
+ */
24
+ public static function add_auto_eot_system ()
25
+ {
26
+ do_action ("ws_plugin__s2member_before_add_auto_eot_system", get_defined_vars ());
27
+ /**/
28
+ if (!c_ws_plugin__s2member_auto_eots::delete_auto_eot_system ())
29
+ {
30
+ return apply_filters ("ws_plugin__s2member_add_auto_eot_system", false, get_defined_vars ());
31
+ }
32
+ else if (function_exists ("wp_cron")) /* Otherwise, we can schedule? */
33
+ {
34
+ wp_schedule_event (time (), "every10m", "ws_plugin__s2member_auto_eot_system__schedule");
35
+ /**/
36
+ return apply_filters ("ws_plugin__s2member_add_auto_eot_system", true, get_defined_vars ());
37
+ }
38
+ else /* Otherwise, it would appear that WP-Cron is not available. */
39
+ {
40
+ return apply_filters ("ws_plugin__s2member_add_auto_eot_system", false, get_defined_vars ());
41
+ }
42
+ }
43
+ /*
44
+ Delete scheduled tasks for s2Member's Auto-EOT System.
45
+ */
46
+ public static function delete_auto_eot_system ()
47
+ {
48
+ do_action ("ws_plugin__s2member_before_delete_auto_eot_system", get_defined_vars ());
49
+ /**/
50
+ if (function_exists ("wp_cron")) /* Is `wp_cron()` even available? */
51
+ {
52
+ wp_clear_scheduled_hook ("ws_plugin__s2member_auto_eot_system__schedule"); /* Since v3.0.3. */
53
+ /**/
54
+ return apply_filters ("ws_plugin__s2member_delete_auto_eot_system", true, get_defined_vars ());
55
+ }
56
+ else /* Otherwise, it would appear that WP-Cron is not available. */
57
+ {
58
+ return apply_filters ("ws_plugin__s2member_delete_auto_eot_system", false, get_defined_vars ());
59
+ }
60
+ }
61
+ /*
62
+ Function processed by WP-Cron. This handles Auto-EOTs.
63
+
64
+ If you have a HUGE userbase, increase the max EOTs per process.
65
+ ~ But NOTE, this runs $per_process ( per Blog ) on a Multisite Network.
66
+ To increase, use: add_filter ("ws_plugin__s2member_auto_eot_system_per_process");
67
+
68
+ s2Member v3.2 ( VERY IMPORTANT ).
69
+ AND `meta_value` != ''
70
+ Because update_user_option() may NOT always delete the key.
71
+
72
+ This function makes an important Hook available: `ws_plugin__s2member_after_auto_eot_system`.
73
+ This Hook is used by some of s2Member Pro's Gateway integrations; allowing CRON processing
74
+ to run for important communications; which poll Payment Gateway APIs for possible EOTs.
75
+ */
76
+ public static function auto_eot_system ($per_process = 3)
77
+ {
78
+ global $wpdb; /* Need global DB obj. */
79
+ global $current_site, $current_blog; /* Multisite. */
80
+ /**/
81
+ include_once ABSPATH . "wp-admin/includes/admin.php";
82
+ /**/
83
+ set_time_limit (0); /* Make time for processing larger userbases. */
84
+ @ini_set ("memory_limit", "256M"); /* Acquire some additional RAM. */
85
+ /**/
86
+ eval ('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$__v;');
87
+ do_action ("ws_plugin__s2member_before_auto_eot_system", get_defined_vars ());
88
+ unset ($__refs, $__v); /* Unset defined __refs, __v. */
89
+ /**/
90
+ if ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["auto_eot_system_enabled"]) /* Enabled? */
91
+ {
92
+ $per_process = apply_filters ("ws_plugin__s2member_auto_eot_system_per_process", $per_process, get_defined_vars ());
93
+ /**/
94
+ if (is_array ($eots = $wpdb->get_results ("SELECT `user_id` AS `ID` FROM `" . $wpdb->usermeta . "` WHERE `meta_key` = '" . $wpdb->prefix . "s2member_auto_eot_time' AND `meta_value` != '' AND `meta_value` <= '" . $wpdb->escape (strtotime ("now")) . "' LIMIT " . $per_process)))
95
+ {
96
+ foreach ($eots as $eot) /* Go through the array of EOTS. We need to (demote|delete) each of them. */
97
+ {
98
+ if (($user_id = $eot->ID) && is_object ($user = new WP_User ($user_id)) && $user->ID)
99
+ {
100
+ delete_user_option ($user_id, "s2member_auto_eot_time"); /* ALWAYS delete this. */
101
+ /**/
102
+ if (!$user->has_cap ("administrator")) /* Do NOT process Administrator accounts. */
103
+ {
104
+ if ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["membership_eot_behavior"] === "demote")
105
+ {
106
+ $custom = get_user_option ("s2member_custom", $user_id);
107
+ $subscr_id = get_user_option ("s2member_subscr_id", $user_id);
108
+ $fields = get_user_option ("s2member_custom_fields", $user_id);
109
+ /**/
110
+ eval ('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$__v;');
111
+ do_action ("ws_plugin__s2member_during_auto_eot_system_during_before_demote", get_defined_vars ());
112
+ do_action ("ws_plugin__s2member_during_collective_eots", $user_id, get_defined_vars (), "auto-eot-cancellation-expiration-demotion");
113
+ unset ($__refs, $__v); /* Unset defined __refs, __v. */
114
+ /**/
115
+ $demotion_role = c_ws_plugin__s2member_option_forces::force_demotion_role ("subscriber");
116
+ $existing_role = c_ws_plugin__s2member_user_access::user_access_role ($user);
117
+ /**/
118
+ if ($existing_role !== $demotion_role) /* Only if NOT the existing Role. */
119
+ $user->set_role ($demotion_role); /* Give User the demotion Role. */
120
+ /**/
121
+ foreach ($user->allcaps as $cap => $cap_enabled)
122
+ if (preg_match ("/^access_s2member_ccap_/", $cap))
123
+ $user->remove_cap ($ccap = $cap);
124
+ /**/
125
+ delete_user_option ($user_id, "s2member_custom");
126
+ delete_user_option ($user_id, "s2member_subscr_id");
127
+ delete_user_option ($user_id, "s2member_subscr_gateway");
128
+ /**/
129
+ delete_user_option ($user_id, "s2member_ipn_signup_vars");
130
+ /**/
131
+ if (!apply_filters ("ws_plugin__s2member_preserve_paid_registration_times", true, get_defined_vars ()))
132
+ delete_user_option ($user_id, "s2member_paid_registration_times");
133
+ /**/
134
+ delete_user_option ($user_id, "s2member_last_status_scan");
135
+ delete_user_option ($user_id, "s2member_last_payment_time");
136
+ delete_user_option ($user_id, "s2member_auto_eot_time");
137
+ /**/
138
+ delete_user_option ($user_id, "s2member_file_download_access_arc");
139
+ delete_user_option ($user_id, "s2member_file_download_access_log");
140
+ /**/
141
+ c_ws_plugin__s2member_user_notes::append_user_notes ($user_id, "Demoted by s2Member: " . date ("D M j, Y g:i a T"));
142
+ /**/
143
+ if ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["eot_del_notification_urls"] && is_array ($cv = preg_split ("/\|/", $custom)))
144
+ {
145
+ foreach (preg_split ("/[\r\n\t]+/", $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["eot_del_notification_urls"]) as $url) /* Handle EOT Notifications. */
146
+ /**/
147
+ if (($url = preg_replace ("/%%cv([0-9]+)%%/ei", 'urlencode(trim($cv[$1]))', $url)) && ($url = preg_replace ("/%%subscr_id%%/i", c_ws_plugin__s2member_utils_strings::esc_ds (urlencode ($subscr_id)), $url)))
148
+ if (($url = preg_replace ("/%%user_first_name%%/i", c_ws_plugin__s2member_utils_strings::esc_ds (urlencode ($user->first_name)), $url)) && ($url = preg_replace ("/%%user_last_name%%/i", c_ws_plugin__s2member_utils_strings::esc_ds (urlencode ($user->last_name)), $url)))
149
+ if (($url = preg_replace ("/%%user_full_name%%/i", c_ws_plugin__s2member_utils_strings::esc_ds (urlencode (trim ($user->first_name . " " . $user->last_name))), $url)))
150
+ if (($url = preg_replace ("/%%user_email%%/i", c_ws_plugin__s2member_utils_strings::esc_ds (urlencode ($user->user_email)), $url)))
151
+ if (($url = preg_replace ("/%%user_login%%/i", c_ws_plugin__s2member_utils_strings::esc_ds (urlencode ($user->user_login)), $url)))
152
+ if (($url = preg_replace ("/%%user_id%%/i", c_ws_plugin__s2member_utils_strings::esc_ds (urlencode ($user_id)), $url)))
153
+ {
154
+ if (is_array ($fields) && !empty ($fields))
155
+ foreach ($fields as $var => $val) /* Custom Registration Fields. */
156
+ if (! ($url = preg_replace ("/%%" . preg_quote ($var, "/") . "%%/i", c_ws_plugin__s2member_utils_strings::esc_ds (urlencode (maybe_serialize ($val))), $url)))
157
+ break;
158
+ /**/
159
+ if (($url = trim (preg_replace ("/%%(.+?)%%/i", "", $url))))
160
+ c_ws_plugin__s2member_utils_urls::remote ($url);
161
+ }
162
+ }
163
+ /**/
164
+ if ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["eot_del_notification_recipients"] && is_array ($cv = preg_split ("/\|/", $custom)))
165
+ {
166
+ c_ws_plugin__s2member_email_configs::email_config_release (); /* Release all Filters applied to wp_mail() From: headers. */
167
+ /**/
168
+ $msg = $sbj = "( s2Member / API Notification Email ) - EOT/Deletion";
169
+ $msg .= "\n\n"; /* Spacing in the message body. */
170
+ /**/
171
+ $msg .= "subscr_id: %%subscr_id%%\n";
172
+ $msg .= "user_first_name: %%user_first_name%%\n";
173
+ $msg .= "user_last_name: %%user_last_name%%\n";
174
+ $msg .= "user_full_name: %%user_full_name%%\n";
175
+ $msg .= "user_email: %%user_email%%\n";
176
+ $msg .= "user_login: %%user_login%%\n";
177
+ $msg .= "user_id: %%user_id%%\n";
178
+ /**/
179
+ if (is_array ($fields) && !empty ($fields))
180
+ foreach ($fields as $var => $val)
181
+ $msg .= $var . ": %%" . $var . "%%\n";
182
+ /**/
183
+ $msg .= "cv0: %%cv0%%\n";
184
+ $msg .= "cv1: %%cv1%%\n";
185
+ $msg .= "cv2: %%cv2%%\n";
186
+ $msg .= "cv3: %%cv3%%\n";
187
+ $msg .= "cv4: %%cv4%%\n";
188
+ $msg .= "cv5: %%cv5%%\n";
189
+ $msg .= "cv6: %%cv6%%\n";
190
+ $msg .= "cv7: %%cv7%%\n";
191
+ $msg .= "cv8: %%cv8%%\n";
192
+ $msg .= "cv9: %%cv9%%";
193
+ /**/
194
+ if (($msg = preg_replace ("/%%cv([0-9]+)%%/ei", 'trim($cv[$1])', $msg)) && ($msg = preg_replace ("/%%subscr_id%%/i", c_ws_plugin__s2member_utils_strings::esc_ds ($subscr_id), $msg)))
195
+ if (($msg = preg_replace ("/%%user_first_name%%/i", c_ws_plugin__s2member_utils_strings::esc_ds ($user->first_name), $msg)) && ($msg = preg_replace ("/%%user_last_name%%/i", c_ws_plugin__s2member_utils_strings::esc_ds ($user->last_name), $msg)))
196
+ if (($msg = preg_replace ("/%%user_full_name%%/i", c_ws_plugin__s2member_utils_strings::esc_ds (trim ($user->first_name . " " . $user->last_name)), $msg)))
197
+ if (($msg = preg_replace ("/%%user_email%%/i", c_ws_plugin__s2member_utils_strings::esc_ds ($user->user_email), $msg)))
198
+ if (($msg = preg_replace ("/%%user_login%%/i", c_ws_plugin__s2member_utils_strings::esc_ds ($user->user_login), $msg)))
199
+ if (($msg = preg_replace ("/%%user_id%%/i", c_ws_plugin__s2member_utils_strings::esc_ds ($user_id), $msg)))
200
+ {
201
+ if (is_array ($fields) && !empty ($fields))
202
+ foreach ($fields as $var => $val) /* Custom Registration Fields. */
203
+ if (! ($msg = preg_replace ("/%%" . preg_quote ($var, "/") . "%%/i", c_ws_plugin__s2member_utils_strings::esc_ds (maybe_serialize ($val)), $msg)))
204
+ break;
205
+ /**/
206
+ if (($msg = trim (preg_replace ("/%%(.+?)%%/i", "", $msg))))
207
+ foreach (c_ws_plugin__s2member_utils_strings::trim_deep (preg_split ("/;+/", $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["eot_del_notification_recipients"])) as $recipient)
208
+ ($recipient) ? wp_mail ($recipient, apply_filters ("ws_plugin__s2member_eot_del_notification_email_sbj", $sbj, get_defined_vars ()), apply_filters ("ws_plugin__s2member_eot_del_notification_email_msg", $msg, get_defined_vars ()), "From: \"" . preg_replace ('/"/', "'", $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["reg_email_from_name"]) . "\" <" . $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["reg_email_from_email"] . ">\r\nContent-Type: text/plain; charset=utf-8") : null;
209
+ }
210
+ }
211
+ /**/
212
+ eval ('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$__v;');
213
+ do_action ("ws_plugin__s2member_during_auto_eot_system_during_demote", get_defined_vars ());
214
+ unset ($__refs, $__v); /* Unset defined __refs, __v. */
215
+ }
216
+ else if ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["membership_eot_behavior"] === "delete")
217
+ {
218
+ eval ('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$__v;');
219
+ do_action ("ws_plugin__s2member_during_auto_eot_system_during_before_delete", get_defined_vars ());
220
+ do_action ("ws_plugin__s2member_during_collective_eots", $user_id, get_defined_vars (), "auto-eot-cancellation-expiration-deletion");
221
+ unset ($__refs, $__v); /* Unset defined __refs, __v. */
222
+ /**/
223
+ if (is_multisite ()) /* Multisite does NOT actually delete; ONLY removes. */
224
+ {
225
+ remove_user_from_blog ($user_id, $current_blog->blog_id);
226
+ /* This will automatically trigger `eot_del_notification_urls` as well. */
227
+ c_ws_plugin__s2member_user_deletions::handle_ms_user_deletions ($user_id, $current_blog->blog_id, "s2says");
228
+ }
229
+ /**/
230
+ else /* Otherwise, we can actually delete them. */
231
+ /* This will automatically trigger `eot_del_notification_urls` as well. */
232
+ wp_delete_user ($user_id); /* `c_ws_plugin__s2member_user_deletions::handle_user_deletions()` */
233
+ /**/
234
+ eval ('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$__v;');
235
+ do_action ("ws_plugin__s2member_during_auto_eot_system_during_delete", get_defined_vars ());
236
+ unset ($__refs, $__v); /* Unset defined __refs, __v. */
237
+ }
238
+ /**/
239
+ eval ('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$__v;');
240
+ do_action ("ws_plugin__s2member_during_auto_eot_system", get_defined_vars ());
241
+ unset ($__refs, $__v); /* Unset defined __refs, __v. */
242
+ }
243
+ }
244
+ }
245
+ }
246
+ }
247
+ /**/
248
+ c_ws_plugin__s2member_utils_logs::cleanup_expired_s2m_transients (); /* Cleanup. */
249
+ /**/
250
+ eval ('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$__v;');
251
+ do_action ("ws_plugin__s2member_after_auto_eot_system", get_defined_vars ());
252
+ unset ($__refs, $__v); /* Unset defined __refs, __v. */
253
+ /**/
254
+ return; /* Return for uniformity. */
255
+ }
256
+ }
257
+ }
258
+ ?>
includes/classes/brute-force.inc.php ADDED
@@ -0,0 +1,77 @@
1
+ <?php
2
+ /*
3
+ Copyright: © 2009 WebSharks, Inc. ( coded in the USA )
4
+ <mailto:support@websharks-inc.com> <http://www.websharks-inc.com/>
5
+
6
+ Released under the terms of the GNU General Public License.
7
+ You should have received a copy of the GNU General Public License,
8
+ along with this software. In the main directory, see: /licensing/
9
+ If not, see: <http://www.gnu.org/licenses/>.
10
+ */
11
+ /*
12
+ Direct access denial.
13
+ */
14
+ if (realpath (__FILE__) === realpath ($_SERVER["SCRIPT_FILENAME"]))
15
+ exit ("Do not access this file directly.");
16
+ /**/
17
+ if (!class_exists ("c_ws_plugin__s2member_brute_force"))
18
+ {
19
+ class c_ws_plugin__s2member_brute_force
20
+ {
21
+ /*
22
+ This prevents an attacker from guessing Usernames/Passwords.
23
+ Allows only 5 failed login attempts every 30 minutes.
24
+ Attach to: add_action("wp_login_failed");
25
+ */
26
+ public static function track_failed_logins ($username = FALSE)
27
+ {
28
+ eval ('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$__v;');
29
+ do_action ("ws_plugin__s2member_before_track_failed_logins", get_defined_vars ());
30
+ unset ($__refs, $__v); /* Unset defined __refs, __v. */
31
+ /**/
32
+ if (($max = $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["max_failed_login_attempts"]))
33
+ {
34
+ $exp_secs = strtotime ("+" . apply_filters ("ws_plugin__s2member_track_failed_logins__exp_time", "30 minutes", get_defined_vars ())) - time ();
35
+ /* If you add Filters to this value, you should use a string that is compatible with PHP's strtotime() function. */
36
+ /**/
37
+ $transient = "s2m_ipr_" . md5 ("s2member_transient_failed_login_attempts_" . $_SERVER["REMOTE_ADDR"]);
38
+ set_transient ($transient, (int)get_transient ($transient) + 1, $exp_secs);
39
+ }
40
+ /**/
41
+ do_action ("ws_plugin__s2member_after_track_failed_logins", get_defined_vars ());
42
+ /**/
43
+ return; /* Return for uniformity. */
44
+ }
45
+ /*
46
+ This prevents an attacker from guessing Usernames/Passwords.
47
+ Allows only 5 failed login attempts every 30 minutes.
48
+ Attach to: add_filter("authenticate");
49
+ */
50
+ public static function stop_brute_force_logins ($user = FALSE)
51
+ {
52
+ eval ('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$__v;');
53
+ do_action ("ws_plugin__s2member_before_stop_brute_force_logins", get_defined_vars ());
54
+ unset ($__refs, $__v); /* Unset defined __refs, __v. */
55
+ /**/
56
+ if (($max = $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["max_failed_login_attempts"]))
57
+ {
58
+ $exp_secs = strtotime ("+" . apply_filters ("ws_plugin__s2member_track_failed_logins__exp_time", "30 minutes", get_defined_vars ())) - time ();
59
+ /* If you add Filters to this value, you should use a string that is compatible with PHP's strtotime() function. */
60
+ /**/
61
+ $about = c_ws_plugin__s2member_utils_time::approx_time_difference (time (), time () + $exp_secs);
62
+ /**/
63
+ if ((int)get_transient ("s2m_ipr_" . md5 ("s2member_transient_failed_login_attempts_" . $_SERVER["REMOTE_ADDR"])) > $max)
64
+ {
65
+ $errors = new WP_Error ("incorrect_password", "Max failed logins. Please wait " . $about . " and try again.");
66
+ /**/
67
+ eval ('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$__v;');
68
+ do_action ("ws_plugin__s2member_during_stop_brute_force_logins", get_defined_vars ());
69
+ unset ($__refs, $__v); /* Unset defined __refs, __v. */
70
+ }
71
+ }
72
+ /**/
73
+ return apply_filters ("ws_plugin__s2member_stop_brute_force_logins", (($errors) ? $errors : $user), get_defined_vars ());
74
+ }
75
+ }
76
+ }
77
+ ?>
includes/classes/catgs-sp.inc.php ADDED
@@ -0,0 +1,86 @@
1
+ <?php
2
+ /*
3
+ Copyright: © 2009 WebSharks, Inc. ( coded in the USA )
4
+ <mailto:support@websharks-inc.com> <http://www.websharks-inc.com/>
5
+
6
+ Released under the terms of the GNU General Public License.
7
+ You should have received a copy of the GNU General Public License,
8
+ along with this software. In the main directory, see: /licensing/
9
+ If not, see: <http://www.gnu.org/licenses/>.
10
+ */
11
+ /*
12
+ Direct access denial.
13
+ */
14
+ if (realpath (__FILE__) === realpath ($_SERVER["SCRIPT_FILENAME"]))
15
+ exit ("Do not access this file directly.");
16
+ /**/
17
+ if (!class_exists ("c_ws_plugin__s2member_catgs_sp"))
18
+ {
19
+ class c_ws_plugin__s2member_catgs_sp
20
+ {
21
+ /*
22
+ Function checks Category Level Access permissions- for a specific Category.
23
+
24
+ Don't call this function directly, use one of these API functions:
25
+
26
+ Is it protected by s2Member at all?
27
+ - is_category_protected_by_s2member($cat_id);
28
+ - is_protected_by_s2member($cat_id, "category");
29
+
30
+ Is the current User permitted/authorized?
31
+ - is_category_permitted_by_s2member($cat_id);
32
+ - is_permitted_by_s2member($cat_id, "category");
33
+
34
+ see: `/s2member/includes/functions/api-functions.inc.php`.
35
+ */
36
+ public static function check_specific_catg_level_access ($cat_id = FALSE, $check_user = TRUE)
37
+ {
38
+ do_action ("ws_plugin__s2member_before_check_specific_catg_level_access", get_defined_vars ());
39
+ /**/
40
+ $excluded = apply_filters ("ws_plugin__s2member_check_specific_catg_level_access_excluded", false, get_defined_vars ());
41
+ /**/
42
+ if (!$excluded && $cat_id && $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["membership_options_page"]) /* Check? */
43
+ {
44
+ $cat_link = get_category_link ($cat_id); /* Determine link to this Category. */
45
+ $cat_path = parse_url ($cat_link, PHP_URL_PATH); /* Parse req path. */
46
+ $cat_query = parse_url ($cat_link, PHP_URL_QUERY); /* Parse query. */
47
+ $cat_uri = ($cat_query) ? $cat_path . "?" . $cat_query : $cat_path;
48
+ /**/
49
+ $current_user = (is_user_logged_in ()) ? wp_get_current_user () : false; /* Get the current User's object. */
50
+ /**/
51
+ if ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["login_redirection_override"] && ($login_redirection_uri = c_ws_plugin__s2member_login_redirects::login_redirection_uri ($current_user)) && preg_match ("/^" . preg_quote ($login_redirection_uri, "/") . "#x2F;", $cat_uri) && (!$check_user || !$current_user || !current_user_can ("access_s2member_level0")))
52
+ return apply_filters ("ws_plugin__s2member_check_specific_catg_level_access", array ("s2member_level_req" => 0), get_defined_vars ());
53
+ /**/
54
+ else if (!c_ws_plugin__s2member_systematics_sp::is_systematic_use_specific_page (null, $cat_uri)) /* Never restrict Systematic Use Pages. However, there is 1 exception above ^. */
55
+ {
56
+ for ($i = 0; $i <= 4; $i++) /* Category Level restrictions. Go through each Membership Level. We also check nested Categories, using `cat_is_ancestor_of()`. */
57
+ {
58
+ if ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["level" . $i . "_catgs"] === "all" && (!$check_user || !$current_user || !current_user_can ("access_s2member_level" . $i)))
59
+ return apply_filters ("ws_plugin__s2member_check_specific_catg_level_access", array ("s2member_level_req" => $i), get_defined_vars ());
60
+ /**/
61
+ else if ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["level" . $i . "_catgs"] && in_array ($cat_id, ($catgs = preg_split ("/[\r\n\t\s;,]+/", $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["level" . $i . "_catgs"]))) && (!$check_user || !$current_user || !current_user_can ("access_s2member_level" . $i)))
62
+ return apply_filters ("ws_plugin__s2member_check_specific_catg_level_access", array ("s2member_level_req" => $i), get_defined_vars ());
63
+ /**/
64
+ else if ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["level" . $i . "_catgs"]) /* Check Category ancestry. */
65
+ foreach (preg_split ("/[\r\n\t\s;,]+/", $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["level" . $i . "_catgs"]) as $catg)
66
+ if ($catg && cat_is_ancestor_of ($catg, $cat_id) && (!$check_user || !$current_user || !current_user_can ("access_s2member_level" . $i)))
67
+ return apply_filters ("ws_plugin__s2member_check_specific_catg_level_access", array ("s2member_level_req" => $i), get_defined_vars ());
68
+ }
69
+ /**/
70
+ for ($i = 0; $i <= 4; $i++) /* URIs. Go through each Membership Level. */
71
+ {
72
+ if ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["level" . $i . "_ruris"])
73
+ foreach (preg_split ("/[\r\n\t]+/", c_ws_plugin__s2member_ruris::fill_ruri_level_access_rc_vars ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["level" . $i . "_ruris"], $current_user)) as $str)
74
+ if ($str && preg_match ("/" . preg_quote ($str, "/") . "/", $cat_uri) && (!$check_user || !$current_user || !current_user_can ("access_s2member_level" . $i)))
75
+ return apply_filters ("ws_plugin__s2member_check_specific_catg_level_access", array ("s2member_level_req" => $i), get_defined_vars ());
76
+ }
77
+ }
78
+ /**/
79
+ do_action ("ws_plugin__s2member_during_check_specific_catg_level_access", get_defined_vars ());
80
+ }
81
+ /**/
82
+ return apply_filters ("ws_plugin__s2member_check_specific_catg_level_access", null, get_defined_vars ());
83
+ }
84
+ }
85
+ }
86
+ ?>
includes/classes/catgs.inc.php ADDED
@@ -0,0 +1,100 @@
1
+ <?php
2
+ /*
3
+ Copyright: © 2009 WebSharks, Inc. ( coded in the USA )
4
+ <mailto:support@websharks-inc.com> <http://www.websharks-inc.com/>
5
+
6
+ Released under the terms of the GNU General Public License.
7
+ You should have received a copy of the GNU General Public License,
8
+ along with this software. In the main directory, see: /licensing/
9
+ If not, see: <http://www.gnu.org/licenses/>.
10
+ */
11
+ /*
12
+ Direct access denial.
13
+ */
14
+ if (realpath (__FILE__) === realpath ($_SERVER["SCRIPT_FILENAME"]))
15
+ exit ("Do not access this file directly.");
16
+ /**/
17
+ if (!class_exists ("c_ws_plugin__s2member_catgs"))
18
+ {
19
+ class c_ws_plugin__s2member_catgs
20
+ {
21
+ /*
22
+ Function for handling Category Level Access permissions.
23
+ Attach to: add_action("template_redirect");
24
+
25
+ Don't call this function directly, use one of these API functions:
26
+
27
+ Is it protected by s2Member at all?
28
+ - is_category_protected_by_s2member($cat_id);
29
+ - is_protected_by_s2member($cat_id, "category");
30
+
31
+ Is the current User permitted/authorized?
32
+ - is_category_permitted_by_s2member($cat_id);
33
+ - is_permitted_by_s2member($cat_id, "category");
34
+
35
+ see: `/s2member/includes/functions/api-functions.inc.php`.
36
+ */
37
+ public static function check_catg_level_access ()
38
+ {
39
+ global $post; /* get_the_ID() is NOT available outside The Loop. */
40
+ /**/
41
+ do_action ("ws_plugin__s2member_before_check_catg_level_access", get_defined_vars ());
42
+ /**/
43
+ $excluded = apply_filters ("ws_plugin__s2member_check_catg_level_access_excluded", false, get_defined_vars ());
44
+ /**/
45
+ if (!$excluded && is_category () && ($cat_id = get_query_var ("cat")) && $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["membership_options_page"])
46
+ {
47
+ $current_user = (is_user_logged_in ()) ? wp_get_current_user () : false; /* Get the current User's object. */
48
+ /**/
49
+ if ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["login_redirection_override"] && ($login_redirection_uri = c_ws_plugin__s2member_login_redirects::login_redirection_uri ($current_user)) && preg_match ("/^" . preg_quote ($login_redirection_uri, "/") . "#x2F;", $_SERVER["REQUEST_URI"]) && c_ws_plugin__s2member_nocache::nocache_constants (true) !== "nill" && (!$current_user || !current_user_can ("access_s2member_level0")))
50
+ {
51
+ wp_redirect (add_query_arg (urlencode_deep (array ("s2member_seeking" => "catg-" . $cat_id, "s2member_level_req" => "0")), get_page_link ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["membership_options_page"])), apply_filters ("ws_plugin__s2member_content_redirect_status", 301, get_defined_vars ()));
52
+ exit ();
53
+ }
54
+ else if (!c_ws_plugin__s2member_systematics::is_systematic_use_page ()) /* Do NOT protect Systematics. However, there is 1 exception above ^. */
55
+ {
56
+ for ($i = 0; $i <= 4; $i++) /* Category Level restrictions. Go through each Membership Level. We also check nested Categories, using `cat_is_ancestor_of()`. */
57
+ {
58
+ if ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["level" . $i . "_catgs"] === "all" && c_ws_plugin__s2member_nocache::nocache_constants (true) !== "nill" && (!$current_user || !current_user_can ("access_s2member_level" . $i)))
59
+ {
60
+ wp_redirect (add_query_arg (urlencode_deep (array ("s2member_seeking" => "catg-" . $cat_id, "s2member_level_req" => $i)), get_page_link ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["membership_options_page"])), apply_filters ("ws_plugin__s2member_content_redirect_status", 301, get_defined_vars ()));
61
+ exit ();
62
+ }
63
+ /**/
64
+ else if ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["level" . $i . "_catgs"] && in_array ($cat_id, ($catgs = preg_split ("/[\r\n\t\s;,]+/", $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["level" . $i . "_catgs"]))) && c_ws_plugin__s2member_nocache::nocache_constants (true) !== "nill" && (!$current_user || !current_user_can ("access_s2member_level" . $i)))
65
+ {
66
+ wp_redirect (add_query_arg (urlencode_deep (array ("s2member_seeking" => "catg-" . $cat_id, "s2member_level_req" => $i)), get_page_link ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["membership_options_page"])), apply_filters ("ws_plugin__s2member_content_redirect_status", 301, get_defined_vars ()));
67
+ exit ();
68
+ }
69
+ /**/
70
+ else if ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["level" . $i . "_catgs"]) /* Check Category ancestry. */
71
+ foreach (preg_split ("/[\r\n\t\s;,]+/", $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["level" . $i . "_catgs"]) as $catg)
72
+ if ($catg && cat_is_ancestor_of ($catg, $cat_id) && c_ws_plugin__s2member_nocache::nocache_constants (true) !== "nill" && (!$current_user || !current_user_can ("access_s2member_level" . $i)))
73
+ {
74
+ wp_redirect (add_query_arg (urlencode_deep (array ("s2member_seeking" => "catg-" . $cat_id, "s2member_level_req" => $i)), get_page_link ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["membership_options_page"])), apply_filters ("ws_plugin__s2member_content_redirect_status", 301, get_defined_vars ()));
75
+ exit ();
76
+ }
77
+ }
78
+ /**/
79
+ for ($i = 0; $i <= 4; $i++) /* URIs. Go through each Membership Level. */
80
+ {
81
+ if ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["level" . $i . "_ruris"])
82
+ foreach (preg_split ("/[\r\n\t]+/", c_ws_plugin__s2member_ruris::fill_ruri_level_access_rc_vars ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["level" . $i . "_ruris"], $current_user)) as $str)
83
+ if ($str && preg_match ("/" . preg_quote ($str, "/") . "/", $_SERVER["REQUEST_URI"]) && c_ws_plugin__s2member_nocache::nocache_constants (true) !== "nill" && (!$current_user || !current_user_can ("access_s2member_level" . $i)))
84
+ {
85
+ wp_redirect (add_query_arg (urlencode_deep (array ("s2member_seeking" => "catg-" . $cat_id, "s2member_level_req" => $i)), get_page_link ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["membership_options_page"])), apply_filters ("ws_plugin__s2member_content_redirect_status", 301, get_defined_vars ()));
86
+ exit ();
87
+ }
88
+ }
89
+ }
90
+ /**/
91
+ do_action ("ws_plugin__s2member_during_check_catg_level_access", get_defined_vars ());
92
+ }
93
+ /**/
94
+ do_action ("ws_plugin__s2member_after_check_catg_level_access", get_defined_vars ());
95
+ /**/
96
+ return; /* For uniformity. */
97
+ }
98
+ }
99
+ }
100
+ ?>
includes/classes/check-activation.inc.php ADDED
@@ -0,0 +1,48 @@
1
+ <?php
2
+ /*
3
+ Copyright: © 2009 WebSharks, Inc. ( coded in the USA )
4
+ <mailto:support@websharks-inc.com> <http://www.websharks-inc.com/>
5
+
6
+ Released under the terms of the GNU General Public License.
7
+ You should have received a copy of the GNU General Public License,
8
+ along with this software. In the main directory, see: /licensing/
9
+ If not, see: <http://www.gnu.org/licenses/>.
10
+ */
11
+ /*
12
+ Direct access denial.
13
+ */
14
+ if (realpath (__FILE__) === realpath ($_SERVER["SCRIPT_FILENAME"]))
15
+ exit ("Do not access this file directly.");
16
+ /**/
17
+ if (!class_exists ("c_ws_plugin__s2member_check_activation"))
18
+ {
19
+ class c_ws_plugin__s2member_check_activation
20
+ {
21
+ /*
22
+ Check existing installations that have not been re-activated.
23
+ Attach to: add_action("admin_init");
24
+ */
25
+ public static function check () /* Up-to-date? */
26
+ {
27
+ $v = get_option ("ws_plugin__s2member_activated_version");
28
+ /**/
29
+ if (!$v || !version_compare ($v, WS_PLUGIN__S2MEMBER_VERSION, ">="))
30
+ {
31
+ c_ws_plugin__s2member_installation::activate ();
32
+ }
33
+ /**/
34
+ else if (is_multisite () && is_main_site ())
35
+ {
36
+ $mms_v = get_option ("ws_plugin__s2member_activated_mms_version");
37
+ /**/
38
+ if (!$mms_v || !version_compare ($mms_v, WS_PLUGIN__S2MEMBER_VERSION, ">="))
39
+ {
40
+ c_ws_plugin__s2member_installation::activate ();
41
+ }
42
+ }
43
+ /**/
44
+ return; /* Return for uniformity. */
45
+ }
46
+ }
47
+ }
48
+ ?>
includes/classes/constants.inc.php ADDED
@@ -0,0 +1,197 @@
1
+ <?php
2
+ /*
3
+ Copyright: © 2009 WebSharks, Inc. ( coded in the USA )
4
+ <mailto:support@websharks-inc.com> <http://www.websharks-inc.com/>
5
+
6
+ Released under the terms of the GNU General Public License.
7
+ You should have received a copy of the GNU General Public License,
8
+ along with this software. In the main directory, see: /licensing/
9
+ If not, see: <http://www.gnu.org/licenses/>.
10
+ */
11
+ /*
12
+ Direct access denial.
13
+ */
14
+ if (realpath (__FILE__) === realpath ($_SERVER["SCRIPT_FILENAME"]))
15
+ exit ("Do not access this file directly.");
16
+ /**/
17
+ if (!class_exists ("c_ws_plugin__s2member_constants"))
18
+ {
19
+ class c_ws_plugin__s2member_constants
20
+ {
21
+ /*
22
+ Define several API Constants for s2Member.
23
+ Note that these are duplicated into the JavaScript API as well.
24
+ Attach to: add_action("init");
25
+ */
26
+ public static function constants ()
27
+ {
28
+ do_action ("ws_plugin__s2member_before_constants", get_defined_vars ());
29
+ /**/
30
+ $links = c_ws_plugin__s2member_constants::constant_links ();
31
+ $level = c_ws_plugin__s2member_user_access::user_access_level ();
32
+ $current_user = (is_user_logged_in ()) ? wp_get_current_user () : false;
33
+ $file_downloads = c_ws_plugin__s2member_files::user_downloads ($current_user, false, null);
34
+ $subscr_id = ($current_user) ? get_user_option ("s2member_subscr_id", $current_user->ID) : "";
35
+ $subscr_gateway = ($current_user) ? get_user_option ("s2member_subscr_gateway", $current_user->ID) : "";
36
+ $custom = ($current_user) ? get_user_option ("s2member_custom", $current_user->ID) : "";
37
+ $custom_fields = ($current_user) ? get_user_option ("s2member_custom_fields", $current_user->ID) : array ();
38
+ $paid_registration_times = ($current_user) ? get_user_option ("s2member_paid_registration_times", $current_user->ID) : array ();
39
+ $login_redirection_url = c_ws_plugin__s2member_login_redirects::login_redirection_url ($current_user);
40
+ /**/
41
+ eval ('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$__v;');
42
+ do_action ("ws_plugin__s2member_during_constants", get_defined_vars ());
43
+ unset ($__refs, $__v); /* Unset defined __refs, __v. */
44
+ /**/
45
+ define ("S2MEMBER_VERSION", ($c[] = WS_PLUGIN__S2MEMBER_VERSION)); /* Since 3.0. */
46
+ /**/
47
+ define ("S2MEMBER_CURRENT_USER_IS_LOGGED_IN", ($c[] = (($current_user) ? true : false)));
48
+ define ("S2MEMBER_CURRENT_USER_IS_LOGGED_IN_AS_MEMBER", ($c[] = ( ($current_user && $level >= 1) ? true : false)));
49
+ define ("S2MEMBER_CURRENT_USER_ACCESS_LEVEL", ($c[] = (int)$level));
50
+ define ("S2MEMBER_CURRENT_USER_ACCESS_LABEL", ($c[] = (string)$GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["level" . $level . "_label"]));
51
+ define ("S2MEMBER_CURRENT_USER_SUBSCR_ID", ($c[] = (($current_user) ? (($subscr_id) ? (string)$subscr_id : (string)$current_user->ID) : "")));
52
+ define ("S2MEMBER_CURRENT_USER_SUBSCR_GATEWAY", ($c[] = (($current_user) ? (string)$subscr_gateway : "")));
53
+ define ("S2MEMBER_CURRENT_USER_CUSTOM", ($c[] = (string)$custom));
54
+ define ("S2MEMBER_CURRENT_USER_REGISTRATION_TIME", ($c[] = ( ($current_user && $current_user->user_registered) ? (int)strtotime ($current_user->user_registered) : 0)));
55
+ define ("S2MEMBER_CURRENT_USER_PAID_REGISTRATION_TIME", ($c[] = ( ($current_user && (int)$paid_registration_times["level"]) ? (int)$paid_registration_times["level"] : 0)));
56
+ define ("S2MEMBER_CURRENT_USER_PAID_REGISTRATION_DAYS", ($c[] = ( ($current_user && (int)$paid_registration_times["level"]) ? (int)floor ((strtotime ("now") - (int)$paid_registration_times["level"]) / 86400) : 0)));
57
+ define ("S2MEMBER_CURRENT_USER_REGISTRATION_DAYS", ($c[] = ( ($current_user && $current_user->user_registered) ? (int)floor ((strtotime ("now") - strtotime ($current_user->user_registered)) / 86400) : 0)));
58
+ define ("S2MEMBER_CURRENT_USER_DISPLAY_NAME", ($c[] = (($current_user) ? (string)$current_user->display_name : "")));
59
+ define ("S2MEMBER_CURRENT_USER_FIRST_NAME", ($c[] = (($current_user) ? (string)$current_user->first_name : "")));
60
+ define ("S2MEMBER_CURRENT_USER_LAST_NAME", ($c[] = (($current_user) ? (string)$current_user->last_name : "")));
61
+ define ("S2MEMBER_CURRENT_USER_LOGIN", ($c[] = (($current_user) ? (string)$current_user->user_login : "")));
62
+ define ("S2MEMBER_CURRENT_USER_EMAIL", ($c[] = (($current_user) ? (string)$current_user->user_email : "")));
63
+ define ("S2MEMBER_CURRENT_USER_IP", ($c[] = (string)$_SERVER["REMOTE_ADDR"]));
64
+ define ("S2MEMBER_CURRENT_USER_ID", ($c[] = (($current_user) ? (int)$current_user->ID : 0)));
65
+ define ("S2MEMBER_CURRENT_USER_FIELDS", ($c[] = (($current_user) ? json_encode (array_merge (array ("id" => S2MEMBER_CURRENT_USER_ID, "ip" => S2MEMBER_CURRENT_USER_IP, "email" => S2MEMBER_CURRENT_USER_EMAIL, "login" => S2MEMBER_CURRENT_USER_LOGIN, "first_name" => S2MEMBER_CURRENT_USER_FIRST_NAME, "last_name" => S2MEMBER_CURRENT_USER_LAST_NAME, "display_name" => S2MEMBER_CURRENT_USER_DISPLAY_NAME, "subscr_id" => S2MEMBER_CURRENT_USER_SUBSCR_ID, "subscr_gateway" => S2MEMBER_CURRENT_USER_SUBSCR_GATEWAY, "custom" => S2MEMBER_CURRENT_USER_CUSTOM), (array)$custom_fields)) : json_encode (array ()))));
66
+ /**/
67
+ define ("S2MEMBER_CURRENT_USER_DOWNLOADS_ALLOWED", ($c[] = (int)$file_downloads["allowed"]));
68
+ define ("S2MEMBER_CURRENT_USER_DOWNLOADS_ALLOWED_IS_UNLIMITED", ($c[] = ( ($file_downloads["allowed"] >= 999999999) ? true : false)));
69
+ define ("S2MEMBER_CURRENT_USER_DOWNLOADS_CURRENTLY", ($c[] = (int)$file_downloads["currently"]));
70
+ define ("S2MEMBER_CURRENT_USER_DOWNLOADS_ALLOWED_DAYS", ($c[] = (int)$file_downloads["allowed_days"]));
71
+ /**/
72
+ define ("S2MEMBER_FILE_DOWNLOAD_LIMIT_EXCEEDED_PAGE_ID", ($c[] = (int)$GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["file_download_limit_exceeded_page"]));
73
+ define ("S2MEMBER_MEMBERSHIP_OPTIONS_PAGE_ID", ($c[] = (int)$GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["membership_options_page"]));
74
+ define ("S2MEMBER_LOGIN_WELCOME_PAGE_ID", ($c[] = (int)$GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["login_welcome_page"]));
75
+ /**/
76
+ define ("S2MEMBER_CURRENT_USER_PROFILE_MODIFICATION_PAGE_URL", ($c[] = site_url ("/?s2member_profile=1")));
77
+ define ("S2MEMBER_FILE_DOWNLOAD_LIMIT_EXCEEDED_PAGE_URL", ($c[] = (string)$links["file_download_limit_exceeded_page"]));
78
+ define ("S2MEMBER_MEMBERSHIP_OPTIONS_PAGE_URL", ($c[] = (string)$links["membership_options_page"]));
79
+ define ("S2MEMBER_LOGIN_WELCOME_PAGE_URL", ($c[] = (($login_redirection_url) ? (string)$login_redirection_url : (string)$links["login_welcome_page"])));
80
+ define ("S2MEMBER_LOGOUT_PAGE_URL", ($c[] = (string)wp_logout_url ()));
81
+ define ("S2MEMBER_LOGIN_PAGE_URL", ($c[] = (string)wp_login_url ()));
82
+ /**/
83
+ define ("S2MEMBER_LEVEL0_LABEL", ($c[] = (string)$GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["level0_label"]));
84
+ define ("S2MEMBER_LEVEL1_LABEL", ($c[] = (string)$GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["level1_label"]));
85
+ define ("S2MEMBER_LEVEL2_LABEL", ($c[] = (string)$GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["level2_label"]));
86
+ define ("S2MEMBER_LEVEL3_LABEL", ($c[] = (string)$GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["level3_label"]));
87
+ define ("S2MEMBER_LEVEL4_LABEL", ($c[] = (string)$GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["level4_label"]));
88
+ /**/
89
+ define ("S2MEMBER_LEVEL0_FILE_DOWNLOADS_ALLOWED", ($c[] = (int)$GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["level0_file_downloads_allowed"]));
90
+ define ("S2MEMBER_LEVEL1_FILE_DOWNLOADS_ALLOWED", ($c[] = (int)$GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["level1_file_downloads_allowed"]));
91
+ define ("S2MEMBER_LEVEL2_FILE_DOWNLOADS_ALLOWED", ($c[] = (int)$GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["level2_file_downloads_allowed"]));
92
+ define ("S2MEMBER_LEVEL3_FILE_DOWNLOADS_ALLOWED", ($c[] = (int)$GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["level3_file_downloads_allowed"]));
93
+ define ("S2MEMBER_LEVEL4_FILE_DOWNLOADS_ALLOWED", ($c[] = (int)$GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["level4_file_downloads_allowed"]));
94
+ /**/
95
+ define ("S2MEMBER_LEVEL0_FILE_DOWNLOADS_ALLOWED_DAYS", ($c[] = (int)$GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["level0_file_downloads_allowed_days"]));
96
+ define ("S2MEMBER_LEVEL1_FILE_DOWNLOADS_ALLOWED_DAYS", ($c[] = (int)$GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["level1_file_downloads_allowed_days"]));
97
+ define ("S2MEMBER_LEVEL2_FILE_DOWNLOADS_ALLOWED_DAYS", ($c[] = (int)$GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["level2_file_downloads_allowed_days"]));
98
+ define ("S2MEMBER_LEVEL3_FILE_DOWNLOADS_ALLOWED_DAYS", ($c[] = (int)$GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["level3_file_downloads_allowed_days"]));
99
+ define ("S2MEMBER_LEVEL4_FILE_DOWNLOADS_ALLOWED_DAYS", ($c[] = (int)$GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["level4_file_downloads_allowed_days"]));
100
+ /**/
101
+ define ("S2MEMBER_FILE_DOWNLOAD_INLINE_EXTENSIONS", ($c[] = (string)$GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["file_download_inline_extensions"]));
102
+ /**/
103
+ define ("S2MEMBER_REG_EMAIL_FROM_NAME", ($c[] = (string)$GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["reg_email_from_name"]));
104
+ define ("S2MEMBER_REG_EMAIL_FROM_EMAIL", ($c[] = (string)$GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["reg_email_from_email"]));
105
+ /**/
106
+ define ("S2MEMBER_PAYPAL_NOTIFY_URL", ($c[] = site_url ("/?s2member_paypal_notify=1")));
107
+ define ("S2MEMBER_PAYPAL_RETURN_URL", ($c[] = site_url ("/?s2member_paypal_return=1")));
108
+ /**/
109
+ define ("S2MEMBER_PAYPAL_BUSINESS", ($c[] = (string)$GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["paypal_business"]));
110
+ define ("S2MEMBER_PAYPAL_ENDPOINT", ($c[] = ( ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["paypal_sandbox"]) ? "www.sandbox.paypal.com" : "www.paypal.com")));
111
+ define ("S2MEMBER_PAYPAL_API_ENDPOINT", ($c[] = ( ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["paypal_sandbox"]) ? "api-3t.sandbox.paypal.com" : "api-3t.paypal.com")));
112
+ define ("S2MEMBER_PAYPAL_API_USERNAME", ($c[] = (string)$GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["paypal_api_username"]));
113
+ define ("S2MEMBER_PAYPAL_API_PASSWORD", ($c[] = (string)$GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["paypal_api_password"]));
114
+ define ("S2MEMBER_PAYPAL_API_SIGNATURE", ($c[] = (string)$GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["paypal_api_signature"]));
115
+ /**/
116
+ define ("S2MEMBER_PAYPAL_PDT_IDENTITY_TOKEN", ($c[] = (string)$GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["paypal_identity_token"]));
117
+ /**/
118
+ define ("S2MEMBER_CURRENT_USER_VALUE_FOR_PP_ON0", ($c[] = ((S2MEMBER_CURRENT_USER_SUBSCR_ID) ? "Updating Subscr. ID" : "")));
119
+ define ("S2MEMBER_CURRENT_USER_VALUE_FOR_PP_OS0", ($c[] = ((S2MEMBER_CURRENT_USER_VALUE_FOR_PP_ON0) ? S2MEMBER_CURRENT_USER_SUBSCR_ID : "")));
120
+ /**/
121
+ $c = apply_filters ("ws_plugin__s2member_during_constants_c", $c, get_defined_vars ()); /* Allows other Constants to be calculated nicely. */
122
+ /**/
123
+ define ("WS_PLUGIN__S2MEMBER_API_CONSTANTS_MD5", md5 (serialize ($c))); /* Used as a Checksum against the state of these Constants. */
124
+ /**/
125
+ do_action ("ws_plugin__s2member_after_constants", get_defined_vars ()); /* Calls the after Hook. Do NOT set Constants here. */
126
+ /**/
127
+ return; /* Return for uniformity. */
128
+ }
129
+ /*
130
+ This function pulls all of the Page links needed for Constants.
131
+ Page links are cached into the s2Member options on 15 min intervals.
132
+ This allows the API Constants to provide quick access to them without being
133
+ forced to execute get_page_link() all the time, which piles up DB queries.
134
+ */
135
+ public static function constant_links ()
136
+ {
137
+ do_action ("ws_plugin__s2member_before_constant_links", get_defined_vars ());
138
+ /**/
139
+ $l = array ("login_welcome_page" => "", "membership_options_page" => "", "file_download_limit_exceeded_page" => "");
140
+ /**/
141
+ $login_welcome_page = $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["login_welcome_page"];
142
+ $membership_options_page = $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["membership_options_page"];
143
+ $file_download_limit_exceeded_page = $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["file_download_limit_exceeded_page"];
144
+ /**/
145
+ $login_welcome_page_cache = $GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["cache"]["login_welcome_page"];
146
+ $membership_options_page_cache = $GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["cache"]["membership_options_page"];
147
+ $file_download_limit_exceeded_page_cache = $GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["cache"]["file_download_limit_exceeded_page"];
148
+ /**/
149
+ if ($login_welcome_page_cache["page"] === $login_welcome_page && $login_welcome_page_cache["time"] >= strtotime ("-15 minutes"))
150
+ {
151
+ $l["login_welcome_page"] = $login_welcome_page_cache["link"];
152
+ }
153
+ else /* Otherwise, we need to query the database using get_page_link() and update the cache. */
154
+ {
155
+ $GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["cache"]["login_welcome_page"]["time"] = strtotime ("now");
156
+ $GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["cache"]["login_welcome_page"]["page"] = $login_welcome_page;
157
+ $l["login_welcome_page"] = $GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["cache"]["login_welcome_page"]["link"] = get_page_link ($login_welcome_page);
158
+ /**/
159
+ $cache_needs_updating = true;
160
+ }
161
+ /**/
162
+ if ($membership_options_page_cache["page"] === $membership_options_page && $membership_options_page_cache["time"] >= strtotime ("-15 minutes"))
163
+ {
164
+ $l["membership_options_page"] = $membership_options_page_cache["link"];
165
+ }
166
+ else /* Otherwise, we need to query the database using get_page_link() and update the cache. */
167
+ {
168
+ $GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["cache"]["membership_options_page"]["time"] = strtotime ("now");
169
+ $GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["cache"]["membership_options_page"]["page"] = $membership_options_page;
170
+ $l["membership_options_page"] = $GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["cache"]["membership_options_page"]["link"] = get_page_link ($membership_options_page);
171
+ /**/
172
+ $cache_needs_updating = true;
173
+ }
174
+ /**/
175
+ if ($file_download_limit_exceeded_page_cache["page"] === $file_download_limit_exceeded_page && $file_download_limit_exceeded_page_cache["time"] >= strtotime ("-15 minutes"))
176
+ {
177
+ $l["file_download_limit_exceeded_page"] = $file_download_limit_exceeded_page_cache["link"];
178
+ }
179
+ else /* Otherwise, we need to query the database using get_page_link() and update the cache. */
180
+ {
181
+ $GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["cache"]["file_download_limit_exceeded_page"]["time"] = strtotime ("now");
182
+ $GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["cache"]["file_download_limit_exceeded_page"]["page"] = $file_download_limit_exceeded_page;
183
+ $l["file_download_limit_exceeded_page"] = $GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["cache"]["file_download_limit_exceeded_page"]["link"] = get_page_link ($file_download_limit_exceeded_page);
184
+ /**/
185
+ $cache_needs_updating = true;
186
+ }
187
+ /**/
188
+ if ($cache_needs_updating) /* The cache is also reset when options are updated from a menu page. */
189
+ {
190
+ update_option ("ws_plugin__s2member_cache", $GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["cache"]);
191
+ }
192
+ /**/
193
+ return apply_filters ("ws_plugin__s2member_constant_links", $l, get_defined_vars ());
194
+ }
195
+ }
196
+ }
197
+ ?>
includes/classes/cron-jobs.inc.php ADDED
@@ -0,0 +1,62 @@
1
+ <?php
2
+ /*
3
+ Copyright: © 2009 WebSharks, Inc. ( coded in the USA )
4
+ <mailto:support@websharks-inc.com> <http://www.websharks-inc.com/>
5
+
6
+ Released under the terms of the GNU General Public License.
7
+ You should have received a copy of the GNU General Public License,
8
+ along with this software. In the main directory, see: /licensing/
9
+ If not, see: <http://www.gnu.org/licenses/>.
10
+ */
11
+ /*
12
+ Direct access denial.
13
+ */
14
+ if (realpath (__FILE__) === realpath ($_SERVER["SCRIPT_FILENAME"]))
15
+ exit ("Do not access this file directly.");
16
+ /**/
17
+ if (!class_exists ("c_ws_plugin__s2member_cron_jobs"))
18
+ {
19
+ class c_ws_plugin__s2member_cron_jobs
20
+ {
21
+ /*
22
+ Extends the WP-Cron schedules to support 10 minute intervals.
23
+ Attach to: add_filter("cron_schedules");
24
+ */
25
+ public static function extend_cron_schedules ($schedules = array ())
26
+ {
27
+ eval ('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$__v;');
28
+ do_action ("ws_plugin__s2member_before_extend_cron_schedules", get_defined_vars ());
29
+ unset ($__refs, $__v); /* Unset defined __refs, __v. */
30
+ /**/
31
+ $array = array ("every10m" => array ("interval" => 600, "display" => "Every 10 Minutes"));
32
+ /**/
33
+ return apply_filters ("ws_plugin__s2member_extend_cron_schedules", array_merge ($array, $schedules), get_defined_vars ());
34
+ }
35
+ /*
36
+ This function allows the Auto-EOT Sytem to be
37
+ processed through a server-side Cron Job.
38
+ Attach to: add_action("init");
39
+ */
40
+ public static function auto_eot_system_via_cron ()
41
+ {
42
+ do_action ("ws_plugin__s2member_before_auto_eot_system_via_cron", get_defined_vars ());
43
+ /**/
44
+ if ($_GET["s2member_auto_eot_system_via_cron"]) /* Being called through HTTP? */
45
+ {
46
+ if ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["auto_eot_system_enabled"])
47
+ {
48
+ c_ws_plugin__s2member_auto_eots::auto_eot_system (); /* Process Auto EOTs now. */
49
+ /**/
50
+ do_action ("ws_plugin__s2member_during_auto_eot_system_via_cron", get_defined_vars ());
51
+ }
52
+ /**/
53
+ exit (); /* Clean exit. */
54
+ }
55
+ /**/
56
+ do_action ("ws_plugin__s2member_after_auto_eot_system_via_cron", get_defined_vars ());
57
+ /**/
58
+ return; /* Return for uniformity. */
59
+ }
60
+ }
61
+ }
62
+ ?>
includes/classes/css-js.inc.php ADDED
@@ -0,0 +1,205 @@
1
+ <?php
2
+ /*
3
+ Copyright: © 2009 WebSharks, Inc. ( coded in the USA )
4
+ <mailto:support@websharks-inc.com> <http://www.websharks-inc.com/>
5
+
6
+ Released under the terms of the GNU General Public License.
7
+ You should have received a copy of the GNU General Public License,
8
+ along with this software. In the main directory, see: /licensing/
9
+ If not, see: <http://www.gnu.org/licenses/>.
10
+ */
11
+ /*
12
+ Direct access denial.
13
+ */
14
+ if (realpath (__FILE__) === realpath ($_SERVER["SCRIPT_FILENAME"]))
15
+ exit ("Do not access this file directly.");
16
+ /**/
17
+ if (!class_exists ("c_ws_plugin__s2member_css_js"))
18
+ {
19
+ class c_ws_plugin__s2member_css_js
20
+ {
21
+ /*
22
+ Adds CSS files.
23
+ Attach to: add_action("wp_print_styles");
24
+ */
25
+ public static function add_css ()
26
+ {
27
+ do_action ("ws_plugin__s2member_before_add_css", get_defined_vars ());
28
+ /**/
29
+ if (!is_admin ()) /* Not in the admin. */
30
+ {
31
+ wp_enqueue_style ("ws-plugin--s2member", site_url ("/?ws_plugin__s2member_css=1&qcABC=1"), array (), $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["options_version"] . $GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["filemtime"], "all");
32
+ /**/
33
+ do_action ("ws_plugin__s2member_during_add_css", get_defined_vars ());
34
+ }
35
+ /**/
36
+ do_action ("ws_plugin__s2member_after_add_css", get_defined_vars ());
37
+ /**/
38
+ return; /* Return for uniformity. */
39
+ }
40
+ /*
41
+ Builds CSS files.
42
+ Attach to: add_action("init");
43
+ */
44
+ public static function css ()
45
+ {
46
+ do_action ("ws_plugin__s2member_before_css", get_defined_vars ());
47
+ /**/
48
+ if ($_GET["ws_plugin__s2member_css"])
49
+ {
50
+ header ("Content-Type: text/css; charset=utf-8");
51
+ header ("Expires: " . gmdate ("D, d M Y H:i:s", strtotime ("+1 week")) . " GMT");
52
+ header ("Last-Modified: " . gmdate ("D, d M Y H:i:s") . " GMT");
53
+ header ("Cache-Control: max-age=604800");
54
+ header ("Pragma: public");
55
+ /**/
56
+ $u = $GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["dir_url"];
57
+ $i = $GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["dir_url"] . "/images";
58
+ /**/
59
+ ob_start ("c_ws_plugin__s2member_utils_css::compress_css"); /* Compress. */
60
+ /**/
61
+ include_once dirname (dirname (__FILE__)) . "/s2member.css";
62
+ /**/
63
+ do_action ("ws_plugin__s2member_during_css", get_defined_vars ());
64
+ /**/
65
+ exit (); /* Clean exit. */
66
+ }
67
+ /**/
68
+ do_action ("ws_plugin__s2member_after_css", get_defined_vars ());
69
+ }
70
+ /*
71
+ Adds JavaScript files.
72
+ Attach to: add_action("wp_print_scripts");
73
+ */
74
+ public static function add_js_w_globals ()
75
+ {
76
+ global $pagenow; /* Need this for comparisons. */
77
+ /**/
78
+ do_action ("ws_plugin__s2member_before_add_js_w_globals", get_defined_vars ());
79
+ /**/
80
+ if (!is_admin () || (c_ws_plugin__s2member_utils_conds::is_user_admin () && $pagenow === "profile.php" && !current_user_can ("edit_users")))
81
+ {
82
+ if (is_user_logged_in ()) /* Separate version for logged-in Users/Members. */
83
+ {
84
+ $md5 = WS_PLUGIN__S2MEMBER_API_CONSTANTS_MD5; /* An MD5 hash based on global key => values. */
85
+ /* The MD5 hash allows the script to be cached in the browser until the globals happen to change. */
86
+ /* For instance, the global variables may change when a User who is logged-in changes their Profile. */
87
+ wp_enqueue_script ("ws-plugin--s2member", site_url ("/?ws_plugin__s2member_js_w_globals=1&qcABC=1&" . $md5), array ("jquery"), $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["options_version"] . $GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["filemtime"]);
88
+ }
89
+ else /* Else if they are not logged in, we distinguish the JavaScript file by NOT including $md5. */
90
+ { /* This essentially creates 2 versions of the script. One while logged in & another when not. */
91
+ wp_enqueue_script ("ws-plugin--s2member", site_url ("/?ws_plugin__s2member_js_w_globals=1&qcABC=1"), array ("jquery"), $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["options_version"] . $GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["filemtime"]);
92
+ }
93
+ /**/
94
+ do_action ("ws_plugin__s2member_during_add_js_w_globals", get_defined_vars ());
95
+ }
96
+ /**/
97
+ do_action ("ws_plugin__s2member_after_add_js_w_globals", get_defined_vars ());
98
+ /**/
99
+ return; /* Return for uniformity. */
100
+ }
101
+ /*
102
+ Builds JavaScript files.
103
+ Attach to: add_action("init");
104
+ */
105
+ public static function js_w_globals ()
106
+ {
107
+ do_action ("ws_plugin__s2member_before_js_w_globals", get_defined_vars ());
108
+ /**/
109
+ if ($_GET["ws_plugin__s2member_js_w_globals"])
110
+ {
111
+ header ("Content-Type: text/javascript; charset=utf-8");
112
+ header ("Expires: " . gmdate ("D, d M Y H:i:s", strtotime ("+1 week")) . " GMT");
113
+ header ("Last-Modified: " . gmdate ("D, d M Y H:i:s") . " GMT");
114
+ header ("Cache-Control: max-age=604800");
115
+ header ("Pragma: public");
116
+ /**/
117
+ $g = "var S2MEMBER_VERSION = '" . c_ws_plugin__s2member_utils_strings::esc_sq (S2MEMBER_VERSION) . "',"; /* Since 3.0. */
118
+ /**/
119
+ $g .= "S2MEMBER_CURRENT_USER_IS_LOGGED_IN = " . ((S2MEMBER_CURRENT_USER_IS_LOGGED_IN) ? "true" : "false") . ",";
120
+ $g .= "S2MEMBER_CURRENT_USER_IS_LOGGED_IN_AS_MEMBER = " . ((S2MEMBER_CURRENT_USER_IS_LOGGED_IN_AS_MEMBER) ? "true" : "false") . ",";
121
+ $g .= "S2MEMBER_CURRENT_USER_ACCESS_LEVEL = " . S2MEMBER_CURRENT_USER_ACCESS_LEVEL . ",";
122
+ $g .= "S2MEMBER_CURRENT_USER_ACCESS_LABEL = '" . c_ws_plugin__s2member_utils_strings::esc_sq (S2MEMBER_CURRENT_USER_ACCESS_LABEL) . "',";
123
+ $g .= "S2MEMBER_CURRENT_USER_SUBSCR_ID = '" . c_ws_plugin__s2member_utils_strings::esc_sq (S2MEMBER_CURRENT_USER_SUBSCR_ID) . "',";
124
+ $g .= "S2MEMBER_CURRENT_USER_CUSTOM = '" . c_ws_plugin__s2member_utils_strings::esc_sq (S2MEMBER_CURRENT_USER_CUSTOM) . "',";
125
+ $g .= "S2MEMBER_CURRENT_USER_REGISTRATION_TIME = " . S2MEMBER_CURRENT_USER_REGISTRATION_TIME . ",";
126
+ $g .= "S2MEMBER_CURRENT_USER_PAID_REGISTRATION_TIME = " . S2MEMBER_CURRENT_USER_PAID_REGISTRATION_TIME . ",";
127
+ $g .= "S2MEMBER_CURRENT_USER_PAID_REGISTRATION_DAYS = " . S2MEMBER_CURRENT_USER_PAID_REGISTRATION_DAYS . ",";
128
+ $g .= "S2MEMBER_CURRENT_USER_REGISTRATION_DAYS = " . S2MEMBER_CURRENT_USER_REGISTRATION_DAYS . ",";
129
+ $g .= "S2MEMBER_CURRENT_USER_DISPLAY_NAME = '" . c_ws_plugin__s2member_utils_strings::esc_sq (S2MEMBER_CURRENT_USER_DISPLAY_NAME) . "',";
130
+ $g .= "S2MEMBER_CURRENT_USER_FIRST_NAME = '" . c_ws_plugin__s2member_utils_strings::esc_sq (S2MEMBER_CURRENT_USER_FIRST_NAME) . "',";
131
+ $g .= "S2MEMBER_CURRENT_USER_LAST_NAME = '" . c_ws_plugin__s2member_utils_strings::esc_sq (S2MEMBER_CURRENT_USER_LAST_NAME) . "',";
132
+ $g .= "S2MEMBER_CURRENT_USER_LOGIN = '" . c_ws_plugin__s2member_utils_strings::esc_sq (S2MEMBER_CURRENT_USER_LOGIN) . "',";
133
+ $g .= "S2MEMBER_CURRENT_USER_EMAIL = '" . c_ws_plugin__s2member_utils_strings::esc_sq (S2MEMBER_CURRENT_USER_EMAIL) . "',";
134
+ $g .= "S2MEMBER_CURRENT_USER_IP = '" . c_ws_plugin__s2member_utils_strings::esc_sq (S2MEMBER_CURRENT_USER_IP) . "',";
135
+ $g .= "S2MEMBER_CURRENT_USER_ID = " . S2MEMBER_CURRENT_USER_ID . ",";
136
+ $g .= "S2MEMBER_CURRENT_USER_FIELDS = " . S2MEMBER_CURRENT_USER_FIELDS . ",";
137
+ /**/
138
+ $g .= "S2MEMBER_CURRENT_USER_DOWNLOADS_ALLOWED = " . S2MEMBER_CURRENT_USER_DOWNLOADS_ALLOWED . ",";
139
+ $g .= "S2MEMBER_CURRENT_USER_DOWNLOADS_ALLOWED_IS_UNLIMITED = " . ((S2MEMBER_CURRENT_USER_DOWNLOADS_ALLOWED_IS_UNLIMITED) ? "true" : "false") . ",";
140
+ $g .= "S2MEMBER_CURRENT_USER_DOWNLOADS_CURRENTLY = " . S2MEMBER_CURRENT_USER_DOWNLOADS_CURRENTLY . ",";
141
+ $g .= "S2MEMBER_CURRENT_USER_DOWNLOADS_ALLOWED_DAYS = " . S2MEMBER_CURRENT_USER_DOWNLOADS_ALLOWED_DAYS . ",";
142
+ /**/
143
+ $g .= "S2MEMBER_FILE_DOWNLOAD_LIMIT_EXCEEDED_PAGE_ID = " . S2MEMBER_FILE_DOWNLOAD_LIMIT_EXCEEDED_PAGE_ID . ",";
144
+ $g .= "S2MEMBER_MEMBERSHIP_OPTIONS_PAGE_ID = " . S2MEMBER_MEMBERSHIP_OPTIONS_PAGE_ID . ",";
145
+ $g .= "S2MEMBER_LOGIN_WELCOME_PAGE_ID = " . S2MEMBER_LOGIN_WELCOME_PAGE_ID . ",";
146
+ /**/
147
+ $g .= "S2MEMBER_CURRENT_USER_PROFILE_MODIFICATION_PAGE_URL = '" . c_ws_plugin__s2member_utils_strings::esc_sq (S2MEMBER_CURRENT_USER_PROFILE_MODIFICATION_PAGE_URL) . "',";
148
+ $g .= "S2MEMBER_FILE_DOWNLOAD_LIMIT_EXCEEDED_PAGE_URL = '" . c_ws_plugin__s2member_utils_strings::esc_sq (S2MEMBER_FILE_DOWNLOAD_LIMIT_EXCEEDED_PAGE_URL) . "',";
149
+ $g .= "S2MEMBER_MEMBERSHIP_OPTIONS_PAGE_URL = '" . c_ws_plugin__s2member_utils_strings::esc_sq (S2MEMBER_MEMBERSHIP_OPTIONS_PAGE_URL) . "',";
150
+ $g .= "S2MEMBER_LOGIN_WELCOME_PAGE_URL = '" . c_ws_plugin__s2member_utils_strings::esc_sq (S2MEMBER_LOGIN_WELCOME_PAGE_URL) . "',";
151
+ $g .= "S2MEMBER_LOGOUT_PAGE_URL = '" . c_ws_plugin__s2member_utils_strings::esc_sq (S2MEMBER_LOGOUT_PAGE_URL) . "',";
152
+ $g .= "S2MEMBER_LOGIN_PAGE_URL = '" . c_ws_plugin__s2member_utils_strings::esc_sq (S2MEMBER_LOGIN_PAGE_URL) . "',";
153
+ /**/
154
+ $g .= "S2MEMBER_LEVEL0_LABEL = '" . c_ws_plugin__s2member_utils_strings::esc_sq (S2MEMBER_LEVEL0_LABEL) . "',";
155
+ $g .= "S2MEMBER_LEVEL1_LABEL = '" . c_ws_plugin__s2member_utils_strings::esc_sq (S2MEMBER_LEVEL1_LABEL) . "',";
156
+ $g .= "S2MEMBER_LEVEL2_LABEL = '" . c_ws_plugin__s2member_utils_strings::esc_sq (S2MEMBER_LEVEL2_LABEL) . "',";
157
+ $g .= "S2MEMBER_LEVEL3_LABEL = '" . c_ws_plugin__s2member_utils_strings::esc_sq (S2MEMBER_LEVEL3_LABEL) . "',";
158
+ $g .= "S2MEMBER_LEVEL4_LABEL = '" . c_ws_plugin__s2member_utils_strings::esc_sq (S2MEMBER_LEVEL4_LABEL) . "',";
159
+ /**/
160
+ $g .= "S2MEMBER_LEVEL0_FILE_DOWNLOADS_ALLOWED = " . S2MEMBER_LEVEL0_FILE_DOWNLOADS_ALLOWED . ",";
161
+ $g .= "S2MEMBER_LEVEL1_FILE_DOWNLOADS_ALLOWED = " . S2MEMBER_LEVEL1_FILE_DOWNLOADS_ALLOWED . ",";
162
+ $g .= "S2MEMBER_LEVEL2_FILE_DOWNLOADS_ALLOWED = " . S2MEMBER_LEVEL2_FILE_DOWNLOADS_ALLOWED . ",";
163
+ $g .= "S2MEMBER_LEVEL3_FILE_DOWNLOADS_ALLOWED = " . S2MEMBER_LEVEL3_FILE_DOWNLOADS_ALLOWED . ",";
164
+ $g .= "S2MEMBER_LEVEL4_FILE_DOWNLOADS_ALLOWED = " . S2MEMBER_LEVEL4_FILE_DOWNLOADS_ALLOWED . ",";
165
+ /**/
166
+ $g .= "S2MEMBER_LEVEL0_FILE_DOWNLOADS_ALLOWED_DAYS = " . S2MEMBER_LEVEL0_FILE_DOWNLOADS_ALLOWED_DAYS . ",";
167
+ $g .= "S2MEMBER_LEVEL1_FILE_DOWNLOADS_ALLOWED_DAYS = " . S2MEMBER_LEVEL1_FILE_DOWNLOADS_ALLOWED_DAYS . ",";
168
+ $g .= "S2MEMBER_LEVEL2_FILE_DOWNLOADS_ALLOWED_DAYS = " . S2MEMBER_LEVEL2_FILE_DOWNLOADS_ALLOWED_DAYS . ",";
169
+ $g .= "S2MEMBER_LEVEL3_FILE_DOWNLOADS_ALLOWED_DAYS = " . S2MEMBER_LEVEL3_FILE_DOWNLOADS_ALLOWED_DAYS . ",";
170
+ $g .= "S2MEMBER_LEVEL4_FILE_DOWNLOADS_ALLOWED_DAYS = " . S2MEMBER_LEVEL4_FILE_DOWNLOADS_ALLOWED_DAYS . ",";
171
+ /**/
172
+ $g .= "S2MEMBER_FILE_DOWNLOAD_INLINE_EXTENSIONS = '" . c_ws_plugin__s2member_utils_strings::esc_sq (S2MEMBER_FILE_DOWNLOAD_INLINE_EXTENSIONS) . "',";
173
+ /**/
174
+ $g .= "S2MEMBER_REG_EMAIL_FROM_NAME = '" . c_ws_plugin__s2member_utils_strings::esc_sq (S2MEMBER_REG_EMAIL_FROM_NAME) . "',";
175
+ $g .= "S2MEMBER_REG_EMAIL_FROM_EMAIL = '" . c_ws_plugin__s2member_utils_strings::esc_sq (S2MEMBER_REG_EMAIL_FROM_EMAIL) . "',";
176
+ /**/
177
+ $g .= "S2MEMBER_PAYPAL_NOTIFY_URL = '" . c_ws_plugin__s2member_utils_strings::esc_sq (S2MEMBER_PAYPAL_NOTIFY_URL) . "',";
178
+ $g .= "S2MEMBER_PAYPAL_RETURN_URL = '" . c_ws_plugin__s2member_utils_strings::esc_sq (S2MEMBER_PAYPAL_RETURN_URL) . "',";
179
+ /**/
180
+ $g .= "S2MEMBER_PAYPAL_BUSINESS = '" . c_ws_plugin__s2member_utils_strings::esc_sq (S2MEMBER_PAYPAL_BUSINESS) . "',";
181
+ $g .= "S2MEMBER_PAYPAL_ENDPOINT = '" . c_ws_plugin__s2member_utils_strings::esc_sq (S2MEMBER_PAYPAL_ENDPOINT) . "',";
182
+ $g .= "S2MEMBER_PAYPAL_API_ENDPOINT = '" . c_ws_plugin__s2member_utils_strings::esc_sq (S2MEMBER_PAYPAL_API_ENDPOINT) . "',";
183
+ /**/
184
+ $g .= "S2MEMBER_CURRENT_USER_VALUE_FOR_PP_ON0 = '" . c_ws_plugin__s2member_utils_strings::esc_sq (S2MEMBER_CURRENT_USER_VALUE_FOR_PP_ON0) . "',";
185
+ $g .= "S2MEMBER_CURRENT_USER_VALUE_FOR_PP_OS0 = '" . c_ws_plugin__s2member_utils_strings::esc_sq (S2MEMBER_CURRENT_USER_VALUE_FOR_PP_OS0) . "',";
186
+ /**/
187
+ $g = trim ($g, " ,") . ";"; /* Trim & add semicolon. */
188
+ /**/
189
+ $u = $GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["dir_url"];
190
+ $i = $GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["dir_url"] . "/images";
191
+ /**/
192
+ echo $g . "\n"; /* Add a line break before inclusion. */
193
+ /**/
194
+ include_once dirname (dirname (__FILE__)) . "/s2member-min.js";
195
+ /**/
196
+ do_action ("ws_plugin__s2member_during_js_w_globals", get_defined_vars ());
197
+ /**/
198
+ exit (); /* Clean exit. */
199
+ }
200
+ /**/
201
+ do_action ("ws_plugin__s2member_after_js_w_globals", get_defined_vars ());
202
+ }
203
+ }
204
+ }
205
+ ?>
includes/classes/custom-reg-fields.inc.php ADDED
@@ -0,0 +1,445 @@