} // END - if
// Version of this extension
-setThisExtensionVersion('0.0.5');
+setThisExtensionVersion('0.0.6');
// Version history array (add more with , '0.0.1' and so on)
-setExtensionVersionHistory(array('0.0.0', '0.0.1', '0.0.2', '0.0.3', '0.0.4', '0.0.5'));
+setExtensionVersionHistory(array('0.0.0', '0.0.1', '0.0.2', '0.0.3', '0.0.4', '0.0.5', '0.0.6'));
switch (getExtensionMode()) {
case 'setup': // Do stuff when installation is running
// Update notes
setExtensionUpdateNotes("IN/OUT ersetzt mit WITHDRAW/PAYOUT.");
break;
+
+ case '0.0.6': // SQL queries for v0.0.6
+ addExtensionChangeTableColumnSql('config', 'wernis_pass_md5', 'wernis_pass_md5', " VARCHAR(255) NOT NULL DEFAULT ''");
+
+ // Update notes
+ setExtensionUpdateNotes("Es wird seit API-Version 0.6-BETA SHA256 (hexadezimal kodiert) verwendet.");
+ break;
} // END - switch
break;
return $str;
}
+// Hash string with SHA256 and encode it to hex
+function hashSha256 ($str) {
+ /// Hash string
+ $hash = mhash(MHASH_SHA256, $str);
+
+ // Encode it to hexadecimal
+ $hex = '';
+ for ($i = 0; $i < strlen($hash); $i++) {
+ // Encode char to decimal, pad it with zero, add it
+ $hex .= padLeftZero(dechex(ord(substr($hash, $i, 1))));
+ } // END - if
+
+ // Return it
+ return $hex;
+}
+
// ----------------------------------------------------------------------------
// "Translatation" functions for points_data table
// ----------------------------------------------------------------------------
} // END - if
// Hash the password and remove clear-text
- setPostRequestElement('wernis_pass_md5', md5(postRequestElement('wernis_pass')));
+ setPostRequestElement('wernis_pass_md5', hashSha256(postRequestElement('wernis_pass')));
unsetPostRequestElement('wernis_pass');
// Save settings
displayMessage('{--MEMBER_WERNIS_WITHDRAW_AMOUNT_SMALLER_MIN--}');
} else {
// All is fine here so do the withdraw
- $success = WERNIS_EXECUTE_WITHDRAW(postRequestElement('wernis_userid'), md5(postRequestElement('wds66_password')), postRequestElement('amount'));
+ $success = WERNIS_EXECUTE_WITHDRAW(postRequestElement('wernis_userid'), hashSha256(postRequestElement('wds66_password')), postRequestElement('amount'));
if ($success === TRUE) {
// Add it to this amount
initReferralSystem();