# Copyright (c) 2007 Erwan Briand # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License version 2 as # published by the Free Software Foundation # # 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA # # ***** END LICENSE BLOCK ***** session_start(); require('include/config.inc.php'); require('include/members.inc.php'); $idprojet = $_GET['idprojet']; $idpage = $_GET['idpage']; $numero = $idprojet; if (IsProjectAdmin()) { $testingreq = mysql_query("SELECT * FROM ct2_os_wiki_lock WHERE idpage = '$idpage' AND idprojet = '$idprojet' "); if (mysql_num_rows($testingreq) == 0) { mysql_query("INSERT INTO ct2_os_wiki_lock (idpage,idprojet) VALUES ('$idpage','$idprojet') ") or die (mysql_error()); } elseif (mysql_num_rows($testingreq) == 1) { mysql_query("DELETE FROM ct2_os_wiki_lock WHERE idpage = '$idpage' AND idprojet = '$idprojet' ") or die (mysql_error()); } $recup = mysql_query("SELECT adresse FROM ct2_os WHERE id = '$idprojet' "); $recuparray = mysql_fetch_array($recup); $recu = mysql_query("SELECT nompage FROM ct2_os_wiki WHERE id = '$idpage' "); $recuarray = mysql_fetch_array($recu); Header('Location: '.$racine.'/'.$recuparray['adresse'].'-doc-'.$recuarray['nompage'].'_'.$ct_lang.'.html'); } else { echo 'Error.'; } ?>