Changeset 1970

Show
Ignore:
Timestamp:
05/28/06 11:08:08 (3 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/branches/2.1/amp_conf/htdocs/admin/functions.inc.php

    r1914 r1970  
    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         
Donate



Support
Download
Develop
Forums
News
Documentation
Paid Support
About

Paid Ads