[ Index ] |
|
Code source de SPIP Agora 1.4 |
1 <?php 2 /***************************************************** 3 * This file is part of Agora, web based content management system. 4 * 5 * Agora is free software; you can redistribute it and/or modify 6 * it under the terms of the GNU General Public License as published by 7 * the Free Software Foundation; version 2 of the License. 8 * 9 * Agora is distributed in the hope that it will be useful, 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 * GNU General Public License for more details (file "COPYING"). 13 * 14 * Copyright © Arnaud Martin, Antoine Pitrou et Philippe Rivière. 15 * List of authors detailed in "copyright_fr.html" file. 16 * E-mail : agora@sig.premier-ministre.gouv.fr 17 * Web site : http://www.agora.gouv.fr 18 *****************************************************/ 19 // Ce fichier ne sera execute qu'une fois 20 if (defined("_ECRIRE_INC_ADMIN")) 21 return; 22 23 define("_ECRIRE_INC_ADMIN", "1"); 24 25 require_once(dirname(__FILE__). "/include/bd/inc_auteur_factory.php"); 26 27 function fichier_admin ($action) { 28 global $connect_login; 29 return "admin_" . substr(md5($action . (time() & ~2047). $connect_login), 0, 10); 30 } 31 32 function debut_admin ($action, $commentaire = '') { 33 global $this_link; 34 global $connect_statut; 35 global $connect_profil; 36 37 $profilMetier = &recuperer_instance_profil(); 38 $monProfil = $profilMetier->getProfilForIntitule('item_webmestre'); 39 40 if ((!$action) || ($connect_profil < $monProfil->getPoids())) { 41 include_ecrire ("inc_presentation.php"); 42 install_debut_html(_T('info_acces_refuse')); 43 install_fin_html(); 44 exit; 45 } 46 47 $fichier = fichier_admin($action); 48 49 if (file_exists("data/$fichier")) { 50 spip_log("Action admin: $action"); 51 return true; 52 } 53 54 include_ecrire ("inc_presentation.php"); 55 install_debut_html(_T('info_action', array('action' => $action))); 56 57 if ($commentaire) { 58 echo "<p>" . propre($commentaire). "</p>"; 59 } 60 61 echo $this_link->getForm('POST'); 62 echo "<p><strong>" . _T('info_authentification_ftp'). "</strong></p>"; 63 echo aide("ftp_auth"); 64 echo "<p>" . _T('info_creer_repertoire'). "</p>"; 65 echo "<p align='center'><input type='text' name='fichier' class='fondl' value=\"$fichier\" size='30' /></p>"; 66 echo "<p>" . _T('info_creer_repertoire_2'). "</p>"; 67 echo "<p align='right'><input type='submit' name='Valider' value='" . _T('bouton_recharger_page'). "' class='fondo'></p>"; 68 echo "</form>"; 69 70 install_fin_html(); 71 exit; 72 } 73 74 function fin_admin ($action) { 75 $fichier = fichier_admin($action); 76 @unlink("data/$fichier"); 77 @rmdir("data/$fichier"); 78 } 79 80 function _action_auteur ($action, $id_auteur, $nom_alea) { 81 if (!$id_auteur) { 82 global $connect_id_auteur, $connect_pass; 83 $id_auteur = $connect_id_auteur; 84 $pass = $connect_pass; 85 } 86 else { 87 $auteurMetier = &recuperer_instance_auteur(); 88 $loadOK = $auteurMetier->load($id_auteur); 89 if (PEAR::isError($loadOK)) { 90 die($loadOK->getMessage()); 91 } 92 else { 93 $pass = $auteurMetier->getPass(); 94 } 95 } 96 97 $alea = lire_meta($nom_alea); 98 return md5($action . $id_auteur . $pass . $alea); 99 } 100 101 // TODO : c quoi ces trucs ? 102 function calculer_action_auteur ($action, $id_auteur = 0) { 103 return _action_auteur($action, $id_auteur, 'alea_ephemere'); 104 } 105 106 // TODO : c quoi ces trucs ? 107 function verifier_action_auteur ($action, $valeur, $id_auteur = 0) { 108 if ($valeur == _action_auteur($action, $id_auteur, 'alea_ephemere')) 109 return true; 110 111 if ($valeur == _action_auteur($action, $id_auteur, 'alea_ephemere_ancien')) 112 return true; 113 114 return false; 115 } 116 ?>
titre
Description
Corps
titre
Description
Corps
titre
Description
Corps
titre
Corps
Généré le : Sat Feb 24 14:40:03 2007 | par Balluche grâce à PHPXref 0.7 |