コード例 #1
0
ファイル: Rule.php プロジェクト: rootzig/SNEP
 /**
  * Verifica se um destino é válido para essa regra.
  *
  * @param string $extension
  * @return boolean validity
  */
 public function isValidDst($extension)
 {
     foreach ($this->getDstList() as $dst) {
         if ($dst['type'] == 'G') {
             try {
                 $peer = PBX_Usuarios::get($extension);
             } catch (PBX_Exception_NotFound $ex) {
                 $peer = false;
             }
             if ($peer instanceof Snep_Usuario && PBX_Usuarios::hasGroupInheritance($dst['value'], $peer->getGroup())) {
                 return true;
             }
         } else {
             if ($this->checkExpr($dst['type'], $dst['value'], $extension)) {
                 return true;
             }
         }
     }
     return false;
 }