Changeset 13934 for modules

Show
Ignore:
Timestamp:
03/27/12 14:01:15 (1 year ago)
Author:
p_lindheimer
Message:

fixes #5734 properly validate new destinations

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • modules/branches/2.10/findmefollow/functions.inc.php

    r13803 r13934  
    399399 
    400400  $results = sql("SELECT grpnum, strategy, grptime, grppre, grplist, annmsg_id, postdest, dring, needsconf, remotealert_id, toolate_id, ringing, pre_ring, voicemail FROM findmefollow INNER JOIN `users` ON `extension` = `grpnum` WHERE grpnum = '".$db->escapeSimple($grpnum)."'","getRow",DB_FETCHMODE_ASSOC); 
     401  if (empty($results)) { 
     402    return array(); 
     403  } 
    401404  if (!isset($results['voicemail'])) { 
    402405    $results['voicemail'] = sql("SELECT `voicemail` FROM `users` WHERE `extension` = '".$db->escapeSimple($grpnum)."'","getOne"); 
     
    566569} 
    567570 
     571// we only return the destination that other modules might use, e.g. extenions/users 
     572function findmefollow_getdest($exten) { 
     573  return array('ext-findmefollow,FM' . $exten . ',1'); 
     574} 
     575 
     576function findmefollow_getdestinfo($dest) { 
     577  if (substr(trim($dest),0,17) == 'ext-findmefollow,' || substr(trim($dest),0,10) == 'ext-local,' && substr(trim($dest),-4) == 'dest') { 
     578    $grp = explode(',',$dest); 
     579    $grp = ltrim($grp[1],'FM'); 
     580    $thisgrp = findmefollow_get($grp); 
     581    if (empty($thisgrp)) { 
     582      return array(); 
     583    } else { 
     584      return array('description' => sprintf(_("Follow Me: %s"),urlencode($grp)), 
     585                   'edit_url' => 'config.php?display=findmefollow&extdisplay=GRP-'.urlencode($grp), 
     586                  ); 
     587    } 
     588  } else { 
     589    return false; 
     590  } 
     591} 
     592 
    568593function findmefollow_check_destinations($dest=true) { 
    569594  global $active_modules;