Changeset 12379
- Timestamp:
- 08/08/11 15:24:15 (2 years ago)
- Files:
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
contributed_modules/modules/routepermissions/functions.inc.php
r7714 r12379 29 29 $extension = isset($_REQUEST['extension'])?$_REQUEST['extension']:null; 30 30 $tech_hardware = isset($_REQUEST['tech_hardware'])?$_REQUEST['tech_hardware']:null; 31 32 31 // We only want to hook 'users' or 'extensions' pages. 33 32 if ($pagename != 'users' && $pagename != 'extensions') … … 70 69 // Insert the ROUTENAME into each route 71 70 // 72 $names = core_routing_ getroutenames();71 $names = core_routing_list(); 73 72 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']); 77 76 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']; 82 78 // If there are any wildcards in there, add a _ to the start 83 79 // … … 126 122 $action = isset($_REQUEST['action'])?$_REQUEST['action']:null; 127 123 $extdisplay = isset($_REQUEST['extdisplay'])?$_REQUEST['extdisplay']:null; 124 if(isset($_REQUEST['extension'])){ 125 $extdisplay=$_REQUEST['extension']; 126 } 128 127 $rps = array(); 129 128 $redir = array(); … … 211 210 sql($sql); 212 211 } 213 214 215 216 // When outbound routes is rewritten to no longer use the 'extensions' database, the following function will need to be changed217 212 218 213 function rp_get_routes() { 219 214 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`;"; 221 216 $res = $db->getAll($sql); 222 217 foreach ($res as $r) { 223 // $r[0] = 'outrt-NNN-routename-goes-here' 224 $arr[] = substr($r[0], 10); 218 $arr[] = $r[0]; 225 219 } 226 220 return $arr; contributed_modules/modules/routepermissions/module.xml
r9871 r12379 3 3 <name>Outbound Route Permissions</name> 4 4 <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> 6 8 <candisable>yes</candisable> 7 9 <canuninstall>yes</canuninstall> 8 10 <changelog> 11 *0.4.0.0* #5220, updated to work with FreePBX 2.9 9 12 *0.3.2.5* add version dependency 10 13 *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) … … 26 29 </menuitems> 27 30 <type>setup</type> 28 <depends>29 <version>lt 2.8.0alpha0</version>30 </depends>31 31 <location>contributed_modules/release/routepermissions-0.3.2.5.tgz</location> 32 32 <md5sum>11734f588010342f5191a87e0017eed1</md5sum>
