Changeset 7583

Show
Ignore:
Timestamp:
04/25/09 20:04:52 (4 years ago)
Author:
xrobau
Message:

Realised that I was making this far too difficult.. the outrt-xxx is always the same length, so just stripping off the first 10 characters.

Files:

Legend:

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

    r7582 r7583  
    153153  $res = $db->getAll($sql); 
    154154  foreach ($res as $r) { 
    155     $pieces = explode("-", $r[0]); 
    156     // $pieces[0] = 'outrt', $pieces[1] = a number, pieces 2+ are the route name. 
    157     array_shift ($pieces); 
    158     array_shift ($pieces); 
    159     $arr[] = implode('-', $pieces); 
     155    // $r[0] = 'outrt-NNN-routename-goes-here' 
     156    $arr[] = substr($r[0], 10); 
    160157  }  
    161158  return $arr; 
  • contributed_modules/modules/routepermissions/install.php

    r7582 r7583  
    5555foreach($extns as $ext) { 
    5656  foreach ($routes as $r) { 
    57     $pieces = explode("-", $r[0]);  
    58     array_shift ($pieces); 
    59                 array_shift ($pieces); 
    60                 $rn = implode('-', $pieces;) 
    61    
     57                $rn = substr($r[0], 10); 
    6258    $db->query("INSERT INTO routepermissions (exten, routename, allowed) VALUES ('$ext[0]', '$rn', 'YES');"); 
    6359  }