b2evolution PHP Cross Reference Blogging Systems

Source: /inc/tools/system.ctrl.php - 664 lines - 21849 bytes - Summary - Text - Print

Description: This file implements the UI controller for System configuration and analysis.

   1  <?php
   2  /**
   3   * This file implements the UI controller for System configuration and analysis.
   4   *
   5   * This file is part of the evoCore framework - {@link http://evocore.net/}
   6   * See also {@link http://sourceforge.net/projects/evocms/}.
   7   *
   8   * @copyright (c)2003-2014 by Francois Planque - {@link http://fplanque.com/}
   9   * Parts of this file are copyright (c)2006 by Daniel HAHLER - {@link http://daniel.hahler.de/}.
  10   *
  11   * {@internal License choice
  12   * - If you have received this file as part of a package, please find the license.txt file in
  13   *   the same folder or the closest folder above for complete license terms.
  14   * - If you have received this file individually (e-g: from http://evocms.cvs.sourceforge.net/)
  15   *   then you must choose one of the following licenses before using the file:
  16   *   - GNU General Public License 2 (GPL) - http://www.opensource.org/licenses/gpl-license.php
  17   *   - Mozilla Public License 1.1 (MPL) - http://www.opensource.org/licenses/mozilla1.1.php
  18   * }}
  19   *
  20   * {@internal Open Source relicensing agreement:
  21   * Daniel HAHLER grants Francois PLANQUE the right to license
  22   * Daniel HAHLER's contributions to this file and the b2evolution project
  23   * under any OSI approved OSS license (http://www.opensource.org/licenses/).
  24   * }}
  25   *
  26   * @package admin
  27   *
  28   * {@internal Below is a list of authors who have contributed to design/coding of this file: }}
  29   * @author fplanque: Francois PLANQUE.
  30   * @author blueyed
  31   *
  32   * @version $Id: system.ctrl.php 6136 2014-03-08 07:59:48Z manuel $
  33   */
  34  if( !defined('EVO_MAIN_INIT') ) die( 'Please, do not access this page directly.' );
  35  
  36  load_funcs( 'tools/model/_system.funcs.php' );
  37  
  38  // Check minimum permission:
  39  $current_User->check_perm( 'options', 'view', true );
  40  
  41  $AdminUI->set_path( 'options', 'system' );
  42  
  43  
  44  $AdminUI->breadcrumbpath_init( false );  // fp> I'm playing with the idea of keeping the current blog in the path here...
  45  $AdminUI->breadcrumbpath_add( T_('System'), '?ctrl=system' );
  46  $AdminUI->breadcrumbpath_add( T_('Status'), '?ctrl=system' );
  47  
  48  
  49  // Display <html><head>...</head> section! (Note: should be done early if actions do not redirect)
  50  $AdminUI->disp_html_head();
  51  
  52  // Display title, menu, messages, etc. (Note: messages MUST be displayed AFTER the actions)
  53  $AdminUI->disp_body_top();
  54  
  55  // Begin payload block:
  56  $AdminUI->disp_payload_begin();
  57  
  58  function init_system_check( $name, $value )
  59  {
  60      global $syscheck_name, $syscheck_value;
  61      $syscheck_name = $name;
  62      $syscheck_value = $value;
  63  }
  64  
  65  function disp_system_check( $condition, $message = '' )
  66  {
  67      global $syscheck_name, $syscheck_value;
  68      echo '<div class="system_check">';
  69      echo '<div class="system_check_name">';
  70      echo $syscheck_name;
  71      echo '</div>';
  72      echo '<div class="system_check_value_'.$condition.'">';
  73      echo $syscheck_value;
  74      echo '&nbsp;</div>';
  75      if( !empty( $message ) )
  76      {
  77          echo '<div class="system_check_message_'.$condition.'">';
  78          echo $message;
  79          echo '</div>';
  80      }
  81      echo '</div>';
  82  }
  83  
  84  $facilitate_exploits = '<p>'.T_('When enabled, this feature is known to facilitate hacking exploits in any PHP application.')."</p>\n<p>"
  85      .T_('b2evolution includes additional measures in order not to be affected by this.
  86      However, for maximum security, we still recommend disabling this PHP feature.')."</p>\n";
  87  $change_ini = '<p>'.T_('If possible, change this setting to <code>%s</code> in your php.ini or ask your hosting provider about it.').'</p>';
  88  
  89  
  90  echo '<h2>'.T_('System status').'</h2>';
  91  
  92  // Get system stats to display:
  93  $system_stats = get_system_stats();
  94  
  95  // Note: hopefully, the update swill have been downloaded in the shutdown function of a previous page (including the login screen)
  96  // However if we have outdated info, we will load updates here.
  97  load_funcs( 'dashboard/model/_dashboard.funcs.php' );
  98  // Let's clear any remaining messages that should already have been displayed before...
  99  $Messages->clear();
 100  
 101  if( b2evonet_get_updates( true ) !== NULL )
 102  {    // Updates are allowed, display them:
 103  
 104      // Display info & error messages
 105      echo $Messages->display( NULL, NULL, false, 'action_messages' );
 106  
 107      /**
 108       * @var AbstractSettings
 109       */
 110      global $global_Cache;
 111      $version_status_msg = $global_Cache->get( 'version_status_msg' );
 112      if( !empty($version_status_msg) )
 113      {    // We have managed to get updates (right now or in the past):
 114          $msg = '<p>'.$version_status_msg.'</p>';
 115          $extra_msg = $global_Cache->get( 'extra_msg' );
 116          if( !empty($extra_msg) )
 117          {
 118              $msg .= '<p>'.$extra_msg.'</p>';
 119          }
 120      }
 121  
 122  }
 123  else
 124  {
 125      $msg = '';
 126  }
 127  
 128  
 129  $block_item_Widget = new Widget( 'block_item' );
 130  
 131  
 132  /**
 133   * b2evolution
 134   */
 135  $block_item_Widget->title = 'b2evolution';
 136  $block_item_Widget->disp_template_replaced( 'block_start' );
 137  
 138  // Version:
 139  $app_timestamp = mysql2timestamp( $app_date );
 140  init_system_check( T_( 'b2evolution version' ), sprintf( /* TRANS: First %s: App version, second %s: release date */ T_( '%s released on %s' ), $app_version, date_i18n( locale_datefmt(), $app_timestamp ) ) );
 141  if( ! empty($msg) )
 142  {
 143      switch( $global_Cache->get( 'version_status_color' ) )
 144      {
 145          case 'green':
 146              disp_system_check( 'ok', $msg );
 147              break;
 148  
 149          case 'yellow':
 150              disp_system_check( 'warning', $msg );
 151              break;
 152  
 153          default:
 154              disp_system_check( 'error', $msg );
 155      }
 156  }
 157  else
 158  {
 159      $msg = '<p>Updates from b2evolution.net are disabled!</p>
 160              <p>You will <b>NOT</b> be alerted if you are running an insecure configuration.</p>';
 161  
 162      $app_age = ($localtimenow - $app_timestamp) / 3600 / 24 / 30;    // approx age in months
 163      if( $app_age > 12 )
 164      {
 165          $msg .= '<p>'.sprintf( T_('Furthermore, this version is old. You should check for newer releases on %s.'),
 166              '<a href="http://b2evolution.net/downloads/">b2evolution.net</a>' ).'</p>';
 167      }
 168      elseif( $app_age > 6 )
 169      {
 170          $msg .= '<p>'.sprintf( T_('Furthermore, this version is aging. You may want to check for newer releases on %s..'),
 171              '<a href="http://b2evolution.net/downloads/">b2evolution.net</a>' ).'</p>';
 172      }
 173  
 174      disp_system_check( 'error', $msg );
 175  }
 176  
 177  // Media folder writable?
 178  list( $mediadir_status, $mediadir_msg ) = system_get_result( $system_stats['mediadir_status'] );
 179  $mediadir_long = '';
 180  if( $mediadir_status == 'error' )
 181  {
 182      $mediadir_long = '<p>'.T_('You will not be able to upload files/images and b2evolution will not be able to generate thumbnails.')."</p>\n"
 183      .'<p>'.T_('Your host requires that you set special file permissions on your media directory.').get_manual_link('media_file_permission_errors')."</p>\n";
 184  }
 185  init_system_check( T_( 'Media directory' ), $mediadir_msg.' - '.$media_path );
 186  disp_system_check( $mediadir_status, $mediadir_long );
 187  
 188  
 189  // /install/ folder deleted?
 190  init_system_check( T_( 'Install folder' ), $system_stats['install_removed'] ?  T_('Deleted') : T_('Not deleted').' - '.$basepath.$install_subdir );
 191  if( ! $system_stats['install_removed'] )
 192  {
 193      disp_system_check( 'warning', T_('For maximum security, it is recommended that you delete your /blogs/install/ folder once you are done with install or upgrade.') );
 194  
 195      // Database reset allowed?
 196      init_system_check( T_( 'Database reset' ), $allow_evodb_reset ?  T_('Allowed!') : T_('Forbidden') );
 197      if( $allow_evodb_reset )
 198      {
 199        disp_system_check( 'error', '<p>'.T_('Currently, anyone who accesses your install folder could entirely reset your b2evolution database.')."</p>\n"
 200         .'<p>'.T_('ALL YOUR DATA WOULD BE LOST!')."</p>\n"
 201         .'<p>'.T_('As soon as possible, change the setting <code>$allow_evodb_reset = 0;</code> in your /conf/_basic.config.php.').'</p>' );
 202      }
 203      else
 204      {
 205          disp_system_check( 'ok' );
 206      }
 207  }
 208  else
 209  {
 210      disp_system_check( 'ok' );
 211  }
 212  
 213  init_system_check( 'Internal b2evo charset' , $system_stats['evo_charset'] );
 214  disp_system_check( 'note' );
 215  
 216  init_system_check( 'Blog count' , $system_stats['evo_blog_count'] );
 217  disp_system_check( 'note' );
 218  
 219  $block_item_Widget->disp_template_raw( 'block_end' );
 220  
 221  
 222  /*
 223   * Caching
 224   */
 225  $block_item_Widget->title = T_( 'Caching' );
 226  $block_item_Widget->disp_template_replaced( 'block_start' );
 227  
 228  // Cache folder writable?
 229  list( $cachedir_status, $cachedir_msg ) = system_get_result( $system_stats['cachedir_status'] );
 230  $cachedir_long = '';
 231  if( $cachedir_status == 'error' )
 232  {
 233      $cachedir_long = '<p>'.T_('You will not be able to use page cache.')."</p>\n"
 234      .'<p>'.T_('Your host requires that you set special file permissions on your cache directory.').get_manual_link('cache_file_permission_errors')."</p>\n";
 235  }
 236  init_system_check( T_( 'Cache directory' ), $cachedir_msg.' - '.$cache_path );
 237  disp_system_check( $cachedir_status, $cachedir_long );
 238  
 239  // cache folder size
 240  init_system_check( 'Cache folder size', bytesreadable($system_stats['cachedir_size']) );
 241  disp_system_check( 'note' );
 242  
 243  if( $cachedir_status != 'error' )
 244  { // 'cache/ directory exists and, it is writable
 245  
 246      // General cache is enabled
 247      init_system_check( T_( 'General caching' ), $system_stats['general_pagecache_enabled'] ? 'Enabled' : 'Disabled' );
 248      disp_system_check( 'note' );
 249  
 250      // how many blogs have enabled caches
 251      $error_messages = system_check_caches( false );
 252      $enabled_message = $system_stats['blog_pagecaches_enabled'].' enabled /'.$system_stats['evo_blog_count'].' blogs';
 253      init_system_check( T_( 'Blog\'s cache setting' ), $enabled_message );
 254      disp_system_check( 'note' );
 255      if( count( $error_messages ) > 0 )
 256      { // show errors
 257          init_system_check( T_( 'Blog\'s cache errors' ), implode( '<br />', $error_messages ) );
 258          disp_system_check( 'error' );
 259      }
 260  }
 261  
 262  $block_item_Widget->disp_template_raw( 'block_end' );
 263  
 264  
 265  /*
 266   * Time
 267   */
 268  $block_item_Widget->title = T_('Time');
 269  $block_item_Widget->disp_template_replaced( 'block_start' );
 270  
 271  init_system_check( T_( 'Server time' ), date_i18n( locale_datetimefmt( ' - ' ), $servertimenow ) );
 272  disp_system_check( 'note' );
 273  
 274  init_system_check( T_( 'GMT / UTC time' ), gmdate( locale_datetimefmt( ' - ' ), $servertimenow ) );
 275  disp_system_check( 'note' );
 276  
 277  init_system_check( T_( 'b2evolution time' ), date_i18n( locale_datetimefmt( ' - ' ), $localtimenow ) );
 278  disp_system_check( 'note' );
 279  
 280  $block_item_Widget->disp_template_raw( 'block_end' );
 281  
 282  
 283  /*
 284   * MySQL Version
 285   */
 286  $block_item_Widget->title = 'MySQL';
 287  $block_item_Widget->disp_template_replaced( 'block_start' );
 288  
 289  // Version:
 290  init_system_check( T_( 'MySQL version' ), $DB->version_long );
 291  if( version_compare( $system_stats['db_version'], $required_mysql_version['application'] ) < 0 )
 292  {
 293      disp_system_check( 'error', sprintf( T_('This version is too old. The minimum recommended MySQL version is %s.'), $required_mysql_version['application'] ) );
 294  }
 295  else
 296  {
 297      disp_system_check( 'ok' );
 298  }
 299  
 300  // UTF8 support?
 301  init_system_check( 'MySQL UTF-8 support', $system_stats['db_utf8'] ?  T_('Yes') : T_('No') );
 302  if( ! $system_stats['db_utf8'] )
 303  {
 304      disp_system_check( 'warning', T_('UTF-8 is not supported by your MySQL server.') ); // fp> TODO: explain why this is bad. Better yet: try to detect if we really need it, base don other conf variables.
 305  }
 306  else
 307  {
 308      disp_system_check( 'ok' );
 309  }
 310  
 311  $block_item_Widget->disp_template_raw( 'block_end' );
 312  
 313  
 314  /**
 315   * PHP
 316   */
 317  $block_item_Widget->title = 'PHP';
 318  $block_item_Widget->disp_template_replaced( 'block_start' );
 319  
 320  
 321  // User ID:
 322  list( $uid, $uname, $running_as ) = system_check_process_user();
 323  init_system_check( 'PHP running as USER:', $running_as );
 324  disp_system_check( 'note' );
 325  
 326  
 327  // Group ID:
 328  list( $gid, $gname, $running_as ) = system_check_process_group();
 329  init_system_check( 'PHP running as GROUP:', $running_as );
 330  disp_system_check( 'note' );
 331  
 332  
 333  // PHP version
 334  $phpinfo_url = '?ctrl=tools&amp;action=view_phpinfo&amp;'.url_crumb('tools');
 335  $phpinfo_link = action_icon( T_('View PHP info'), 'info', $phpinfo_url, '', 5, '', array( 'target'=>'_blank', 'onclick'=>'return pop_up_window( \''.$phpinfo_url.'\', \'phpinfo\', 650 )' ) );
 336  init_system_check( 'PHP version', $system_stats['php_version'].' '.$phpinfo_link );
 337  
 338  if( version_compare( $system_stats['php_version'], $required_php_version['application'], '<' ) )
 339  {
 340      disp_system_check( 'error', T_('This version is too old. b2evolution will not run correctly. You must ask your host to upgrade PHP before you can run b2evolution.') );
 341  }
 342  elseif( version_compare( $system_stats['php_version'], '5.2', '<' ) )
 343  {
 344      disp_system_check( 'warning', T_('This version is old. b2evolution may run but some features may fail. You should ask your host to upgrade PHP before running b2evolution.') );
 345  }
 346  else
 347  {
 348      disp_system_check( 'ok' );
 349  }
 350  
 351  // register_globals?
 352  init_system_check( 'PHP register_globals', $system_stats['php_reg_globals'] ?  T_('On') : T_('Off') );
 353  if( $system_stats['php_reg_globals'] )
 354  {
 355      disp_system_check( 'warning', $facilitate_exploits.' '.sprintf( $change_ini, 'register_globals = Off' )  );
 356  }
 357  else
 358  {
 359      disp_system_check( 'ok' );
 360  }
 361  
 362  
 363  // allow_url_include? (since 5.2, supercedes allow_url_fopen for require()/include())
 364  if( version_compare(PHP_VERSION, '5.2', '>=') )
 365  {
 366      init_system_check( 'PHP allow_url_include', $system_stats['php_allow_url_include'] ?  T_('On') : T_('Off') );
 367      if( $system_stats['php_allow_url_include'] )
 368      {
 369          disp_system_check( 'warning', $facilitate_exploits.' '.sprintf( $change_ini, 'allow_url_include = Off' )  );
 370      }
 371      else
 372      {
 373          disp_system_check( 'ok' );
 374      }
 375  }
 376  else
 377  {
 378      /*
 379       * allow_url_fopen
 380       * Note: this allows including of remote files (PHP 4 only) as well as opening remote files with fopen() (all versions of PHP)
 381       * Both have potential for exploits. (The first is easier to exploit than the second).
 382       * dh> Should we check for curl etc then also and warn the user until there's no method for us anymore to open remote files?
 383       * fp> Yes
 384       */
 385      init_system_check( 'PHP allow_url_fopen', $system_stats['php_allow_url_fopen'] ?  T_('On') : T_('Off') );
 386      if( $system_stats['php_allow_url_fopen'] )
 387      {
 388          disp_system_check( 'warning', $facilitate_exploits.' '.sprintf( $change_ini, 'allow_url_fopen = Off' )  );
 389      }
 390      else
 391      {
 392          disp_system_check( 'ok' );
 393      }
 394  }
 395  
 396  // Magic quotes:
 397  if( !strcasecmp( ini_get('magic_quotes_sybase'), 'on' ) )
 398  {
 399      $magic_quotes = T_('On').' (magic_quotes_sybase)';
 400      $message = 'magic_quotes_sybase = Off';
 401  }
 402  elseif( get_magic_quotes_gpc() )
 403  {
 404      $magic_quotes = T_('On').' (magic_quotes_gpc)';
 405      $message = 'magic_quotes_gpc = Off';
 406  }
 407  else
 408  {
 409      $magic_quotes = T_('Off');
 410      $message = '';
 411  }
 412  init_system_check( 'PHP Magic Quotes', $magic_quotes );
 413  if( !empty( $message ) )
 414  {
 415      disp_system_check( 'warning', T_('PHP is adding extra quotes to all inputs. This leads to unnecessary extra processing.')
 416          .' '.sprintf( $change_ini, $message ) );
 417  }
 418  else
 419  {
 420      disp_system_check( 'ok' );
 421  }
 422  
 423  
 424  // Max upload size:
 425  $upload_max_filesize = system_check_upload_max_filesize();
 426  init_system_check( 'PHP upload_max_filesize', ini_get('upload_max_filesize') );
 427  disp_system_check( 'ok' );
 428  
 429  // Max post size:
 430  $post_max_size = system_check_post_max_size();
 431  init_system_check( 'PHP post_max_size', ini_get('post_max_size') );
 432  if( $post_max_size > $upload_max_filesize )
 433  {
 434      disp_system_check( 'ok' );
 435  }
 436  else
 437  {
 438      disp_system_check( 'error', T_('post_max_size should be larger than upload_max_filesize') );
 439  }
 440  
 441  // Memory limit:
 442  $memory_limit = system_check_memory_limit();
 443  if( empty($memory_limit) )
 444  {
 445      init_system_check( 'PHP memory_limit', T_('n.a.') );
 446      disp_system_check( 'note' );
 447  }
 448  else
 449  {
 450      init_system_check( 'PHP memory_limit', ini_get('memory_limit') );
 451      if( $memory_limit < get_php_bytes_size( '8M' ) )
 452      {
 453          disp_system_check( 'error', T_('The memory_limit is very low. Some features of b2evolution will fail to work;') );
 454      }
 455      elseif( $memory_limit < get_php_bytes_size( '12M' ) )
 456      {
 457          disp_system_check( 'warning', T_('The memory_limit is low. Some features of b2evolution may fail to work;') );
 458      }
 459      else
 460      {
 461          disp_system_check( 'ok' );
 462      }
 463  }
 464  
 465  // Maximum execution time of each script
 466  $max_execution_time = system_check_max_execution_time();
 467  if( empty( $max_execution_time ) )
 468  {
 469      init_system_check( 'PHP max_execution_time', T_('Unlimited') );
 470      disp_system_check( 'ok' );
 471  }
 472  else
 473  {
 474      init_system_check( 'PHP max_execution_time', sprintf( T_('%s seconds'), $max_execution_time ) );
 475      if( $max_execution_time <= 5 * 60 )
 476      {
 477          disp_system_check( 'error' );
 478      }
 479      elseif( $max_execution_time > 5 * 60 )
 480      {
 481          disp_system_check( 'warning' );
 482      }
 483  }
 484  if( $max_execution_time < 600 )
 485  { // Force max_execution_time to 10 minutes
 486      $result = ini_set( 'max_execution_time', 600 );
 487      if( $result !== false )
 488      {
 489          $max_execution_time = system_check_max_execution_time();
 490          init_system_check( 'PHP forced max_execution_time', sprintf( T_('%s seconds'), $max_execution_time ) );
 491          disp_system_check( 'warning' );
 492      }
 493  }
 494  
 495  // mbstring extension
 496  init_system_check( 'PHP mbstring extension', extension_loaded('mbstring') ?  T_('Loaded') : T_('Not loaded') );
 497  if( ! extension_loaded('mbstring' ) )
 498  {
 499      disp_system_check( 'warning', T_('b2evolution will not be able to convert character sets and special characters/languages may not be displayed correctly. Enable the mbstring extension in your php.ini file or ask your hosting provider about it.') );
 500  }
 501  else
 502  {
 503      disp_system_check( 'ok' );
 504  }
 505  
 506  
 507  // XML extension
 508  init_system_check( 'PHP XML extension', extension_loaded('xml') ?  T_('Loaded') : T_('Not loaded') );
 509  if( ! extension_loaded('xml' ) )
 510  {
 511      disp_system_check( 'warning', T_('The XML extension is not loaded.') ); // fp> This message only repeats the exact same info that is already displayed. Not helpful.
 512      // fp>TODO: explain what we need it for. Is it a problem or not.
 513      // furthermore I think xmlrpc does dynamic loading (or has it been removed?), in which case this should be tested too.
 514      // dh> You mean the deprecated dl() loading? (fp>yes) We might just try this then here also before any warning.
 515  }
 516  else
 517  {
 518      disp_system_check( 'ok' );
 519  }
 520  
 521  // IMAP extension
 522  $imap_loaded = extension_loaded( 'imap' );
 523  init_system_check( 'PHP IMAP extension', $imap_loaded ? T_( 'Loaded' ) : T_( 'Not loaded' ) );
 524  if ( ! $imap_loaded )
 525  {
 526      disp_system_check( 'warning', T_( 'You will not be able to use the Post by Email feature and the Return Path email processing of b2evolution. Enable the IMAP extension in your php.ini file or ask your hosting provider about it.' ) );
 527  }
 528  else
 529  {
 530      disp_system_check( 'ok' );
 531  }
 532  
 533  // Opcode cache
 534  $opcode_cache = get_active_opcode_cache();
 535  init_system_check( 'PHP opcode cache', $opcode_cache );
 536  if( $opcode_cache == 'none' )
 537  {
 538      disp_system_check( 'warning', T_( 'Using an opcode cache allows all your PHP scripts to run faster by caching a "compiled" (opcode) version of the scripts instead of recompiling everything at every page load. Several opcode caches are available. We recommend APC.' ) );
 539  }
 540  else
 541  {
 542      disp_system_check( 'ok' );
 543  }
 544  
 545  // pre_dump( get_loaded_extensions() );
 546  
 547  $block_item_Widget->disp_template_raw( 'block_end' );
 548  
 549  
 550  
 551  /*
 552   * GD Library
 553   * windows: extension=php_gd2.dll
 554   * unix: ?
 555   * fp> Note: I'm going to use this for thumbnails for now, but I plan to use it for other things like small stats & status graphics.
 556   */
 557  $block_item_Widget->title = T_('GD Library (image handling)');
 558  $block_item_Widget->disp_template_replaced( 'block_start' );
 559  
 560  $gd_version = system_check_gd_version();
 561  init_system_check( T_( 'GD Library version' ), isset($gd_version) ? $gd_version : T_('Not installed') );
 562  if( ! isset($gd_version) )
 563  {
 564      disp_system_check( 'warning', T_('You will not be able to automatically generate thumbnails for images. Enable the gd2 extension in your php.ini file or ask your hosting provider about it.') );
 565  }
 566  else
 567  {
 568      disp_system_check( 'ok' );
 569  
 570      $gd_info = gd_info();
 571  
 572      // JPG:
 573      // Tblue> Note: "JPG Support" was renamed to "JPEG Support" in PHP 5.3.
 574      init_system_check( 'GD JPG Support', ( ! empty($gd_info['JPG Support']) || ! empty($gd_info['JPEG Support']) ) ? T_('Read/Write') : T_('No') );
 575      if( empty($gd_info['JPG Support']) && empty($gd_info['JPEG Support']) )
 576      {
 577          disp_system_check( 'warning', T_('You will not be able to automatically generate thumbnails for JPG images.') );
 578      }
 579      else
 580      {
 581          disp_system_check( 'ok' );
 582      }
 583  
 584      // PNG:
 585      init_system_check( 'GD PNG Support', !empty($gd_info['PNG Support']) ? T_('Read/Write') : T_('No') );
 586      if( empty($gd_info['PNG Support']) )
 587      {
 588          disp_system_check( 'warning', T_('You will not be able to automatically generate thumbnails for PNG images.') );
 589      }
 590      else
 591      {
 592          disp_system_check( 'ok' );
 593      }
 594  
 595      // GIF:
 596      if( !empty($gd_info['GIF Create Support']) )
 597      {
 598          $gif_support = T_('Read/Write');
 599      }
 600      elseif( !empty($gd_info['GIF Read Support']) )
 601      {
 602          $gif_support = T_('Read');
 603      }
 604      else
 605      {
 606          $gif_support = T_('No');
 607      }
 608      init_system_check( 'GD GIF Support', $gif_support );
 609      if( $gif_support == T_('No') )
 610      {
 611          disp_system_check( 'warning', T_('You will not be able to automatically generate thumbnails for GIF images.') );
 612      }
 613      elseif( $gif_support == T_('Read') )
 614      {
 615          disp_system_check( 'warning', T_('Thumbnails for GIF images will be generated as PNG or JPG.') );
 616      }
 617      else
 618      {
 619          disp_system_check( 'ok' );
 620      }
 621  
 622      // FreeType:
 623      init_system_check( 'GD FreeType Support', !empty($gd_info['FreeType Support']) ?  T_('Yes') : T_('No') );
 624      if( empty($gd_info['FreeType Support']) )
 625      {
 626          disp_system_check( 'warning', T_('You will not be able to write text to images using TrueType fonts.') );
 627      }
 628      else
 629      {
 630          disp_system_check( 'ok' );
 631      }
 632      // pre_dump( $gd_info );
 633  }
 634  $block_item_Widget->disp_template_raw( 'block_end' );
 635  
 636  
 637  /*
 638   * Info pages
 639   */
 640  $block_item_Widget->title = T_('Info pages');
 641  $block_item_Widget->disp_template_replaced( 'block_start' );
 642  
 643  init_system_check( 'Default page:', '<a href="'.$baseurl.'default.php">'.$baseurl.'default.php</a>' );
 644  disp_system_check( 'note' );
 645  
 646  $block_item_Widget->disp_template_raw( 'block_end' );
 647  
 648  // TODO: dh> output_buffering (recommend off)
 649  // TODO: dh> session.auto_start (recommend off)
 650  // TODO: dh> How to change ini settings in .htaccess (for mod_php), link to manual
 651  // fp> all good ideas :)
 652  // TODO: dh> submit the report into a central database
 653  // fp>yope, with a Globally unique identifier in order to avoid duplicates.
 654  
 655  // pre_dump( ini_get_all() );
 656  
 657  
 658  // End payload block:
 659  $AdminUI->disp_payload_end();
 660  
 661  // Display body bottom, debug info and close </html>:
 662  $AdminUI->disp_global_footer();
 663  
 664  ?>

title

Description

title

Description

title

Description

title

title

Body