Changeset 5985


Ignore:
Timestamp:
04/28/10 18:11:07 (9 years ago)
Author:
plg
Message:

bug 860: display a more readable error when the _data directory is not writable

Location:
trunk/include
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/include/functions_html.inc.php

    r5924 r5985  
    362362 * @param string msg a message to display 
    363363 */ 
    364 function fatal_error($msg) 
    365 { 
     364function fatal_error($msg, $title=null, $show_trace=true) 
     365{ 
     366  if (empty($title)) 
     367  { 
     368    $title = 'Piwigo encountered a non recoverable error'; 
     369  } 
     370   
    366371  $btrace_msg = ''; 
    367   if (function_exists('debug_backtrace')) 
     372  if ($show_trace and function_exists('debug_backtrace')) 
    368373  { 
    369374    $bt = debug_backtrace(); 
     
    378383 
    379384  $display = "<meta http-equiv='Content-Type' content='text/html; charset=utf-8'> 
    380 <h1>Piwigo encountered a non recoverable error</h1> 
     385<h1>$title</h1> 
    381386<pre style='font-size:larger;background:white;color:red;padding:1em;margin:0;clear:both;display:block;width:auto;height:auto;overflow:auto'> 
    382387<b>$msg</b> 
  • trunk/include/template.class.php

    r5448 r5985  
    5353    $this->smarty->force_compile = $conf['template_force_compile']; 
    5454 
     55    if (!is_writable($conf['local_data_dir'])) 
     56    { 
     57      load_language('admin.lang'); 
     58      fatal_error( 
     59        sprintf( 
     60          l10n('Give write access (chmod 777) to "%s" directory at the root of your Piwigo installation'), 
     61          basename($conf['local_data_dir']) 
     62          ), 
     63        l10n('an error happened'), 
     64        false // show trace 
     65        ); 
     66    } 
    5567    $compile_dir = $conf['local_data_dir'].'/templates_c'; 
    5668    mkgetdir( $compile_dir ); 
Note: See TracChangeset for help on using the changeset viewer.