Ticket #2594: blacklist_target.diff
| File blacklist_target.diff, 3.7 kB (added by daniele.martini, 3 years ago) |
|---|
-
uninstall.php
old new 1 1 <?php 2 2 3 3 sql('DELETE FROM featurecodes WHERE modulename="blacklist"'); 4 4 sql('DELETE FROM globals WHERE variable="BLACKLIST_DEST"'; 5 5 needreload(); 6 6 7 7 ?> -
functions.inc.php
old new 7 7 global $ext; 8 8 switch($engine) { 9 9 case "asterisk": 10 $results = sql("SELECT value FROM globals WHERE variable='BLACKLIST_DEST'","getAll",DB_FETCHMODE_ASSOC); 11 $row=$results[0]; 12 $goto=$row['value']; 10 13 11 14 $id = "app-blacklist"; 12 15 $ext->addInclude('from-internal-additional', $id); // Add the include from from-internal … … 14 17 $id = "app-blacklist-check"; 15 18 $c = "s"; 16 19 $ext->add($id, $c, '', new ext_lookupblacklist('')); 17 $ext->add($id, $c, '', new ext_gotoif('$["${LOOKUPBLSTATUS}"="FOUND"]', 'blacklisted'));20 $ext->add($id, $c, '', new ext_gotoif('$["${LOOKUPBLSTATUS}"="FOUND"]', $goto)); 18 21 $ext->add($id, $c, '', new ext_return('')); 19 $ext->add($id, $c, 'blacklisted', new ext_answer(''));20 $ext->add($id, $c, '', new ext_wait(1));21 $ext->add($id, $c, '', new ext_zapateller(''));22 $ext->add($id, $c, '', new ext_playback('ss-noservice'));23 $ext->add($id, $c, '', new ext_hangup(''));24 22 25 23 $modulename = 'blacklist'; 26 24 … … 208 206 return true; 209 207 } 210 208 209 function blacklist_setdestination($dest){ 210 global $amp_conf; 211 global $astman; 212 global $db; 213 214 sql("UPDATE globals SET value='".$dest."' WHERE variable='BLACKLIST_DEST')"); 215 } 216 211 217 ?> -
page.blacklist.php
old new 19 19 20 20 $dispnum = "blacklist"; //used for switch on config.php 21 21 22 if (isset($_REQUEST['goto0']) && isset($_REQUEST[$_REQUEST['goto0']."0"])) { 23 $goto = $_REQUEST[$_REQUEST['goto0']."0"]; 24 } else{ 25 $results = sql("SELECT value FROM globals WHERE variable='BLACKLIST_DEST'","getAll",DB_FETCHMODE_ASSOC); 26 $row=$results[0]; 27 $goto=$row['value']; 28 } 29 22 30 //if submitting form, update database 23 31 24 32 if(isset($_REQUEST['action'])) { … … 36 44 blacklist_add($_POST); 37 45 redirect_standard('editnumber'); 38 46 break; 39 40 47 case "setdestination": 48 blacklist_setdestination($goto); 49 needreload(); 50 redirect_standard(); 51 break; 41 52 } 42 53 } 43 54 … … 141 152 142 153 143 154 </form> 155 156 <form autocomplete="off" name="edit" action="<?php $_SERVER['PHP_SELF'] ?>" method="post"> 157 <input type="hidden" name="action" value="setdestination"> 158 159 <table> 160 <tr> 161 <td colspan="2"><h5><?php echo _("Set Destination") ?><hr></h5></td> 162 </tr> 163 164 <?php echo drawselects($goto,0); ?> 165 <tr> 166 <td colspan="2"><br><h6><input name="submit" type="submit" value="<?php echo _("Submit Changes")?>"></h6></td> 167 </tr> 168 </table> 169 </form> -
install.php
old new 16 16 $fcc->setDefault('*32'); 17 17 $fcc->update(); 18 18 unset($fcc); 19 20 sql("INSERT INTO globals VALUES('BLACKLIST_DEST','app-blackhole,zapateller,1')"); 19 21 ?>
