Source for file class.sites.php
Documentation is available at class.sites.php
* LODEL - Logiciel d'Edition ELectronique.
* Home page: http://www.lodel.org
* E-Mail: lodel@lodel.org
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
* @author Ghislain Picard
* @copyright 2001-2002, Ghislain Picard, Marin Dacos
* @copyright 2003, Ghislain Picard, Marin Dacos, Luc Santeramo, Nicolas Nutten, Anne Gentil-Beccot
* @copyright 2004, Ghislain Picard, Marin Dacos, Luc Santeramo, Anne Gentil-Beccot, Bruno Cénou
* @copyright 2005, Ghislain Picard, Marin Dacos, Luc Santeramo, Gautier Poupeau, Jean Lamy, Bruno Cénou
* @copyright 2006, Marin Dacos, Luc Santeramo, Bruno Cénou, Jean Lamy, Mikaël Cixous, Sophie Malafosse
* @copyright 2007, Marin Dacos, Bruno Cénou, Sophie Malafosse, Pierre-Alain Mignot
* @licence http://www.gnu.org/copyleft/gpl.html
* @since Fichier ajouté depuis la version 0.8
* @version CVS:$Id: class.sites.php 4006 2007-10-05 11:53:41Z malafosse $
* Classe de logique des sites
* @author Ghislain Picard
* @copyright 2001-2002, Ghislain Picard, Marin Dacos
* @copyright 2003, Ghislain Picard, Marin Dacos, Luc Santeramo, Nicolas Nutten, Anne Gentil-Beccot
* @copyright 2004, Ghislain Picard, Marin Dacos, Luc Santeramo, Anne Gentil-Beccot, Bruno Cénou
* @copyright 2005, Ghislain Picard, Marin Dacos, Luc Santeramo, Gautier Poupeau, Jean Lamy, Bruno Cénou
* @copyright 2006, Marin Dacos, Luc Santeramo, Bruno Cénou, Jean Lamy, Mikaël Cixous, Sophie Malafosse
* @copyright 2007, Marin Dacos, Bruno Cénou, Sophie Malafosse, Pierre-Alain Mignot
* @licence http://www.gnu.org/copyleft/gpl.html
* @since Classe ajouté depuis la version 0.8
* Construction des balises select HTML pour cet objet
* @param array &$context le contexte, tableau passé par référence
* @param string $var le nom de la variable du select
* Met le status d'un site à 32
* @param array &$context le contexte passé par référence
* @param array &$error le tableau des erreurs éventuelles passé par référence
* Met le status d'un site à 1
* @param array &$context le contexte passé par référence
* @param array &$error le tableau des erreurs éventuelles passé par référence
* @param integer $id identifiant du site
* @param string $action lock ou unlock
$critere = " id = '$id' AND status > 0";
if($action == 'lock') // Verouillage du site
// cherche le nom du site
$vo = $dao->find($critere, 'path');
$context['error'] = getlodeltextcontent('error_during_lock_site_the_site_may_have_been_deleted', 'lodeladmin');
// delogue tout le monde sauf l'utilisateur courant
$db->execute(lq("DELETE FROM #_MTP_session WHERE site='$site' AND iduser!='$iduser'")) or dberror();
// change le statut du site
$db->execute(lq("UPDATE #_MTP_sites SET status = 32 WHERE $critere")) or dberror();
} else if ($action == 'unlock') { // Déverouillage du site
$db->execute(lq("UPDATE #_MTP_sites SET status = 1 WHERE $critere")) or dberror();
require_once 'cachefunc.php';
// begin{publicfields} automatic generation //
* Retourne la liste des champs publics
return array('title' => array('text', '+'),
'subtitle' => array('text', '+'),
'path' => array('text', '+'),
'url' => array('text', '+'),
'langdef' => array('select', ''));
// end{publicfields} automatic generation //
// begin{uniquefields} automatic generation //
// end{uniquefields} automatic generation //
|