Changeset 12379

Show
Ignore:
Timestamp:
08/08/11 15:24:15 (2 years ago)
Author:
mickecarlsson
Message:

Re #5220, updated Route Permissions to be in phase with HiPBX code. No release yet, more testing needs to be done

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • contributed_modules/modules/routepermissions/functions.inc.php

    r7714 r12379  
    2929        $extension = isset($_REQUEST['extension'])?$_REQUEST['extension']:null; 
    3030        $tech_hardware = isset($_REQUEST['tech_hardware'])?$_REQUEST['tech_hardware']:null; 
    31  
    3231        // We only want to hook 'users' or 'extensions' pages. 
    3332        if ($pagename != 'users' && $pagename != 'extensions') 
     
    7069      // Insert the ROUTENAME into each route 
    7170      // 
    72       $names = core_routing_getroutenames(); 
     71      $names = core_routing_list(); 
    7372      foreach($names as $name) { 
    74         $context = 'outrt-'.$name[0]; 
    75         $routename = substr($context,10)
    76         $routes = core_routing_getroutepatterns($name[0]); 
     73        $context = 'outrt-'.$name['route_id']; 
     74        $routename = $name['name']
     75        $routes = core_routing_getroutepatternsbyid($name['route_id']); 
    7776        foreach ($routes as $rt) { 
    78           //strip the pipe out as that's what we use for the dialplan extension 
    79           // 
    80           $extension = str_replace('|','',$rt); 
    81  
     77          $extension = $rt['match_pattern_prefix'].$rt['match_pattern_pass']; 
    8278          // If there are any wildcards in there, add a _ to the start 
    8379          // 
     
    126122        $action = isset($_REQUEST['action'])?$_REQUEST['action']:null; 
    127123        $extdisplay = isset($_REQUEST['extdisplay'])?$_REQUEST['extdisplay']:null; 
     124        if(isset($_REQUEST['extension'])){ 
     125          $extdisplay=$_REQUEST['extension']; 
     126        } 
    128127  $rps = array(); 
    129128  $redir = array(); 
     
    211210  sql($sql); 
    212211} 
    213    
    214    
    215  
    216 // When outbound routes is rewritten to no longer use the 'extensions' database, the following function will need to be changed 
    217212 
    218213function rp_get_routes() { 
    219214  global $db; 
    220   $sql = "SELECT DISTINCT context FROM extensions WHERE context LIKE 'outrt%';"; 
     215  $sql = "SELECT DISTINCT a.name FROM `outbound_routes` a JOIN `outbound_route_sequence` b ON a.route_id = b.route_id ORDER BY `seq`;"; 
    221216  $res = $db->getAll($sql); 
    222217  foreach ($res as $r) { 
    223     // $r[0] = 'outrt-NNN-routename-goes-here' 
    224     $arr[] = substr($r[0], 10); 
     218    $arr[] = $r[0]; 
    225219  }  
    226220  return $arr; 
  • contributed_modules/modules/routepermissions/module.xml

    r9871 r12379  
    33  <name>Outbound Route Permissions</name> 
    44  <category>Third Party Addon</category> 
    5   <version>0.3.2.5</version> 
     5  <version>0.4.0.0</version> 
     6  <publisher>HiPBX.org</publisher> 
     7  <license>AGPLv3</license> 
    68  <candisable>yes</candisable> 
    79  <canuninstall>yes</canuninstall> 
    810  <changelog> 
     11    *0.4.0.0* #5220, updated to work with FreePBX 2.9 
    912    *0.3.2.5* add version dependency 
    1013    *0.3.2.4* Changed category to Third Party Addon, that name to be used by all modules in the Extended Repo (until they are brought into the main repo) 
     
    2629  </menuitems> 
    2730  <type>setup</type> 
    28   <depends> 
    29     <version>lt 2.8.0alpha0</version> 
    30   </depends> 
    3131  <location>contributed_modules/release/routepermissions-0.3.2.5.tgz</location> 
    3232  <md5sum>11734f588010342f5191a87e0017eed1</md5sum>