Changeset 1971

Show
Ignore:
Timestamp:
05/28/06 14:08:25 (7 years ago)
Author:
mheydon1973
Message:

Show fatal error message when cannot read /etc/amportal.conf file

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • freepbx/trunk/amp_conf/htdocs/admin/functions.inc.php

    r1914 r1971  
    1616function parse_amportal_conf($filename) { 
    1717  $file = file($filename); 
    18   foreach ($file as $line) { 
    19     if (preg_match("/^\s*([a-zA-Z0-9]+)=([a-zA-Z0-9 .&-@=_<>\"\']+)\s*$/",$line,$matches)) { 
    20       $conf[ $matches[1] ] = $matches[2]; 
    21     } 
     18  if (is_array($file)) { 
     19    foreach ($file as $line) { 
     20      if (preg_match("/^\s*([a-zA-Z0-9]+)=([a-zA-Z0-9 .&-@=_<>\"\']+)\s*$/",$line,$matches)) { 
     21        $conf[ $matches[1] ] = $matches[2]; 
     22      } 
     23    } 
     24  } else { 
     25    die("<h1>Missing or unreadable config file ($filename)...cannot continue</h1>"); 
    2226  } 
    2327