Changeset 7784

Show
Ignore:
Timestamp:
06/01/09 12:19:05 (9 months ago)
Author:
p_lindheimer
Message:

fixes #3705 so & can be used in sip and iax secrets, also modifies core_trunks_getDetails to provide a table of all the trunks from the new trunk table if no paramter is passed

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • modules/branches/2.6/core/functions.inc.php

    r7783 r7784  
    236236                        $results2 = array(); 
    237237                        foreach ($results2_pre as $element) { 
    238                                 $options = explode("&", $element['data']); 
    239                                 foreach ($options as $option) { 
    240                                         if (($element['keyword'] == 'disallow' && $option == 'all') | ($element['keyword'] == 'deny')) { 
    241                                                 array_unshift($results2,array('keyword'=>$element['keyword'],'data'=>$option)); 
    242                                         } else { 
    243                                                 $results2[] = array('keyword'=>$element['keyword'],'data'=>$option); 
     238                                if (strtolower(trim($element['keyword'])) != 'secret') { 
     239                                        $options = explode("&", $element['data']); 
     240                                        foreach ($options as $option) { 
     241                                                if (($element['keyword'] == 'disallow' && $option == 'all') | ($element['keyword'] == 'deny')) { 
     242                                                        array_unshift($results2,array('keyword'=>$element['keyword'],'data'=>$option)); 
     243                                                } else { 
     244                                                        $results2[] = array('keyword'=>$element['keyword'],'data'=>$option); 
     245                                                } 
    244246                                        } 
     247                                } else { 
     248                                        $results2[] = array('keyword'=>$element['keyword'],'data'=>$element['data']); 
    245249                                } 
    246250                        } 
     
    394398                        $results2 = array(); 
    395399                        foreach ($results2_pre as $element) { 
    396                                 $options = explode("&", $element['data']); 
    397                                 foreach ($options as $option) { 
    398                                         if (($element['keyword'] == 'disallow' && $option == 'all') | ($element['keyword'] == 'deny')) { 
    399                                                 array_unshift($results2,array('keyword'=>$element['keyword'],'data'=>$option)); 
    400                                         } else { 
    401                                                 $results2[] = array('keyword'=>$element['keyword'],'data'=>$option); 
     400                                if (strtolower(trim($element['keyword'])) != 'secret') { 
     401                                        $options = explode("&", $element['data']); 
     402                                        foreach ($options as $option) { 
     403                                                if (($element['keyword'] == 'disallow' && $option == 'all') | ($element['keyword'] == 'deny')) { 
     404                                                        array_unshift($results2,array('keyword'=>$element['keyword'],'data'=>$option)); 
     405                                                } else { 
     406                                                        $results2[] = array('keyword'=>$element['keyword'],'data'=>$option); 
     407                                                } 
    402408                                        } 
     409                                } else { 
     410                                        $results2[] = array('keyword'=>$element['keyword'],'data'=>$element['data']); 
    403411                                } 
    404412                        } 
     
    38243832 
    38253833//get unique trunks 
    3826 function core_trunks_getDetails($trunkid) { 
     3834function core_trunks_getDetails($trunkid='') { 
    38273835        global $db; 
    38283836        global $amp_conf; 
    38293837 
    3830         $sql = "SELECT * FROM `trunks` WHERE `trunkid` = '$trunkid'"; 
    3831         $trunk = sql($sql,"getRow",DB_FETCHMODE_ASSOC); 
    3832  
    3833         $tech = strtolower($trunk['tech']); 
    3834         switch ($tech) { 
    3835                 case 'iax2': 
    3836                         $trunk['tech'] = 'iax'; 
    3837                         break; 
    3838                 default: 
    3839                         $trunk['tech'] = $tech; 
    3840                         break; 
     3838        if ($trunkid != '') { 
     3839                $sql = "SELECT * FROM `trunks` WHERE `trunkid` = '$trunkid'"; 
     3840                $trunk = sql($sql,"getRow",DB_FETCHMODE_ASSOC); 
     3841 
     3842                $tech = strtolower($trunk['tech']); 
     3843                switch ($tech) { 
     3844                        case 'iax2': 
     3845                                $trunk['tech'] = 'iax'; 
     3846                                break; 
     3847                        default: 
     3848                                $trunk['tech'] = $tech; 
     3849                                break; 
     3850                }  
     3851        } else { 
     3852                $sql = "SELECT * FROM `trunks` ORDER BY tech, name"; 
     3853                $trunk = sql($sql,"getAll",DB_FETCHMODE_ASSOC); 
    38413854        } 
    38423855        return $trunk;