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);
 }
示例#2
0
<script>
function appendAffiliateParams(url)
{
	if(jQuery("#mm-affiliate").val() != "")
	{
		url += "&<?php 
echo MM_OptionUtils::getOption(MM_OptionUtils::$OPTION_KEY_AFFILIATE);
?>
=";
		url += jQuery("#mm-affiliate").val();
	}

	if(jQuery("#mm-subaffiliate").val() != "")
	{
		url += "&<?php 
echo MM_OptionUtils::getOption(MM_OptionUtils::$OPTION_KEY_SUB_AFFILIATE);
?>
=";
		url += jQuery("#mm-subaffiliate").val();
	}

	return url;
}

function sendEmail(checkoutUrl)
{
	var subject = "Purchase '<?php 
echo addslashes($accessName);
?>
'";
	var body = "You can purchase '<?php 
<?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")) 
示例#4
0
<?php

/**
 * 
 * MemberMouse(TM) (http://www.membermouse.com)
 * (c) MemberMouse, LLC. All rights reserved.
 */
global $current_user;
$view = new MM_DiagnosticsView();
$currentMode = MM_DiagnosticLog::getMode();
$modeList = MM_DiagnosticLog::getModeLabels();
$modeListHtml = MM_HtmlUtils::generateSelectionsList($modeList, $currentMode);
// determine if this user's preference is to have the advanced search open
$showFilterOptionName = MM_OptionUtils::$OPTION_KEY_SHOW_DIAGNOSTICS_LOG_FILTERS . "-" . $current_user->ID;
$showFilterOptionValue = MM_OptionUtils::getOption($showFilterOptionName);
$showFilters = $showFilterOptionValue == "1";
?>
<div class="mm-wrap">
	<div>
		<table>
			<tr>
				<td>Current Mode:</td>
				<td><?php 
echo $modeList[$currentMode];
?>
</td>
			</tr>
			<tr>
				<td>Change mode to: </td>
				<td><select id="newMode" name="newMode">
						<?php 
示例#5
0
/**
 * 
 * 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();
	} 
	else 
<?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>
示例#7
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>
示例#8
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));
 }
示例#9
0
 * 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 = "";
$numUnsupported = count($unsupportedPaymentServices);
if ($numUnsupported > 0) {
    $lastService = "";
    if ($numUnsupported > 1) {
示例#10
0
<?php

/**
 * 
 * MemberMouse(TM) (http://www.membermouse.com)
 * (c) MemberMouse, LLC. All rights reserved.
 */
$memberData = array();
$memberData["mm_field_first_name"] = "";
$memberData["mm_field_last_name"] = "";
$memberData["mm_field_email"] = "";
$memberData["mm_field_phone"] = "";
$memberData["mm_field_password"] = "";
if (MM_OptionUtils::getOption(MM_OptionUtils::$OPTION_KEY_USE_CHECKOUT_FORM_TEST_DATA) == "1") {
    $testData = MM_TestDataUtils::getCheckoutFormTestData();
    $memberData["mm_field_first_name"] = MM_TestDataUtils::getTestValue($testData, "mm_field_first_name");
    $memberData["mm_field_last_name"] = MM_TestDataUtils::getTestValue($testData, "mm_field_last_name");
    $memberData["mm_field_email"] = MM_TestDataUtils::getTestValue($testData, "mm_field_email", true);
    $memberData["mm_field_password"] = MM_TestDataUtils::getTestValue($testData, "mm_field_password");
    $memberData["mm_field_phone"] = MM_TestDataUtils::getTestValue($testData, "mm_field_phone");
}
?>
<div id="mm-new-member-form-container">
	<table cellspacing="10">
		<tr>
			<td width="120">Membership Level</td>
			<td>
				<select id="mm-new-membership-selector" style="width:300px;">
					<?php 
echo MM_HtmlUtils::getMemberships(null, true);
?>
示例#11
0
 * (c) MemberMouse, LLC. All rights reserved.
 */
$view = new MM_MembersView();
$showSearch = false;
//only show 'export csv' option if current user is an administrator
global $current_user;
$showCsvExportButton = false;
if (isset($current_user) && isset($current_user->ID)) {
    $employee = MM_Employee::findByUserId($current_user->ID);
    if ($employee->isValid() && ($employee->getRoleId() == MM_Role::$ROLE_ADMINISTRATOR || $employee->doAllowExport())) {
        $showCsvExportButton = true;
    }
    echo "<input type='hidden' id='mm-admin-id' value='{$current_user->ID}' />";
    // determine if this user's preference is to have the advanced search open
    $showSearchOptionName = MM_OptionUtils::$OPTION_KEY_SHOW_MBRS_SEARCH . "-" . $current_user->ID;
    $showSearchOptionValue = MM_OptionUtils::getOption($showSearchOptionName);
    if ($showSearchOptionValue == "1") {
        $showSearch = true;
    }
}
?>
<div class="mm-wrap">
	<?php 
if (count(MM_MembershipLevel::getMembershipLevelsList()) > 0) {
    ?>
		<div style="margin-top:20px;" class="mm-button-container">			
			<a id="mm-show-search-btn" onclick="mmjs.showSearch()" class="mm-ui-button blue" <?php 
    echo $showSearch ? "style=\"display:none;\"" : "";
    ?>
><?php 
    echo MM_Utils::getIcon('search-plus');
示例#12
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;
 }
示例#13
0
<?php

/**
 * 
 * MemberMouse(TM) (http://www.membermouse.com)
 * (c) MemberMouse, LLC. All rights reserved.
 */
$cssStyles = is_admin_bar_showing() ? "margin-top:28px; " : "margin-top:0px; ";
if (MM_OptionUtils::getOption(MM_OptionUtils::$OPTION_KEY_SHOW_PREVIEW_BAR) == "0") {
    $cssStyles .= "display: none;";
}
$membershipsList = $p->memberTypes;
$bundleCount = $p->count_tags;
$appliedBundleCount = $p->count_applied;
$daysAsMemberList = $p->days;
$bundlesList = $p->accessTags;
$day = "";
$previewSettingsInfo = "When you're logged in as an administrator you can use the options to the right to preview your site with different access rights and at different times during the membership.";
$previewSettingsInfo .= "The options available to you will dynamically change based on what access rights you've used to protect content and the drip content schedules you've defined.";
?>

<div id="mm-preview-settings-bar" style="<?php 
echo $cssStyles;
?>
">
	<div style="float:left;">
		<span style="margin-right:10px;">
			MM Preview Settings <?php 
echo MM_Utils::getIcon('info-circle', 'grey', '1.3em', '2px', $previewSettingsInfo);
?>
		</span>
示例#14
0
        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";
?>
  />
		Enable activity log cleanup
			
示例#15
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();
 }
示例#16
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");
示例#17
0
 * 
 * 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 
	{
		jQuery("#mm_use_mm_css_checkout").val("0");
	}
function generatePurchaseSection($productId)
{
    ?>
	<div id="mm-purchaselinks-<?php 
    echo $productId;
    ?>
" style="display:none;">
	<p><strong>Purchase Link SmartTag</strong><?php 
    echo MM_Utils::getInfoIcon("You can use this Purchase Link SmartTag in any post or page on your site. When using this SmartTag MemberMouse will automatically generate a link customers can click on to purchase this bundle.");
    ?>
</p>
	
	<?php 
    $smartTag = "<a href=\"[MM_Purchase_Link productId='{$productId}']\">Buy Now</a>";
    ?>
	<input id="mm-smart-tag-<?php 
    echo $productId;
    ?>
" type="text" readonly value="<?php 
    echo htmlentities($smartTag);
    ?>
" style="width:440px; font-family:courier; font-size:11px;" onclick="jQuery('#mm-smart-tag-<?php 
    echo $productId;
    ?>
').focus(); jQuery('#mm-smart-tag-<?php 
    echo $productId;
    ?>
').select();" />
	
	<ul style="margin-left:20px;">
	<li>Set the <code>isGift</code> attribute to <code>true</code> to indicate that this purchase is a gift.</li>
	</ul>
	
	<p style="margin-left:20px;">
	Read this article to 
		<a href="https://membermouse.uservoice.com/knowledgebase/articles/319170-mm-purchase-link-smarttag" target="_blank">learn more about the <code>MM_Purchase_Link</code> SmartTag</a>.
	</p>
	
	<p><strong>Static Link</strong><?php 
    echo MM_Utils::getInfoIcon("You can use this link anywhere -- in a PPC or banner ad, email, on your site, on a 3rd party site, etc. Customers can click on this link to purchase this bundle.");
    ?>
</p>
	
	<input id="mm-static-link-<?php 
    echo $productId;
    ?>
" type="text" readonly value="<?php 
    echo htmlentities(MM_CorePageEngine::getCheckoutPageStaticLink($productId));
    ?>
" style="width:440px; font-family:courier; font-size:11px;" onclick="jQuery('#mm-static-link-<?php 
    echo $productId;
    ?>
').focus(); jQuery('#mm-static-link-<?php 
    echo $productId;
    ?>
').select();" />
	
	<?php 
    $affiliateId = MM_OptionUtils::getOption(MM_OptionUtils::$OPTION_KEY_AFFILIATE);
    $subAffiliateId = MM_OptionUtils::getOption(MM_OptionUtils::$OPTION_KEY_SUB_AFFILIATE);
    ?>
	<p><strong>Add Affiliate Tracking</strong></p>
	<p>To add affiliate tracking to the above purchase links you simply need to append affiliate tracking parameters to the URL as follows:</p>
	<p><em>Purchase Link SmartTag</em>: <br/><code>&lt;a href="[MM_Purchase_Link productId='#']<strong>&<?php 
    echo $affiliateId;
    ?>
=###&<?php 
    echo $subAffiliateId;
    ?>
=###</strong>"&gt;Buy Now&lt;/a&gt;</code></p>
	<p><em>Static Link</em>: <br/><code>http://yourdomain.com/checkout/?rid=p4K7d<strong>&<?php 
    echo $affiliateId;
    ?>
=###&<?php 
    echo $subAffiliateId;
    ?>
=###</strong></code></p>
	<p>Where all <code>#</code>'s would be replaced with the appropriate values. Read this article to <a href="http://membermouse.uservoice.com/knowledgebase/articles/319248-create-an-affiliate-link" target="_blank">learn more about creating an affiliate link</a>.</p>
	</div>
<?php 
}
示例#19
0
    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;
?>
	</select></p>
	
	<p style="font-size:11px; margin-left:15px;">
	Select Multiple Countries: PC <code>ctrl + click</code>
示例#20
0
$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">
    <p class="mm-header-text" style="margin-bottom:15px;">Version History</p>

    <?php 
if (MM_OptionUtils::getOption(MM_OptionUtils::$OPTION_KEY_UPGRADE_NOTICE)) {
    ?>
    <form method="post" style="margin-top:10px;">
    	<input type="hidden" name="clear-upgrade-notice" value="1" />
   		<input type="submit" value="Clear Upgrade Notice" class="mm-ui-button blue" />
    </form>
    <?php 
} else {
    if (isset($_POST["clear-upgrade-notice"]) && $_POST["clear-upgrade-notice"] == "1") {
        ?>
    <p style="margin-top:10px; font-size:14px;"><em>Upgrade notice cleared successfully. Changes will be reflected on next page load.</em></p>
    <?php 
    }
}
?>
	
示例#21
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;
?>
"/>
示例#22
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>
        $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 
echo MM_OptionUtils::$OPTION_KEY_PURCHASE_CONFIRMATION_DIALOG_WIDTH;
?>
' value='<?php 
echo $width;
示例#24
0
 public static function getPluginWarnings()
 {
     $problemPlugins = array();
     $problemPlugins["W3 Total Cache"] = "w3-total-cache/w3-total-cache.php";
     $problemPlugins["WP Super Cache"] = "wp-super-cache/wp-cache.php";
     $plugins = get_option('active_plugins');
     foreach ($problemPlugins as $name => $location) {
         if (in_array($location, $plugins)) {
             if (!MM_Messages::isMessageHidden($location)) {
                 $hideWarningUrl = MM_Messages::getHideMessageUrl(self::constructPageUrl(), $location);
                 MM_Messages::addError("<i class=\"fa fa-exclamation-triangle\"></i> <strong>MemberMouse Warning</strong>: The <em>{$name}</em> plugin is known to cause issues with MemberMouse. <a href='https://membermouse.uservoice.com/knowledgebase/articles/319203-plugins-that-cause-problems' target='_blank'>Learn more</a> | <a href='{$hideWarningUrl}'>Hide this warning</a>");
             }
         }
     }
     // check if client is using Visual Composer
     $visualComposerPlugin = "js_composer/js_composer.php";
     if (in_array($visualComposerPlugin, $plugins)) {
         if (!MM_Messages::isMessageHidden($visualComposerPlugin)) {
             $hideWarningUrl = MM_Messages::getHideMessageUrl(self::constructPageUrl(), $visualComposerPlugin);
             $visualEditorMsg = "<p><i class=\"fa fa-exclamation-triangle\"></i> <strong>MemberMouse Warning: Visual Composer</strong></p>";
             $visualEditorMsg .= "<div style=\"margin-left:20px;\"><i class=\"fa fa-caret-right\"></i> ";
             $visualEditorMsg .= "You're using Visual Composer. To avoid issues make sure to follow the instructions in this article when <a href='http://membermouse.uservoice.com/knowledgebase/articles/792249' target='_blank'>using SmartTags</a> | <a href='{$hideWarningUrl}'>Hide this warning</a>";
             $visualEditorMsg .= "</div>";
             MM_Messages::addError($visualEditorMsg);
         }
     }
     // check if client is using WP Engine
     if (class_exists("WPE_API", false) || defined("WPE_APIKEY") || defined("WPE_ISP")) {
         if (!MM_Messages::isMessageHidden("wp-engine-warning")) {
             $hideWarningUrl = MM_Messages::getHideMessageUrl(self::constructPageUrl(), "wp-engine-warning");
             MM_Messages::addError("<i class=\"fa fa-exclamation-triangle\"></i> <strong>MemberMouse Warning</strong>: You're using WP Engine. Follow the instructions in this article to <a href='http://membermouse.uservoice.com/knowledgebase/articles/356866-configuring-wp-engine-hosting' target='_blank'>work with WP Engine to ensure your server is configured to allow MemberMouse to run properly</a>. | <a href='{$hideWarningUrl}'>Hide this warning</a>");
         }
     }
     // TODO this code can be removed after no active license is on a version less than 2.2.4
     $captchaSiteKey = MM_OptionUtils::getOption(MM_OptionUtils::$OPTION_KEY_CAPTCHA_KEY);
     $captchaPrivateKey = MM_OptionUtils::getOption(MM_OptionUtils::$OPTION_KEY_CAPTCHA_PRIVATE_KEY);
     $mmVersion = MemberMouse::getPluginVersion();
     // check if client is using recaptcha and on version 2.2.4 of MM
     if ($mmVersion == "2.2.4" && !empty($captchaSiteKey) && !empty($captchaPrivateKey)) {
         if (!MM_Messages::isMessageHidden("recaptcha-upgrade-warning")) {
             $hideWarningUrl = MM_Messages::getHideMessageUrl(self::constructPageUrl(), "recaptcha-upgrade-warning");
             MM_Messages::addError("<div style='width:750px;'><i class=\"fa fa-exclamation-triangle\"></i> <strong>MemberMouse Warning</strong>: It appears that you're currently using reCaptcha. In this version of MemberMouse reCaptcha has been upgraded and your <strong>action is required</strong> to ensure your checkout process continues to function correctly. <a href='http://membermouse.uservoice.com/knowledgebase/articles/718512#recaptcha-upgrade' target='_blank'>Watch this video for details</a>. | <a href='{$hideWarningUrl}'>Hide this warning</a></div>");
         }
     }
 }
<?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>
    
示例#26
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 
示例#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>
示例#28
0
 function loginRedirect($redirectTo, $request, $user)
 {
     // clear login form session parameters
     MM_Session::clear(MM_Session::$KEY_LOGIN_FORM_USER_ID);
     MM_Session::clear(MM_Session::$KEY_LOGIN_FORM_USERNAME);
     $newRedirectTo = "";
     $allowUserOverride = true;
     if (class_exists("MM_CorePageEngine")) {
         if ($user instanceof WP_User && isset($user->data->ID) && intval($user->data->ID) > 0) {
             // check if this is an employee
             $employee = MM_Employee::findByUserId($user->data->ID);
             if ($employee->isValid()) {
                 MM_Preview::clearPreviewMode();
                 MM_Preview::getData();
                 $newRedirectTo = $employee->getHomepage();
             }
             if (empty($newRedirectTo)) {
                 $mmUser = new MM_User($user->data->ID);
                 if ($mmUser->getStatus() == MM_Status::$EXPIRED) {
                     $allowUserOverride = false;
                     $newRedirectTo = MM_CorePageEngine::getUrl(MM_CorePageType::$ERROR, MM_Error::$ACCOUNT_EXPIRED, $mmUser);
                     wp_logout();
                 } else {
                     if ($mmUser->getStatus() == MM_Status::$CANCELED) {
                         $allowUserOverride = false;
                         $newRedirectTo = MM_CorePageEngine::getUrl(MM_CorePageType::$ERROR, MM_Error::$ACCOUNT_CANCELED, $mmUser);
                         wp_logout();
                     } else {
                         if ($mmUser->getStatus() == MM_Status::$LOCKED) {
                             $allowUserOverride = false;
                             $newRedirectTo = MM_CorePageEngine::getUrl(MM_CorePageType::$ERROR, MM_Error::$ACCOUNT_LOCKED, $mmUser);
                             wp_logout();
                         } else {
                             if ($mmUser->getStatus() == MM_Status::$OVERDUE) {
                                 $newRedirectTo = MM_CorePageEngine::getUrl(MM_CorePageType::$MY_ACCOUNT, "", $mmUser);
                             } else {
                                 MM_Preview::clearPreviewMode();
                                 $setting = MM_OptionUtils::getOption(MM_OptionUtils::$OPTION_KEY_ON_LOGIN_USE_WP_FRONTPAGE);
                                 if ($setting == "1") {
                                     $newRedirectTo = MM_OptionUtils::getOption("siteurl");
                                 } else {
                                     $newRedirectTo = MM_CorePageEngine::getUrl(MM_CorePageType::$MEMBER_HOME_PAGE, "", $mmUser);
                                 }
                                 $lastAccessDeniedPageID = MM_Session::value(MM_OptionUtils::$OPTION_KEY_LAST_PAGE_DENIED);
                                 // check if current member has access to the last access denied page
                                 $pce = new MM_ProtectedContentEngine();
                                 if (intval($lastAccessDeniedPageID) > 0 && $pce->canAccessPost($lastAccessDeniedPageID, $mmUser->getId())) {
                                     $corePageEngine = new MM_CorePageEngine();
                                     if (!$corePageEngine->arePermalinksUsed()) {
                                         $newRedirectTo = get_page_link($lastAccessDeniedPageID);
                                     } else {
                                         $newRedirectTo = get_permalink($lastAccessDeniedPageID);
                                     }
                                 }
                                 MM_Session::clear(MM_OptionUtils::$OPTION_KEY_LAST_PAGE_DENIED);
                                 MM_ActivityLog::log($mmUser, MM_ActivityLog::$EVENT_TYPE_LOGIN);
                                 if ($mmUser->hasReachedMaxIPCount()) {
                                     global $current_user, $user;
                                     $mmUser->setStatus(MM_Status::$LOCKED);
                                     $mmUser->commitData();
                                     $newRedirectTo = MM_CorePageEngine::getUrl(MM_CorePageType::$ERROR, MM_Error::$ACCOUNT_LOCKED, $mmUser);
                                     wp_logout();
                                 }
                             }
                         }
                     }
                 }
                 if (empty($newRedirectTo)) {
                     $newRedirectTo = MM_OptionUtils::getOption("siteurl");
                 }
             }
         }
         // give customer an opportunity to redirect the user
         if ($allowUserOverride) {
             $currentUrl = !empty($newRedirectTo) ? $newRedirectTo : $redirectTo;
             $infoObj = new stdClass();
             $infoObj->currentUrl = $currentUrl;
             $infoObj->user = $user;
             $redirectOverride = apply_filters(MM_Filters::$LOGIN_REDIRECT, $infoObj);
             if (is_string($redirectOverride) && !empty($redirectOverride) && $redirectOverride != $currentUrl) {
                 if (!defined("DOING_AJAX") || !DOING_AJAX) {
                     wp_redirect($redirectOverride);
                     exit;
                 } else {
                     return $redirectOverride;
                 }
             }
         }
         if (!empty($newRedirectTo)) {
             return $newRedirectTo;
         }
         return $redirectTo;
     }
 }
示例#29
0
/**
 * 
 * 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");
	}
}
function linkStyleChangeHandler()
示例#30
0
    ?>
</p>
	</div>
	<?php 
}
?>
	
	<div class="mm-button-container">
		<a onclick="mmjs.create('mm-coupons-dialog', 620, 615)" class="mm-ui-button green"><?php 
echo MM_Utils::getIcon('plus-circle', '', '1.2em', '1px');
?>
 Create Coupon</a>
		
		<?php 
$showArchivedCoupons = MM_OptionUtils::getOption(MM_CouponView::$SEARCH_OPTION_SHOW_ARCHIVED . "-" . $current_user->ID) == "1" ? true : false;
$showExpiredCoupons = MM_OptionUtils::getOption(MM_CouponView::$SEARCH_OPTION_SHOW_EXPIRED . "-" . $current_user->ID) == "1" ? true : false;
?>
		
		<span style="font-size:11px;">
			<input type='hidden' id='mm-admin-id' value='<?php 
echo $current_user->ID;
?>
' />
			<input type='checkbox' id='mm-show-archived-coupons' <?php 
echo $showArchivedCoupons ? "checked" : "";
?>
 style="margin-left:10px;" onclick="mmjs.storeCouponSearchOptions();" /> Show archived coupons
			<input type='checkbox' id='mm-show-expired-coupons' <?php 
echo $showExpiredCoupons ? "checked" : "";
?>
 style="margin-left:10px;" onclick="mmjs.storeCouponSearchOptions();" /> Show expired coupons