[ 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_AUTH_SPIP")) 21 return; 22 23 define("_ECRIRE_INC_AUTH_SPIP", "1"); 24 25 class Auth_spip { 26 var $auteurId, $nom, $login, $email, $md5pass, $md5next, $alea_futur, $statut; 27 28 function init () { 29 return true; 30 } 31 32 function verifier_challenge_md5 ($login, $mdpass_actuel, $mdpass_futur) { 33 $auteurMetier = &recuperer_instance_auteur(); 34 require_once dirname(__FILE__). "/include/bd/inc_profil_factory.php"; 35 $profilMetier = &recuperer_instance_profil(); 36 $monProfil = $profilMetier->getProfilForIntitule('texte_statut_poubelle'); 37 38 if (PEAR::isError($monProfil)) { 39 die ($monProfil->getMessage()); 40 } 41 $allAuteurs = $auteurMetier->getAllForLoginAndPassAndSourceExceptProfil($login, 42 $mdpass_actuel, 43 'spip', 44 $monProfil->getPoids()); 45 if (PEAR::isError($allAuteurs)) { 46 die ($allAuteurs->getMessage()); 47 } 48 49 if (list(, $monAuteur) = each($allAuteurs)) { 50 $this->auteurId = $monAuteur->getAuteurId(); 51 $this->nom = $monAuteur->getNom(); 52 $this->login = $monAuteur->getLogin(); 53 $this->email = $monAuteur->getEmail(); 54 $this->statut = $monAuteur->getStatut(); 55 $this->md5pass = $mdpass_actuel; 56 $this->md5next = $mdpass_futur; 57 return true; 58 } 59 return false; 60 } 61 62 function verifier ($login, $pass) { 63 return false; 64 } 65 66 function lire () { 67 return true; 68 } 69 70 function activer () { 71 if ($this->statut == 'nouveau') { // nouvel inscrit 72 //----------Modification Clever Age elebescond---------- 73 $auteurMetier = &recuperer_instance_auteur(); 74 $profilMetier = &recuperer_instance_profil(); 75 $monProfil = $profilMetier->getProfilForintitule('item_redacteur'); 76 $updateProfilForLogin = $auteurMetier->updateProfilForLogin($monProfil->getPoids(), addslashes($this->login)); 77 78 if (PEAR::isError($updateProfilForLogin)) { 79 die ($updateStatutForLoginOK->getMessage()); 80 } 81 82 $monProfil = $profilMetier->getProfilForintitule('item_redacteur_en_chef'); 83 $updateProfilForLogin = $auteurMetier->updateProfilForLogin($monProfil->getPoids(), addslashes($this->login)); 84 if (PEAR::isError($updateProfilForLogin)) { 85 die ($updateStatutForLoginOK->getMessage()); 86 } 87 } 88 89 if ($this->md5next) { 90 include_ecrire ("inc_session.php"); 91 // fait tourner le codage du pass dans la base 92 $nouvel_alea_futur = creer_uniqid(); 93 //----------Modification Clever Age elebescond---------- 94 $auteurMetier = &recuperer_instance_auteur(); 95 $updatePassAndAleaFuturForLoginOK = $auteurMetier->updatePassAndAleaFuturForLogin($this->md5next, $nouvel_alea_futur, $this->login); 96 if (PEAR::isError($updatePassAndAleaFuturForLoginOK)) { 97 die ($updatePassAndAleaFuturForLoginOK->getMessage()); 98 } 99 } 100 } 101 } 102 ?>
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 |