Skip to content

Commit

Permalink
Merge pull request MPOS#2676 from smiba/development-patch-1
Browse files Browse the repository at this point in the history
Expend CSRF token expiry & Est. Diff for constantly changing coins
  • Loading branch information
TheSerapher authored Feb 21, 2018
2 parents ae337b4 + f0f4e00 commit 6c0d9a1
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 12 deletions.
4 changes: 2 additions & 2 deletions cronjobs/tables_cleanup.php
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@
}
$log->logInfo(sprintf($strLogMask, 'cleanupTokens', $affected, number_format(microtime(true) - $start, 3), $status, $message));

// Clenaup shares archive
// Cleanup shares archive
$start = microtime(true);
$status = 'OK';
$message = '';
Expand All @@ -73,7 +73,7 @@
}
$log->logInfo(sprintf($strLogMask, 'purgeArchive', $affected, number_format(microtime(true) - $start, 3), $status, $message));

// Clenaup shares archive
// Cleanup shares archive
$start = microtime(true);
$status = 'OK';
$message = '';
Expand Down
17 changes: 10 additions & 7 deletions include/classes/csrftoken.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,19 +16,22 @@ public function getBasic($user, $type) {
}

/**
* Returns +1 min and +1 hour rollovers hashes
* Returns +1 min up to +15 min rollovers hashes
* @param string $user user or IP/host address
* @param string $type page name or other unique per-page identifier
* @return array 1min and 1hour hashes
* @return array 1 minute ago up to 15 minute ago hashes
*/

public function checkAdditional($user, $type) {
$date = date('m/d/y/H/i');
$d = explode('/', $date);
// minute may have rolled over
$seed1 = $this->buildSeed($user.$type, $d[0], $d[1], $d[2], $d[3], ($d[4]-1));
// hour may have rolled over
$seed2 = $this->buildSeed($user.$type, $d[0], $d[1], $d[2], ($d[3]-1), 59);
return array($this->getHash($seed1), $this->getHash($seed2));
$hashes = array();
for ($x = 1; $x < 16; $x++){
for ($y = 4;$d[$y]-- == 0;$y--);
if ($d[4] < 0) { $d[4] = 59; }
$hashes[$x-1] = $this->getHash($this->buildSeed($user.$type, $d[0], $d[1], $d[2], $d[3], $d[4]));
}
return $hashes;
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@
<p class="h5" id="b-nextdiff">{if $GLOBAL.nethashrate > 0}{$NETWORK.EstNextDifficulty|number_format:"8"}{else}n/a{/if}</p>
</div>
<div class="circle-tile-number text-faded">
<p class="h6">Est Next Difficulty{if $GLOBAL.nethashrate > 0}<br/>Change in {$NETWORK.BlocksUntilDiffChange} Blocks{else}No Estimates{/if}</p>
<p class="h6">Est. Next Difficulty{if $GLOBAL.config.coindiffchangetarget > 1}{if $GLOBAL.nethashrate > 0}<br/>Change in {$NETWORK.BlocksUntilDiffChange} Blocks{else}No Estimates{/if}{/if}</p>
</div>
</div>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@
<p id="b-nextdiff" class="h5">{if $GLOBAL.nethashrate > 0}{$NETWORK.EstNextDifficulty|number_format:"8"}{else}n/a{/if}</p>
</div>
<div class="circle-tile-number text-faded">
<p class="h6">Est Next Difficulty{if $GLOBAL.nethashrate > 0}<br/>Change in {$NETWORK.BlocksUntilDiffChange} Blocks{else}No Estimates{/if}</p>
<p class="h6">Est. Next Difficulty{if $GLOBAL.config.coindiffchangetarget > 1}{if $GLOBAL.nethashrate > 0}<br/>Change in {$NETWORK.BlocksUntilDiffChange} Blocks{else}No Estimates{/if}{/if}</p>
</div>
</div>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@
<p class="h5" id="b-nextdiff">{if $GLOBAL.nethashrate > 0}{$NETWORK.EstNextDifficulty|number_format:"8"}{else}n/a{/if}</p>
</div>
<div class="circle-tile-number text-faded">
<p class="h6">Est Next Difficulty{if $GLOBAL.nethashrate > 0}<br/>Change in {$NETWORK.BlocksUntilDiffChange} Blocks{else}No Estimates{/if}</p>
<p class="h6">Est. Next Difficulty{if $GLOBAL.config.coindiffchangetarget > 1}{if $GLOBAL.nethashrate > 0}<br/>Change in {$NETWORK.BlocksUntilDiffChange} Blocks{else}No Estimates{/if}{/if}</p>
</div>
</div>
</div>
Expand Down

0 comments on commit 6c0d9a1

Please sign in to comment.