[ Index ] |
|
Code source de GeekLog 1.4.1 |
1 <?php 2 3 // +---------------------------------------------------------------------------+ 4 // | Spam-X plugin 1.0.2 | 5 // +---------------------------------------------------------------------------+ 6 // | admin/index.php | 7 // | | 8 // | Administration page. | 9 // +---------------------------------------------------------------------------+ 10 // | Copyright (C) 2002-2004 by the following authors: | 11 // | | 12 // | Author: | 13 // | Constructed with the Universal Plugin | 14 // | Copyright (C) 2002 by the following authors: | 15 // | Tom Willett - twillett@users.sourceforge.net | 16 // | Blaine Lang - langmail@sympatico.ca | 17 // | The Universal Plugin is based on prior work by: | 18 // | Tony Bibbs - tony@tonybibbs.com | 19 // +---------------------------------------------------------------------------+ 20 // | | 21 // | This program is free software; you can redistribute it and/or | 22 // | modify it under the terms of the GNU General Public License | 23 // | as published by the Free Software Foundation; either version 2 | 24 // | of the License, or (at your option) any later version. | 25 // | | 26 // | This program is distributed in the hope that it will be useful, | 27 // | but WITHOUT ANY WARRANTY; without even the implied warranty of | 28 // | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | 29 // | GNU General Public License for more details. | 30 // | | 31 // | You should have received a copy of the GNU General Public License | 32 // | along with this program; if not, write to the Free Software Foundation, | 33 // | Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. | 34 // | | 35 // +---------------------------------------------------------------------------+ 36 // 37 38 require_once ('../../../lib-common.php'); 39 40 41 // Only let admin users access this page 42 if (!SEC_hasRights ('spamx.admin')) { 43 // Someone is trying to illegally access this page 44 COM_accessLog ("Someone has tried to illegally access the Spam-X Admin page. User id: {$_USER['uid']}, Username: {$_USER['username']}, IP: {$_SERVER['REMOTE_ADDR']}", 1); 45 $display = COM_siteHeader ('menu', $LANG_SX00['access_denied']); 46 $display .= COM_startBlock ($LANG_SX00['access_denied']); 47 $display .= $LANG_SX00['access_denied_msg']; 48 $display .= COM_endBlock (); 49 $display .= COM_siteFooter (true); 50 echo $display; 51 exit; 52 } 53 54 55 /** 56 * Main 57 */ 58 59 $display = COM_siteHeader ('menu', $LANG_SX00['plugin_name']); 60 $T = new Template ($_CONF['path'] . 'plugins/spamx/templates'); 61 $T->set_file ('admin', 'admin.thtml'); 62 $T->set_var ('site_url', $_CONF['site_url']); 63 $T->set_var ('site_admin_url', $_CONF['site_admin_url']); 64 $T->set_var ('header', $LANG_SX00['admin']); 65 $T->set_var ('plugin_name', $LANG_SX00['plugin_name']); 66 $T->set_var ('plugin', 'spamx'); 67 $T->parse ('output', 'admin'); 68 $display .= $T->finish ($T->get_var ('output')); 69 $display .= '<p>'; 70 71 $files = array (); 72 if ($dir = @opendir ($_CONF['path'] . 'plugins/spamx/')) { 73 while (($file = readdir ($dir)) !== false) { 74 if (is_file ($_CONF['path'] . 'plugins/spamx/' . $file)) 75 { 76 if (substr ($file, -16) == '.Admin.class.php') { 77 $tmp = str_replace ('.Admin.class.php', '', $file); 78 array_push ($files, $tmp); 79 } 80 } 81 } 82 closedir ($dir); 83 } 84 $display .= '<p><b>' . $LANG_SX00['adminc'] . '</b></p><ul>'; 85 86 foreach ($files as $file) { 87 require_once ($_CONF['path'] . 'plugins/spamx/' . $file . '.Admin.class.php'); 88 $CM = new $file; 89 $display .= '<li><a href="' . $_CONF['site_admin_url'] 90 . '/plugins/spamx/index.php?command=' . $file . '">' . $CM->link () 91 . '</a></li>'; 92 } 93 $display .= '<li><a href="' . $_CONF['site_url'] . '/docs/spamx.html">' 94 . $LANG_SX00['documentation'] . '</a></li>'; 95 $display .= '</ul>'; 96 97 if (isset ($_REQUEST['command'])) { 98 $CM = new $_REQUEST['command']; 99 $display .= $CM->display (); 100 } 101 $display .= COM_siteFooter (true); 102 103 echo $display; 104 105 ?>
titre
Description
Corps
titre
Description
Corps
titre
Description
Corps
titre
Corps
Généré le : Wed Nov 21 12:27:40 2007 | par Balluche grâce à PHPXref 0.7 |
![]() |