Changeset 10701
- Timestamp:
- 12/11/10 18:09:00 (2 years ago)
- Files:
-
- freepbx/branches/bootstrap (modified) (1 prop)
- freepbx/branches/bootstrap/amp_conf/htdocs/admin/libraries/config.functions.php (modified) (1 diff)
- freepbx/branches/bootstrap/amp_conf/htdocs/admin/libraries/module.functions.php (modified) (3 diffs)
- freepbx/branches/bootstrap/amp_conf/htdocs/recordings/modules/phonefeatures.module (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
freepbx/branches/bootstrap
- Property svnmerge-integrated changed from /freepbx/trunk:1-10368,10370-10678 /freepbx/branches/2.8:1-10284 to /freepbx/branches/2.8:1-10284 /freepbx/trunk:1-10368,10370-10699
freepbx/branches/bootstrap/amp_conf/htdocs/admin/libraries/config.functions.php
r10678 r10701 17 17 'ARI_ADMIN_PASSWORD' => array('std' , 'ari_password'), 18 18 'TCINTERVAL '=> array('std' , '60'), 19 'CFRINGTIMERDEFAULT' => array('std' , '0'), 19 20 20 21 'ASTETCDIR' => array('dir' , '/etc/asterisk'), freepbx/branches/bootstrap/amp_conf/htdocs/admin/libraries/module.functions.php
r10671 r10701 832 832 } 833 833 834 if (!preg_match('/\.(tar\.gz|tgz )$/', $uploaded_file['name'])) {835 $errors[] = _("File must be in tar +gzip (.tgz or .tar.gz) format");834 if (!preg_match('/\.(tar\.gz|tgz|tar)$/', $uploaded_file['name'])) { 835 $errors[] = _("File must be in tar or tar+gzip (.tar, .tgz or .tar.gz) format"); 836 836 return $errors; 837 837 } 838 838 839 if (!preg_match('/^([A-Za-z][A-Za-z0-9_]+)\-([0-9a-zA-Z]+(\.[0-9a-zA-Z]+)*)\.(tar\.gz|tgz )$/', $uploaded_file['name'], $matches)) {840 $errors[] = _("Filename not in correct format: must be modulename-version. tar.gz (eg. custommodule-0.1.tar.gz)");839 if (!preg_match('/^([A-Za-z][A-Za-z0-9_]+)\-([0-9a-zA-Z]+(\.[0-9a-zA-Z]+)*)\.(tar\.gz|tgz|tar)$/', $uploaded_file['name'], $matches)) { 840 $errors[] = _("Filename not in correct format: must be modulename-version.[tar|tar.gz|tgz] (eg. custommodule-0.1.tgz)"); 841 841 return $errors; 842 842 } else { … … 853 853 move_uploaded_file($uploaded_file['tmp_name'], $filename); 854 854 855 exec("tar ztf ".escapeshellarg($filename), $output, $exitcode); 855 $tar_z_arg = substr($uploaded_file['name'],-4) == '.tar' ? '' : 'z'; 856 exec("tar ".$tar_z_arg."tf ".escapeshellarg($filename), $output, $exitcode); 856 857 if ($exitcode != 0) { 857 $errors[] = _("Error untaring uploaded file. Must be a tar +gzip file");858 $errors[] = _("Error untaring uploaded file. Must be a tar or tar+gzip file"); 858 859 return $errors; 859 860 } … … 879 880 return array(sprintf(_('Could not remove %s to install new version'), $amp_conf['AMPWEBROOT'].'/admin/modules/_cache/'.$modulenam)); 880 881 } 881 exec("tar zxf ".escapeshellarg($filename)." -C ".escapeshellarg($amp_conf['AMPWEBROOT'].'/admin/modules/_cache/'), $output, $exitcode);882 exec("tar ".$tar_z_arg."xf ".escapeshellarg($filename)." -C ".escapeshellarg($amp_conf['AMPWEBROOT'].'/admin/modules/_cache/'), $output, $exitcode); 882 883 if ($exitcode != 0) { 883 884 return array(sprintf(_('Could not untar %s to %s'), $filename, $amp_conf['AMPWEBROOT'].'/admin/modules/_cache')); freepbx/branches/bootstrap/amp_conf/htdocs/recordings/modules/phonefeatures.module
r10317 r10701 46 46 $this->storePhoneSetting( $args, $exten, 'do_not_disturb', 'DND', 'YES'); 47 47 $this->storeCallScreen( $args, $exten); 48 $this->storeRingtimer($args, $exten, 'ringtimer'); 49 $this->storeRingtimer($args, $exten, 'cfringtimer'); 48 50 } 49 51 } … … 99 101 $dnd_cw_text.= $this->displayPhoneControls( $exten, 'do_not_disturb', 'DND', _("Do Not Disturb")); 100 102 $dnd_cw_text.= $this->displayCallScreenControls( $exten); 103 104 $dnd_cw_text.= $this->displayRingTimerControls($exten, 'ringtimer'); 105 $dnd_cw_text.= $this->displayRingTimerControls($exten, 'cfringtimer'); 101 106 102 107 $dnd_cw_text .= "</table>"; … … 431 436 } 432 437 438 //***************************************************************************** 439 function storeRingtimer($args, $exten, $type) { 440 441 global $astman; 442 443 $ringtimer = (int) getArgument( $args, $type); 444 445 if ($ringtimer > 120) 446 $ringtimer = 120; 447 448 switch($type){ 449 case 'cfringtimer': 450 if ($ringtimer < -1) 451 $ringtimer = -1; 452 453 $astman->database_put("AMPUSER", $exten . '/cfringtimer', $ringtimer); 454 break; 455 case 'ringtimer': 456 if ($ringtimer < 0) 457 $ringtimer = 0; 458 459 $astman->database_put("AMPUSER", $exten . '/ringtimer', $ringtimer); 460 break; 461 } 462 } 463 464 //***************************************************************************** 465 function getRingTimer($exten, $type) { 466 467 global $astman; 468 469 $ringtimer = (int) $astman->database_get("AMPUSER", $exten . '/' . $type); 470 471 return $ringtimer; 472 } 473 474 //***************************************************************************** 475 function displayRingTimerControls($exten, $type) 476 { 477 478 $ringtimer = $this->getRingTimer($exten, $type); 479 480 $ret = "\n<tr>"; 481 if($type == 'cfringtimer') 482 $ret.= "<td><a href='#' class='info'>" . _("CallForward Ringtimer:") . "<span>" . _("Number of seconds to ring prior to going to voicemail or other fail over destinations that may be setup by an administrator on this account. The Always setting will ring the call forward destinaiton until answered or the caller hangs up. The Default setting will use the value set in Ring Time. Your setting here will be forced to Always if there is no Voicemail or alternartive fail over destination for a call to go to.") . " </span></a></td>"; 483 else 484 $ret.= "<td><a href='#' class='info'>" . _("Ringtimer:") . "<span>" . _("Number of seconds to ring prior to going to voicemail or ringing other numbers that may be configured such as a Call Forward Unavailabe or an Unavailable destination that may be configured by your administrator. The Default setting will use the value set for the PBX.") . " </span></a></td>"; 485 $ret .= "<td>"; 486 $ret .= "<select name='$type'>"; 487 $ret .= '<option value="0" ' . (0 == $ringtimer ? 'selected' : '') . '>' . _("Default") . '</option>'; 488 if($type == 'cfringtimer') 489 $ret .= '<option value="-1" ' . (-1 == $ringtimer ? 'selected' : '') . '>' . _("Always") . '</option>'; 490 for ($i=1; $i <= 120; $i++) { 491 $ret .= '<option value="' . $i . '" ' . ($i == $ringtimer ? 'selected' : '') . '>' . $i . '</option>'; 492 } 493 $ret .= "</select>"; 494 $ret .= "</td>"; 495 $ret .= "</tr>\n"; 496 497 return $ret; 498 } 433 499 } // class 434 500 ?>
