Subversion Repositories Applications.papyrus

Compare Revisions

Ignore whitespace Rev 1695 → Rev 1696

/branches/livraison_aha/client/integrateur_wikini/bibliotheque/iw_integrateur.fonct.php
21,7 → 21,7
// | along with Foobar; if not, write to the Free Software |
// | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
// +------------------------------------------------------------------------------------------------------+
// CVS : $Id: iw_integrateur.fonct.php,v 1.19 2006-08-29 20:22:41 ddelon Exp $
// CVS : $Id: iw_integrateur.fonct.php,v 1.19.6.1 2007-11-19 10:05:22 ddelon Exp $
/**
* Fonctions de l'integrateur de page Wikini
*
33,7 → 33,7
//Autres auteurs :
*@author Aucun
*@copyright Tela-Botanica 2000-2004
*@version $Revision: 1.19 $ $Date: 2006-08-29 20:22:41 $
*@version $Revision: 1.19.6.1 $ $Date: 2007-11-19 10:05:22 $
*
// +------------------------------------------------------------------------------------------------------+
// | ENTETE du PROGRAMME |
205,6 → 205,13
if ($_POST) {
if ($_POST["submit"] == "Sauver") {
require_once(ADWI_CHEMIN_BIBLIOTHEQUE.'/hashcash/secret/wp-hashcash.lib');
if($_POST["hashcash_value"] != hashcash_field_value()) {
$this->SetMessage("Cette page n\'a pas été enregistrée car ce wiki pense que vous etes un robot !");
$this->Redirect($this->href());
}
// check for overwriting
if ($this->page) {
if ($this->page["id"] != $_POST["previous"]) {
263,6 → 270,42
}
else
{
// Edition
require_once(ADWI_CHEMIN_BIBLIOTHEQUE.'/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 (isset($GLOBALS['_GEN_commun']['url_sauvegarde']) && ($GLOBALS['_GEN_commun']['url_sauvegarde']!='')) {
$a=parse_url(str_replace('&', '&', $GLOBALS['_GEN_commun']['url_sauvegarde']->getUrl()));
}
 
else {
$a = parse_url($this->config['base_url']);
}
$siteurl = ($a['scheme'].'://'.$a['host'].dirname($a['path']));
$ChampsHashcash =
'<link rel="powered" title="Elliott Back\'s Antispam" href="http://elliottback.com" />'.
'<script type="text/javascript" src="' . $siteurl . '/client/integrateur_wikini/bibliotheque/hashcash/wp-hashcash-js.php?siteurl='.$siteurl.'"></script>';
$ACbuttonsBar='';
require_once(IW_CHEMIN_BIBLIO_ACEDITOR."ACeditor.buttonsBar.php");
272,7 → 315,7
"<textarea onkeydown=\"fKeyDown()\" name=\"body\" cols=\"60\" rows=\"40\" wrap=\"soft\" class=\"edit\">\n".
htmlspecialchars($body).
"\n</textarea><br />\n".'<div class="boutons_wiki">'.
($this->config["preview_before_save"] ? "" : "<input name=\"submit\" type=\"submit\" value=\"Sauver\" accesskey=\"s\" />\n").
($this->config["preview_before_save"] ? "" : $ChampsHashcash."<input name=\"submit\" type=\"submit\" value=\"Sauver\" accesskey=\"s\" />\n").
"<input name=\"submit\" type=\"submit\" value=\"Aper&ccedil;u\" accesskey=\"p\" />\n".
"<input type=\"button\" value=\"Annulation\" onclick=\"document.location='".$this->href("")."';\" /></div>\n".
$this->FormClose();