| | 472 | |
|---|
| | 473 | function paging_configpageinit($pagename) { |
|---|
| | 474 | global $currentcomponent; |
|---|
| | 475 | |
|---|
| | 476 | $action = isset($_REQUEST['action'])?$_REQUEST['action']:null; |
|---|
| | 477 | $extdisplay = isset($_REQUEST['extdisplay'])?$_REQUEST['extdisplay']:null; |
|---|
| | 478 | $extension = isset($_REQUEST['extension'])?$_REQUEST['extension']:null; |
|---|
| | 479 | $tech_hardware = isset($_REQUEST['tech_hardware'])?$_REQUEST['tech_hardware']:null; |
|---|
| | 480 | |
|---|
| | 481 | // We only want to hook 'users' or 'extensions' pages. |
|---|
| | 482 | if ($pagename != 'devices' && $pagename != 'extensions') { |
|---|
| | 483 | return true; |
|---|
| | 484 | } |
|---|
| | 485 | |
|---|
| | 486 | if ($extdisplay != '') { |
|---|
| | 487 | $currentcomponent->addprocessfunc('pagings_configprocess', 8); |
|---|
| | 488 | } |
|---|
| | 489 | } |
|---|
| | 490 | |
|---|
| | 491 | function pagings_configprocess() { |
|---|
| | 492 | global $db; |
|---|
| | 493 | |
|---|
| | 494 | //create vars from the request |
|---|
| | 495 | // |
|---|
| | 496 | $action = isset($_REQUEST['action'])?$_REQUEST['action']:null; |
|---|
| | 497 | $ext = isset($_REQUEST['extdisplay'])?$_REQUEST['extdisplay']:null; |
|---|
| | 498 | $extn = isset($_REQUEST['extension'])?$_REQUEST['extension']:null; |
|---|
| | 499 | $langcode = isset($_REQUEST['langcode'])?$_REQUEST['langcode']:null; |
|---|
| | 500 | |
|---|
| | 501 | $extdisplay = ($ext==='') ? $extn : $ext; |
|---|
| | 502 | if ($action == "del") { |
|---|
| | 503 | $sql = "DELETE FROM paging_groups WHERE ext = '$extdisplay'"; |
|---|
| | 504 | $res = $db->query($sql); |
|---|
| | 505 | if (DB::isError($res)) { |
|---|
| | 506 | var_dump($res); |
|---|
| | 507 | die_freepbx("Error in paging_del(): "); |
|---|
| | 508 | } |
|---|
| | 509 | } |
|---|
| | 510 | } |
|---|
| | 511 | |
|---|