Subversion Repositories Sites.tela-botanica.org

Compare Revisions

No changes between revisions

Ignore whitespace Rev 609 → Rev 610

/branches/v4.0/wikini/maj_wikini/tools/hashcash/secret/.htaccess
New file
0,0 → 1,0
deny from all
Property changes:
Added: svn:executable
+*
\ No newline at end of property
/branches/v4.0/wikini/maj_wikini/tools/hashcash/secret/wp-hashcash.lib
New file
0,0 → 1,49
<?php
 
define('HASHCASH_FORM_ACTION', 'wp-comments-post.php');
define('HASHCASH_SECRET_FILE', realpath(dirname(__FILE__) . '/') . '/wp-hashcash.key');
define('HASHCASH_FORM_ID', 'ACEditor');
define('HASHCASH_FORM_CLASS', 'page');
define('HASHCASH_REFRESH', 60*60*4);
define('HASHCASH_IP_EXPIRE', 60*60*24*7);
define('HASHCASH_VERSION', 3.2);
 
// Produce random unique strings
function hashcash_random_string($l, $exclude = array()) {
// Sanity check
if($l < 1){
return '';
}
$str = '';
while(in_array($str, $exclude) || strlen($str) < $l){
$str = '';
while(strlen($str) < $l){
$str .= chr(rand(65, 90) + rand(0, 1) * 32);
}
}
return $str;
}
 
// looks up the secret key
function hashcash_field_value(){
if(function_exists('file_get_contents')){
return file_get_contents(HASHCASH_SECRET_FILE);
} else {
$fp = fopen(HASHCASH_SECRET_FILE, 'r');
$data = fread($fp, @filesize(HASHCASH_SECRET_FILE));
fclose($fp);
return $data;
}
}
 
// Returns a phrase representing the product
function hashcash_verbage(){
 
$phrase = 'Protection anti-spam active';
 
return $phrase;
}
 
?>
Property changes:
Added: svn:executable
+*
\ No newline at end of property
/branches/v4.0/wikini/maj_wikini/tools/hashcash/secret/wp-hashcash.key
New file
0,0 → 1,0
1600348414
Property changes:
Added: svn:executable
+*
\ No newline at end of property