示例#1
0
 /**
  * Méthode qui recrée la vignettes d'une image
  *
  * @param	filename	nom de l'image
  * @return  msg			message contenant le résultat du traitement
  * @author	Stephane F
  **/
 public function makeThumb($filename)
 {
     # Initialisation
     $file = $this->path . $dir . '/' . $filename;
     # Test
     if (file_exists($file) and substr(strrchr($filename, '.'), 1) != 'tb') {
         # On recrée la miniature
         if ($this->privMakeThumb($file)) {
             return 'Miniature recréée avec succès';
         } else {
             return plxMsg::Error('Erreur pendant la création de la miniature');
         }
     } else {
         return plxMsg::Info('Aucune miniature à créer');
     }
 }
示例#2
0
# Control du token du formulaire
plxToken::validateFormToken($_POST);
# Hook Plugins
eval($plxAdmin->plxPlugins->callHook('AdminCategoryPrepend'));
# Control de l'accès à la page en fonction du profil de l'utilisateur connecté
$plxAdmin->checkProfil(PROFIL_ADMIN, PROFIL_MANAGER, PROFIL_MODERATOR, PROFIL_EDITOR);
# On édite la catégorie
if (!empty($_POST) and isset($plxAdmin->aCats[$_POST['id']])) {
    $plxAdmin->editCategorie($_POST);
    header('Location: categorie.php?p=' . $_POST['id']);
    exit;
} elseif (!empty($_GET['p'])) {
    # On vérifie l'existence de la catégorie
    $id = plxUtils::strCheck($_GET['p']);
    if (!isset($plxAdmin->aCats[$id])) {
        plxMsg::Error(L_CAT_UNKNOWN);
        header('Location: categorie.php');
        exit;
    }
} else {
    # Sinon, on redirige
    header('Location: categories.php');
    exit;
}
# On récupère les templates des catégories
$aTemplates = array();
$files = plxGlob::getInstance(PLX_ROOT . $plxAdmin->aConf['racine_themes'] . $plxAdmin->aConf['style']);
if ($array = $files->query('/^categorie(-[a-z0-9-_]+)?.php$/')) {
    foreach ($array as $k => $v) {
        $aTemplates[$v] = $v;
    }
示例#3
0
                $menu = plxUtils::formatMenu(plxUtils::strCheck($plugInstance->adminMenu['title']), PLX_CORE . 'admin/plugin.php?p=' . $plugName, plxUtils::strCheck($plugInstance->adminMenu['caption']));
                if ($plugInstance->adminMenu['position'] != '') {
                    array_splice($menus, $plugInstance->adminMenu['position'] - 1, 0, $menu);
                } else {
                    $menus[] = $menu;
                }
            } else {
                $menus[] = plxUtils::formatMenu(plxUtils::strCheck($plugInstance->getInfo('title')), PLX_CORE . 'admin/plugin.php?p=' . $plugName, plxUtils::strCheck($plugInstance->getInfo('title')));
            }
        }
    }
}
# Hook Plugins
eval($plxAdmin->plxPlugins->callHook('AdminTopMenus'));
echo implode('', $menus);
?>
			</ul>
		</nav>
	</aside>

	<section class="section col sml-12 med-9 med-offset-3 lrg-10 lrg-offset-2">

		<?php 
if (is_file(PLX_ROOT . 'install.php')) {
    echo '<p class="alert red">' . L_WARNING_INSTALLATION_FILE . '</p>';
}
plxMsg::Display();
?>

		<?php 
eval($plxAdmin->plxPlugins->callHook('AdminTopBottom'));
示例#4
0
 /**
  * Méthode qui sauvegarde le fichier des parametres du plugin parameters.xml
  *
  * @return	boolean		resultat de la sauvegarde / TRUE = ok
  * @author	Stephane F
  **/
 public function saveParams()
 {
     # Début du fichier XML
     $xml = "<?xml version='1.0' encoding='" . PLX_CHARSET . "'?>\n";
     $xml .= "<document>\n";
     foreach ($this->aParams as $k => $v) {
         switch ($v['type']) {
             case 'numeric':
                 $xml .= "\t<parameter name=\"{$k}\" type=\"" . $v['type'] . "\">" . intval($v['value']) . "</parameter>\n";
                 break;
             case 'string':
                 $xml .= "\t<parameter name=\"{$k}\" type=\"" . $v['type'] . "\">" . plxUtils::cdataCheck(plxUtils::strCheck($v['value'])) . "</parameter>\n";
                 break;
             case 'cdata':
                 $xml .= "\t<parameter name=\"{$k}\" type=\"" . $v['type'] . "\"><![CDATA[" . plxUtils::cdataCheck($v['value']) . "]]></parameter>\n";
                 break;
         }
     }
     $xml .= "</document>";
     # On écrit le fichier
     if (plxUtils::write($xml, $this->plug['parameters.xml'])) {
         # suppression ancien fichier parameters.xml s'il existe encore (5.1.7+)
         if (file_exists($this->plug['dir'] . $this->plug['name'] . '/parameters.xml')) {
             unlink($this->plug['dir'] . $this->plug['name'] . '/parameters.xml');
         }
         return plxMsg::Info(L_SAVE_SUCCESSFUL);
     } else {
         return plxMsg::Error(L_SAVE_ERR . ' ' . $this->plug['parameters.xml']);
     }
 }
示例#5
0
        header('Location: ./commentaire_new.php?c=' . $_POST['comId']) . (!empty($_GET['a']) ? '&a=' . $_GET['a'] : '');
        exit;
    }
    # Edition
    $plxAdmin->editCommentaire($_POST, $_POST['comId']);
    header('Location: ./commentaire.php?c=' . $_POST['comId'] . (!empty($_GET['a']) ? '&a=' . $_GET['a'] : ''));
    exit;
}
# Variable de redirection
$redirect = preg_match('/^_/', $_GET['c']) ? 'commentaires_offline.php' : 'commentaires_online.php';
# On va récupérer les infos sur le commentaire
$plxAdmin->getCommentaires('/^' . $_GET['c'] . '.xml$/', 0, 1);
if (!$plxAdmin->plxGlob_coms->count or !$plxAdmin->plxRecord_coms->size) {
    # Commentaire inexistant
    # On redirige
    plxMsg::Error('Le commentaire demand&eacute; n\'existe pas ou n\'existe plus !');
    header('Location: ' . $redirect . (!empty($_GET['a']) ? '?a=' . $_GET['a'] : ''));
    exit;
}
# On va récupérer les infos sur l'article
$artId = $plxAdmin->plxRecord_coms->f('article');
# On va rechercher notre article
if (($aFile = $plxAdmin->plxGlob_arts->query('/^' . $artId . '.(.+).xml$/', '', 'sort', 0, 1)) == false) {
    # On indique que le commentaire est attaché à aucun article
    $article = '<strong>aucun article</strong>';
    # Statut du commentaire
    $statut = '<strong>non visible (nous vous conseillons de supprimer ce commentaire)</strong>';
} else {
    $result = $plxAdmin->parseArticle(PLX_ROOT . $plxAdmin->aConf['racine_articles'] . $aFile['0']);
    # On génère notre lien
    $article = '<a href="article.php?a=' . $result['numero'] . '" title="Article attach&eacute; &agrave; ce commentaire">';
示例#6
0
if (!preg_match('#^' . str_replace('\\', '/', realpath(PLX_ROOT . $plxAdmin->aConf['racine_themes'] . $style . '/') . '#'), str_replace('\\', '/', $filename))) {
    $tpl = 'home.php';
}
$filename = realpath(PLX_ROOT . $plxAdmin->aConf['racine_themes'] . $style . '/' . $tpl);
# On teste l'existence du thème
if (empty($style) or !is_dir(PLX_ROOT . $plxAdmin->aConf['racine_themes'] . $style)) {
    plxMsg::Error(L_CONFIG_EDITTPL_ERROR_NOTHEME);
    header('Location: parametres_affichage.php');
    exit;
}
# Traitement du formulaire: sauvegarde du template
if (isset($_POST['submit']) and trim($_POST['content']) != '') {
    if (plxUtils::write($_POST['content'], $filename)) {
        plxMsg::Info(L_SAVE_FILE_SUCCESSFULLY);
    } else {
        plxMsg::Error(L_SAVE_FILE_ERROR);
    }
}
# On récupère les fichiers templates du thèmes
$aTemplates = array();
function listFolderFiles($dir, $include, $root = '')
{
    $content = array();
    $ffs = scandir($dir);
    foreach ($ffs as $ff) {
        if ($ff != '.' && $ff != '..') {
            $ext = strtolower(strrchr($ff, '.'));
            if (!is_dir($dir . '/' . $ff) and is_array($include) and in_array($ext, $include)) {
                $f = str_replace($root, "", PLX_ROOT . ltrim($dir . '/' . $ff, './'));
                $content[$f] = $f;
            }
示例#7
0
 /**
  * Méthode qui vérifie sur le site de PluXml la dernière version et la compare avec celle en local
  *
  * @return	string
  * @author	Florent MONTHEL et Amaury GRAILLAT
  **/
 public function checkMaj()
 {
     # La fonction est active ?
     if (!ini_get('allow_url_fopen')) {
         return 'Impossible de v&eacute;rifier les mises &agrave; jour tant que \'allow_url_fopen\' est d&eacute;sactiv&eacute; sur ce syst&egrave;me';
     }
     # Requete HTTP sur le site de PluXml
     $fp = @fopen('http://telechargements.pluxml.org/latest-version', 'r');
     $latest_version = trim(@fread($fp, 16));
     @fclose($fp);
     if ($latest_version == '') {
         return plxMsg::Error('La v&eacute;rification de mise &agrave; jour a &eacute;chou&eacute;e pour une raison inconnue');
     }
     # Comparaison
     if (version_compare($this->version, $latest_version, ">=")) {
         return plxMsg::Info('Vous utilisez la derni&egrave;re version de PluXml (' . $this->version . ')');
     } else {
         return plxMsg::Info('Une nouvelle version de PluXml est sortie ! Vous pouvez la t&eacute;l&eacute;charger sur <a href="http://pluxml.org/">PluXml.org</a>');
     }
 }
示例#8
0
    }
    # On parse et alimente nos variables
    $result = $plxAdmin->parseArticle(PLX_ROOT . $plxAdmin->aConf['racine_articles'] . $aFile['0']);
    $title = trim($result['title']);
    $chapo = trim($result['chapo']);
    $content = trim($result['content']);
    $tags = trim($result['tags']);
    $author = $result['author'];
    $url = $result['url'];
    $date = plxDate::dateIso2Admin($result['date']);
    $catId = explode(',', $result['categorie']);
    $artId = $result['numero'];
    $allow_com = $result['allow_com'];
    $template = $result['template'];
    if ($author != $_SESSION['user'] and $_SESSION['profil'] == PROFIL_WRITER) {
        plxMsg::Error('Vous n\'avez pas les droits pour acc&eacute;der &agrave cet article !');
        header('Location: index.php');
        exit;
    }
} else {
    # On a rien validé, c'est pour la création d'un article
    $title = 'Nouvel article';
    $chapo = $url = '';
    $content = '';
    $tags = '';
    $author = $_SESSION['user'];
    $date = array('year' => @date('Y'), 'month' => @date('m'), 'day' => @date('d'), 'time' => @date('H:i'));
    $catId = array();
    $artId = '0000';
    $allow_com = $plxAdmin->aConf['allow_com'];
    $template = 'article.php';
示例#9
0
        exit;
    }
    # Répondre au commentaire
    if (isset($_POST['answer'])) {
        header('Location: comment_new.php?c=' . $_POST['comId']) . (!empty($_GET['a']) ? '&a=' . $_GET['a'] : '');
        exit;
    }
    # Edition
    $plxAdmin->editCommentaire($_POST, $_POST['comId']);
    header('Location: comment.php?c=' . $_POST['comId'] . (!empty($_GET['a']) ? '&a=' . $_GET['a'] : ''));
    exit;
}
# On va récupérer les infos sur le commentaire
if (!$plxAdmin->getCommentaires('/^' . plxUtils::nullbyteRemove($_GET['c']) . '.xml$/', '', 0, 1, 'all')) {
    # Commentaire inexistant, on redirige
    plxMsg::Error(L_ERR_UNKNOWN_COMMENT);
    header('Location: comments.php');
    exit;
}
# On va récupérer les infos sur l'article
$artId = $plxAdmin->plxRecord_coms->f('article');
# On va rechercher notre article
if (($aFile = $plxAdmin->plxGlob_arts->query('/^' . $artId . '.(.+).xml$/', '', 'sort', 0, 1)) == false) {
    # On indique que le commentaire est attaché à aucun article
    $article = '<strong>' . L_COMMENT_ORPHAN . '</strong>';
    # Statut du commentaire
    $statut = '<strong>' . L_COMMENT_ORPHAN_STATUS . '</strong>';
} else {
    $result = $plxAdmin->parseArticle(PLX_ROOT . $plxAdmin->aConf['racine_articles'] . $aFile['0']);
    # On génère notre lien
    $article = '<a href="' . $plxAdmin->aConf['racine'] . 'index.php?article' . intval($result['numero']) . '/' . $result['url'] . '" title="' . L_COMMENT_ARTICLE_LINKED_TITLE . '">';
示例#10
0
    # Ok, on récupère les commentaires de l'article
    $plxAdmin->getCommentaires('/^' . str_replace('_', '', $artId) . '.(.*).xml$/', 'sort');
} else {
    # Mode inconnu
    header('Location: .index.php');
    exit;
}
# On a validé le formulaire
if (!empty($_POST) and !empty($_POST['content'])) {
    # Création du commentaire
    if (!$plxAdmin->newCommentaire(str_replace('_', '', $artId), $_POST)) {
        # Erreur
        plxMsg::Error(L_ERR_CREATING_COMMENT);
    } else {
        # Ok
        plxMsg::Info(L_CREATING_COMMENT_SUCCESSFUL);
    }
    header('Location: comment_new.php?a=' . $artId);
    exit;
}
# On inclut le header
include dirname(__FILE__) . '/top.php';
?>
<form action="comment_new.php?<?php 
echo plxUtils::strCheck($get);
?>
" method="post" id="form_comment">

	<div class="inline-form action-bar">
		<h2><?php 
echo L_CREATE_NEW_COMMENT;
示例#11
0
<?php

/**
 * Page pour vérifier la version officielle
 *
 * @package PLX
 * @author	Florent MONTHEL
 **/
include dirname(__FILE__) . '/prepend.php';
# Control de l'accès à la page en fonction du profil de l'utilisateur connecté
$plxAdmin->checkProfil(PROFIL_ADMIN);
# Contrôle du hash
if (isset($_GET['hash']) and $_GET['hash'] == $_SESSION['hash']) {
    $plxAdmin->checkMaj();
} else {
    plxMsg::Error('Variable de s&eacute;curit&eacute; invalide !');
}
# Inclusion du header et du footer
include dirname(__FILE__) . '/top.php';
include dirname(__FILE__) . '/foot.php';
示例#12
0
        $plxAdmin->modCommentaire($v, 'online');
    }
    header('Location: comments.php' . (!empty($_GET['a']) ? '?a=' . $_GET['a'] : ''));
    exit;
} elseif (isset($_POST['selection']) and (!empty($_POST['btn_ok1']) and $_POST['selection'][0] == 'offline') and isset($_POST['idCom'])) {
    foreach ($_POST['idCom'] as $k => $v) {
        $plxAdmin->modCommentaire($v, 'offline');
    }
    header('Location: comments.php' . (!empty($_GET['a']) ? '?a=' . $_GET['a'] : ''));
    exit;
}
# Récupération des infos sur l'article attaché au commentaire si passé en paramètre
if (!empty($_GET['a'])) {
    # Infos sur notre article
    if (!($globArt = $plxAdmin->plxGlob_arts->query('/^' . $_GET['a'] . '.(.*).xml$/', '', 'sort', 0, 1))) {
        plxMsg::Error(L_ERR_UNKNOWN_ARTICLE);
        # Article inexistant
        header('Location: index.php');
        exit;
    }
    # Infos sur l'article
    $aArt = $plxAdmin->parseArticle(PLX_ROOT . $plxAdmin->aConf['racine_articles'] . $globArt['0']);
    $portee = L_COMMENTS_ARTICLE_SCOPE . ' &laquo;' . $aArt['title'] . '&raquo;';
} else {
    # Commentaires globaux
    $portee = '';
}
# On inclut le header
include dirname(__FILE__) . '/top.php';
# Récupération du type de commentaire à afficher
$_GET['sel'] = !empty($_GET['sel']) ? $_GET['sel'] : '';
示例#13
0
$filename = realpath(PLX_ROOT . 'themes/' . $style . '/' . $tpl);
if (!preg_match('#^' . str_replace('\\', '/', realpath(PLX_ROOT . 'themes/' . $style . '/') . '#'), str_replace('\\', '/', $filename))) {
    $filename = PLX_ROOT . 'themes/' . $style . '/home.php';
}
# On teste l'existence du thème
if (empty($style) or !is_dir(PLX_ROOT . 'themes/' . $style)) {
    plxMsg::Error('Ce th&egrave;me n\'existe pas !');
    header('Location: parametres_affichage.php');
    exit;
}
# Traitement du formulaire: sauvegarde du template
if (isset($_POST['submit']) and !empty($tpl) and trim($_POST['content']) != '') {
    if (plxUtils::write($_POST['content'], $filename)) {
        plxMsg::Info("Fichier enregistr&eacute; avec succ&egrave;s");
    } else {
        plxMsg::Error("Erreur pendant l'enregistrement du fichier");
    }
    header("Location: parametres_edittpl.php?tpl=" . $tpl . (isset($_GET['mobile']) ? '&mobile' : ''));
    exit;
}
# On récupère les fichiers templates du thèmes
$files = plxGlob::getInstance(PLX_ROOT . 'themes/' . $style);
if ($aTemplates = $files->query('/[a-z0-9-_]+.(php|css)$/')) {
    foreach ($aTemplates as $k => $v) {
        $aTemplate[$v] = $v;
    }
}
# On récupère le contenu du fichier template
$content = '';
if (file_exists($filename) and filesize($filename) > 0) {
    if ($f = fopen($filename, 'r')) {
示例#14
0
/**
 * Edition du code source d'un produit
 *
 * @package PLX
 * @author    David L
 **/
# On édite le produit
if (!empty($_POST) and isset($plxPlugin->aProds[$_POST['id']])) {
    $plxPlugin->editProduct($_POST);
    header('Location: plugin.php?p=plxMyShop&prod=' . $_POST['id']);
    exit;
} elseif (!empty($_GET['prod'])) {
    # On affiche le contenu de la page
    $id = plxUtils::strCheck(plxUtils::nullbyteRemove($_GET['prod']));
    if (!isset($plxPlugin->aProds[$id])) {
        plxMsg::Error(L_PRODUCT_UNKNOWN_PAGE);
        header('Location: plugin.php?p=plxMyShop');
        exit;
    }
    # On récupère le contenu
    $content = trim($plxPlugin->getFileProduct($id));
    $image = $plxPlugin->aProds[$id]['image'];
    $pricettc = $plxPlugin->aProds[$id]['pricettc'];
    $pcat = $plxPlugin->aProds[$id]['pcat'];
    $poidg = $plxPlugin->aProds[$id]['poidg'];
    $title = $plxPlugin->aProds[$id]['name'];
    $url = $plxPlugin->aProds[$id]['url'];
    $active = $plxPlugin->aProds[$id]['active'];
    $noaddcart = $plxPlugin->aProds[$id]['noaddcart'];
    $notice_noaddcart = $plxPlugin->aProds[$id]['notice_noaddcart'];
    $title_htmltag = $plxPlugin->aProds[$id]['title_htmltag'];
示例#15
0
    header('Location: commentaires_offline.php' . (!empty($_GET['a']) ? '?a=' . $_GET['a'] : ''));
    exit;
} elseif (isset($_POST['selection']) and $_POST['selection'] == 'online' and isset($_POST['idCom'])) {
    foreach ($_POST['idCom'] as $k => $v) {
        $plxAdmin->modCommentaire($v);
    }
    header('Location: commentaires_offline.php' . (!empty($_GET['a']) ? '?a=' . $_GET['a'] : ''));
    exit;
}
# Commentaires d'un article, on check
if (!empty($_GET['a'])) {
    # Infos sur notre article
    $globArt = $plxAdmin->plxGlob_arts->query('/^' . $_GET['a'] . '.(.*).xml$/', '', 'sort', 0, 1);
    if (!$plxAdmin->plxGlob_arts->count) {
        # Article inexistant
        plxMsg::Error('L\'article demand&eacute n\'existe pas ou n\'existe plus');
        header('Location: index.php');
        exit;
    }
    $aArt = $plxAdmin->parseArticle(PLX_ROOT . $plxAdmin->aConf['racine_articles'] . $globArt['0']);
    $portee = 'article &laquo;' . plxUtils::strCheck(plxUtils::strCut($aArt['title'], 80)) . '&raquo;';
    $artRegex = $_GET['a'];
} else {
    # Commentaires globaux
    $portee = 'site entier';
    $artRegex = '[0-9]{4}';
}
# On inclut le header
include dirname(__FILE__) . '/top.php';
?>
示例#16
0
 /**
  * Méthode qui sauvegarde le contenu d'un produit
  *
  * @param    content    données à sauvegarder
  * @return    string
  * @author    David.L
  **/
 public function editProduct($content)
 {
     # Mise à jour du fichier product.xml
     if (isset($content["listeCategories"])) {
         $this->aProds[$content['id']]['group'] = implode(",", $content["listeCategories"]);
     }
     // formatage du prix et du poids à l'édition
     foreach (array("pricettc", "poidg") as $champ) {
         $content[$champ] = number_format($content[$champ], 2, ".", "");
     }
     // données du produit
     $this->aProds[$content['id']]['image'] = $content['image'];
     $this->aProds[$content['id']]['noaddcart'] = $content['noaddcart'];
     $this->aProds[$content['id']]['notice_noaddcart'] = $content['notice_noaddcart'];
     $this->aProds[$content['id']]['pricettc'] = $content['pricettc'];
     $this->aProds[$content['id']]['poidg'] = $content['poidg'];
     $this->aProds[$content['id']]['template'] = $content['template'];
     $this->aProds[$content['id']]['title_htmltag'] = trim($content['title_htmltag']);
     $this->aProds[$content['id']]['meta_description'] = trim($content['meta_description']);
     $this->aProds[$content['id']]['meta_keywords'] = trim($content['meta_keywords']);
     # Hook plugins
     //eval($this->plxPlugins->callHook('plxAdminEditProduct'));
     if ($this->editProducts(null, true)) {
         if (!is_dir(PLX_ROOT . 'data/products/')) {
             mkdir(PLX_ROOT . 'data/products/', 0755, true);
         }
         # Génération du nom du fichier de la page statique
         $filename = PLX_ROOT . 'data/products/' . $content['id'] . '.' . $this->aProds[$content['id']]['url'] . '.php';
         # On écrit le fichier
         if (plxUtils::write($content['content'], $filename)) {
             return plxMsg::Info(L_SAVE_SUCCESSFUL);
         } else {
             return plxMsg::Error(L_SAVE_ERR . ' ' . $filename);
         }
     }
 }
示例#17
0
        $valid = plxMsg::Error(L_ERR_INVALID_DATE_CREATION) and $valid;
    }
    # Vérification de la validité de la date de mise à jour
    if (!plxDate::checkDate($_POST['date_update_day'], $_POST['date_update_month'], $_POST['date_update_year'], $_POST['date_update_time'])) {
        $valid = plxMsg::Error(L_ERR_INVALID_DATE_UPDATE) and $valid;
    }
    if ($valid) {
        $plxAdmin->editStatique($_POST);
    }
    header('Location: statique.php?p=' . $_POST['id']);
    exit;
} elseif (!empty($_GET['p'])) {
    # On affiche le contenu de la page
    $id = plxUtils::strCheck(plxUtils::nullbyteRemove($_GET['p']));
    if (!isset($plxAdmin->aStats[$id])) {
        plxMsg::Error(L_STATIC_UNKNOWN_PAGE);
        header('Location: statiques.php');
        exit;
    }
    # On récupère le contenu
    $content = trim($plxAdmin->getFileStatique($id));
    $title = $plxAdmin->aStats[$id]['name'];
    $url = $plxAdmin->aStats[$id]['url'];
    $active = $plxAdmin->aStats[$id]['active'];
    $title_htmltag = $plxAdmin->aStats[$id]['title_htmltag'];
    $meta_description = $plxAdmin->aStats[$id]['meta_description'];
    $meta_keywords = $plxAdmin->aStats[$id]['meta_keywords'];
    $template = $plxAdmin->aStats[$id]['template'];
    $date_creation = plxDate::date2Array($plxAdmin->aStats[$id]['date_creation']);
    $date_update = plxDate::date2Array($plxAdmin->aStats[$id]['date_update']);
} else {
示例#18
0
    $title = trim($result['title']);
    $chapo = trim($result['chapo']);
    $content = trim($result['content']);
    $tags = trim($result['tags']);
    $author = $result['author'];
    $url = $result['url'];
    $date = plxDate::date2Array($result['date']);
    $catId = explode(',', $result['categorie']);
    $artId = $result['numero'];
    $allow_com = $result['allow_com'];
    $template = $result['template'];
    $meta_description = $result['meta_description'];
    $meta_keywords = $result['meta_keywords'];
    $title_htmltag = $result['title_htmltag'];
    if ($author != $_SESSION['user'] and $_SESSION['profil'] == PROFIL_WRITER) {
        plxMsg::Error(L_ERR_FORBIDDEN_ARTICLE);
        header('Location: index.php');
        exit;
    }
    # Hook Plugins
    eval($plxAdmin->plxPlugins->callHook('AdminArticleParseData'));
} else {
    # On a rien validé, c'est pour la création d'un article
    $title = plxUtils::strRevCheck(L_DEFAULT_NEW_ARTICLE_TITLE);
    $chapo = $url = '';
    $content = '';
    $tags = '';
    $author = $_SESSION['user'];
    $date = array('year' => date('Y'), 'month' => date('m'), 'day' => date('d'), 'time' => date('H:i'));
    $catId = array('draft');
    $artId = '0000';
示例#19
0
 /**
  * Méthode qui permet de modérer ou valider un commentaire
  *
  * @param	id	identifiant du commentaire à traiter (que l'on retourne)
  * @param	mod	type de moderation (online ou offline)
  * @return	string
  * @author	Stephane F. et Florent MONTHEL
  **/
 public function modCommentaire(&$id, $mod)
 {
     # Génération du nom du fichier
     $oldfilename = PLX_ROOT . $this->aConf['racine_commentaires'] . $id . '.xml';
     if (!file_exists($oldfilename)) {
         # Commentaire inexistant
         return plxMsg::Error(L_ERR_UNKNOWN_COMMENT);
     }
     # Modérer ou valider ?
     if (preg_match('/([[:punct:]]?)[0-9]{4}.[0-9]{10}-[0-9]+$/', $id, $capture)) {
         $id = str_replace($capture[1], '', $id);
     }
     if ($mod == 'offline') {
         $id = '_' . $id;
     }
     # Génération du nouveau nom de fichier
     $newfilename = PLX_ROOT . $this->aConf['racine_commentaires'] . $id . '.xml';
     # On renomme le fichier
     @rename($oldfilename, $newfilename);
     # Contrôle
     if (is_readable($newfilename)) {
         if ($type == 'online') {
             return plxMsg::Info(L_COMMENT_VALIDATE_SUCCESSFUL);
         } else {
             return plxMsg::Info(L_COMMENT_MODERATE_SUCCESSFUL);
         }
     } else {
         if ($type == 'online') {
             return plxMsg::Error(L_COMMENT_VALIDATE_ERR);
         } else {
             return plxMsg::Error(L_COMMENT_MODERATE_ERR);
         }
     }
 }
示例#20
0
# Control du token du formulaire
plxToken::validateFormToken($_POST);
# Hook Plugins
eval($plxAdmin->plxPlugins->callHook('AdminUserPrepend'));
# Control de l'accès à la page en fonction du profil de l'utilisateur connecté
$plxAdmin->checkProfil(PROFIL_ADMIN);
# On édite la page statique
if (!empty($_POST) and isset($plxAdmin->aUsers[$_POST['id']])) {
    $plxAdmin->editUser($_POST);
    header('Location: user.php?p=' . $_POST['id']);
    exit;
} elseif (!empty($_GET['p'])) {
    # On vérifie l'existence de l'utilisateur
    $id = plxUtils::strCheck(plxUtils::nullbyteRemove($_GET['p']));
    if (!isset($plxAdmin->aUsers[$id])) {
        plxMsg::Error(L_USER_UNKNOWN);
        header('Location: parametres_users.php');
        exit;
    }
} else {
    # Sinon, on redirige
    header('Location: parametres_users.php');
    exit;
}
# On inclut le header
include dirname(__FILE__) . '/top.php';
?>

<form action="user.php" method="post" id="form_user">

	<div class="inline-form action-bar">
示例#21
0
    # Ok, on récupère les commentaires de l'article
    $plxAdmin->getCommentaires('/^' . $artId . '.(.*).xml$/', 'rsort');
} else {
    # Mode inconnu
    header('Location: .index.php');
    exit;
}
# On a validé le formulaire
if (!empty($_POST) and !empty($_POST['content'])) {
    # Création du commentaire
    if (!$plxAdmin->newCommentaire($artId, $_POST['content'])) {
        # Erreur
        plxMsg::Error('Une erreur est survenue au cours de la cr&eacute;tion du commentaire');
    } else {
        # Ok
        plxMsg::Info('Le commentaire a &eacute;t&eacute; cr&eacute;e avec succ&egrave;s');
    }
    header('Location: commentaire_new.php?a=' . $artId);
    exit;
}
# On inclut le header
include dirname(__FILE__) . '/top.php';
?>

<?php 
if (!empty($_GET['a'])) {
    ?>
	<p><a href="commentaires_online.php?a=<?php 
    echo $_GET['a'];
    ?>
">&laquo; Retour &agrave; la liste des commentaires de cet article</a></p>
示例#22
0
 /**
  * Méthode qui recréer les miniatures
  *
  * @param   files		liste des fichier à déplacer
  * @param	width		largeur des miniatures
  * @param	height		hauteur des miniatures
  * @return  boolean		faux si erreur sinon vrai
  * @author	Stephane F
  **/
 public function makeThumbs($files, $width, $height)
 {
     $count = 0;
     foreach ($files as $file) {
         $file = basename($file);
         if (is_file($this->path . $this->dir . $file)) {
             $thumName = plxUtils::thumbName($file);
             $ext = strtolower(strrchr($this->path . $this->dir . $file, '.'));
             if (in_array($ext, array('.gif', '.jpg', '.png'))) {
                 if (plxUtils::makeThumb($this->path . $this->dir . $file, $this->path . $this->dir . $thumName, $width, $height, 80)) {
                     $count++;
                 }
             }
         }
     }
     if (sizeof($files) == 1) {
         if ($count == 0) {
             return plxMsg::Error(L_PLXMEDIAS_RECREATE_THUMB_ERR);
         } else {
             return plxMsg::Info(L_PLXMEDIAS_RECREATE_THUMB_SUCCESSFUL);
         }
     } else {
         if ($count == 0) {
             return plxMsg::Error(L_PLXMEDIAS_RECREATE_THUMBS_ERR);
         } else {
             return plxMsg::Info(L_PLXMEDIAS_RECREATE_THUMBS_SUCCESSFUL);
         }
     }
 }
示例#23
0
# chargement du fichier d'administration du plugin
$filename = realpath(PLX_PLUGINS . $plugin . '/config.php');
if (is_file($filename)) {
    # si le plugin n'est pas actif, aucune instance n'a été créée, on va donc la créer, sinon on prend celle qui existe
    if (!isset($plxAdmin->plxPlugins->aPlugins[$plugin])) {
        $plxPlugin = $plxAdmin->plxPlugins->getInstance($plugin);
    } else {
        $plxPlugin = $plxAdmin->plxPlugins->aPlugins[$plugin];
    }
    # Control des autorisation d'accès à l'écran config.php du plugin
    $plxAdmin->checkProfil($plxPlugin->getConfigProfil());
    # chargement de l'écran de paramétrage du plugin config.php
    ob_start();
    echo '
	<div class="inline-form action-bar">
		<h2>' . plxUtils::strCheck($plugin) . '</h2>
		<p><a class="back" href="parametres_plugins.php">' . L_BACK_TO_PLUGINS . '</a></p>
	</div>';
    include $filename;
    $output = ob_get_clean();
} else {
    plxMsg::Error(L_NO_ENTRY);
    header('Location: parametres_plugins.php');
    exit;
}
# On inclut le header
include dirname(__FILE__) . '/top.php';
# Affichage des données
echo $output;
# On inclut le footer
include dirname(__FILE__) . '/foot.php';
示例#24
0
 * @package PLX
 * @author	Stephane F. et Florent MONTHEL
 **/
include dirname(__FILE__) . '/prepend.php';
# Control de l'accès à la page en fonction du profil de l'utilisateur connecté
$plxAdmin->checkProfil(PROFIL_ADMIN);
# On édite la page statique
if (!empty($_POST) and isset($plxAdmin->aStats[$_POST['id']])) {
    $plxAdmin->editFileStatique($_POST);
    header('Location: statique.php?p=' . $_POST['id']);
    exit;
} elseif (!empty($_GET['p'])) {
    # On affiche le contenu de la page
    $id = $_GET['p'];
    if (!isset($plxAdmin->aStats[$id])) {
        plxMsg::Error('Cette page statique n\'existe pas ou n\'existe plus !');
        header('Location: statiques.php');
        exit;
    }
    # On récupère le contenu
    $content = trim($plxAdmin->getFileStatique($id));
    $title = $plxAdmin->aStats[$id]['name'];
    $url = $plxAdmin->aStats[$id]['url'];
} else {
    # Sinon, on redirige
    header('Location: statiques.php');
    exit;
}
# On inclut le header
include dirname(__FILE__) . '/top.php';
?>