diff --git a/.gitignore b/.gitignore index c669bc09..b4976dfc 100644 --- a/.gitignore +++ b/.gitignore @@ -14,6 +14,7 @@ /logs/* # Test configs +/include/config/global.inc.test.php /include/config/global.inc.scrypt.php /include/config/global.inc.sha.php diff --git a/README.md b/README.md index 79bc2be4..61ea994b 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -Description [ ![Codeship Status for TheSerapher/php-mpos](https://www.codeship.io/projects/40fa7600-61a6-0131-3fd3-367b94dc0d60/status?branch=next)](https://www.codeship.io/projects/12276) +Description =========== MPOS is a web based Mining Portal for various crypto currencies. It was created by [TheSerapher](https://github.com/TheSerapher) and has hence grown quite large. Recently it was migrated into a Github Organization to make development easier. It's a community driven open source project. Support can be requested on IRC at https://webchat.freenode.net/?channels=#mpos @@ -15,7 +15,10 @@ Donations to this project are going directly to [TheSerapher](https://github.com * LTC address: `Lge95QR2frp9y1wJufjUPCycVsg5gLJPW8` * BTC address: `1HuYK6WPU8o3yWCrAaADDZPRpL5QiXitfv` -* DOGE Address: `D6YtvxFGBmaD8Yq3i8LZsBQVPvCbZwCDzF` +* DOGE address: `DANk8bnc3vHEf7Jthaxq1Xgn1BSiArNdjG` +* 42Coin address: `4VxA6Ht59Mj6ikhA4gDXLiHuAaDCJEvYTZ` +* FST address: `fiRqMgZyhjTN1GSEB3ZxV35JXsE5bjEaQ2` +* FRK address: `FDcgGZjX2B29qevSuiuQVwXhkNhtQT4cEW` * Cryptsy Trade Key: `6ff7292142463b7b80cbbbdfc52334ba89727b11` Website Footer @@ -79,15 +82,14 @@ The following feature have been implemented so far: * Fully re-written GUI with [Smarty][2] templates * Full file based template support - * **NEW** SQL based templates -* Mobile WebUI -* Scrypt, SHA256, VARDIFF Support +* VARDIFF Support * Reward Systems * Propotional, PPS and PPLNS * New Theme * Live Dashboard * AJAX Support * Overhauled API + * Bootstrap * Web User accounts * Re-Captcha protected registration form * Worker accounts @@ -95,7 +97,7 @@ The following feature have been implemented so far: * Worker hashrates * Pool statistics * Block statistics -* Pool donations, fees and block bonuses +* Pool donations, bonuses, fees and block bonuses * Manual and auto payout * Transaction list * Admin Panel @@ -105,7 +107,6 @@ The following feature have been implemented so far: * User Transactions * News Posts * Pool Settings - * Templates * Pool Workers * User Reports * Template Overwrite @@ -115,9 +116,11 @@ The following feature have been implemented so far: * Auto Payout * Manual Payout * User-to-user Invitation System -* Support for various coins via config +* Support for various coins via coin class and config * All scrypt coins * All sha256d coins + * All x11 coins + * Others may be supported by creating a custom coin class Installation ============ @@ -131,7 +134,7 @@ This project was meant to allow users to easily customize the system and templat If you are just using the system, there will be no need to adjust anything. Things will work out of the box! But if you plan on creating your own theme, things are pretty easy: -* Create a new theme folder in `public/templates/` +* Create a new theme folder in `templates/` * Create a new site_assets folder in `public/site_assets` * Create your own complete custom template or copy from an existing one * Change your theme in the `Admin Panel` and point it to the newly created folder diff --git a/include/classes/api.class.php b/include/classes/api.class.php index 913a1f03..bc6670f3 100644 --- a/include/classes/api.class.php +++ b/include/classes/api.class.php @@ -37,8 +37,10 @@ class Api extends Base { )), $force ? JSON_FORCE_OBJECT : 0 ); // JSONP support issue #1700 - if (isset($_REQUEST['callback'])) + if (isset($_REQUEST['callback']) && ctype_alpha($_REQUEST['callback'])) { + header('Content-type: application/json; charset=utf-8'); return $_REQUEST['callback'] . '(' . $json . ');'; + } return $json; } diff --git a/include/classes/share.class.php b/include/classes/share.class.php index b50188f8..23a7911e 100644 --- a/include/classes/share.class.php +++ b/include/classes/share.class.php @@ -129,8 +129,8 @@ class Share Extends Base { * return array data Returns an array with usernames as keys for easy access **/ function getArchiveShares($iCount) { - $iMinId = $this->getMinArchiveShareId($iCount); $iMaxId = $this->getMaxArchiveShareId(); + $iMinId = $this->getMinArchiveShareId($iCount); $stmt = $this->mysqli->prepare(" SELECT a.id, diff --git a/include/classes/tools.class.php b/include/classes/tools.class.php index 8e861e63..c42f5159 100644 --- a/include/classes/tools.class.php +++ b/include/classes/tools.class.php @@ -18,11 +18,11 @@ class Tools extends Base { curl_setopt($curl, CURLOPT_HEADER, false); $data = curl_exec($curl); preg_match('/define\(\'MPOS_VERSION\', \'(.*)\'\);/', $data, $match); - $mpos_versions['MPOS_VERSION'] = $match[1]; + $mpos_versions['MPOS_VERSION'] = @$match[1]; preg_match('/define\(\'DB_VERSION\', \'(.*)\'\);/', $data, $match); - $mpos_versions['DB_VERSION'] = $match[1]; + $mpos_versions['DB_VERSION'] = @$match[1]; preg_match('/define\(\'CONFIG_VERSION\', \'(.*)\'\);/', $data, $match); - $mpos_versions['CONFIG_VERSION'] = $match[1]; + $mpos_versions['CONFIG_VERSION'] = @$match[1]; curl_close($curl); return $this->memcache->setCache($key, $mpos_versions, 30); } else { diff --git a/include/classes/user.class.php b/include/classes/user.class.php index a8d0f308..7cb0d58b 100644 --- a/include/classes/user.class.php +++ b/include/classes/user.class.php @@ -741,9 +741,11 @@ class User extends Base { $this->setErrorMessage('Username exceeding character limit'); return false; } - if (!$this->bitcoin->validateaddress($coinaddress)) { - $this->setErrorMessage('Coin address is not valid'); - return false; + if (!is_null($coinaddress)) { + if (!$this->bitcoin->validateaddress($coinaddress)) { + $this->setErrorMessage('Coin address is not valid'); + return false; + } } if (preg_match('/[^a-z_\-0-9]/i', $username)) { $this->setErrorMessage('Username may only contain alphanumeric characters'); @@ -841,7 +843,7 @@ class User extends Base { } else { $this->setErrorMessage( 'Unable to register' ); $this->debug->append('Failed to insert user into DB: ' . $this->mysqli->error); - if ($stmt->sqlstate == '23000') $this->setErrorMessage( 'Username or email already registered' ); + if ($stmt->sqlstate == '23000') $this->setErrorMessage( 'Username, email or Coinaddress already registered' ); return false; } return false; diff --git a/include/config/global.inc.dist.php b/include/config/global.inc.dist.php index ca1069dd..40aa975b 100644 --- a/include/config/global.inc.dist.php +++ b/include/config/global.inc.dist.php @@ -7,7 +7,7 @@ $defflip = (!cfip()) ? exit(header('HTTP/1.1 401 Unauthorized')) : 1; * https://github.com/MPOS/php-mpos/wiki/Config-Setup#wiki-config-version **/ $config['version'] = '0.0.8'; -$config['version_url'] = 'https://raw.githubusercontent.com/MPOS/php-mpos/master/public/include/version.inc.php'; +$config['version_url'] = 'https://raw.githubusercontent.com/MPOS/php-mpos/master/include/version.inc.php'; /** * Unless you disable this, we'll do a quick check on your config first. @@ -15,6 +15,12 @@ $config['version_url'] = 'https://raw.githubusercontent.com/MPOS/php-mpos/master */ $config['skip_config_tests'] = false; +/** + * Unless you disable this, we'll do a check for a valid coin address on registration. + * https://github.com/MPOS/php-mpos/wiki/Config-Setup#check-for-valid-wallet-address + */ +$config['check_valid_coinaddress'] = true; + /** * Defines * Debug setting and salts for hashing passwords diff --git a/include/pages/admin/news.inc.php b/include/pages/admin/news.inc.php index 197bdba5..9d39146e 100644 --- a/include/pages/admin/news.inc.php +++ b/include/pages/admin/news.inc.php @@ -10,23 +10,31 @@ if (!$user->isAuthenticated() || !$user->isAdmin($_SESSION['USERDATA']['id'])) { // Include markdown library use \Michelf\Markdown; -if (@$_REQUEST['do'] == 'toggle_active') - if ($news->toggleActive($_REQUEST['id'])) - $_SESSION['POPUP'][] = array('CONTENT' => 'News entry changed', 'TYPE' => 'alert alert-success'); +if (@$_REQUEST['do'] == 'toggle_active') { + if (!$config['csrf']['enabled'] || $config['csrf']['enabled'] && $csrftoken->valid) { + if ($news->toggleActive($_REQUEST['id'])) { + $_SESSION['POPUP'][] = array('CONTENT' => 'News entry changed', 'TYPE' => 'alert alert-success'); + } + } +} if (@$_REQUEST['do'] == 'add') { - if ($news->addNews($_SESSION['USERDATA']['id'], $_POST['data'])) { - $_SESSION['POPUP'][] = array('CONTENT' => 'News entry added', 'TYPE' => 'alert alert-success'); - } else { - $_SESSION['POPUP'][] = array('CONTENT' => 'Failed to add new entry: ' . $news->getError(), 'TYPE' => 'alert alert-danger'); + if (!$config['csrf']['enabled'] || $config['csrf']['enabled'] && $csrftoken->valid) { + if ($news->addNews($_SESSION['USERDATA']['id'], $_POST['data'])) { + $_SESSION['POPUP'][] = array('CONTENT' => 'News entry added', 'TYPE' => 'alert alert-success'); + } else { + $_SESSION['POPUP'][] = array('CONTENT' => 'Failed to add new entry: ' . $news->getError(), 'TYPE' => 'alert alert-danger'); + } } } if (@$_REQUEST['do'] == 'delete') { - if ($news->deleteNews((int)$_REQUEST['id'])) { - $_SESSION['POPUP'][] = array('CONTENT' => 'Succesfully removed news entry', 'TYPE' => 'alert alert-success'); - } else { - $_SESSION['POPUP'][] = array('CONTENT' => 'Failed to delete entry: ' . $news->getError(), 'TYPE' => 'alert alert-danger'); + if (!$config['csrf']['enabled'] || $config['csrf']['enabled'] && $csrftoken->valid) { + if ($news->deleteNews((int)$_REQUEST['id'])) { + $_SESSION['POPUP'][] = array('CONTENT' => 'Succesfully removed news entry', 'TYPE' => 'alert alert-success'); + } else { + $_SESSION['POPUP'][] = array('CONTENT' => 'Failed to delete entry: ' . $news->getError(), 'TYPE' => 'alert alert-danger'); + } } } @@ -38,4 +46,4 @@ foreach ($aNews as $key => $aData) { } $smarty->assign("NEWS", $aNews); $smarty->assign("CONTENT", "default.tpl"); -?> +?> \ No newline at end of file diff --git a/include/pages/admin/news_edit.inc.php b/include/pages/admin/news_edit.inc.php index 3d5eceed..07c472b8 100644 --- a/include/pages/admin/news_edit.inc.php +++ b/include/pages/admin/news_edit.inc.php @@ -10,11 +10,13 @@ if (!$user->isAuthenticated() || !$user->isAdmin($_SESSION['USERDATA']['id'])) { // Include markdown library use \Michelf\Markdown; -if (@$_REQUEST['do'] == 'save') { - if ($news->updateNews($_REQUEST['id'], $_REQUEST['header'], $_REQUEST['content'], $_REQUEST['active'])) { - $_SESSION['POPUP'][] = array('CONTENT' => 'News updated', 'TYPE' => 'alert alert-success'); - } else { - $_SESSION['POPUP'][] = array('CONTENT' => 'News update failed: ' . $news->getError(), 'TYPE' => 'alert alert-danger'); +if (!$config['csrf']['enabled'] || $config['csrf']['enabled'] && $csrftoken->valid) { + if (@$_REQUEST['do'] == 'save') { + if ($news->updateNews($_REQUEST['id'], $_REQUEST['header'], $_REQUEST['content'], $_REQUEST['active'])) { + $_SESSION['POPUP'][] = array('CONTENT' => 'News updated', 'TYPE' => 'alert alert-success'); + } else { + $_SESSION['POPUP'][] = array('CONTENT' => 'News update failed: ' . $news->getError(), 'TYPE' => 'alert alert-danger'); + } } } @@ -22,4 +24,4 @@ if (@$_REQUEST['do'] == 'save') { $aNews = $news->getEntry($_REQUEST['id']); $smarty->assign("NEWS", $aNews); $smarty->assign("CONTENT", "default.tpl"); -?> +?> \ No newline at end of file diff --git a/include/pages/admin/settings.inc.php b/include/pages/admin/settings.inc.php index 9412f69c..dcb749d3 100644 --- a/include/pages/admin/settings.inc.php +++ b/include/pages/admin/settings.inc.php @@ -8,11 +8,15 @@ if (!$user->isAuthenticated() || !$user->isAdmin($_SESSION['USERDATA']['id'])) { } if (@$_REQUEST['do'] == 'save' && !empty($_REQUEST['data'])) { - $user->log->log("warn", @$_SESSION['USERDATA']['username']." changed admin settings"); - foreach($_REQUEST['data'] as $var => $value) { - $setting->setValue($var, $value); + if (!$config['csrf']['enabled'] || $config['csrf']['enabled'] && $csrftoken->valid) { + $user->log->log("warn", @$_SESSION['USERDATA']['username']." changed admin settings"); + foreach($_REQUEST['data'] as $var => $value) { + $setting->setValue($var, $value); + } + $_SESSION['POPUP'][] = array('CONTENT' => 'Settings updated', 'TYPE' => 'alert alert-success'); + } else { + $_SESSION['POPUP'][] = array('CONTENT' => $csrftoken->getErrorWithDescriptionHTML(), 'TYPE' => 'alert alert-warning'); } - $_SESSION['POPUP'][] = array('CONTENT' => 'Settings updated', 'TYPE' => 'alert alert-success'); } // Load our available settings from configuration @@ -23,4 +27,4 @@ $smarty->assign("SETTINGS", $aSettings); // Tempalte specifics $smarty->assign("CONTENT", "default.tpl"); -?> +?> \ No newline at end of file diff --git a/include/pages/admin/user.inc.php b/include/pages/admin/user.inc.php index dfc9de05..8f0dfa83 100644 --- a/include/pages/admin/user.inc.php +++ b/include/pages/admin/user.inc.php @@ -16,26 +16,28 @@ $smarty->assign('LOCKED', array('' => '', '0' => 'No', '1' => 'Yes')); $smarty->assign('NOFEE', array('' => '', '0' => 'No', '1' => 'Yes')); // Catch our JS queries to update some settings -switch (@$_REQUEST['do']) { -case 'lock': - $supress_master = 1; - // Reset user account - if ($user->isLocked($_POST['account_id']) == 0) { - $user->setLocked($_POST['account_id'], 2); - } else { - $user->setLocked($_POST['account_id'], 0); - $user->setUserFailed($_POST['account_id'], 0); - $user->setUserPinFailed($_POST['account_id'], 0); +if (!$config['csrf']['enabled'] || $config['csrf']['enabled'] && $csrftoken->valid) { + switch (@$_REQUEST['do']) { + case 'lock': + $supress_master = 1; + // Reset user account + if ($user->isLocked($_POST['account_id']) == 0) { + $user->setLocked($_POST['account_id'], 2); + } else { + $user->setLocked($_POST['account_id'], 0); + $user->setUserFailed($_POST['account_id'], 0); + $user->setUserPinFailed($_POST['account_id'], 0); + } + break; + case 'fee': + $supress_master = 1; + $user->changeNoFee($_POST['account_id']); + break; + case 'admin': + $supress_master = 1; + $user->changeAdmin($_POST['account_id']); + break; } - break; -case 'fee': - $supress_master = 1; - $user->changeNoFee($_POST['account_id']); - break; -case 'admin': - $supress_master = 1; - $user->changeAdmin($_POST['account_id']); - break; } // Gernerate the GET URL for filters @@ -81,4 +83,4 @@ if (isset($_REQUEST['filter'])) { // Tempalte specifics $smarty->assign("CONTENT", "default.tpl"); -?> +?> \ No newline at end of file diff --git a/include/pages/register/register.inc.php b/include/pages/register/register.inc.php index 60d988c6..87f856ee 100644 --- a/include/pages/register/register.inc.php +++ b/include/pages/register/register.inc.php @@ -26,10 +26,15 @@ if ($setting->getValue('disable_invitations') && $setting->getValue('lock_regist if ($setting->getValue('recaptcha_enabled') != 1 || $setting->getValue('recaptcha_enabled_registrations') != 1 || $rsp->is_valid) { // Check if recaptcha is enabled, process form data if valid or disabled isset($_POST['token']) ? $token = $_POST['token'] : $token = ''; - if ($user->register(@$_POST['username'], @$_POST['coinaddress'], @$_POST['password1'], @$_POST['password2'], @$_POST['pin'], @$_POST['email1'], @$_POST['email2'], @$_POST['tac'], $token)) { - (!$setting->getValue('accounts_confirm_email_disabled')) ? $_SESSION['POPUP'][] = array('CONTENT' => 'Please check your mailbox to activate this account') : $_SESSION['POPUP'][] = array('CONTENT' => 'Account created, please login'); + isset($_POST['coinaddress']) ? $validcoinaddress = $_POST['coinaddress'] : $validcoinaddress = NULL; + if ($config['check_valid_coinaddress'] AND empty($validcoinaddress)) { + $_SESSION['POPUP'][] = array('CONTENT' => 'Please enter a valid Wallet Address', 'TYPE' => 'alert alert-danger'); } else { - $_SESSION['POPUP'][] = array('CONTENT' => 'Unable to create account: ' . $user->getError(), 'TYPE' => 'alert alert-danger'); + if ($user->register(@$_POST['username'], $validcoinaddress, @$_POST['password1'], @$_POST['password2'], @$_POST['pin'], @$_POST['email1'], @$_POST['email2'], @$_POST['tac'], $token)) { + (!$setting->getValue('accounts_confirm_email_disabled')) ? $_SESSION['POPUP'][] = array('CONTENT' => 'Please check your mailbox to activate this account') : $_SESSION['POPUP'][] = array('CONTENT' => 'Account created, please login'); + } else { + $_SESSION['POPUP'][] = array('CONTENT' => 'Unable to create account: ' . $user->getError(), 'TYPE' => 'alert alert-danger'); + } } } } else { diff --git a/include/smarty_globals.inc.php b/include/smarty_globals.inc.php index b94b661d..ea13a6d1 100644 --- a/include/smarty_globals.inc.php +++ b/include/smarty_globals.inc.php @@ -26,7 +26,7 @@ if ( ! $dPoolHashrateModifier = $setting->getValue('statistics_pool_hashrate_mod $iCurrentPoolHashrate = $statistics->getCurrentHashrate(); // Avoid confusion, ensure our nethash isn't higher than poolhash -if ($iCurrentPoolHashrate > $dNetworkHashrate / 1000) $dNetworkHashrate = $iCurrentPoolHashrate; +if ($iCurrentPoolHashrate > $dNetworkHashrate / 1000) $dNetworkHashrate = $iCurrentPoolHashrate * 1000; // Baseline network hashrate for templates if ( ! $dPersonalHashrateModifier = $setting->getValue('statistics_personal_hashrate_modifier') ) $dPersonalHashrateModifier = 1; @@ -63,6 +63,7 @@ $aGlobal = array( 'reward' => $config['reward_type'] == 'fixed' ? $config['reward'] : $block->getAverageAmount(), 'price' => $setting->getValue('price'), 'twofactor' => $config['twofactor'], + 'coinaddresscheck' => $config['check_valid_coinaddress'], 'csrf' => $config['csrf'], 'config' => array( 'date' => $setting->getValue('system_date_format', '%m/%d/%Y %H:%M:%S'), diff --git a/include/version.inc.php b/include/version.inc.php index f0ea33f7..91d93ee8 100644 --- a/include/version.inc.php +++ b/include/version.inc.php @@ -2,7 +2,7 @@ $defflip = (!cfip()) ? exit(header('HTTP/1.1 401 Unauthorized')) : 1; define('MPOS_VERSION', '0.0.4'); -define('DB_VERSION', '0.0.10'); +define('DB_VERSION', '0.0.11'); define('CONFIG_VERSION', '0.0.8'); define('HASH_VERSION', 1); diff --git a/public/site_assets/bootstrap/css/mpos.css b/public/site_assets/bootstrap/css/mpos.css index d8cd9220..67f85adf 100644 --- a/public/site_assets/bootstrap/css/mpos.css +++ b/public/site_assets/bootstrap/css/mpos.css @@ -620,4 +620,8 @@ div.fade { color: #F79D00; } +.toggleSoundButton { + width: 30px; +} + /* End Footer */ diff --git a/sql/000_base_structure.sql b/sql/000_base_structure.sql index 3c55f36c..8a80ee2e 100644 --- a/sql/000_base_structure.sql +++ b/sql/000_base_structure.sql @@ -155,8 +155,8 @@ CREATE TABLE IF NOT EXISTS `shares` ( ) ENGINE=InnoDB DEFAULT CHARSET=utf8; CREATE TABLE IF NOT EXISTS `shares_archive` ( - `id` int(255) unsigned NOT NULL AUTO_INCREMENT, - `share_id` int(255) unsigned NOT NULL, + `id` bigint(30) unsigned NOT NULL AUTO_INCREMENT, + `share_id` bigint(30) unsigned NOT NULL, `username` varchar(120) NOT NULL, `our_result` enum('Y','N') DEFAULT NULL, `upstream_result` enum('Y','N') DEFAULT NULL, diff --git a/templates/bootstrap/account/notifications/default.tpl b/templates/bootstrap/account/notifications/default.tpl index f1fa1a0d..12dbcd0b 100644 --- a/templates/bootstrap/account/notifications/default.tpl +++ b/templates/bootstrap/account/notifications/default.tpl @@ -13,7 +13,7 @@ {if $DISABLE_IDLEWORKERNOTIFICATIONS|default:"" != 1} - + @@ -93,7 +93,7 @@ {if $NOTIFICATIONS[notification].type == new_block}New Block {else if $NOTIFICATIONS[notification].type == payout}Payout -{else if $NOTIFICATIONS[notification].type == idle_worker}IDLE Worker +{else if $NOTIFICATIONS[notification].type == idle_worker}Idle Worker {else if $NOTIFICATIONS[notification].type == success_login}Successful Login {/if} diff --git a/templates/bootstrap/admin/news/default.tpl b/templates/bootstrap/admin/news/default.tpl index 0d30d5f1..2bbe31de 100644 --- a/templates/bootstrap/admin/news/default.tpl +++ b/templates/bootstrap/admin/news/default.tpl @@ -53,7 +53,7 @@ @@ -61,4 +61,3 @@ {/section} {/nocache} - diff --git a/templates/bootstrap/admin/user/default.tpl b/templates/bootstrap/admin/user/default.tpl index 357a8ba0..2ef58e08 100644 --- a/templates/bootstrap/admin/user/default.tpl +++ b/templates/bootstrap/admin/user/default.tpl @@ -3,21 +3,21 @@ $.ajax({ type: "POST", url: "{$smarty.server.SCRIPT_NAME}", - data: "page={$smarty.request.page|escape}&action={$smarty.request.action|escape}&do=fee&account_id=" + id, + data: "page={$smarty.request.page|escape}&action={$smarty.request.action|escape}&do=fee&account_id=" + id + "&ctoken={$smarty.request.ctoken|escape}", }); } function storeLock(id) { $.ajax({ type: "POST", url: "{$smarty.server.SCRIPT_NAME}", - data: "page={$smarty.request.page|escape}&action={$smarty.request.action|escape}&do=lock&account_id=" + id, + data: "page={$smarty.request.page|escape}&action={$smarty.request.action|escape}&do=lock&account_id=" + id + "&ctoken={$smarty.request.ctoken|escape}", }); } function storeAdmin(id) { $.ajax({ type: "POST", url: "{$smarty.server.SCRIPT_NAME}", - data: "page={$smarty.request.page|escape}&action={$smarty.request.action|escape}&do=admin&account_id=" + id, + data: "page={$smarty.request.page|escape}&action={$smarty.request.action|escape}&do=admin&account_id=" + id + "&ctoken={$smarty.request.ctoken|escape}", }); } @@ -147,4 +147,4 @@ - + \ No newline at end of file diff --git a/templates/bootstrap/dashboard/blocks/default.tpl b/templates/bootstrap/dashboard/blocks/default.tpl index 46467cd6..83959217 100644 --- a/templates/bootstrap/dashboard/blocks/default.tpl +++ b/templates/bootstrap/dashboard/blocks/default.tpl @@ -37,6 +37,11 @@ +
+ +
-{/if} +{/if} \ No newline at end of file diff --git a/templates/bootstrap/dashboard/js/api.tpl b/templates/bootstrap/dashboard/js/api.tpl index f81a1fe0..e73b4859 100644 --- a/templates/bootstrap/dashboard/js/api.tpl +++ b/templates/bootstrap/dashboard/js/api.tpl @@ -3,10 +3,23 @@ diff --git a/templates/bootstrap/register/default.tpl b/templates/bootstrap/register/default.tpl index 722f903f..2f49357b 100644 --- a/templates/bootstrap/register/default.tpl +++ b/templates/bootstrap/register/default.tpl @@ -22,11 +22,13 @@ + {if $GLOBAL.coinaddresscheck|default:"1"}
+ {/if} (Strength)
diff --git a/upgrade/definitions/0.0.10_to_0.0.11.inc.php b/upgrade/definitions/0.0.10_to_0.0.11.inc.php new file mode 100644 index 00000000..752b41a4 --- /dev/null +++ b/upgrade/definitions/0.0.10_to_0.0.11.inc.php @@ -0,0 +1,31 @@ +getValue('DB_VERSION'); // Our actual version installed + + // Upgrade specific variables + $aSql[] = "ALTER TABLE `shares_archive` CHANGE `id` `id` BIGINT(30) unsigned NOT NULL AUTO_INCREMENT"; + $aSql[] = "ALTER TABLE `shares_archive` CHANGE `share_id` `share_id` BIGINT(30) unsigned NOT NULL"; + $aSql[] = "UPDATE " . $setting->getTableName() . " SET value = '0.0.11' WHERE name = 'DB_VERSION'"; + + if ($db_version_now == $db_version_old && version_compare($db_version_now, DB_VERSION, '<')) { + // Run the upgrade + echo '- Starting database migration to version ' . $db_version_new . PHP_EOL; + foreach ($aSql as $sql) { + echo '- Preparing: ' . $sql . PHP_EOL; + $stmt = $mysqli->prepare($sql); + if ($stmt && $stmt->execute()) { + echo '- success' . PHP_EOL; + } else { + echo '- failed: ' . $mysqli->error . PHP_EOL; + exit(1); + } + } + } +} +?> \ No newline at end of file