- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/rsr.v5.1.dev/web/punbb/admin_index.php
r1 r3 1 1 <?php 2 /***********************************************************************3 2 4 Copyright (C) 2002-2005 Rickard Andersson (rickard@punbb.org) 5 6 This file is part of PunBB. 7 8 PunBB is free software; you can redistribute it and/or modify it 9 under the terms of the GNU General Public License as published 10 by the Free Software Foundation; either version 2 of the License, 11 or (at your option) any later version. 12 13 PunBB is distributed in the hope that it will be useful, but 14 WITHOUT ANY WARRANTY; without even the implied warranty of 15 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 GNU General Public License for more details. 17 18 You should have received a copy of the GNU General Public License 19 along with this program; if not, write to the Free Software 20 Foundation, Inc., 59 Temple Place, Suite 330, Boston, 21 MA 02111-1307 USA 22 23 ************************************************************************/ 24 3 /** 4 * Copyright (C) 2008-2011 FluxBB 5 * based on code by Rickard Andersson copyright (C) 2002-2008 PunBB 6 * License: http://www.gnu.org/licenses/gpl.html GPL version 2 or higher 7 */ 25 8 26 9 // Tell header.php to use the admin template 27 10 define('PUN_ADMIN_CONSOLE', 1); 28 11 29 define('PUN_ROOT', './');12 define('PUN_ROOT', dirname(__FILE__).'/'); 30 13 require PUN_ROOT.'include/common.php'; 31 14 require PUN_ROOT.'include/common_admin.php'; 32 15 33 16 34 if ( $pun_user['g_id'] > PUN_MOD)17 if (!$pun_user['is_admmod']) 35 18 message($lang_common['No permission']); 36 19 20 // Load the admin_index.php language file 21 require PUN_ROOT.'lang/'.$admin_language.'/admin_index.php'; 37 22 38 23 $action = isset($_GET['action']) ? $_GET['action'] : null; … … 42 27 { 43 28 if (!ini_get('allow_url_fopen')) 44 message( 'Impossible de vérifier les mises à jour tant que \'allow_url_fopen\' est désactivé sur ce systÚme.');29 message($lang_admin_index['fopen disabled message']); 45 30 46 $ fp = @fopen('http://www.punbb.org/latest_version', 'r');47 $latest_version = trim(@fread($fp, 16));48 @fclose($fp);31 $latest_version = trim(@file_get_contents('http://fluxbb.org/latest_version')); 32 if (empty($latest_version)) 33 message($lang_admin_index['Upgrade check failed message']); 49 34 50 if ($latest_version == '') 51 message('La vérification de mise à jour a échouée pour une raison inconnue.'); 52 53 $cur_version = str_replace(array('.', 'dev', 'beta', ' '), '', strtolower($pun_config['o_cur_version'])); 54 $cur_version = (strlen($cur_version) == 2) ? intval($cur_version) * 10 : intval($cur_version); 55 56 $latest_version = str_replace('.', '', strtolower($latest_version)); 57 $latest_version = (strlen($latest_version) == 2) ? intval($latest_version) * 10 : intval($latest_version); 58 59 if ($cur_version >= $latest_version) 60 message('Vous utilisez la derniÚre version de PunBB.'); 35 if (version_compare($pun_config['o_cur_version'], $latest_version, '>=')) 36 message($lang_admin_index['Running latest version message']); 61 37 else 62 message('Une nouvelle version de PunBB est sortie ! Vous pouvez télécharger cette derniÚre version sur <a href="http://www.punbb.org/">PunBB.org</a>.'); 63 } 64 65 // Check for french upgrade 66 if ($action == 'check_upgrade_fr') 67 { 68 if (!ini_get('allow_url_fopen')) 69 message('Impossible de vérifier les mises à jour tant que \'allow_url_fopen\' est désactivé sur ce systÚme.'); 70 71 $fp = @fopen('http://www.punbb.fr/latest_version', 'r'); 72 $latest_version = trim(@fread($fp, 16)); 73 @fclose($fp); 74 75 if ($latest_version == '') 76 message('La vérification de mise à jour a échouée pour une raison inconnue.'); 77 78 $cur_version = str_replace(array('.', 'dev', 'beta', ' '), '', strtolower($pun_config['o_cur_version_fr'])); 79 $cur_version = (strlen($cur_version) == 2) ? intval($cur_version) * 10 : intval($cur_version); 80 81 $latest_version = str_replace('.', '', strtolower($latest_version)); 82 $latest_version = (strlen($latest_version) == 2) ? intval($latest_version) * 10 : intval($latest_version); 83 84 if ($cur_version >= $latest_version) 85 message('Vous utilisez la derniÚre version de PunBB en français.'); 86 else 87 message('Une nouvelle version de PunBB en français est sortie ! Vous pouvez télécharger cette derniÚre version sur <a href="http://www.punbb.fr/">PunBB.fr</a>.'); 38 message(sprintf($lang_admin_index['New version available message'], '<a href="http://fluxbb.org/">FluxBB.org</a>')); 88 39 } 89 40 … … 93 44 { 94 45 // Is phpinfo() a disabled function? 95 if (strpos(strtolower((string) @ini_get('disable_functions')), 'phpinfo') !== false)96 message( 'La fonction phpinfo() de PHP est désactivée sur ce serveur.');46 if (strpos(strtolower((string) ini_get('disable_functions')), 'phpinfo') !== false) 47 message($lang_admin_index['PHPinfo disabled message']); 97 48 98 49 phpinfo(); … … 109 60 @fclose($fh); 110 61 62 if (($fh = @fopen('/proc/loadavg', 'r'))) 63 { 64 $load_averages = fread($fh, 64); 65 fclose($fh); 66 } 67 else 68 $load_averages = ''; 69 111 70 $load_averages = @explode(' ', $load_averages); 112 $server_load = isset($load_averages[2]) ? $load_averages[0].' '.$load_averages[1].' '.$load_averages[2] : 'Indisponible';71 $server_load = isset($load_averages[2]) ? $load_averages[0].' '.$load_averages[1].' '.$load_averages[2] : $lang_admin_index['Not available']; 113 72 } 114 else if (!in_array(PHP_OS, array('WINNT', 'WIN32')) && preg_match(' /averages?: ([0-9\.]+),[\s]+([0-9\.]+),[\s]+([0-9\.]+)/i', @exec('uptime'), $load_averages))73 else if (!in_array(PHP_OS, array('WINNT', 'WIN32')) && preg_match('%averages?: ([0-9\.]+),?\s+([0-9\.]+),?\s+([0-9\.]+)%i', @exec('uptime'), $load_averages)) 115 74 $server_load = $load_averages[1].' '.$load_averages[2].' '.$load_averages[3]; 116 75 else 117 $server_load = 'Indisponible';76 $server_load = $lang_admin_index['Not available']; 118 77 119 78 120 79 // Get number of current visitors 121 $result = $db->query('SELECT COUNT(user_id) FROM '.$db->prefix.'online WHERE idle=0') or error(' Impossible de retrouver le total d\'utilisateurs en ligne', __FILE__, __LINE__, $db->error());80 $result = $db->query('SELECT COUNT(user_id) FROM '.$db->prefix.'online WHERE idle=0') or error('Unable to fetch online count', __FILE__, __LINE__, $db->error()); 122 81 $num_online = $db->result($result); 123 82 124 83 125 // Get the database system version126 switch ($db_type)84 // Collect some additional info about MySQL 85 if ($db_type == 'mysql' || $db_type == 'mysqli' || $db_type == 'mysql_innodb' || $db_type == 'mysqli_innodb') 127 86 { 128 case 'sqlite':129 $db_version = 'SQLite '.sqlite_libversion();130 break;131 132 default:133 $result = $db->query('SELECT VERSION()') or error('Impossible de retrouver les informations utilisateurs', __FILE__, __LINE__, $db->error());134 $db_version = $db->result($result);135 break;136 }137 138 139 // Collect some additional info about MySQL140 if ($db_type == 'mysql' || $db_type == 'mysqli')141 {142 $db_version = 'MySQL '.$db_version;143 144 87 // Calculate total db size/row count 145 $result = $db->query('SHOW TABLE STATUS FROM `'.$db_name.'`') or error('Impossible de retrouver le statut des tables', __FILE__, __LINE__, $db->error());88 $result = $db->query('SHOW TABLE STATUS LIKE \''.$db->prefix.'%\'') or error('Unable to fetch table status', __FILE__, __LINE__, $db->error()); 146 89 147 90 $total_records = $total_size = 0; … … 152 95 } 153 96 154 $total_size = $total_size / 1024; 155 156 if ($total_size > 1024) 157 $total_size = round($total_size / 1024, 2).' MB'; 158 else 159 $total_size = round($total_size, 2).' KB'; 97 $total_size = file_size($total_size); 160 98 } 161 99 162 100 163 // See if MMCache or PHPA is loaded101 // Check for the existence of various PHP opcode caches/optimizers 164 102 if (function_exists('mmcache')) 165 $php_accelerator = '<a href="http:// turck-mmcache.sourceforge.net/">Turck MMCache</a>';103 $php_accelerator = '<a href="http://'.$lang_admin_index['Turck MMCache link'].'">'.$lang_admin_index['Turck MMCache'].'</a>'; 166 104 else if (isset($_PHPA)) 167 $php_accelerator = '<a href="http://www.php-accelerator.co.uk/">ionCube PHP Accelerator</a>'; 105 $php_accelerator = '<a href="http://'.$lang_admin_index['ionCube PHP Accelerator link'].'">'.$lang_admin_index['ionCube PHP Accelerator'].'</a>'; 106 else if (ini_get('apc.enabled')) 107 $php_accelerator ='<a href="http://'.$lang_admin_index['Alternative PHP Cache (APC) link'].'">'.$lang_admin_index['Alternative PHP Cache (APC)'].'</a>'; 108 else if (ini_get('zend_optimizer.optimization_level')) 109 $php_accelerator = '<a href="http://'.$lang_admin_index['Zend Optimizer link'].'">'.$lang_admin_index['Zend Optimizer'].'</a>'; 110 else if (ini_get('eaccelerator.enable')) 111 $php_accelerator = '<a href="http://'.$lang_admin_index['eAccelerator link'].'">'.$lang_admin_index['eAccelerator'].'</a>'; 112 else if (ini_get('xcache.cacher')) 113 $php_accelerator = '<a href="http://'.$lang_admin_index['XCache link'].'">'.$lang_admin_index['XCache'].'</a>'; 168 114 else 169 $php_accelerator = 'N/A';115 $php_accelerator = $lang_admin_index['NA']; 170 116 171 117 172 $page_title = pun_htmlspecialchars($pun_config['o_board_title']).' / Admin'; 118 $page_title = array(pun_htmlspecialchars($pun_config['o_board_title']), $lang_admin_common['Admin'], $lang_admin_common['Index']); 119 define('PUN_ACTIVE_PAGE', 'admin'); 173 120 require PUN_ROOT.'header.php'; 174 121 … … 177 124 ?> 178 125 <div class="block"> 179 <h2> Administration Forum</h2>126 <h2><span><?php echo $lang_admin_index['Forum admin head'] ?></span></h2> 180 127 <div id="adintro" class="box"> 181 128 <div class="inbox"> 182 <p>Bienvenue sur le panneau de contrÃŽles de PunBB. Depuis cet espace vous pouvez contrÃŽler les points essentiels de votre forum. Selon que vous êtes un administrateur ou un modérateur vous pouvez :<br /><br /> 183  - organiser les catégories et les forums.<br /> 184  - régler les principales options et préférences.<br /> 185  - contrÃŽler les permissions pour les utilisateurs et les visiteurs.<br /> 186  - voir les statistiques des IP pour les utilisateurs.<br /> 187  - bannir des utilisateurs.<br /> 188  - censurer des mots.<br /> 189  - régler les rangs des utilisateurs.<br /> 190  - élaguer les anciens messages.<br /> 191  - traiter les messages signalés. 192 </p> 129 <p><?php echo $lang_admin_index['Welcome to admin'] ?></p> 130 <ul> 131 <li><span><?php echo $lang_admin_index['Welcome 1'] ?></span></li> 132 <li><span><?php echo $lang_admin_index['Welcome 2'] ?></span></li> 133 <li><span><?php echo $lang_admin_index['Welcome 3'] ?></span></li> 134 <li><span><?php echo $lang_admin_index['Welcome 4'] ?></span></li> 135 <li><span><?php echo $lang_admin_index['Welcome 5'] ?></span></li> 136 <li><span><?php echo $lang_admin_index['Welcome 6'] ?></span></li> 137 <li><span><?php echo $lang_admin_index['Welcome 7'] ?></span></li> 138 <li><span><?php echo $lang_admin_index['Welcome 8'] ?></span></li> 139 <li><span><?php echo $lang_admin_index['Welcome 9'] ?></span></li> 140 </ul> 193 141 </div> 194 142 </div> 195 143 196 <h2 class="block2"><span> Statistiques</span></h2>144 <h2 class="block2"><span><?php echo $lang_admin_index['Statistics head'] ?></span></h2> 197 145 <div id="adstats" class="box"> 198 146 <div class="inbox"> 199 147 <dl> 200 <dt> PunBB version</dt>148 <dt><?php echo $lang_admin_index['FluxBB version label'] ?></dt> 201 149 <dd> 202 PunBB version française <?php echo $pun_config['o_cur_version_fr'] ?> basée sur PunBB <?php echo $pun_config['o_cur_version'] ?><br /> 203 <a href="admin_index.php?action=check_upgrade">Vérifier la version officielle</a> - <a href="admin_index.php?action=check_upgrade_fr">Vérifier la version française</a> <br /> 204 © Copyright 2002, 2003, 2004, 2005 Rickard Andersson 150 <?php printf($lang_admin_index['FluxBB version data']."\n", $pun_config['o_cur_version'], '<a href="admin_index.php?action=check_upgrade">'.$lang_admin_index['Check for upgrade'].'</a>') ?> 205 151 </dd> 206 <dt> Exécution serveur</dt>152 <dt><?php echo $lang_admin_index['Server load label'] ?></dt> 207 153 <dd> 208 <?php echo $server_load ?> (<?php echo $num_online ?> utilisateurs en ligne)154 <?php printf($lang_admin_index['Server load data']."\n", $server_load, $num_online) ?> 209 155 </dd> 210 <?php if ($pun_user['g_id'] == PUN_ADMIN): ?> <dt> Environnement</dt>156 <?php if ($pun_user['g_id'] == PUN_ADMIN): ?> <dt><?php echo $lang_admin_index['Environment label'] ?></dt> 211 157 <dd> 212 SystÚme d'exploitation : <?php echo PHP_OS?><br />213 PHP : <?php echo phpversion() ?> - <a href="admin_index.php?action=phpinfo">Afficher infos</a><br />214 Accélérateur PHP : <?php echo $php_accelerator."\n"?>158 <?php printf($lang_admin_index['Environment data OS'], PHP_OS) ?><br /> 159 <?php printf($lang_admin_index['Environment data version'], phpversion(), '<a href="admin_index.php?action=phpinfo">'.$lang_admin_index['Show info'].'</a>') ?><br /> 160 <?php printf($lang_admin_index['Environment data acc']."\n", $php_accelerator) ?> 215 161 </dd> 216 <dt> Base de données</dt>162 <dt><?php echo $lang_admin_index['Database label'] ?></dt> 217 163 <dd> 218 <?php echo $db_version."\n" ?> 219 <?php if (isset($total_records) && isset($total_size)): ?> <br />Lignes : <?php echo $total_records."\n" ?> 220 <br />Taille : <?php echo $total_size."\n" ?> 221 <?php endif; endif; ?> </dd> 164 <?php echo implode(' ', $db->get_version())."\n" ?> 165 <?php if (isset($total_records) && isset($total_size)): ?> <br /><?php printf($lang_admin_index['Database data rows']."\n", forum_number_format($total_records)) ?> 166 <br /><?php printf($lang_admin_index['Database data size']."\n", $total_size) ?> 167 <?php endif; ?> </dd> 168 <?php endif; ?> 222 169 </dl> 223 170 </div>
Note: See TracChangeset
for help on using the changeset viewer.