Changeset 5263

Show
Ignore:
Timestamp:
11/18/07 23:23:55 (6 years ago)
Author:
p_lindheimer
Message:

added option to database_show to provide a family to show, default is everything. Also fixed some bogus output it was producing

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • freepbx/trunk/amp_conf/htdocs/admin/common/php-asmanager.php

    r3577 r5263  
    730730   * @return Array associative array of key=>value 
    731731   */ 
    732   function database_show() { 
    733     $r = $this->command("database show"); 
     732  function database_show($family='') { 
     733    $r = $this->command("database show $family"); 
    734734     
    735735    $data = explode("\n",$r["data"]); 
    736736    $db = array(); 
    737737     
     738    // Remove the Privilege => Command initial entry that comes from the heading 
     739    // 
     740    array_shift($data); 
    738741    foreach ($data as $line) { 
    739742      $temp = explode(":",$line); 
    740       $temp[1] = isset($temp[1])?$temp[1]:null; 
    741       $db[ trim($temp[0]) ] = trim($temp[1]); 
     743      if (trim($temp[0]) != '') { 
     744        $temp[1] = isset($temp[1])?$temp[1]:null; 
     745        $db[ trim($temp[0]) ] = trim($temp[1]); 
     746      } 
    742747    } 
    743748    return $db;