Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- include ('../../../../includes/ini.inc.php');
- include ('../../../../includes/global.inc.php');
- include ('../../../../classes/db.inc.php');
- $db = new db();
- include_once ('../../../../includes/functions.inc.php');
- $config = fetchDbConfig('config');
- include_once ('../../../../language/' . $config['defaultLang'] . '/lang.inc.php');
- $enableSSl = 1;
- include ('../../../../includes/sslSwitch.inc.php');
- include ('../../../includes/auth.inc.php');
- include ('../../../../includes/currencyVars.inc.php');
- $productsPerPage = 25;
- if (permission('settings', 'read') == FALSE) {
- header('Location: ' . $GLOBALS['rootRel'] . 'admin/401.php');
- exit;
- }
- $table_there = $db->select('check table ' . $glob['dbprefix'] . 'CubeCart_adg_mustlogin_mod quick');
- if ($table_there[0]['Msg_type'] == 'error' || $table_there[0]['Msg_type'] == 'Error') {
- $install_sql1 = 'CREATE TABLE `' . $glob['dbprefix'] . 'CubeCart_adg_mustlogin_mod` (`id` int(11) NOT NULL auto_increment, PRIMARY KEY (`id`)) TYPE=MyISAM AUTO_INCREMENT=1 ;';
- $install_sql2 = 'ALTER TABLE `' . $glob['dbprefix'] . "CubeCart_customer` ADD `prices` INT(11) DEFAULT '0' NOT NULL ;";
- $run_sql1 = $db->misc($install_sql1);
- $run_sql2 = $db->misc($install_sql2);
- if ($run_sql1 == FALSE) {
- $msg = 'Error CubeCart_adg_mustlogin_mod Table, Contact cubemods@alexgoldberg.com for support';
- } elseif ($run_sql2 == FALSE) {
- $msg = 'Error Updating CubeCart_customer Table, Contact cubemods@alexgoldberg.com for support';
- } else {
- $msg = 'You can now configure your mod';
- }
- }
- if (isset($_POST['module'])) {
- include ('../../status.php');
- include ('../../../includes/functions.inc.php');
- $module = fetchDbConfig('Must_Login');
- $msg = writeDbConf($_POST['module'], 'Must_Login', $module);
- }
- $module = fetchDbConfig('Must_Login');
- if (isset($_POST['licensekey'])) {
- $module['modSecurityKey'] = $_POST['licensekey'];
- $module['badserver'] = '';
- $module['badsip'] = '';
- $msg = writeDbConf($module, 'Must_Login', $module);
- }
- if (isset($_GET['resetkey'])) {
- include ('../../../includes/functions.inc.php');
- $module = fetchDbConfig('Must_Login');
- $module['modSecurityKey'] = '';
- $msg = writeDbConf($module, 'Must_Login', $module);
- }
- if ($_SERVER['SERVER_ADDR'] != '127.0.0.1') {
- if (isset($module['modSecurityKey'])) {
- $domain_parts = explode('.', $_SERVER['SERVER_NAME']);
- switch (count($domain_parts)) {
- case 5:
- switch ($domain_parts[4]) {
- case 'com':
- case 'org':
- case 'net':
- case 'com':
- case 'ws':
- case 'ie':
- case 'info':
- $domain_to_encode = $domain_parts[3];
- $tld = $domain_parts[4];
- break;
- default:
- $domain_to_encode = $domain_parts[2];
- $tld = $domain_parts[3] . '.' . $domain_parts[4];
- break;
- }
- break;
- case 4:
- switch ($domain_parts[3]) {
- case 'com':
- case 'org':
- case 'net':
- case 'com':
- case 'ws':
- case 'ie':
- case 'info':
- $domain_to_encode = $domain_parts[2];
- $tld = $domain_parts[3];
- break;
- default:
- $domain_to_encode = $domain_parts[1];
- $tld = $domain_parts[2] . '.' . $domain_parts[3];
- break;
- }
- break;
- case 3:
- switch ($domain_parts[2]) {
- case 'au':
- case 'ca':
- case 'cz':
- case 'de':
- case 'dk':
- case 'fr':
- case 'in':
- case 'it':
- case 'nl':
- case 'no':
- case 'pt':
- case 'ru':
- case 'uk':
- if ($domain_parts[1] == 'co' || $domain_parts[1] == 'com') {
- $domain_to_encode = $domain_parts[0];
- $tld = $domain_parts[1] . '.' . $domain_parts[2];
- } else {
- $domain_to_encode = $domain_parts[1];
- $tld = $domain_parts[2];
- }
- break;
- default:
- $domain_to_encode = $domain_parts[1];
- $tld = $domain_parts[2];
- }
- break;
- default:
- $domain_to_encode = $domain_parts[0];
- $tld = $domain_parts[1];
- break;
- }
- $ssl_domains = array('secure-secure', 'bluehost', 'omnis', 'startlogic', 'powweb', 'myhosting', 'silverlinestudio');
- $ip_domains = array('208.109.193.82', '69.89.31.102');
- if ($module['modSecurityKey'] == md5('supper' . $domain_to_encode . 'goober_1992' . 'Must_Login') || in_array($domain_to_encode, $ssl_domains) || in_array($_SERVER['SERVER_ADDR'], $ip_domains)) {
- $module['badserver'] = '';
- $module['badsip'] = '';
- } else {
- $msg = 'There appears to be a missmatch in the configured web site address.<br>Please check your configuration or contact keys@cubecartmodder.com for assistance';
- $modSecurityError = TRUE;
- $license_error = '<br>Unlicensed server: ' . $module['badserver'];
- $license_error = $license_error . '<br>Unlicensed address: ' . $module['badsip'];
- }
- } else {
- $getSecurityKey = TRUE;
- }
- } else {
- $msg = "<p class='warnText'>Goober Mod is running in <b><i>TEST</i></b> mode</p>";
- }
- include ('../../../includes/header.inc.php');
- ?><p class="pageTitle"><?php echo $lang['mods']['mustlogin']['mod_title']; ?><br/>
- </br>
- <span class="infoText" style="font-size:60%">
- CubeCart mod by Goober <a href="http://www.cubecartmodder.com/">www.cubecartmodder.com</a>
- </span></p>
- <?php
- if (isset($msg)) {
- echo $msg;
- }
- if ($getSecurityKey or $modSecurityError) { ?>
- <form action="<?php echo $GLOBALS['rootRel']; ?>admin/modules/3rdparty/Must_Login/index.php?module=3rdparty&folder=Must_Login" method="post" enctype="multipart/form-data">
- <table border="0" cellspacing="0" cellpadding="3" class="mainTable">
- <tr>
- <td colspan="2" class="tdTitle">Please Enter License Key</td>
- <td colspan="2" class="tdText">The mod found your domain name as: <b>
- <?php echo $_SERVER['SERVER_NAME']; ?></b><br>Use this name to generate license key.
- <?php
- $license_error = '<br>Unlicensed Domain: ' . $module['badserver'];
- $license_error = $license_error . '<br>Unlicensed address: ' . $module['badsip'];
- echo $license_error;
- ?> </td>
- </tr>
- <tr>
- <td align="left" class="tdText"><strong>Key:</strong></td>
- <td class="tdText">
- <input type="text" name="licensekey">
- </td>
- <td colspan="2" class="tdText" align="right">Please visit <a href="http://www.cubecartmodder.com/" target="_NEW">www.cubecartmodder.com</a> and login to your account to get a copy of your key.</td>
- </tr>
- <tr>
- <td align="right" class="tdText"> </td>
- <td class="tdText">
- <input name="module[default]" value="0" type="hidden" />
- <input name="module[status]" value="0" type="hidden" />
- <input type="submit" class="submit" value="Submit Key" />
- </td>
- <td colspan="2" class="tdText"></td>
- </tr>
- </table>
- </form>
- <?php
- exit;
- }
- ?><p>
- <form action="<?php echo $GLOBALS['rootRel']; ?>admin/modules/3rdparty/Must_Login/index.php?module=3rdparty&folder=Must_Login" method="post" enctype="multipart/form-data">
- <table border="0" cellspacing="0" cellpadding="3" class="mainTable">
- <tr>
- <td colspan="2" class="tdTitle"><?php echo $lang['mods']['mustlogin']['config_settings']; ?></td>
- </tr>
- <tr>
- <td rowspan="4" align="left" class="tdText" valign="top"><strong><?php echo $lang['mods']['mustlogin']['must_auth_for_prices']; ?>:</strong></td>
- <td class="tdText"><table><tr><td valign="top">
- <input type="radio" value="3" name="module[must_auth]" <?php if ($module['must_auth'] == 3) echo "checked='checked'"; ?>>
- </td>
- <td class="tdText"><?php echo $lang['mods']['mustlogin']['must_auth_for_all_prices']; ?></td>
- </tr></table></td>
- </tr>
- <tr>
- <td class="tdText"><table><tr><td valign="top">
- <input type="radio" value="2" name="module[must_auth]" <?php if ($module['must_auth'] == 2) echo "checked='checked'"; ?>>
- </td>
- <td class="tdText"><?php echo $lang['mods']['mustlogin']['must_auth_for_login_and_sale_prices']; ?></td>
- </tr></table></td>
- </tr>
- <tr>
- <td class="tdText"><table><tr><td valign="top">
- <input type="radio" value="1" name="module[must_auth]" <?php if ($module['must_auth'] == 1) echo "checked='checked'"; ?>>
- </td>
- <td class="tdText"><?php echo $lang['mods']['mustlogin']['must_auth_for_no_prices']; ?> </td>
- </tr></table></td>
- </tr>
- <tr>
- <td class="tdText"><table><tr><td valign="top">
- <input type="radio" value="0" name="module[must_auth]" <?php if ($module['must_auth'] == 0) echo "checked='checked'"; ?>>
- </td>
- <td class="tdText"><?php echo $lang['mods']['mustlogin']['must_auth_for_sale_prices']; ?> </td>
- </tr></table></td>
- </tr>
- <tr>
- <td align="left" class="tdText"><strong><?php echo $lang['mods']['mustlogin']['view_button']; ?>:</strong></td>
- <td class="tdText">
- <select name="module[view_button]">
- <option value="1" <?php if ($module['view_button'] == 1) echo "selected='selected'"; ?>><?php echo $lang['admin']['yes']; ?></option>
- <option value="0" <?php if ($module['view_button'] == 0) echo "selected='selected'"; ?>><?php echo $lang['admin']['no']; ?></option>
- </select>
- </td>
- </tr>
- <tr>
- <td align="left" class="tdText"><strong><?php echo $lang['mods']['mustlogin']['status']; ?>:</strong></td>
- <td class="tdText">
- <select name="module[status]">
- <option value="1" <?php if ($module['status'] == 1) echo "selected='selected'"; ?>><?php echo $lang['mods']['mustlogin']['enabled']; ?></option>
- <option value="0" <?php if ($module['status'] == 0) echo "selected='selected'"; ?>><?php echo $lang['mods']['mustlogin']['disabled']; ?></option>
- </select>
- </td>
- </tr>
- <?php
- if ($module['badserver'] != '' || $module['badsip'] != '') { ?> <tr>
- <td align="left" class="tdText">Unlicensed Domain</strong></td>
- <td class="tdText"><?php echo $module['badserver']; ?></td>
- </tr>
- <tr>
- <td align="left" class="tdText">Unlicensed Address</strong></td>
- <td class="tdText"><?php echo $module['badsip']; ?></td>
- </tr>
- <?php
- } ?> <tr>
- <td align="right" class="tdText"> </td>
- <td class="tdText">
- <input type="hidden" name="module[default]" value="0" />
- <input type="submit" class="submit" value="Edit Config" />
- </td>
- </tr>
- </table>
- </form>
- <?php include ('../../../includes/footer.inc.php'); ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement