} // END - while
/*
- * When the size is below 40 we can also add additional security by
- * scrambling it. Otherwise the hash may corrupted..
+ * When the length of the password is below 40 characters additional
+ * security can be added by scrambling it. Otherwise the hash may
+ * corrupted.
*/
if (strlen($password) <= 40) {
// Also scramble the password
// Default
$GLOBALS[__FUNCTION__][$yn] = '??? (' . $yn . ')';
switch ($yn) {
- case 'Y': $GLOBALS[__FUNCTION__][$yn] = '{--YES--}'; break;
- case 'N': $GLOBALS[__FUNCTION__][$yn] = '{--NO--}'; break;
- default:
- // Log unknown value
+ case 'Y': // Yes
+ $GLOBALS[__FUNCTION__][$yn] = '{--YES--}';
+ break;
+
+ case 'N': // No
+ $GLOBALS[__FUNCTION__][$yn] = '{--NO--}';
+ break;
+
+ default: // Log unknown value
logDebugMessage(__FUNCTION__, __LINE__, sprintf('Unknown value %s. Expected: Y/N', $yn));
break;
} // END - switch
// Default
$GLOBALS[__FUNCTION__][$status] = '??? (' . $status . ')';
switch ($status) {
- case 'Y': $GLOBALS[__FUNCTION__][$status] = '{--ACTIVATED--}'; break;
- case 'N': $GLOBALS[__FUNCTION__][$status] = '{--DEACTIVATED--}'; break;
- default:
- // Log unknown value
+ case 'Y': // Activated
+ $GLOBALS[__FUNCTION__][$status] = '{--ACTIVATED--}';
+ break;
+
+ case 'N': // Deactivated
+ $GLOBALS[__FUNCTION__][$status] = '{--DEACTIVATED--}';
+ break;
+
+ default: // Log unknown value
logDebugMessage(__FUNCTION__, __LINE__, sprintf('Unknown value %s. Expected: Y/N', $status));
break;
} // END - switch
// Generates an URL for the frametester
function generateFrametesterUrl ($url) {
// Prepare frametester URL
- $frametesterUrl = sprintf("{%%url=modules.php?module=frametester&url=%s%%}",
+ $frametesterUrl = sprintf('{%%url=modules.php?module=frametester&url=%s%%}',
encodeString(compileUriCode($url))
);
// Creates a Uni* timestamp from given selection data and prefix
function createEpocheTimeFromSelections ($prefix, $postData) {
+ // Assert on typical array element (maybe all?)
+ assert(isset($postData[$prefix . '_ye']));
+
// Initial return value
$ret = '0';
// Is there a leap year?
$SWITCH = '0';
- $TEST = getYear() / 4;
- $M1 = getMonth();
+ $TEST = getYear() / 4;
+ $M1 = getMonth();
// If so and if current time is before 02/29 and estimated time is after 02/29 then add 86400 seconds (one day)
// 01 2 2 1 1 1 123 4 43 3 32 233 4 43 3 3210
// Return check result
//* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'email=' . $email . ',isValid=' . intval($GLOBALS[__FUNCTION__][$email]) . ' - EXIT!');
- return $GLOBALS[__FUNCTION__][$email];;
+ return $GLOBALS[__FUNCTION__][$email];
}
// Function taken from user comments on www.php.net / function isInStringIgnoreCase()
$scrambleNums = explode(':', genScrambleString(strlen($str)));
}
- // Compare both lengths and abort if different
- if (strlen($str) != count($scrambleNums)) {
- return $str;
- } // END - if
+ // Assert on both lengths
+ assert(strlen($str) == count($scrambleNums));
// Scramble string here
//* DEBUG: */ debugOutput('***Original=' . $str.'***<br />');
// So let's create the string for storing it in database
$scrambleString = implode(':', $scrambleNumbers);
+
+ // Return it
return $scrambleString;
}
// Default is hexadecimal of index if both are same
$mod = dechex($idx);
+
// Is part1 larger or part2 than its counter part?
if ($part1 > $part2) {
// part1 is larger