Subversion Repositories Sites.tela-botanica.org

Compare Revisions

No changes between revisions

Ignore whitespace Rev 419 → Rev 420

/trunk/wikini/maj_wikini/tools/hashcash/handlers/page/__addcomment.php
New file
0,0 → 1,11
<?php
 
if (!defined("WIKINI_VERSION"))
{
die ("acc&egrave;s direct interdit");
}
 
$this->SetMessage("Commentaires desactives");
$this->Redirect($this->href());
 
?>
Property changes:
Added: svn:executable
+*
\ No newline at end of property
/trunk/wikini/maj_wikini/tools/hashcash/handlers/page/__edit.php
New file
0,0 → 1,22
<?php
/*
*/
if (!defined("WIKINI_VERSION"))
{
die ("acc&egrave;s direct interdit");
}
 
 
if ($this->HasAccess("write") && $this->HasAccess("read"))
{
if ($_POST["submit"] == 'Sauver') {
require_once('tools/hashcash/secret/wp-hashcash.lib');
if($_POST["hashcash_value"] != hashcash_field_value()) {
$this->SetMessage("Cette page n\'a pas &eacute;t&eacute; enregistr&eacute;e car ce wiki pense que vous etes un robot !");
$this->Redirect($this->href());
}
}
}
 
?>
Property changes:
Added: svn:executable
+*
\ No newline at end of property
/trunk/wikini/maj_wikini/tools/hashcash/handlers/page/edit__.php
New file
0,0 → 1,56
<?php
/*
*/
if (!defined("WIKINI_VERSION"))
{
die ("acc&egrave;s direct interdit");
}
 
 
if ($this->HasAccess("write") && $this->HasAccess("read"))
{
// Edition
if ($_POST["submit"] != 'Aperçu' && $_POST["submit"] != 'Sauver') {
require_once('tools/hashcash/secret/wp-hashcash.lib');
 
// UPDATE RANDOM SECRET
$curr = @file_get_contents(HASHCASH_SECRET_FILE);
if(empty($curr) || (time() - @filemtime(HASHCASH_SECRET_FILE)) > HASHCASH_REFRESH){
// update our secret
$fp = fopen(HASHCASH_SECRET_FILE, 'w');
 
if(@flock($fp, LOCK_EX)){
fwrite($fp, rand(21474836, 2126008810));
@flock($fp, LOCK_UN);
}
 
fclose($fp);
}
if (substr($this->config['base_url'],0,4)!="http") { // Wakka.config mal configure
$base_url="http://".$_SERVER["SERVER_NAME"].($_SERVER["SERVER_PORT"] != 80 ? ":".$_SERVER["SERVER_PORT"] : "").$_SERVER["REQUEST_URI"].(preg_match("/".preg_quote("wakka.php")."$/", $_SERVER["REQUEST_URI"]) ? "?wiki=" : "");
$a = parse_url($base_url);
}
else {
$a = parse_url($this->config['base_url']);
}
$siteurl = ($a['scheme'].'://'.$a['host'].dirname($a['path']));
 
 
$ChampsHashcash =
'<script type="text/javascript" src="' . $siteurl . '/tools/hashcash/wp-hashcash-js.php?siteurl='.$siteurl.'"></script>';
$plugin_output_new=preg_replace ('/\<input name=\"submit\" type=\"submit\" value=\"Sauver\"/',
$ChampsHashcash.'<input name="submit" type="submit" value="Sauver"', $plugin_output_new);
}
 
}
 
?>
Property changes:
Added: svn:executable
+*
\ No newline at end of property