diff --git a/public/include/classes/user.class.php b/public/include/classes/user.class.php index 68616e3e..53b86d6f 100644 --- a/public/include/classes/user.class.php +++ b/public/include/classes/user.class.php @@ -442,6 +442,10 @@ class User { **/ public function register($username, $password1, $password2, $pin, $email1='', $email2='') { $this->debug->append("STA " . __METHOD__, 4); + if (strlen($username > 40)) { + $this->setErrorMessage('Username exceeding character limit'); + return false; + } if ($this->getEmail($email1)) { $this->setErrorMessage( 'This e-mail address is already taken' ); return false; @@ -482,8 +486,9 @@ class User { $password_hash = $this->getHash($password1); $pin_hash = $this->getHash($pin); $apikey_hash = $this->getHash($username); + $username_clean = strip_tags($username); - if ($this->checkStmt($stmt) && $stmt->bind_param('sssss', $username, $password_hash, $email1, $pin_hash, $apikey_hash)) { + if ($this->checkStmt($stmt) && $stmt->bind_param('sssss', $username_clean, $password_hash, $email1, $pin_hash, $apikey_hash)) { if (!$stmt->execute()) { $this->setErrorMessage( 'Unable to register' ); if ($stmt->sqlstate == '23000') $this->setErrorMessage( 'Username or email already registered' ); diff --git a/public/templates/mmcFE/account/edit/default.tpl b/public/templates/mmcFE/account/edit/default.tpl index c15b56d4..fd445286 100644 --- a/public/templates/mmcFE/account/edit/default.tpl +++ b/public/templates/mmcFE/account/edit/default.tpl @@ -4,7 +4,7 @@ - + diff --git a/public/templates/mmcFE/admin/user/default.tpl b/public/templates/mmcFE/admin/user/default.tpl index 8c65c49f..fef10bfa 100644 --- a/public/templates/mmcFE/admin/user/default.tpl +++ b/public/templates/mmcFE/admin/user/default.tpl @@ -48,8 +48,8 @@ {section name=user loop=$USERS|default} - - + + diff --git a/public/templates/mmcFE/global/userinfo.tpl b/public/templates/mmcFE/global/userinfo.tpl index 92105bdc..d9745394 100644 --- a/public/templates/mmcFE/global/userinfo.tpl +++ b/public/templates/mmcFE/global/userinfo.tpl @@ -1,5 +1,5 @@ {if $GLOBAL.userdata.username|default} -

Welcome, {$smarty.session.USERDATA.username} Active Account: {$GLOBAL.fees}% Pool Fee (You are donating {$GLOBAL.userdata.donate_percent}% of your earnings)

+

Welcome, {$smarty.session.USERDATA.username|escape} Active Account: {$GLOBAL.fees|escape}% Pool Fee (You are donating {$GLOBAL.userdata.donate_percent|escape}% of your earnings)

{else}

Welcome guest, please register to user this pool.

{/if} diff --git a/public/templates/mmcFE/statistics/blocks/default.tpl b/public/templates/mmcFE/statistics/blocks/default.tpl index f404673c..0856a269 100644 --- a/public/templates/mmcFE/statistics/blocks/default.tpl +++ b/public/templates/mmcFE/statistics/blocks/default.tpl @@ -57,7 +57,7 @@ target and network difficulty and assuming a zero variance scenario. {else if $BLOCKSFOUND[block].confirmations == -1} Orphan {else}{$GLOBAL.confirmations - $BLOCKSFOUND[block].confirmations} left{/if} - + diff --git a/public/templates/mmcFE/statistics/blocks/small_table.tpl b/public/templates/mmcFE/statistics/blocks/small_table.tpl index 731d57ef..2b0f8aac 100644 --- a/public/templates/mmcFE/statistics/blocks/small_table.tpl +++ b/public/templates/mmcFE/statistics/blocks/small_table.tpl @@ -14,7 +14,7 @@ {section block $BLOCKSFOUND} - + diff --git a/public/templates/mmcFE/statistics/pool/contributors_hashrate.tpl b/public/templates/mmcFE/statistics/pool/contributors_hashrate.tpl index a2a6ed58..b6168c36 100644 --- a/public/templates/mmcFE/statistics/pool/contributors_hashrate.tpl +++ b/public/templates/mmcFE/statistics/pool/contributors_hashrate.tpl @@ -17,7 +17,7 @@ {math assign="estday" equation="round(reward / ( diff * pow(2,32) / ( hashrate * 1000 ) / 3600 / 24), 3)" diff=$DIFFICULTY reward=$REWARD hashrate=$CONTRIBHASHES[contrib].hashrate} - + {if $GLOBAL.config.price.currency}{/if} @@ -27,7 +27,7 @@ {if $GLOBAL.userdata.hashrate > 0}{math assign="myestday" equation="round(reward / ( diff * pow(2,32) / ( hashrate * 1000 ) / 3600 / 24), 3)" diff=$DIFFICULTY reward=$REWARD hashrate=$GLOBAL.userdata.hashrate}{/if} - + {if $GLOBAL.config.price.currency}{/if} diff --git a/public/templates/mmcFE/statistics/pool/contributors_shares.tpl b/public/templates/mmcFE/statistics/pool/contributors_shares.tpl index 2a482209..232e76b2 100644 --- a/public/templates/mmcFE/statistics/pool/contributors_shares.tpl +++ b/public/templates/mmcFE/statistics/pool/contributors_shares.tpl @@ -14,14 +14,14 @@ {section hashrate $CONTRIBSHARES} - + {/section} {if $listed != 1 && $GLOBAL.userdata.username|default:""} - + {/if}
Username: {$GLOBAL.userdata.username}
Username: {$GLOBAL.userdata.username|escape}
User Id: {$GLOBAL.userdata.id}
API Key: {$GLOBAL.userdata.api_key}
E-Mail:
{$USERS[user].id}{$USERS[user].username}{$USERS[user].email}{$USERS[user].username|escape}{$USERS[user].email|escape} {$USERS[user].shares} {$USERS[user].hashrate} {$USERS[user].payout.est_donation|number_format:"8"}{$BLOCKSFOUND[block].finder|default:"unknown"}{$BLOCKSFOUND[block].finder|default:"unknown"|escape} {$BLOCKSFOUND[block].time|date_format:"%d/%m %H:%M:%S"} {$BLOCKSFOUND[block].difficulty|number_format:"2"} {$BLOCKSFOUND[block].amount|number_format:"2"}
{$BLOCKSFOUND[block].height}{$BLOCKSFOUND[block].finder|default:"unknown"}{$BLOCKSFOUND[block].finder|default:"unknown"|escape} {$BLOCKSFOUND[block].time|date_format:"%d/%m %H:%M:%S"} {$BLOCKSFOUND[block].shares|number_format}
{$rank++}{$CONTRIBHASHES[contrib].account}{$CONTRIBHASHES[contrib].account|escape} {$CONTRIBHASHES[contrib].hashrate|number_format} {$estday|number_format:"3"}{($estday * $GLOBAL.price)|default:"n/a"|number_format:"2"}
n/a{$GLOBAL.userdata.username}{$GLOBAL.userdata.username|escape} {$GLOBAL.userdata.hashrate} {$myestday|number_format:"3"|default:"n/a"}{($myestday * $GLOBAL.price)|default:"n/a"|number_format:"2"}{$rank++}{$CONTRIBSHARES[hashrate].account}{$CONTRIBSHARES[hashrate].account|escape} {$CONTRIBSHARES[hashrate].shares|number_format}
n/a{$GLOBAL.userdata.username}{$GLOBAL.userdata.username|escape} {$GLOBAL.userdata.shares.valid|number_format}