Source Code Documentation


s2member\includes\classes\check-activation.inc.php


  1. <?php
  2. /**
  3. * s2Member's self re-activation routines.
  4. *
  5. * Copyright: © 2009-2011
  6. * {@link http://www.websharks-inc.com/ WebSharks, Inc.}
  7. * (coded in the USA)
  8. *
  9. * Released under the terms of the GNU General Public License.
  10. * You should have received a copy of the GNU General Public License,
  11. * along with this software. In the main directory, see: /licensing/
  12. * If not, see: {@link http://www.gnu.org/licenses/}.
  13. *
  14. * @package s2Member\Installation
  15. * @since 3.5
  16. */
  17. if (realpath (__FILE__) === realpath ($_SERVER["SCRIPT_FILENAME"]))
  18. exit ("Do not access this file directly.");
  19.  
  20. if (!class_exists ("c_ws_plugin__s2member_check_activation"))
  21. {
  22. /**
  23. * s2Member's self re-activation routines.
  24. *
  25. * @package s2Member\Installation
  26. * @since 3.5
  27. */
  28. class c_ws_plugin__s2member_check_activation
  29. {
  30. /**
  31. * Checks for existing installs that are NOT yet re-activated.
  32. *
  33. * @package s2Member\Installation
  34. * @since 3.5
  35. *
  36. * @attaches-to ``add_action("admin_init");``
  37. *
  38. * @return null
  39. */
  40. public static function check ()
  41. {
  42. if (!($v = get_option ("ws_plugin__s2member_activated_version")) || !version_compare ($v, WS_PLUGIN__S2MEMBER_VERSION, ">="))
  43. {
  44. c_ws_plugin__s2member_installation::activate ("version");
  45. }
  46. else if (is_multisite () && is_main_site () && (!($mms_v = get_option ("ws_plugin__s2member_activated_mms_version")) || !version_compare ($mms_v, WS_PLUGIN__S2MEMBER_VERSION, ">=")))
  47. {
  48. c_ws_plugin__s2member_installation::activate ("mms_version");
  49. }
  50. else if (!($l = (int)get_option ("ws_plugin__s2member_activated_levels")) || $l !== $GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["levels"])
  51. {
  52. c_ws_plugin__s2member_installation::activate ("levels");
  53. }
  54. return /* Return for uniformity. */;
  55. }
  56. }
  57. }
  58. ?>

s2member\includes\classes\check-activation.inc.php

Source Code Documentation