Subversion Repositories Applications.wikini

Compare Revisions

Ignore whitespace Rev 45 → Rev 46

/trunk/tools/templates/presentation/templates/moteurrecherche_basic.tpl.html
New file
0,0 → 1,9
<form class="<?php echo $class;?>" method="get" action="<?php echo $url;?>">
<div class="btn-group">
<div class="input-append">
<input type="text" class="search-query has-tooltip" data-placement="bottom" placeholder="<?php echo TEMPLATE_SEARCH_PLACEHOLDER;?>" value="<?php echo $phrase;?>" title="<?php echo TEMPLATE_SEARCH_INPUT_TITLE;?>" accesskey="C" tabindex="1" name="phrase" />
<button type="submit" class="btn search-btn<?php echo $btnclass; ?>"><i class="icon-search<?php echo $iconclass; ?>"></i>&nbsp;</button>
</div>
</div>
<input type="hidden" value="RechercheTexte" name="wiki" />
</form>
/trunk/tools/templates/actions/barreredaction.php
New file
0,0 → 1,79
<?php
if (!defined("WIKINI_VERSION"))
{
die ("acc&egrave;s direct interdit");
}
 
if ($this->HasAccess("write")) {
// on récupère la page et ses valeurs associées
$page = $this->GetParameter('page');
if (empty($page)) {
$page = $this->GetPageTag();
$time = $this->GetPageTime();
$content = $this->page;
} else {
$content = $this->LoadPage($page);
$time = $content["time"];
}
$barreredactionelements['page'] = $page;
$barreredactionelements['linkpage'] = $this->href("", $page);
 
// on choisit le template utilisé
$template = $this->GetParameter('template');
if (empty($template)) {
$template = 'barreredaction_basic.tpl.html';
}
 
// on peut ajouter des classes à la classe par défaut .footer
$barreredactionelements['class'] = ($this->GetParameter('class') ? 'footer '.$this->GetParameter('class') : 'footer');
 
// on ajoute le lien d'édition si l'action est autorisée
if ( $this->HasAccess("write", $page) ) {
$barreredactionelements['linkedit'] = $this->href("edit", $page);
}
 
//
if ( $time ) {
$barreredactionelements['linkrevisions'] = $this->href("revisions", $page);
$barreredactionelements['time'] = date(TEMPLATE_DATE_FORMAT, strtotime($time));
}
 
// if this page exists
if ( $content ) {
// if owner is current user
if ($this->UserIsOwner($page) || $this->UserIsAdmin()) {
$barreredactionelements['owner'] = TEMPLATE_OWNER." : ".TEMPLATE_YOU.' - '.TEMPLATE_PERMISSIONS;
$barreredactionelements['linkacls'] = $this->href("acls", $page);
$barreredactionelements['linkdeletepage'] = $this->href("deletepage", $page);
}
else {
if ($owner = $this->GetPageOwner($page)) {
$barreredactionelements['owner'] = TEMPLATE_OWNER." : ".$owner;
if ($this->UserIsAdmin()) {
$barreredactionelements['linkacls'] = $this->href("acls", $page);
$barreredactionelements['owner'] .= ' - '.TEMPLATE_PERMISSIONS;
}
else {
//$barreredactionelements['linkacls'] = $this->href('', $owner);
}
}
else {
$barreredactionelements['owner'] = TEMPLATE_NO_OWNER.($this->GetUser() ? " - ".TEMPLATE_CLAIM : "");
if ($this->GetUser()) $barreredactionelements['linkacls'] = $this->href("claim", $page);
//else $barreredactionelements['linkacls'] = $this->href("claim", $page);
}
}
 
}
$barreredactionelements['linkreferrers'] = $this->href("referrers", $page);
$barreredactionelements['linkdiaporama'] = $this->href("diaporama", $page);
$barreredactionelements['linkshare'] = $this->href("share", $page);
include_once('tools/templates/libs/squelettephp.class.php');
$barreredactiontemplate = new SquelettePhp('tools/templates/presentation/templates/'.$template);
$barreredactiontemplate->set($barreredactionelements);
echo $barreredactiontemplate->analyser();
}
 
?>
/trunk/tools/actions/actions/usersdeleting.php
New file
0,0 → 1,358
<?php
/*
usersdeleting.php
 
Copyright 2002 Patrick PAUL
Copyright 2003 David DELON
* Copyright 2013 Jean-Pascal MILCENT
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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
 
// Data managment
$origineLink = $this->Href();
$messages = array();
if ($this->UserIsAdmin() === false) {
$msg = "Il est nécessaire d'être administrateur de ce wikini pour accéder à la gestion des utilisateurs.";
$messages[] = array('type' => 'warning', 'txt' => $msg);
} else {
$msg_accueil = "Zone de sécurité renforcé : identifiez vous avec l'identifiant et le mot de passe de connexion à la base de données de ce Wikini";
$msg_echec = "Accès limité aux administrateurs de ce Wikini ayant accès aux paramètres d'installation (identifiant et mot de passe de la base de données).\n".
"Votre tentative d'identification a échoué.\n".
"Actualiser la page pour essayer à nouveau si vous avez en votre possession les paramètres nécessaires.";
$wikiAuthHttp = new WikiAuthHttp($msg_accueil, $msg_echec, $this->config['mysql_user'], $this->config['mysql_password']);
$wikiAuthHttp->authentifier();
$prefix = $this->config['table_prefix'];
// Data update, insert or delete
if (isset($_POST['action'])) {
if ($_POST['action'] == 'deleteUser') {
if (isset($_POST['users']) === false) {
$messages[] = array('type' => 'error', 'txt' => 'Veuillez sélectionner au moins un utilisateur.');
} else {
$usersDeleted = array();
$usersEscaped = array();
foreach ($_POST['users'] as $user_name) {
$usersDeleted[] = $user_name;
$usersEscaped[] = "'".mysql_real_escape_string($user_name)."'";
}
$sqlUsersToDelete = implode(',', $usersEscaped);
}
$queryDeleteUser = "DELETE FROM {$prefix}users ".
"WHERE name IN ($sqlUsersToDelete) ";
$this->Query($queryDeleteUser);
$usersDeleted = implode(', ', $usersDeleted);
if (empty($usersDeleted) == false) {
$msg = "Les utilisateurs suivant ont été supprimés : $usersDeleted.";
$messages[] = array('type' => 'success', 'txt' => $msg);
}
} else if ($_POST['action'] == 'deletePage') {
$deletedPages = array();
if (!empty($_POST['suppr'])) {
foreach ($_POST['suppr'] as $page) {
// Effacement de la page en utilisant la méthode DeleteOrphanedPage
$this->DeleteOrphanedPage($page);
$deletedPages[] = $page;
}
$deletedPages = implode(', ', $deletedPages);
if (empty($deletedPages) == false) {
$msg = "Les pages suivantes ont été supprimées : $deletedPages.";
$messages[] = array('type' => 'success', 'txt' => $msg);
}
}
$restoredPages = array();
if (!empty($_POST['rev'])) {
foreach ($_POST['rev'] as $rev_id) {
// Sélectionne la révision
$id = "'".mysql_real_escape_string($rev_id)."'";
$query = 'SELECT * '.
"FROM {$prefix}pages ".
"WHERE id = $id ".
'LIMIT 1';
$revision = $this->LoadSingle($query);
 
// Fait de la dernière version de cette révision une version archivée
$tag = "'".mysql_real_escape_string($revision['tag'])."'";
$queryUpdate =
"UPDATE {$prefix}pages " .
"SET latest = 'N' ".
"WHERE latest = 'Y' " .
"AND tag = $tag " .
"LIMIT 1";
$this->Query($queryUpdate);
$restoredPages[] = $revision['tag'];
// add new revision
$owner = "'".mysql_real_escape_string($revision['owner'] )."'";
$user = "'".mysql_real_escape_string('WikiAdmin')."'";
$body = "'".mysql_real_escape_string(chop($revision['body']))."'";
$queryInsert = "INSERT INTO {$prefix}pages SET ".
"tag = $tag, ".
"time = NOW(), ".
"owner = $owner, ".
"user = $user, ".
"latest = 'Y', ".
"body = $body";
$this->Query($queryInsert);
}
}
$restoredPages = implode(', ', $restoredPages);
if (empty($restoredPages) == false) {
$msg = "Les pages suivantes ont été restaurées à une version antérieure: $restoredPages.";
$messages[] = array('type' => 'success', 'txt' => $msg);
}
}
}
// Data loading
$queryAllUsers = 'SELECT name, email, motto, revisioncount, changescount, doubleclickedit, signuptime, show_comments '.
"FROM {$prefix}users ".
'ORDER BY signuptime DESC';
$users = $this->LoadAll($queryAllUsers);
$users_infos = array();
foreach($users as $user) {
$user_name = mysql_real_escape_string($user['name']);
$result = $this->LoadSingle("SELECT COUNT(*) AS pages FROM {$prefix}pages WHERE user = '$user_name'");
$user['pages_user'] = $result['pages'];
$result = $this->LoadSingle("SELECT COUNT(*) AS pages FROM {$prefix}pages WHERE latest = 'Y' AND owner = '$user_name'");
$user['pages_owner'] = $result['pages'];
$user['has_pages'] = ($user['pages_user'] != 0 || $user['pages_owner'] != 0) ? true : false;
$user['pages_link'] = $this->Href('', '', "action=seeUserPage&user={$user['name']}");
$users_infos[] = $user;
}
if (count($users_infos) == 0) {
$msg = "Ce Wikini ne possède pas d'utilisateur";
$messages[] = array('type' => 'info', 'txt' => $msg);
}
if (isset($_GET['action'])) {
if ($_GET['action'] == 'seeUserPage' && $_GET['user'] != '') {
$actionLink = $this->Href('', '', "action=seeUserPage&user={$_GET['user']}");
$userPages['name'] = $_GET['user'];
$userName = "'".mysql_real_escape_string($_GET['user'])."'";
$queryAllUserPages = "SELECT tag ".
"FROM {$prefix}pages ".
"WHERE owner = $userName OR ".
" user = $userName ".
"ORDER BY time DESC ";
$pages = $this->LoadAll($queryAllUserPages);
if (count($pages) == 0) {
$msg = "Cet utilisateur ne possède plus aucune page.";
$messages[] = array('type' => 'error', 'txt' => $msg);
} else {
foreach ($pages as $page) {
if (! isset($userPages['pages'][$page['tag']])) {
$pageTag = "'".mysql_real_escape_string($page['tag'])."'";
$infos = $this->LoadSingle("SELECT * FROM {$prefix}pages WHERE tag = $pageTag AND latest = 'Y'");
$infos['link'] = $this->Href('', $page['tag']);
$infos['revisions'] = $this->LoadAll("SELECT * FROM {$prefix}pages WHERE tag = $pageTag ORDER BY time DESC");
$userPages['pages'][$page['tag']] = $infos;
}
}
}
}
}
}
 
// Template HTML
$html = '';
if ($_GET['action'] == 'seeUserPage') {
$html .= '<ul class="breadcrumb">
<li>Retour&nbsp;:&nbsp;</li>
<li><a href="'.$origineLink.'">Gestion des utilisateurs</a> <span class="divider">&gt;</span></li>
<li class="active">Pages utilisateur '.$userPages['name'].'</li>
</ul>';
}
$html .= '<h2>Gestion des utilisateurs</h2>';
 
if (count($messages) != 0) {
foreach ($messages as $msg) {
$html .= '<p class="alert alert-'.$msg['type'].'">';
$html .= $msg['txt'].'<br />';
$html .= '</p>';
}
}
if ($this->UserIsAdmin()) {
if ($_GET['action'] == 'seeUserPage' && isset($userPages)) {
if (count($userPages['pages']) > 0) {
$html .= '<h3 id="user-pages-modal-label">'."Pages de l'utilisateur {$userPages['name']}".'</h3>'.
'<p class="alert alert-info">Sélectionnez une ou plusieurs pages à supprimer et/ou versions à restaurer puis cliquer sur le bouton en bas de page.</p>';
$html .= '<form action="'.$actionLink.'" method="post">';
$html .= '<table class="table table-bordered">
<thead>
<tr>
<th>[supprimer] Page</th>
<th>Propriétaire</th>
<th>[restaurer] Version du</th>
<th>Auteur modification</th>
</tr>
</thead>';
foreach ($userPages['pages'] as $page) {
$html .= '<tr class="success">'.
'<td>'.
'<span class="has-tooltip" title="Supprimer la page '.$page['tag'].' et toutes ses versions !">'.
'<input name="suppr[]" value="'.$page['tag'].'" type="checkbox"/>'.
'</span> '.
'<a href="'.$page['link'].'">'.
$page['tag'].
'</a>'.
'</td>'.
'<td>'.$page['owner'].'</td>'.
'<td>'.$page['time'].'</td>'.
'<td>'.$page['user'].'</td>'.
'</tr>';
$revisionsNbre = count($page['revisions']);
if ($revisionsNbre != 0) {
for ($i = 1; $i < $revisionsNbre; $i++) {
$revision = $page['revisions'][$i];
$html .= '<tr>'.
'<td>&nbsp;</td>'.
'<td>'.$revision['owner'].'</td>'.
'<td>'.
'<span class="has-tooltip" title="Restaurer la version du '.$revision['time'].' de la page '.$page["tag"].'">'.
'<input name="rev[]" value="'.$revision['id'].'" type="checkbox"/> '.
'</span>'.
$revision['time'].
'</td>'.
'<td>'.$revision['user'].'</td>'.
'</tr>';
}
}
}
$html .= '</table>
<div class="form-actions">
<button class="btn btn-danger has-tooltip" type="submit" name="action" value="deletePage" title="Supprime les pages sélectionnés ou restaure des anciennes versions">
Supprimer des pages et/ou restaurer des versions
</button>
</div>
</form>';
}
} else {
$html .= '<form action="'.$origineLink.'" method="post">';
$html .= '<p class="alert alert-info">Sélectionnez un ou plusieurs utilisateurs à supprimer puis cliquer sur le bouton supprimer en bas de page.</p>
<table class="table table-striped table-hover table-bordered table-condensed">
<thead>
<tr>
<th>&nbsp;</th>
<th>Nom & Devise</th>
<th>Courriel</th>
<th>Inscription</th>
<th>
<span class="has-tooltip" title="Nombre de pages (hors archive) dont l\'utilisateur est le propriétaire.">Pages proprio.</span>
/
<span class="has-tooltip" title="Nombre de pages toutes versions confondues modifiées par l\'utilisateur.">Modif.</span>
</th>
<th>
<span class="has-tooltip" title="Nombre de révisions visible par l\'utilisateur">révisions</span> /
<span class="has-tooltip" title="Nombre de changements visible par l\'utilisateur">changements</span> /
<span class="has-tooltip" title="L\'utilisateur peut éditer les page en réalisant un double clic.">clic</span> /
<span class="has-tooltip" title="L\'utilisateur veut voir les commentaires sur la page.">commentaire</span>
</th>
</tr>
</thead>
<tbody>';
if (isset($users_infos)) {
foreach ($users_infos as $user) {
$html .= '<tr>
<td><input type="checkbox" name="users[]" value="'.$user['name'].'"/></td>
<td>'.
$user['name'].
(empty($user['motto']) ? '' : '<br /><em><cite>'.$user['motto'].'</cite></em>').
'</td>
<td><a href="mailto:'.$user['email'].'">'.$user['email'].'</a></td>
<td>'.$user['signuptime'].'</td>
<td>'.
($user['has_pages'] ? '<a href="'.$user['pages_link'].'">' : '').
$user['pages_owner'].' / '.$user['pages_user'].
($user['has_pages'] ? '</a>' : '').
'</td>
<td>'.$user['revisioncount'].' / '.$user['changescount'].' / '.$user['doubleclickedit'].' / '.$user['show_comments'].'</td>
</tr>';
}
}
$html .= '</tbody>
</table>
<div class="form-actions">
<button class="btn btn-danger has-tooltip" type="submit" name="action" value="deleteUser" title="Supprime les utilisateurs sélectionnés de la base de données">
Supprimer des utilisateurs
</button>
</div>
</form>';
}
}
 
// Sortie
echo isset($this->config['encoding']) ? mb_convert_encoding($html, $this->config['encoding'], 'iso-8859-15') : $html;
 
// Functions & class
class WikiAuthHttp {
private $message_accueil;
private $message_echec;
private $identifiant;
private $mot_de_passe;
public function __construct($message_accueil, $message_echec, $identifiant, $mot_de_passe) {
$this->message_accueil = $message_accueil;
$this->message_echec = $message_echec;
$this->identifiant = $identifiant;
$this->mot_de_passe = $mot_de_passe;
}
public function authentifier() {
$authentifie = $this->etreAutorise();
if ($authentifie === false) {
$this->envoyerAuth();
}
return $authentifie;
}
 
private function envoyerAuth() {
header('HTTP/1.0 401 Unauthorized');
header('WWW-Authenticate: Basic realm="'.$this->message_accueil.'"');
header('Content-type: text/plain; charset=ISO-8859-15');
print $this->message_echec;
exit(0);
}
 
private function etreAutorise() {
$identifiant = $this->getAuthIdentifiant();
$mdp = $this->getAuthMotDePasse();
$autorisation = ($identifiant == $this->identifiant && $mdp == $this->mot_de_passe) ? true : false;
return $autorisation;
}
 
private function getAuthIdentifiant() {
$id = (isset($_SERVER['PHP_AUTH_USER'])) ? $_SERVER['PHP_AUTH_USER'] : null;
return $id;
}
 
private function getAuthMotDePasse() {
$mdp = (isset($_SERVER['PHP_AUTH_PW'])) ? $_SERVER['PHP_AUTH_PW'] : null;
return $mdp;
}
}
?>
/trunk/tools/actions/actions/recentchangesrss.php
New file
0,0 → 1,107
<?php
/*
recentchangesrss.php
 
Copyright 2003 David DELON
Copyright 2005-2007 Didier LOISEAU
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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
 
if ($this->GetMethod() != 'xml') {
echo 'Pour obtenir le fil RSS des derniers changements, utilisez l\'adresse suivante: ';
echo $this->Link($this->Href('xml'));
return;
}
 
if (isset($_GET['max']) && is_numeric($_GET['max'])) {
$max = ($_GET['max'] < 1000) ? $_GET['max'] : 1000;
} else if ($user = $this->GetUser()) {
$max = $user["changescount"];
} else {
$max = 50;
}
$pages = $this->LoadRecentlyChanged($max);
$last_users = $this->LoadAll('SELECT name, signuptime, motto FROM '.$this->GetConfigValue('table_prefix').'users ORDER BY signuptime DESC LIMIT '.$max);
if ($pages || $last_users)
{
if (!($link = $this->GetParameter("link"))) $link=$this->GetConfigValue("root_page");
$output = '<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/">' . "\n";
$output .= "<channel>\n";
$output .= "<title> Derniers changements sur ". $this->GetConfigValue("wakka_name") . "</title>\n";
$output .= "<link>" . $this->Href(false, $link) . "</link>\n";
$output .= "<description> $max derniers changements sur " . htmlspecialchars($this->GetConfigValue("wakka_name")) . " </description>\n";
$output .= "<language>fr</language>\n";
$output .= '<generator>WikiNi ' . WIKINI_VERSION . "</generator>\n";
$items = array();
if ($pages)
{
foreach ($pages as $page)
{
$items[strtotime($page['time'])] = array('type' => 'page', 'content' => $page);
}
}
if ($last_users)
{
foreach ($last_users as $user) {
$items[strtotime($user['signuptime'])] = array('type' => 'user', 'content' => $user);
}
}
krsort($items);
foreach ($items as $item) {
$type = $item['type'];
if ($type == 'page')
{
$page = $item['content'];
$output .= "<item>\n";
$output .= "<title>" . htmlspecialchars($page["tag"]) . "</title>\n";
$output .= '<dc:creator>' . htmlspecialchars($page["user"]) . "</dc:creator>\n";
$output .= '<pubDate>' . gmdate('D, d M Y H:i:s \G\M\T', strtotime($page['time'])) . "</pubDate>\n";
$output .= "<description>" . htmlspecialchars(
'Modification de ' . $this->ComposeLinkToPage($page["tag"])
. ' (' . $this->ComposeLinkToPage($page["tag"], 'revisions', 'historique') . ')'
. " --- par " .$page["user"])
. "</description>\n";
$itemurl = $this->href(false, $page["tag"], "time=" . htmlspecialchars(rawurlencode($page["time"])));
$output .= '<guid>' . $itemurl . "</guid>\n";
$output .= "</item>\n";
}
else if ($type == 'user')
{
$user = $item['content'];
$itemurl = $this->Href('', $user['name']);
$output .= '<item>'."\n";
$output .= '<title>'.'Utilisateur '.htmlspecialchars($user['name']).' - inscription le '.$user['signuptime'].'</title>'."\n";
$output .= '<link>'.$itemurl.'</link>'."\n";
$output .= '<pubDate>' . gmdate('D, d M Y H:i:s \G\M\T', strtotime($user['signuptime'])) . "</pubDate>\n";
$output .= '<description>'.'L\'utilisateur '.htmlspecialchars($user['name']).' s\'est inscrit le '.$user['signuptime'];
if (!empty($user['motto']))
{
$output .= ' avec pour devise "'.htmlspecialchars($user['motto']).'"';
}
$output .= '</description>'."\n";
$output .= '<guid>'.$itemurl.'</guid>'."\n";
$output .= '</item>'."\n";
}
}
$output .= "</channel>\n";
$output .= "</rss>\n";
echo $output ;
}
?>
/trunk/tools/actions/desc.xml
New file
0,0 → 1,6
<?xml version="1.0" encoding="ISO-8859-1"?>
<plugin name="actions" version="0.1" active="1">
<author>Jean-Pascal MILCENT</author>
<label>Actions supplementaires ou de rempalcement</label>
<desc>Plugin fournissant de nouvelles actions a Wikini.</desc>
</plugin>
/trunk/tools/actions/index.php
New file
0,0 → 1,10
<?php
// Administration
 
 
// Vérification de sécurité
if (!defined("TOOLS_MANAGER"))
{
die ("acc&egrave;s direct interdit");
}
?>
/trunk/tools/handlers/desc.xml
2,8 → 2,5
<plugin name="handlers" version="0.1" active="1">
<author>Jean-Pascal MILCENT</author>
<label>Handlers supplementaires</label>
<desc>Plugin fournissant de nouveaux handlers a Wikini :
- raw_html : affiche le contenu du body de la page wikini au format html dans une page html de base (utile pour les iFrame)
- raw_html_txt : affiche le contenu du body de la page wikini au format html. Le html n'est pas interprété par le navigateur car il est envoyé avec l'entête text/plain. Utile pour
</desc>
<desc>Plugin fournissant de nouveaux handlers a Wikini.</desc>
</plugin>
/trunk/tools/handlers/index.php
1,6 → 1,8
<?php
// Administration
 
// Vérification de sécurité
if (!defined("TOOLS_MANAGER")) {
die ("accés direct interdit");
die ("acc&egrave;s direct interdit");
}
?>
/trunk/tools/handlers/handlers/page/raw_html_txt.php
1,19 → 1,19
<?php
// declare(encoding='UTF-8');
// declare(encoding='ISO-8859-1');
/**
* Handler renvoyant au navigateur le contenu HTML de la page wiki avec un type mime text/plain.
*
*
* @category PHP 5.2
* @package Framework
* @author Jean-Pascal MILCENT <jpm@tela-botanica.org>
* @copyright Copyright (c) 2009, Tela Botanica (accueil@tela-botanica.org)
* @license http://www.gnu.org/licenses/gpl.html Licence GNU-GPL-v3
* @license http://www.cecill.info/licences/Licence_CeCILL_V2-fr.txt Licence CECILL-v2
* @license http://www.cecill.info/licences/Licence_CeCILL_V2-fr.txt Licence CECILL-v2
* @version $Id$
*/
 
 
//Vérification de sécurité
//Vérification de sécurité
if (!eregi("wakka.php", $_SERVER['PHP_SELF'])) {
die ("Acc&eacute;s direct interdit");
}
/trunk/tools/handlers/handlers/page/raw_html.php
1,40 → 1,40
<?php
// declare(encoding='UTF-8');
/**
* Handler renvoyant au navigateur le contenu HTML de la page wiki.
*
* @category PHP 5.2
* @package Framework
* @author Jean-Pascal MILCENT <jpm@tela-botanica.org>
* @copyright Copyright (c) 2009, Tela Botanica (accueil@tela-botanica.org)
* @license http://www.gnu.org/licenses/gpl.html Licence GNU-GPL-v3
* @license http://www.cecill.info/licences/Licence_CeCILL_V2-fr.txt Licence CECILL-v2
* @version $Id$
*/
 
 
//Vérification de sécurité
if (!eregi("wakka.php", $_SERVER['PHP_SELF'])) {
die ("Acc&eacute;s direct interdit");
}
if ($this->HasAccess("read")) {
if (!$this->page) {
return;
} else {
header("Content-type: text/html");
// Affichage de la page HTML
$html = '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">'."\n";
$html .= '<html>'."\n";
$html .= ' <head>'."\n";
$html .= ' <title>'.$this->GetPageTag().'</title>'."\n";
$html .= ' </head>'."\n";
$html .= ' <body>'."\n";
$html .= $this->Format($this->page["body"], "wakka");
$html .= ' </body>'."\n";
$html .= '</html>';
echo $html;
}
} else {
return;
}
<?php
// declare(encoding='ISO-8859-1');
/**
* Handler renvoyant au navigateur le contenu HTML de la page wiki.
*
* @category PHP 5.2
* @package Framework
* @author Jean-Pascal MILCENT <jpm@tela-botanica.org>
* @copyright Copyright (c) 2009, Tela Botanica (accueil@tela-botanica.org)
* @license http://www.gnu.org/licenses/gpl.html Licence GNU-GPL-v3
* @license http://www.cecill.info/licences/Licence_CeCILL_V2-fr.txt Licence CECILL-v2
* @version $Id$
*/
 
 
//Vérification de sécurité
if (!eregi("wakka.php", $_SERVER['PHP_SELF'])) {
die ("Acc&eacute;s direct interdit");
}
if ($this->HasAccess("read")) {
if (!$this->page) {
return;
} else {
header("Content-type: text/html");
// Affichage de la page HTML
$html = '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">'."\n";
$html .= '<html>'."\n";
$html .= ' <head>'."\n";
$html .= ' <title>'.$this->GetPageTag().'</title>'."\n";
$html .= ' </head>'."\n";
$html .= ' <body>'."\n";
$html .= $this->Format($this->page["body"], "wakka");
$html .= ' </body>'."\n";
$html .= '</html>';
echo $html;
}
} else {
return;
}
?>
/trunk/tools/handlers/handlers/page/deletepage.php
New file
0,0 → 1,110
<?php
/*
$Id: deletepage.php 858 2007-11-22 00:46:30Z nepote $
Copyright 2002 David DELON
Copyright 2003 Eric FELDSTEIN
Copyright 2004 Jean Christophe ANDRÉ
Copyright 2006 Didier Loiseau
Copyright 2007 Charles NÉPOTE
Copyright 2013 Jean-Pascal MILCENT
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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
 
// Vérification de sécurité
if (!defined('WIKINI_VERSION'))
{
die ('Accès direct interdit');
}
print_r($_POST);
if ($this->UserIsOwner() || $this->UserIsAdmin())
{
$deletePage = false;
$tag = $this->GetPageTag();
if ($this->IsOrphanedPage($this->GetPageTag()))
{
if ($_POST['confirme'] == 'Oui') {
$deletePage = true;
}
else
{
$pageLink = $this->Link($tag);
$actionLink = $this->Href('deletepage');
$cancelLink = $this->Href();
 
$msg .= '<form action="'.$actionLink.'" method="post" style="display: inline">'."\n".
'<p class="alert alert-warning">Voulez-vous supprimer définitivement la page '.$pageLink.' &nbsp;?<br/>'."\n".
'<button class="btn btn-danger" name="confirme" value="Oui" type="submit">Oui</button>'."\n".
'<a class="btn" href="'.$cancelLink.'">Non</a>'."\n".
'</p>'."\n".
'</form>'."\n";
}
}
else
{
if ($_POST['confirme'] == 'Oui') {
$deletePage = true;
}
else
{
$pageTag = $this->GetPageTag();
$tablePrefix = $this->config["table_prefix"];
$query = "SELECT DISTINCT from_tag ".
"FROM {$tablePrefix}links ".
"WHERE to_tag = '$pageTag'";
$linkedFrom = $this->LoadAll($query);
$pageLink = $this->ComposeLinkToPage($this->tag, "", "", 0);
 
$msg = '<p><em>Cette page n\'est pas orpheline.</em></p>'."\n".
'<p>Pages ayant un lien vers '.$pageLink.' :</p>'."\n".
'<ul>'."\n";
foreach ($linkedFrom as $page)
{
$currentPageLink = $this->ComposeLinkToPage($page['from_tag'], '', '', 0);
$msg .= '<li>'.$currentPageLink.'</li>'."\n";
}
$msg .= '</ul>'."\n";
 
if ($this->UserIsAdmin()) {
$actionLink = $this->Href('deletepage');
$cancelLink = $this->Href();
$msg .= '<form action="'.$actionLink.'" method="post" style="display: inline">'."\n".
'<p class="alert alert-warning">En tant qu\'administrateur, vous pouvez supprimer malgré tout la page.<br/>'.
'Cela laissera des liens de type "page à créer" dans les pages listées ci-dessus.<br/>'.
'Voulez-vous supprimer définitivement la page '.$pageLink.' &nbsp;?<br/>'."\n".
'<button class="btn btn-danger" name="confirme" value="Oui" type="submit">Oui</button>'."\n".
'<a class="btn" href="'.$cancelLink.'">Non</a>'."\n".
'</p>'."\n".
'</form>'."\n";
}
}
}
 
if ($deletePage == true) {
$this->DeleteOrphanedPage($tag);
$this->LogAdministrativeAction($this->GetUserName(), "Suppression de la page ->\"\"" . $tag . "\"\"");
$msg = '<p class="alert alert-info">'."La page ${tag} a été définitivement supprimée.".'</p>';
}
}
else
{
$msg = '<p class="alert alert-warning"><em>'."Vous n'êtes pas le propriétaire de cette page.".'</em></p>'."\n";
}
 
echo $this->Header();
echo '<div class="page">'."\n";
echo $msg;
echo '</div>'."\n";
echo $this->Footer();
?>