Esempio n. 1
0
 public function deployRelease($rest)
 {
     $post = $rest->getRequest()->getPost();
     MM_LogApi::logRequest(json_encode($post), "/deployRelease");
     if (!isset($post["version"])) {
         return new Response($rest, "Major version number is required", RESPONSE_ERROR_MESSAGE_MISSING_PARAMS . " : version", RESPONSE_ERROR_CODE_MISSING_PARAMS, RESPONSE_ERROR_MESSAGE_MISSING_PARAMS);
     }
     $majorVersion = $post["version"];
     $minorVersion = isset($post["minor_version"]) ? $post["minor_version"] : MM_MemberMouseService::$DEFAULT_MINOR_VERSION;
     $crntVersion = MemberMouse::getPluginVersion();
     if ($crntVersion != $majorVersion) {
         MM_OptionUtils::setOption(MM_OptionUtils::$OPTION_KEY_UPGRADE_NOTICE, $majorVersion);
         return new Response($rest, "Major version do not match. A notification will be displayed to the customer informing them an update is available.", "Major version do not match. A notification will be displayed to the customer informing them an update is available.", RESPONSE_ERROR_CODE_BAD_REQUEST, RESPONSE_ERROR_MESSAGE_MISSING_PARAMS);
     }
     // if major versions match, update cache with the latest files from central
     $writeableDir = MM_Utils::getCacheDir();
     // delete existing cache
     if (is_dir($writeableDir)) {
         if (is_writeable($writeableDir)) {
             if ($handle = opendir($writeableDir)) {
                 while (false !== ($file = readdir($handle))) {
                     if (!is_dir($file)) {
                         @unlink($writeableDir . "/" . $file);
                     }
                 }
                 closedir($handle);
             }
         }
     }
     // get updated classes from central
     MM_OptionUtils::setOption(MM_OptionUtils::$OPTION_KEY_MINOR_VERSION, $minorVersion);
     $ret = MM_MemberMouseService::authorize(true);
     if (MM_Response::isError($ret)) {
         return new Response($rest, "Could not find classes associated with version {$majorVersion}.{$minorVersion}", "Invalid major/minor version combination", RESPONSE_ERROR_CODE_BAD_REQUEST, RESPONSE_ERROR_MESSAGE_MISSING_PARAMS);
     }
     if (defined("DB_NAME")) {
         global $wpdb;
         if (file_exists($writeableDir . "/membermouse_schema.sql")) {
             $phpObj = new MM_PhpObj($wpdb, DB_NAME);
             if (!$phpObj->importFile($writeableDir . "/membermouse_schema.sql", true)) {
                 return new Response($rest, "Could not update MemberMouse database", "Could not update MemberMouse database", RESPONSE_ERROR_CODE_BAD_REQUEST, RESPONSE_ERROR_MESSAGE_MISSING_PARAMS);
             }
         }
     } else {
         return new Response($rest, "DB_NAME not defined", "DB_NAME not defined", RESPONSE_ERROR_CODE_BAD_REQUEST, RESPONSE_ERROR_MESSAGE_MISSING_PARAMS);
     }
     $version = $majorVersion;
     if (!empty($minorVersion)) {
         $version .= "-" . $minorVersion;
     }
     $versionRelease = MM_VersionRelease::findByVersion($version);
     $versionRelease->setVersion($version);
     $versionRelease->commitData();
     return new Response($rest);
 }
Esempio n. 2
0
$field->fieldId = "mm_field_cc_exp_month";
$field->fieldName = "ccexpirationdate";
$field->label = "CC Exp. Date";
$fieldInfo[] = $field;
$field = new stdClass();
$field->fieldId = "mm_field_cc_exp_year";
$field->fieldName = "ccexpirationdate";
$field->label = "CC Exp. Date";
$fieldInfo[] = $field;
$field = new stdClass();
$field->fieldId = "mm_field_cc_cvv";
$field->fieldName = "ccsecuritycode";
$field->label = "CC Security Code";
$fieldInfo[] = $field;
if (isset($_POST["mm_use_test_data"])) {
    MM_OptionUtils::setOption(MM_OptionUtils::$OPTION_KEY_USE_CHECKOUT_FORM_TEST_DATA, $_POST["mm_use_test_data"]);
    if ($_POST["mm_use_test_data"] == "1") {
        // collect/store form information
        $data = array();
        foreach ($fieldInfo as $field) {
            $data[$field->fieldId] = $_POST[$field->fieldId];
        }
        MM_TestDataUtils::saveCheckoutFormTestData($data);
    }
}
$useTestData = MM_OptionUtils::getOption(MM_OptionUtils::$OPTION_KEY_USE_CHECKOUT_FORM_TEST_DATA);
$testData = MM_TestDataUtils::getCheckoutFormTestData();
$form = new MM_CheckoutForm();
if (!isset($testData["mm_field_shipping_country"])) {
    $testData["mm_field_shipping_country"] = "";
}
Esempio n. 3
0
<?php

/**
 * 
 * MemberMouse(TM) (http://www.membermouse.com)
 * (c) MemberMouse, LLC. All rights reserved.
 */
if (isset($_POST["mm_hide_admin_bar"])) {
    MM_OptionUtils::setOption(MM_OptionUtils::$OPTION_KEY_HIDE_ADMIN_BAR, $_POST["mm_hide_admin_bar"]);
    MM_OptionUtils::setOption(MM_OptionUtils::$OPTION_KEY_ENABLE_USERNAME_CHANGE, $_POST["mm_enable_username_change"]);
}
$hideAdminBar = MM_OptionUtils::getOption(MM_OptionUtils::$OPTION_KEY_HIDE_ADMIN_BAR);
$hideAdminBarDesc = "When this is checked MemberMouse will configure new mebers so that the WordPress admin bar is not displayed on the front page. When this is unchecked, whether or not the admin bar will be shown for new members will be based on settings in WordPress or another plugin.";
$enableUsernameChange = MM_OptionUtils::getOption(MM_OptionUtils::$OPTION_KEY_ENABLE_USERNAME_CHANGE);
$enableUsernameChangeDesc = "By default, WordPress doesn't allow user's to change their username once their account is created. MemberMouse bypasses this restriction and allows members to change their username from the My Account page. Check this box to allow members to change their username from the My Account page. Uncheck this check box, if you want MemberMouse to hide the username field from the My Account page.";
?>
<div style="width: 600px; margin-top: 8px;" class="mm-divider"></div> 

<script>
function udpateWPUserForm()
{	
	if(jQuery("#mm_hide_admin_bar_cb").is(":checked")) 
	{
		jQuery("#mm_hide_admin_bar").val("1");
	} 
	else 
	{
		jQuery("#mm_hide_admin_bar").val("0");
	}

	if(jQuery("#mm_enable_username_change_cb").is(":checked")) 
<?php

/**
 * 
 * MemberMouse(TM) (http://www.membermouse.com)
 * (c) MemberMouse, LLC. All rights reserved.
 */
if (isset($_POST["mm_enable_wp_autop"])) {
    MM_OptionUtils::setOption(MM_OptionUtils::$OPTION_KEY_ENABLE_WP_AUTOP, $_POST["mm_enable_wp_autop"]);
}
$enableWPAutoP = MM_OptionUtils::getOption(MM_OptionUtils::$OPTION_KEY_ENABLE_WP_AUTOP);
?>
<div style="width: 600px; margin-top: 8px;" class="mm-divider"></div> 

<script>
function updateWPContentForm()
{	
	if(jQuery("#mm_enable_wp_autop_cb").is(":checked")) 
	{
		jQuery("#mm_enable_wp_autop").val("0");
	} 
	else 
	{
		jQuery("#mm_enable_wp_autop").val("1");
	}
}
</script>

<div class="mm-wrap">
    <p class="mm-header-text">WordPress Content Options</p>
    
 */
$error = "";
if (isset($_POST[MM_OptionUtils::$OPTION_KEY_PURCHASE_CONFIRMATION_DIALOG_HEIGHT])) {
    if (!preg_match("/[0-9]+/", $_POST[MM_OptionUtils::$OPTION_KEY_PURCHASE_CONFIRMATION_DIALOG_HEIGHT]) || intval($_POST[MM_OptionUtils::$OPTION_KEY_PURCHASE_CONFIRMATION_DIALOG_HEIGHT]) <= 0) {
        $error = "1-click purchase confirmation dialog height must be greater than 0.";
    }
    if (empty($error)) {
        MM_OptionUtils::setOption(MM_OptionUtils::$OPTION_KEY_PURCHASE_CONFIRMATION_DIALOG_HEIGHT, $_POST[MM_OptionUtils::$OPTION_KEY_PURCHASE_CONFIRMATION_DIALOG_HEIGHT]);
    }
}
if (isset($_POST[MM_OptionUtils::$OPTION_KEY_PURCHASE_CONFIRMATION_DIALOG_WIDTH])) {
    if (!preg_match("/[0-9]+/", $_POST[MM_OptionUtils::$OPTION_KEY_PURCHASE_CONFIRMATION_DIALOG_WIDTH]) || intval($_POST[MM_OptionUtils::$OPTION_KEY_PURCHASE_CONFIRMATION_DIALOG_WIDTH]) <= 0) {
        $error = "1-click purchase confirmation dialog width must be greater than 0.";
    }
    if (empty($error)) {
        MM_OptionUtils::setOption(MM_OptionUtils::$OPTION_KEY_PURCHASE_CONFIRMATION_DIALOG_WIDTH, $_POST[MM_OptionUtils::$OPTION_KEY_PURCHASE_CONFIRMATION_DIALOG_WIDTH]);
    }
}
$width = MM_OptionUtils::getOption(MM_OptionUtils::$OPTION_KEY_PURCHASE_CONFIRMATION_DIALOG_WIDTH);
$height = MM_OptionUtils::getOption(MM_OptionUtils::$OPTION_KEY_PURCHASE_CONFIRMATION_DIALOG_HEIGHT);
?>

<div style="width: 600px; margin-top: 8px;" class="mm-divider"></div> 

<div class="mm-wrap">
	<p class="mm-header-text">1-Click Purchase Confirmation Settings <span style="font-size:12px;"><a href="https://membermouse.uservoice.com/knowledgebase/articles/319083-adjust-the-size-of-the-1-click-purchase-confirmati" target="_blank">Learn more</a></span></p>
	
	<div style="margin-top:10px;">
		<p>Set the width and height for the 1-click purchase confirmation dialog below:</p>
		<p>
			Width: <input type='text' style='width: 60px;' name='<?php 
Esempio n. 6
0
    $forgotPasswordEmail->subject = "";
}
if (!isset($forgotPasswordEmail->body)) {
    $forgotPasswordEmail->body = "";
}
if (isset($_POST[MM_OptionUtils::$OPTION_KEY_FORGOT_PASSWORD_SUBJECT]) && $_POST[MM_OptionUtils::$OPTION_KEY_FORGOT_PASSWORD_SUBJECT] != $forgotPasswordEmail->subject) {
    MM_OptionUtils::setOption(MM_OptionUtils::$OPTION_KEY_FORGOT_PASSWORD_SUBJECT, $_POST[MM_OptionUtils::$OPTION_KEY_FORGOT_PASSWORD_SUBJECT]);
    $forgotPasswordEmail->subject = stripslashes($_POST[MM_OptionUtils::$OPTION_KEY_FORGOT_PASSWORD_SUBJECT]);
    $settingsSaved = true;
}
if (isset($_POST[MM_OptionUtils::$OPTION_KEY_FORGOT_PASSWORD_BODY]) && $_POST[MM_OptionUtils::$OPTION_KEY_FORGOT_PASSWORD_BODY] != $forgotPasswordEmail->body) {
    $pattern = "\\[mm_corepage_link type=(['|\"]{1})resetpassword(['|\"]{1})\\]";
    if (!preg_match("/{$pattern}/i", stripslashes($_POST[MM_OptionUtils::$OPTION_KEY_FORGOT_PASSWORD_BODY]))) {
        $error = "This template requires the following SmartTag:\\n[MM_CorePage_Link type=\\'resetpassword\\']\\n\\nYou\\'ll need to include this SmartTag somewhere in the template before the template can be saved.";
    } else {
        MM_OptionUtils::setOption(MM_OptionUtils::$OPTION_KEY_FORGOT_PASSWORD_BODY, preg_replace("/{$pattern}/i", "[MM_CorePage_Link type='resetpassword']", stripslashes($_POST[MM_OptionUtils::$OPTION_KEY_FORGOT_PASSWORD_BODY])));
        $forgotPasswordEmail->body = preg_replace("/{$pattern}/i", "[MM_CorePage_Link type='resetpassword']", stripslashes($_POST[MM_OptionUtils::$OPTION_KEY_FORGOT_PASSWORD_BODY]));
        $settingsSaved = true;
    }
}
?>
<form name='configure_site_text' method='post' >
<div class="mm-wrap">
    <span class="mm-section-header">Forgot Password Email</span>
	<div id="mm-form-container" style="margin-top: 10px; margin-bottom: 15px;">	
		<div style="margin-top:5px">
			Subject*
			<input name="mm-forgot-password-email-subject" type="text" style="width:454px; font-family:courier; font-size: 11px;" value="<?php 
echo $forgotPasswordEmail->subject;
?>
"/>
Esempio n. 7
0
 * MemberMouse(TM) (http://www.membermouse.com)
 * (c) MemberMouse, LLC. All rights reserved.
 */
$saved = false;
if (isset($_POST["mm-country"])) {
    if (isset($_POST["mm-country"]) && is_array($_POST["mm-country"]) && count($_POST["mm-country"]) > 0) {
        $selections = array();
        foreach ($_POST["mm-country"] as $iso) {
            $selections[$iso] = $iso;
        }
        MM_OptionUtils::setOption(MM_OptionUtils::$OPTION_KEY_COUNTRY_SELECTIONS, $selections);
        $saved = true;
    }
    if (isset($_POST["mm-default-country"])) {
        //MM_OptionUtils::setOption(MM_OptionUtils::$OPTION_KEY_DFLT_COUNTRY_SELECTION, in_array($_POST["mm-default-country"], $_POST["mm-country"]) ? $_POST["mm-default-country"] : $_POST["mm-country"][0]);
        MM_OptionUtils::setOption(MM_OptionUtils::$OPTION_KEY_DFLT_COUNTRY_SELECTION, $_POST["mm-default-country"]);
    }
}
// get country selections
$selections = MM_OptionUtils::getOption(MM_OptionUtils::$OPTION_KEY_COUNTRY_SELECTIONS);
$dfltCountry = MM_OptionUtils::getOption(MM_OptionUtils::$OPTION_KEY_DFLT_COUNTRY_SELECTION);
$fullCountryList = MM_HtmlUtils::getFullCountryList($selections);
$countryList = MM_HtmlUtils::getCountryList($dfltCountry);
?>
<div class="mm-wrap">
<form name='savecountry' method='post'>
   <p><strong>Select the countries customers can make purchases from below:</strong></p>   
	
	<p style="margin-left:15px;"><select name='mm-country[]' multiple size='100' style='height: 300px; width: 400px; font-size: 12px;'>
	<?php 
echo $fullCountryList;
Esempio n. 8
0
<?php

/**
 * 
 * MemberMouse(TM) (http://www.membermouse.com)
 * (c) MemberMouse, LLC. All rights reserved.
 */
if (isset($_POST["mm_use_mm_css_checkout"])) {
    MM_OptionUtils::setOption(MM_OptionUtils::$OPTION_KEY_USE_MM_CSS_CHECKOUT, $_POST["mm_use_mm_css_checkout"]);
    MM_OptionUtils::setOption(MM_OptionUtils::$OPTION_KEY_USE_MM_CSS_MY_ACCOUNT, $_POST["mm_use_mm_css_my_account"]);
    MM_OptionUtils::setOption(MM_OptionUtils::$OPTION_KEY_USE_MM_CSS_LOGIN, $_POST["mm_use_mm_css_login"]);
    MM_OptionUtils::setOption(MM_OptionUtils::$OPTION_KEY_USE_MM_CSS_FORGOT_PASSWORD, $_POST["mm_use_mm_css_forgot_pass"]);
    MM_OptionUtils::setOption(MM_OptionUtils::$OPTION_KEY_USE_MM_CSS_RESET_PASSWORD, $_POST["mm_use_mm_css_reset_pass"]);
}
$useMMCSSCheckout = MM_OptionUtils::getOption(MM_OptionUtils::$OPTION_KEY_USE_MM_CSS_CHECKOUT);
$useMMCSSMyAccount = MM_OptionUtils::getOption(MM_OptionUtils::$OPTION_KEY_USE_MM_CSS_MY_ACCOUNT);
$useMMCSSLogin = MM_OptionUtils::getOption(MM_OptionUtils::$OPTION_KEY_USE_MM_CSS_LOGIN);
$useMMCSSForgotPassword = MM_OptionUtils::getOption(MM_OptionUtils::$OPTION_KEY_USE_MM_CSS_FORGOT_PASSWORD);
$useMMCSSResetPassword = MM_OptionUtils::getOption(MM_OptionUtils::$OPTION_KEY_USE_MM_CSS_RESET_PASSWORD);
?>
<div style="width: 600px; margin-top: 8px;" class="mm-divider"></div> 

<script>
function updateCorePageCSSForm()
{	
	if(jQuery("#mm_use_mm_css_checkout_cb").is(":checked")) 
	{
		jQuery("#mm_use_mm_css_checkout").val("1");
	} 
	else 
	{
 * (c) MemberMouse, LLC. All rights reserved.
 */
if (isset($_POST["mm_acct_sharing_max_ips"])) {
    if (isset($_POST["mm_enable_acct_sharing_prevention"]) && $_POST["mm_enable_acct_sharing_prevention"] == "on") {
        if (intval($_POST["mm_acct_sharing_max_ips"]) < 1) {
            ?>
			<script>
			alert("Please enter the maximum number of IP addresses for Account Sharing Protection. It must be greater than 0.");
			</script>
		<?php 
        } else {
            MM_OptionUtils::setOption(MM_OptionUtils::$OPTION_KEY_ACCT_SECURITY_ENABLED, "1");
            MM_OptionUtils::setOption(MM_OptionUtils::$OPTION_KEY_ACCT_SECURITY_MAX_IPS, $_POST["mm_acct_sharing_max_ips"]);
        }
    } else {
        MM_OptionUtils::setOption(MM_OptionUtils::$OPTION_KEY_ACCT_SECURITY_ENABLED, "0");
    }
}
$enabled = MM_OptionUtils::getOption(MM_OptionUtils::$OPTION_KEY_ACCT_SECURITY_ENABLED);
$maxIPs = MM_OptionUtils::getOption(MM_OptionUtils::$OPTION_KEY_ACCT_SECURITY_MAX_IPS);
if ($maxIPs === false || $maxIPs === "") {
    $maxIPs = MM_OptionUtils::$DEFAULT_ACCT_SECURITY_MAX_IPS;
}
?>
<div style="width: 600px; margin-top: 8px;" class="mm-divider"></div> 
<div class="mm-wrap">
    <p class="mm-header-text">Account Sharing Protection <span style="font-size:12px;"><a href="https://membermouse.uservoice.com/knowledgebase/articles/319079-account-sharing-protection" target="_blank">Learn more</a></span></p>
   
	<div style="margin-top:10px;">
		<input onchange="mmjs.showAccountSharingForm()" id="mm-cb-enable-acct-sharing-prevention" name="mm_enable_acct_sharing_prevention" type="checkbox"  <?php 
echo $enabled == "0" ? "" : "checked";
Esempio n. 10
0
 public function showNotices()
 {
     $this->checkVersion();
     // check to see if cache is being used
     $writeableDir = MM_PLUGIN_ABSPATH . "/com/membermouse/cache";
     $usingDbCache = false;
     if (class_exists("MM_Session")) {
         $usingDbCache = MM_Session::value(MM_Session::$KEY_USING_DB_CACHE);
         if (empty($usingDbCache)) {
             $usingDbCache = false;
         }
     }
     if (!isset($_GET['module']) || $_GET['module'] != MM_MODULE_REPAIR_INSTALL) {
         $cacheRepairUrl = MM_ModuleUtils::getUrl(MM_MODULE_GENERAL_SETTINGS, MM_MODULE_REPAIR_INSTALL);
         if (!file_exists($writeableDir) || is_dir($writeableDir) && !is_writeable($writeableDir)) {
             MM_Messages::addMessage("Currently MemberMouse can't utilize the cache. <a href='{$cacheRepairUrl}'>Click here to correct this.</a>");
             if (!file_exists($writeableDir)) {
                 @mkdir($writeableDir);
                 //if the cache directory is missing, attempt to create it silently if possible
             }
         } else {
             if ($usingDbCache) {
                 //this means the dbcache is in use, but the cache is now writeable, show banner and see if refresh is available
                 MM_Messages::addMessage("Currently MemberMouse can't utilize the cache. <a href='{$cacheRepairUrl}'>Click here to correct this.</a>");
                 $lastAuth = MM_OptionUtils::getOption(MM_OptionUtils::$OPTION_KEY_LAST_CODE_REFRESH);
                 $minInterval = time() - 60;
                 //(1 min)
                 if (class_exists("MM_MemberMouseService") && (empty($lastAuth) || $lastAuth <= $minInterval)) {
                     $refreshSuccess = MM_MemberMouseService::authorize();
                     MM_OptionUtils::setOption(MM_OptionUtils::$OPTION_KEY_LAST_CODE_REFRESH, time());
                 }
                 MM_Session::clear(MM_Session::$KEY_USING_DB_CACHE);
             }
         }
     }
     // check to see if this is a beta version
     if (MM_IS_BETA == true) {
         $mmVersion = self::getPluginVersion();
         $msg = "<div style='width:750px;'><em class='mm-beta'>beta</em><strong>MemberMouse {$mmVersion}</strong>";
         $msg .= "<div style='margin-left:20px; margin-top:5px; line-height:22px;'>This is a Beta version of MemberMouse.<br/>";
         $msg .= "<i class=\"fa fa-caret-right\"></i> <a href='http://membermouse.com/beta-release-notes.php?version={$mmVersion}' target='_blank'>Beta {$mmVersion} Release Notes</a><br/>";
         $msg .= "<i class=\"fa fa-caret-right\"></i> Email <a href='mailto:beta@membermouse.com'>beta@membermouse.com</a> for support or questions on the beta version</div>";
         $msg .= "</div>";
         MM_Messages::addError($msg);
     }
     // check to see if there's a new version of MM available
     if (class_exists("MM_MemberMouseService")) {
         // check if there's an upgrade available
         $crntMajorVersion = self::getPluginVersion();
         $upgradeVersion = MM_OptionUtils::getOption(MM_OptionUtils::$OPTION_KEY_UPGRADE_NOTICE);
         if (!empty($upgradeVersion)) {
             if (version_compare($upgradeVersion, $crntMajorVersion, ">") || MM_IS_BETA == true && version_compare($upgradeVersion, $crntMajorVersion, "==")) {
                 // verify that customer is on PHP 5.3+
                 if ((double) phpversion() < 5.3) {
                     $phpWarning = "<div style='width:750px;'><i class=\"fa fa-exclamation-triangle\"></i> <strong>Warning:</strong> A new version of MemberMouse is available. In order to upgrade to the latest version of MemberMouse you will need to upgrade to PHP 5.3 or higher.</div>";
                     MM_Messages::addError($phpWarning);
                 } else {
                     if (strpos($_SERVER["PHP_SELF"], "plugins.php") === false && !(isset($_GET["action"]) && $_GET["action"] == "upgrade-plugin")) {
                         MM_Messages::addMessage("<a href='https://membermouse.uservoice.com/knowledgebase/articles/319210-membermouse-versions' target='_blank'>MemberMouse {$upgradeVersion}</a> is available! <a href='plugins.php?plugin_update=membermouse&version={$upgradeVersion}'>Please update now</a>.");
                     }
                 }
             }
         }
         // check if plugin needs to be upgraded
         global $wpdb;
         $sql = "SELECT count(u.wp_user_id) as total FROM " . MM_TABLE_USER_DATA . " u, " . MM_TABLE_MEMBERSHIP_LEVELS . " m WHERE ";
         $sql .= "u.membership_level_id = m.id AND (u.status = '" . MM_Status::$ACTIVE . "' OR u.status = '" . MM_Status::$PENDING_CANCELLATION . "') ";
         $result = $wpdb->get_row($sql);
         if ($result) {
             $activeMembers = intval($result->total);
             $memberLimit = intval(MM_MemberMouseService::getMemberLimit());
             $upgradeUrl = MM_MemberMouseService::getUpgradeUrl();
             if ($memberLimit != -1 && $activeMembers > $memberLimit) {
                 MM_Messages::addMessage("MemberMouse is currently over the limit of " . number_format($memberLimit) . " members and will be deactivated within a week of going over the limit. Please <a href='{$upgradeUrl}' target='_blank'>upgrade your account</a> to avoid any service interruptions.");
             }
         }
         // check to see if in Safe Mode
         $safeMode = MM_SafeMode::getMode();
         if ($safeMode == MM_SafeMode::$MODE_ENABLED) {
             $safeModeUrl = MM_ModuleUtils::getUrl(MM_MODULE_GENERAL_SETTINGS, MM_MODULE_SAFE_MODE);
             MM_Messages::addError("<i class=\"fa fa-life-saver\"></i> MemberMouse Safe Mode is Enabled. <a href='{$safeModeUrl}'>Safe Mode Settings</a>");
         }
         //check to see if payment subsystem is in test mode or if test data is being used.
         $testPaymentSrvcEnabled = class_exists("MM_TestPaymentService") && MM_TestPaymentService::isSiteUsingTestService();
         $testDataEnabled = MM_OptionUtils::getOption(MM_OptionUtils::$OPTION_KEY_USE_CHECKOUT_FORM_TEST_DATA) == "1" ? true : false;
         if ($testPaymentSrvcEnabled || $testDataEnabled) {
             $errorMsg = "<i class=\"fa fa-flask\"></i> <strong>MemberMouse Testing Enabled</strong>";
             $errorMsg .= "<div style='margin-left:20px;'>";
             if ($testPaymentSrvcEnabled) {
                 $paymentSettingsUrl = MM_ModuleUtils::getUrl(MM_MODULE_PAYMENT_SETTINGS, MM_MODULE_PAYMENT_METHODS);
                 $errorMsg .= "<i class=\"fa fa-caret-right\"></i> Test Payment Service is enabled. ";
                 $errorMsg .= "All charges will be processed by the test payment service. ";
                 $errorMsg .= "<a href='{$paymentSettingsUrl}'>Payment Method Settings</a><br/>";
             }
             if ($testDataEnabled) {
                 $testDataSettingsUrl = MM_ModuleUtils::getUrl(MM_MODULE_PAYMENT_SETTINGS, MM_MODULE_TEST_DATA);
                 $errorMsg .= "<i class=\"fa fa-caret-right\"></i> Test Data is enabled. All checkout forms will be prepopulated with test data. <a href='{$testDataSettingsUrl}'>Test Data Settings</a>";
             }
             $errorMsg .= "</div>";
             MM_Messages::addError($errorMsg);
         }
     }
     // check PHP version
     if ((double) phpversion() < 5.3) {
         $phpWarning = "<div style='width:750px;'><i class=\"fa fa-exclamation-triangle\"></i> <strong>Warning:</strong> Your webserver is running PHP ";
         $phpWarning .= phpversion();
         $phpWarning .= ", which is an obsolete version of PHP. MemberMouse isn't compatible with versions of PHP lower than 5.3 and you will experience issues ";
         $phpWarning .= "using the MemberMouse plugin. Please contact your hosting provider and request a more recent version of PHP. ";
         $phpWarning .= "For more information, <a href='http://membermouse.uservoice.com/knowledgebase/articles/534052' target='_blank'>click here</a>.</div>";
         MM_Messages::addError($phpWarning);
     }
     // check to see if any trouble plugins are activated
     MM_Utils::getPluginWarnings();
     // get error messages
     $errors = MM_Messages::get(MM_Session::$KEY_ERRORS);
     $output = "";
     if (is_array($errors) && count($errors) > 0) {
         $output .= "<div class=\"error\">";
         foreach ($errors as $msg) {
             $output .= "<p>{$msg}</p>";
         }
         $output .= "</div>";
     }
     // get notices
     $messages = MM_Messages::get(MM_Session::$KEY_MESSAGES);
     if (is_array($messages) && count($messages) > 0) {
         $output .= "<div class=\"updated\">";
         foreach ($messages as $msg) {
             $output .= "<p>{$msg}</p>";
         }
         $output .= "</div>";
     }
     echo $output;
     MM_Messages::clear();
 }
<?php

/**
 * 
 * MemberMouse(TM) (http://www.membermouse.com)
 * (c) MemberMouse, LLC. All rights reserved.
 */
if (isset($_POST["mm_allow_logged_out_purchases"])) {
    MM_OptionUtils::setOption(MM_OptionUtils::$OPTION_KEY_ALLOW_LOGGED_OUT_PURCHASES, $_POST["mm_allow_logged_out_purchases"]);
}
$allowLoggedOutPurchases = MM_OptionUtils::getOption(MM_OptionUtils::$OPTION_KEY_ALLOW_LOGGED_OUT_PURCHASES);
?>
<script>
function allowPurchasesChangeHandler()
{
	if(jQuery("#mm_allow_logged_out_purchases_cb").is(":checked")) 
	{
		jQuery("#mm_allow_logged_out_purchases").val("1");
	} 
	else 
	{
		jQuery("#mm_allow_logged_out_purchases").val("0");
	}
}
</script>
<div class="mm-wrap">
    <p class="mm-header-text">Allow Logged Out Purchases <span style="font-size:12px;"><a href="https://membermouse.uservoice.com/knowledgebase/articles/319029-allow-logged-out-member-s-to-make-purchases" target="_blank">Learn more</a></span></p>
    <div style="clear:both; height: 10px;"></div>
    <div style="margin-bottom:10px; width:550px;">Checking the checkbox below indicates that when a logged out user attempts 
    to make a purchase using an email address associated with an existing account that the purchase should be associated with the existing
    account. If the option below is unchecked, an error will be displayed to the user indicating that an account already exists with that
Esempio n. 12
0
 public static function load($className, $canRecurse = true)
 {
     if (!$canRecurse) {
         LogMe::write("Missing {$className} from cache");
         showLoadedClasses($className, "Eval Missing {$className} from cache");
     }
     /** only try to load MemberMouse classes **/
     if (strpos($className, "MM_") !== 0 && !preg_match("/LogMe/", $className)) {
         return false;
     }
     $exclusions = array("MemberMouse");
     if (in_array($className, $exclusions)) {
         return false;
     }
     /** end exclusions **/
     $classFileName = str_replace("MM_", "", $className);
     if (self::includeLimitedLocalFiles($className, $classFileName)) {
         return true;
     }
     $forceUseDBCache = MM_OptionUtils::getOption(MM_OptionUtils::$OPTION_KEY_FORCE_USE_DB_CACHE) == "1" ? true : false;
     if (isLocalInstall("localhost") && !$forceUseDBCache) {
         // look locally
         if (self::includeLocalFiles($className, $classFileName)) {
             return true;
         }
         if (class_exists($className, false) || interface_exists($className, false)) {
             return true;
         } else {
             if (self::includeCacheFiles($className, $classFileName)) {
                 return true;
             }
             /// get db class
             if (self::includeDBClass($className, $classFileName)) {
                 if ($classFileName != "MemberMouseService") {
                     MM_Session::value(MM_Session::$KEY_USING_DB_CACHE, true);
                 }
                 return true;
             }
         }
     } else {
         if (class_exists($className, false) || interface_exists($className, false)) {
             return true;
         } else {
             if (self::includeCacheFiles($className, $classFileName)) {
                 return true;
             }
             // get class from DB
             if (self::includeDBClass($className, $classFileName)) {
                 if ($classFileName != "MemberMouseService") {
                     MM_Session::value(MM_Session::$KEY_USING_DB_CACHE, true);
                 }
                 return true;
             }
         }
         // look locally
         if (self::includeLocalFiles($className, $classFileName)) {
             return true;
         }
     }
     //if execution gets here, then a needed class is unloadable, meaning its not in the cache or in the dbcache
     //reauth if we haven't already done so in the last 10 mins, and attempt to populate both
     $lastAuth = MM_OptionUtils::getOption(MM_OptionUtils::$OPTION_KEY_LAST_CODE_REFRESH);
     $minInterval = time() - 600;
     //(600 secs = 10 min)
     if ($canRecurse && class_exists("MM_MemberMouseService") && (empty($lastAuth) || $lastAuth <= $minInterval)) {
         $authSuccess = MM_MemberMouseService::authorize();
         MM_OptionUtils::setOption(MM_OptionUtils::$OPTION_KEY_LAST_CODE_REFRESH, time());
         if ($authSuccess) {
             return MM_ClassLoader::load($className, false);
             //this will break if the session doesnt work.. but then you have bigger problems...
         }
     }
     return false;
 }
<?php

if (isset($_POST["mm_checkout_paid_message"])) {
    $checkoutPaidMessage = $_POST["mm_checkout_paid_message"];
    $checkoutFreeMessage = $_POST["mm_checkout_free_message"];
    $checkoutMessageCSS = $_POST["mm_checkout_message_css"];
    MM_OptionUtils::setOption(MM_OptionUtils::$OPTION_KEY_CHECKOUT_PAID_MESSAGE, trim($checkoutPaidMessage));
    MM_OptionUtils::setOption(MM_OptionUtils::$OPTION_KEY_CHECKOUT_FREE_MESSAGE, trim($checkoutFreeMessage));
    MM_OptionUtils::setOption(MM_OptionUtils::$OPTION_KEY_CHECKOUT_MESSAGE_CSS, trim($checkoutMessageCSS));
}
$checkoutPaidMessage = MM_OptionUtils::getOption(MM_OptionUtils::$OPTION_KEY_CHECKOUT_PAID_MESSAGE);
$checkoutFreeMessage = MM_OptionUtils::getOption(MM_OptionUtils::$OPTION_KEY_CHECKOUT_FREE_MESSAGE);
$checkoutMessageCSS = MM_OptionUtils::getOption(MM_OptionUtils::$OPTION_KEY_CHECKOUT_MESSAGE_CSS);
?>
<script>
function updatePreviewButton()
{
	jQuery("#mm-save-changes").show();
}
</script>
<div class="mm-wrap">
    <p class="mm-header-text">Checkout Processing Message <span style="font-size:12px;"><a href="https://membermouse.uservoice.com/knowledgebase/articles/319032-customize-the-checkout-page-processing-message" target="_blank">Learn more</a></span></p>
	<table style="margin-bottom:10px;">
		<tr>
			<td width='110' style='vertical-align:top;'>Paid Message<?php 
echo MM_Utils::getInfoIcon("This is the message that will be displayed to customers when a payment is being processed.");
?>
</td>
			<td>
				<span style="font-family: courier; font-size: 11px;">
				<textarea id='mm_checkout_paid_message' name='mm_checkout_paid_message' style="width: 380px; height: 50px;" onkeydown="updatePreviewButton()"><?php 
Esempio n. 14
0
<?php

/**
 *
 * MemberMouse(TM) (http://www.membermouse.com)
 * (c) MemberMouse, LLC. All rights reserved.
 */
$error = "";
if (isset($_POST[MM_OptionUtils::$OPTION_KEY_LOGIN_TOKEN_LIFESPAN])) {
    if (!preg_match("/[0-9]+/", $_POST[MM_OptionUtils::$OPTION_KEY_LOGIN_TOKEN_LIFESPAN]) || intval($_POST[MM_OptionUtils::$OPTION_KEY_LOGIN_TOKEN_LIFESPAN]) <= 0) {
        $error = "Login token lifespan must be greater than 0.";
    }
    if (empty($error)) {
        MM_OptionUtils::setOption(MM_OptionUtils::$OPTION_KEY_LOGIN_TOKEN_LIFESPAN, $_POST[MM_OptionUtils::$OPTION_KEY_LOGIN_TOKEN_LIFESPAN]);
    }
}
$lifespan = MM_OptionUtils::getOption(MM_OptionUtils::$OPTION_KEY_LOGIN_TOKEN_LIFESPAN);
if (!preg_match("/[0-9]+/", $lifespan)) {
    $lifespan = MM_OptionUtils::$DEFAULT_LOGIN_TOKEN_LIFESPAN;
}
$loginTokenLifespanDesc = "When the auto-login attribute is set to true on certain [MM_..._Link] SmartTags, a login token is created that allows the customer to be automatically logged in when they click the link. ";
$loginTokenLifespanDesc .= "This setting indicates how long that login token will be valid.";
?>

<div style="width: 600px; margin-top: 8px;" class="mm-divider"></div> 

<div class="mm-wrap">
	<p class="mm-header-text">Login Token Settings <span style="font-size:12px;"><a href="http://membermouse.uservoice.com/knowledgebase/articles/776460" target="_blank">Learn more</a></span></p>
	
	<div style="margin-top:10px;">
		Login tokens are valid for
Esempio n. 15
0
<?php

/**
 * 
 * MemberMouse(TM) (http://www.membermouse.com)
 * (c) MemberMouse, LLC. All rights reserved.
 */
if (isset($_POST["mm_hide_menu_items"])) {
    MM_OptionUtils::setOption(MM_OptionUtils::$OPTION_KEY_HIDE_PROTECTED_MENU_ITEMS, $_POST["mm_hide_menu_items"]);
}
if (isset($_POST["mm_show_login_logout_link"])) {
    MM_OptionUtils::setOption(MM_OptionUtils::$OPTION_KEY_SHOW_LOGIN_LOGOUT_LINK, $_POST["mm_show_login_logout_link"]);
}
$hideMenuItems = MM_OptionUtils::getOption(MM_OptionUtils::$OPTION_KEY_HIDE_PROTECTED_MENU_ITEMS);
$hideMenuItemsDesc = "When this is checked MemberMouse will automatically show/hide protected pages in the WordPress menu based on the access rights of the logged in member.";
$showLoginLogoutLink = MM_OptionUtils::getOption(MM_OptionUtils::$OPTION_KEY_SHOW_LOGIN_LOGOUT_LINK);
$showLinkDesc = "When this is checked MemberMouse will automatically add a login/logout link to the primary WordPress menu. NOTE: In order for this to work, your theme should support WordPress 3.0 menus and you should create a primary menu for your site in Appearance > Menus.";
?>
<div style="width: 600px; margin-top: 8px;" class="mm-divider"></div> 
<div class="mm-wrap">
    <p class="mm-header-text">WordPress Menu Options</p>
    
	<div style="margin-top:10px;">
		<input id="mm_hide_menu_items_cb" type="checkbox" <?php 
echo $hideMenuItems == "1" ? "checked" : "";
?>
 onchange="mmjs.updateWPMenuSettingsForm();" />
		Hide Protected Menu Items<?php 
echo MM_Utils::getInfoIcon($hideMenuItemsDesc);
?>
		<input id="mm_hide_menu_items" name="mm_hide_menu_items" type="hidden" value="<?php 
Esempio n. 16
0
<?php

/**
 * 
 * MemberMouse(TM) (http://www.membermouse.com)
 * (c) MemberMouse, LLC. All rights reserved.
 */
if (isset($_POST["mm_enable_membership_proration"])) {
    MM_OptionUtils::setOption(MM_OptionUtils::$OPTION_KEY_ENABLE_MEMBERSHIP_PRORATION, $_POST["mm_enable_membership_proration"]);
}
$enableMembershipProration = MM_OptionUtils::getOption(MM_OptionUtils::$OPTION_KEY_ENABLE_MEMBERSHIP_PRORATION);
?>
<script>
function enableProrationChangeHandler()
{
	if(jQuery("#mm_enable_membership_proration_cb").is(":checked")) 
	{
		jQuery("#mm_enable_membership_proration").val("1");
	} 
	else 
	{
		jQuery("#mm_enable_membership_proration").val("0");
	}
}
</script>
<div class="mm-wrap">
    <p class="mm-header-text">Prorate Membership Subscription on Upgrade/Downgrade <span style="font-size:12px;"><a href="http://membermouse.uservoice.com/knowledgebase/articles/395932" target="_blank">Learn more</a></span></p>
    <div style="clear:both; height: 10px;"></div>
    <div style="margin-bottom:10px; width:550px;">Checking the checkbox below will enable proration when an existing member upgrades/downgrades 
    their membership. If there's an unused balance on the member's current subsription at the time they siwtch, this will be applied a credit to 
    the first charge on the new subscription. In order for a proration to be applied the following must be true:
Esempio n. 17
0
<?php

/**
 * 
 * MemberMouse(TM) (http://www.membermouse.com)
 * (c) MemberMouse, LLC. All rights reserved.
 */
if (isset($_POST["mm_login_page"])) {
    MM_OptionUtils::setOption(MM_OptionUtils::$OPTION_KEY_USE_MM_LOGIN_PAGE, $_POST["mm_login_page"]);
    MM_OptionUtils::setOption(MM_OptionUtils::$OPTION_KEY_USE_MM_RESET_PASSWORD_PAGE, $_POST["mm_reset_password_page"]);
}
$useMMLoginPage = MM_OptionUtils::getOption(MM_OptionUtils::$OPTION_KEY_USE_MM_LOGIN_PAGE);
$useMMResetPasswordPage = MM_OptionUtils::getOption(MM_OptionUtils::$OPTION_KEY_USE_MM_RESET_PASSWORD_PAGE);
?>
<div style="width: 600px; margin-top: 8px;" class="mm-divider"></div> 

<script>
function updateWPLoginPageForm()
{	
	if(jQuery("#mm_login_page_cb").is(":checked")) 
	{
		jQuery("#mm_login_page").val("1");
	} 
	else 
	{
		jQuery("#mm_login_page").val("0");
	}

	if(jQuery("#mm_reset_password_page_cb").is(":checked")) 
	{
		jQuery("#mm_reset_password_page").val("1");
Esempio n. 18
0
 /**
  * Handler for actions that need to happen when a page is published, or is edited to have the status changed to published
  * 
  * @param int $ID
  * @param string $post
  */
 public function publishPageHandler($ID, $post)
 {
     if (MM_CorePageEngine::isCheckoutCorePage($ID)) {
         //if a captcha is included on the checkout page, set flag in the database to enforce checking it
         $hasCaptcha = preg_match("/\\[\\s*mm_form_field\\s+(.*)(type=['\"]input['\"]){0,1}(name=['\"]captcha['\"])(.*)(type=['\"]input['\"]){0,1}(.*)\\]/i", $post->post_content) ? 1 : 0;
         MM_OptionUtils::setOption(MM_OptionUtils::$OPTION_KEY_CAPTCHA_ENABLED, $hasCaptcha);
     }
     //rebuild core page cache in case the permalink has changed
     MM_CorePageEngine::createCorePageCache();
 }
Esempio n. 19
0
 /**
  * Log a safe mode event
  * 
  * @param String $mode one of the possible modes
  * @param String $message the message to log
  */
 public static function log($mode, $message)
 {
     $log = MM_OptionUtils::getOption(MM_OptionUtils::$OPTION_KEY_SAFE_MODE_LOG);
     if (!empty($log)) {
         $log = unserialize($log);
     } else {
         $log = array();
     }
     $logEvent = new stdClass();
     $logEvent->date = date('M j, Y g:i a');
     $logEvent->mode = $mode;
     $logEvent->message = $message;
     array_unshift($log, $logEvent);
     MM_OptionUtils::setOption(MM_OptionUtils::$OPTION_KEY_SAFE_MODE_LOG, serialize($log));
 }
Esempio n. 20
0
 * (c) MemberMouse, LLC. All rights reserved.
 */
if (isset($_POST["mm_cleanup_interval"])) {
    if (isset($_POST["mm_enable_activity_log_cleanup"]) && $_POST["mm_enable_activity_log_cleanup"] == "on") {
        if (intval($_POST["mm_cleanup_interval"]) < 1) {
            ?>
			<script>
			alert("The activity log cleanup interval must be greater than 0");
			</script>
		<?php 
        } else {
            MM_OptionUtils::setOption(MM_OptionUtils::$OPTION_KEY_ACTIVITY_LOG_CLEANUP_ENABLED, "1");
            MM_OptionUtils::setOption(MM_OptionUtils::$OPTION_KEY_ACTIVITY_LOG_CLEANUP_INTERVAL, $_POST["mm_cleanup_interval"]);
        }
    } else {
        MM_OptionUtils::setOption(MM_OptionUtils::$OPTION_KEY_ACTIVITY_LOG_CLEANUP_ENABLED, "0");
    }
}
$enabled = MM_OptionUtils::getOption(MM_OptionUtils::$OPTION_KEY_ACTIVITY_LOG_CLEANUP_ENABLED);
$cleanupInterval = MM_OptionUtils::getOption(MM_OptionUtils::$OPTION_KEY_ACTIVITY_LOG_CLEANUP_INTERVAL);
if ($cleanupInterval === false || $cleanupInterval === "") {
    $cleanupInterval = MM_OptionUtils::$DEFAULT_ACTIVITY_LOG_CLEANUP_INTERVAL;
}
?>
<div style="width: 600px; margin-top: 8px;" class="mm-divider"></div> 
<div class="mm-wrap">
    <p class="mm-header-text">Activity Log Settings <span style="font-size:12px;"><a href="https://membermouse.uservoice.com/knowledgebase/articles/319088-configure-activity-log-cleanup" target="_blank">Learn more</a></span></p>
   
	<div style="margin-top:10px;">
		<input onchange="mmjs.showActivityLogForm()" id="mm-cb-enable-activity-log-cleanup" name="mm_enable_activity_log_cleanup" type="checkbox"  <?php 
echo $enabled == "0" ? "" : "checked";
Esempio n. 21
0
<?php

/**
 *
 * MemberMouse(TM) (http://www.membermouse.com)
 * (c) MemberMouse, LLC. All rights reserved.
 */
if (isset($_POST["cancel_method"])) {
    MM_OptionUtils::setOption(MM_OptionUtils::$OPTION_KEY_DFLT_CANCELLATION_METHOD, $_POST["cancel_method"]);
}
$cancelChecked = MM_OptionUtils::getOption(MM_OptionUtils::$OPTION_KEY_DFLT_CANCELLATION_METHOD);
?>

<form method='post'>
<div class="mm-wrap" style='width: 600px;'> 
	
<p>MemberMouse supports two different cancellation methods: a hard cancel and pause. With a hard cancel, the member won't be 
able to log in at all. With a pause, the member will be able to log in and access all the protected content they had access to 
up until the time their account was paused. With the paused status, their drip content schedule won't progress so they won't 
get access to any additional content unless their account is reactivated.</p>

<p>There are 3 ways a member's account can be canceled:</p>

<ol>
<li>By the member themselves through the <code>[MM_Member_Link]</code> SmartTag</li>
<li>By an administrator through the Member Details &gt; Manage Access Rights page by clicking <em>Cancel Membership</em> or <em>Pause Membership</em></li>
<li>By MemberMouse, when responding to an event that occurs in your payment service (i.e. stop recurring, void or refund)</li>
</ol>

<p>It's the third case that you need to tell MemberMouse which method to use.</p>
Esempio n. 22
0
 /**
  * Returns the configured mode of the diagnostic log. It the option has never been set, it is set to $MODE_OFF initially
  * 
  * @return string One of MM_DiagnosticLog::$MODE_OFF, MM_DiagnosticLog::$MODE_ERRORS, or MM_DiagnosticLog::$MODE_FULL
  */
 public static function getMode()
 {
     $mode = MM_OptionUtils::getOption(MM_OptionUtils::$OPTION_KEY_DIAGNOSTIC_MODE);
     $modeList = self::getModeLabels();
     if (!in_array($mode, array_keys($modeList))) {
         $mode = self::$MODE_OFF;
         MM_OptionUtils::setOption(MM_OptionUtils::$OPTION_KEY_DIAGNOSTIC_MODE, $mode);
     }
     return $mode;
 }
<?php

/**
 * 
 * MemberMouse(TM) (http://www.membermouse.com)
 * (c) MemberMouse, LLC. All rights reserved.
 */
if (isset($_POST["mm_allow_overdue_access"])) {
    MM_OptionUtils::setOption(MM_OptionUtils::$OPTION_KEY_ALLOW_OVERDUE_ACCESS, $_POST["mm_allow_overdue_access"]);
}
$allowOverdueAccess = MM_OptionUtils::getOption(MM_OptionUtils::$OPTION_KEY_ALLOW_OVERDUE_ACCESS);
?>
<div style="width: 600px; margin-top: 8px;" class="mm-divider"></div> 

<script>
function updateContentProtectionForm()
{	
	if(jQuery("#mm_allow_overdue_access_cb").is(":checked")) 
	{
		jQuery("#mm_allow_overdue_access").val("1");
	} 
	else 
	{
		jQuery("#mm_allow_overdue_access").val("0");
	}
}
</script>

<div class="mm-wrap">
    <p class="mm-header-text">Content Protection Settings</p>
Esempio n. 24
0
<?php

/**
 * 
 * MemberMouse(TM) (http://www.membermouse.com)
 * (c) MemberMouse, LLC. All rights reserved.
 */
if (isset($_POST["mm_selected_currency"])) {
    //update default currency
    if (in_array($_POST['mm_selected_currency'], array_keys(MM_CurrencyUtil::getSupportedCurrencies()))) {
        MM_OptionUtils::setOption(MM_OptionUtils::$OPTION_KEY_CURRENCY, $_POST["mm_selected_currency"]);
    }
    if (isset($_POST["mm_postfix_iso_to_currency"]) && $_POST["mm_postfix_iso_to_currency"] == "1") {
        MM_OptionUtils::setOption(MM_OptionUtils::$OPTION_KEY_CURRENCY_FORMAT_POSTFIX_ISO, true);
    } else {
        MM_OptionUtils::setOption(MM_OptionUtils::$OPTION_KEY_CURRENCY_FORMAT_POSTFIX_ISO, false);
    }
}
$currentCurrency = MM_OptionUtils::getOption(MM_OptionUtils::$OPTION_KEY_CURRENCY);
$postfixIsoToCurrency = MM_OptionUtils::getOption(MM_OptionUtils::$OPTION_KEY_CURRENCY_FORMAT_POSTFIX_ISO);
$postfixIsoToCurrency = empty($postfixIsoToCurrency) ? false : $postfixIsoToCurrency;
//check the support of the active payment services for the currently selected currency
$activePaymentServices = MM_PaymentServiceFactory::getAvailablePaymentServices();
$unsupportedPaymentServices = array();
foreach ($activePaymentServices as $aps) {
    if (!$aps->isSupportedCurrency($currentCurrency)) {
        $unsupportedPaymentServices[] = $aps->getName();
    }
}
$warningMsg = "";
$warningBox = "";
Esempio n. 25
0
<?php

/**
 * 
 * MemberMouse(TM) (http://www.membermouse.com)
 * (c) MemberMouse, LLC. All rights reserved.
 */
if (isset($_POST["mm_checkout_item_type"])) {
    MM_OptionUtils::setOption(MM_OptionUtils::$OPTION_KEY_DEFAULT_CHECKOUT_ITEM_TYPE, $_POST["mm_checkout_item_type"]);
    if ($_POST["mm_checkout_item_type"] == "membership_level") {
        MM_OptionUtils::setOption(MM_OptionUtils::$OPTION_KEY_DEFAULT_CHECKOUT_ITEM_ID, $_POST["mm_membership_level_selector"]);
    } else {
        MM_OptionUtils::setOption(MM_OptionUtils::$OPTION_KEY_DEFAULT_CHECKOUT_ITEM_ID, $_POST["mm_product_selector"]);
    }
}
$dfltCheckoutItemType = MM_OptionUtils::getOption(MM_OptionUtils::$OPTION_KEY_DEFAULT_CHECKOUT_ITEM_TYPE);
$dfltCheckoutItemId = MM_OptionUtils::getOption(MM_OptionUtils::$OPTION_KEY_DEFAULT_CHECKOUT_ITEM_ID);
if (empty($dfltCheckoutItemId) || intval($dfltCheckoutItemId) == -1) {
    $dfltCheckoutItemType = "membership_level";
    $dfltMembership = MM_MembershipLevel::getDefaultMembership();
    $dfltCheckoutItemId = $dfltMembership->getId();
}
?>
<script>
function itemTypeChangeHandler()
{
	if(jQuery("input:radio[name=mm_checkout_item_type]:checked").val() == "membership_level") 
	{
		jQuery("#mm_membership_level_selector").show();
		jQuery("#mm_product_selector").hide();
	} 
Esempio n. 26
0
<?php

/**
 *
 * MemberMouse(TM) (http://www.membermouse.com)
 * (c) MemberMouse, LLC. All rights reserved.
 */
if (isset($_POST["clear-upgrade-notice"]) && $_POST["clear-upgrade-notice"] == "1") {
    MM_OptionUtils::setOption(MM_OptionUtils::$OPTION_KEY_UPGRADE_NOTICE, "");
}
$versions = array();
$view = new MM_ManageInstallView();
$dataGrid = new MM_DataGrid($_REQUEST, "id", "desc", 10);
$dataGrid->showPagingControls = false;
$data = $view->getViewData($dataGrid);
$dataGrid->setTotalRecords($data);
$dataGrid->width = "500px";
$dataGrid->recordName = "version";
$rows = array();
$headers = array('version' => array('content' => '<a onclick="mmjs.sort(\'version\');" href="#">Version</a>'), 'date_added' => array('content' => '<a onclick="mmjs.sort(\'date_added\');" href="#">Date</a>'));
foreach ($data as $key => $item) {
    $rows[] = array(array('content' => $item->version), array('content' => MM_Utils::dateToLocal($item->date_added)));
}
$dataGrid->setHeaders($headers);
$dataGrid->setRows($rows);
$dgHtml = $dataGrid->generateHtml();
if ($dgHtml == "") {
    $dgHtml = "<p><i>No version history.</i></p>";
}
?>
<div class="mm-wrap">
Esempio n. 27
0
<?php

/**
 * 
 * MemberMouse(TM) (http://www.membermouse.com)
 * (c) MemberMouse, LLC. All rights reserved.
 */
if (isset($_POST["mm_use_jquery_ui"])) {
    MM_OptionUtils::setOption(MM_OptionUtils::$OPTION_KEY_USE_JQUERY_UI, $_POST["mm_use_jquery_ui"]);
}
$useJQueryUI = MM_OptionUtils::getOption(MM_OptionUtils::$OPTION_KEY_USE_JQUERY_UI);
?>
<div style="width: 600px; margin-top: 8px;" class="mm-divider"></div> 

<script>
function updateJQueryUIForm()
{	
	if(jQuery("#mm_use_jquery_ui_cb").is(":checked")) 
	{
		jQuery("#mm_use_jquery_ui").val("1");
	} 
	else 
	{
		jQuery("#mm_use_jquery_ui").val("0");
	}
}
</script>

<div class="mm-wrap">
    <p class="mm-header-text">jQuery UI Options <span style="font-size:12px;"><a href="https://membermouse.uservoice.com/knowledgebase/articles/319087-disable-jquery-ui" target="_blank">Learn more</a></span></p>
Esempio n. 28
0
<?php

/**
 * 
 * MemberMouse(TM) (http://www.membermouse.com)
 * (c) MemberMouse, LLC. All rights reserved.
 */
if (isset($_POST["mm_show_preview_settings_bar"])) {
    MM_OptionUtils::setOption(MM_OptionUtils::$OPTION_KEY_SHOW_PREVIEW_BAR, $_POST["mm_show_preview_settings_bar"]);
}
$showPreviewBar = MM_OptionUtils::getOption(MM_OptionUtils::$OPTION_KEY_SHOW_PREVIEW_BAR);
$showPreviewBarDesc = "When this is checked MemberMouse will display the preview settings bar when you're viewing your site as an administrator.";
?>
<div style="width: 600px; margin-top: 8px;" class="mm-divider"></div> 

<script>
function updatePreviewSettingsBarForm()
{	
	if(jQuery("#mm_show_preview_settings_bar_cb").is(":checked")) 
	{
		jQuery("#mm_show_preview_settings_bar").val("1");
	} 
	else 
	{
		jQuery("#mm_show_preview_settings_bar").val("0");
	}
}
</script>

<div class="mm-wrap">
	<a name="preview-settings-bar-options"></a>
Esempio n. 29
0
<?php

/**
 * 
 * MemberMouse(TM) (http://www.membermouse.com)
 * (c) MemberMouse, LLC. All rights reserved.
 */
if (isset($_POST["mm_purchase_link_style"])) {
    MM_OptionUtils::setOption(MM_OptionUtils::$OPTION_KEY_PURCHASE_LINK_STYLE, $_POST["mm_purchase_link_style"]);
    if ($_POST["mm_purchase_link_style"] == MM_LINK_STYLE_EXPLICIT) {
        MM_OptionUtils::setOption(MM_OptionUtils::$OPTION_KEY_DISABLE_EXPLICIT_LINKS, "0");
    } else {
        MM_OptionUtils::setOption(MM_OptionUtils::$OPTION_KEY_DISABLE_EXPLICIT_LINKS, $_POST["mm_disable_explicit_links"]);
    }
}
$crntLinkStyle = MM_OptionUtils::getOption(MM_OptionUtils::$OPTION_KEY_PURCHASE_LINK_STYLE);
$disableExplicitLinks = MM_OptionUtils::getOption(MM_OptionUtils::$OPTION_KEY_DISABLE_EXPLICIT_LINKS);
$linkSecurityDescription = "By default, MemberMouse allows both explicit and reference link styles. For increased security you can disable explicit links by checking off the box to the left. Doing this will keep customers from being able to manually modify purchase links to discover other products and membership levels that you're offering. If you have any links on your site or on 3rd party sites that use explicit links, you'll want to change these to reference links prior to disabling support for explicit links.";
?>
<script>
function disableExplicitLinksChangeHandler()
{
	if(jQuery("#mm_disable_explicit_links_cb").is(":checked")) 
	{
		jQuery("#mm_disable_explicit_links").val("1");
	} 
	else 
	{
		jQuery("#mm_disable_explicit_links").val("0");
	}
}
Esempio n. 30
0
<?php

/**
 * 
 * MemberMouse(TM) (http://www.membermouse.com)
 * (c) MemberMouse, LLC. All rights reserved.
 */
if (isset($_POST["mm_member_homepage_setting"])) {
    MM_OptionUtils::setOption(MM_OptionUtils::$OPTION_KEY_ON_LOGIN_USE_WP_FRONTPAGE, $_POST["mm_member_homepage_setting"]);
}
if (isset($_POST["mm_member_homepage_use_mbr_homepage"])) {
    MM_OptionUtils::setOption(MM_OptionUtils::$OPTION_KEY_AFTER_LOGIN_USE_WP_FRONTPAGE, $_POST["mm_member_homepage_use_mbr_homepage"]);
}
$useWPFrontpageOnLogin = MM_OptionUtils::getOption(MM_OptionUtils::$OPTION_KEY_ON_LOGIN_USE_WP_FRONTPAGE);
$useWPFrontpageAfterLogin = MM_OptionUtils::getOption(MM_OptionUtils::$OPTION_KEY_AFTER_LOGIN_USE_WP_FRONTPAGE);
?>

<div class="mm-wrap">
    <p class="mm-header-text">Member Homepage Settings <span style="font-size:12px;"><a href="https://membermouse.uservoice.com/knowledgebase/articles/319080-member-homepage-settings" target="_blank">Learn more</a></span></p>
	<div id="mm-form-container2" style="margin-top: 10px;">
	<p>When members login...</p>
		<div>
			<input onchange="mmjs.showMbrHomepageOptions();" name="mm_member_homepage_setting" value='0' type="radio" <?php 
echo $useWPFrontpageOnLogin != "1" ? "checked" : "";
?>
  />
			Redirect to a homepage specific to their membership level
		</div>
		<div style="magin-top:30px; margin-left:20px; margin-botton:20px; line-height:22px;" id="mm-mbr-homepage-options-div">
			When members are logged in and click to go to the site's homepage...<br/>
			<input name="mm_member_homepage_use_mbr_homepage" value='0' type="radio" <?php