Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions functions.inc.php
Original file line number Diff line number Diff line change
Expand Up @@ -320,7 +320,7 @@ function voicemail_configpageinit($pagename) {

// JS for verifying an empty password is OK
$msg = _('Voicemail is enabled but the Voicemail Password field is empty. Are you sure you wish to continue?');
$js = 'if(theForm.vmpwd.value.match(/^[0-9A-D\*#]*$/i)) {return true;}else{return false;}';
$js = 'if(theForm.vmpwd.value.match(/^\-{0,1}[0-9A-D\*#]+$/i)) {return true;}else{return false;}';
$js = 'if (theForm.vmpwd.value == "") { if(confirm("'.$msg.'")) { return true } else { return false; }} else { '.$js.' };';
$currentcomponent->addjsfunc('isValidVoicemailPass(notused)', $js);

Expand Down Expand Up @@ -495,7 +495,7 @@ function voicemail_configpageload() {

$fc_vm = featurecodes_getFeatureCode('voicemail', 'dialvoicemail');

$msgInvalidVmPwd = _("Please enter a valid Voicemail Password, using digits only");
$msgInvalidVmPwd = _("Please enter a valid Voicemail Password, using digits only (and an optional starting '-')");
$msgInvalidEmail = _("Please enter a valid Email Address");
$msgInvalidPager = _("Please enter a valid Pager Email Address");
$msgInvalidVMContext = _("VM Context cannot be blank");
Expand All @@ -511,7 +511,7 @@ function voicemail_configpageload() {
$currentcomponent->addguielem($section, new gui_radio([...$guidefaults, ...$el]),$category);
$disable = ($vmselect == 'disabled');

$el = ["elemname" => "vmpwd", "prompttext" => _('Voicemail Password'), "helptext" => sprintf(_("This is the password used to access the Voicemail system.%sThis password can only contain numbers.%sA user can change the password you enter here after logging into the Voicemail system (%s) with a phone."),"<br /><br />","<br /><br />",$fc_vm), "currentvalue" => $vmpwd, "jsvalidation" => "frm_{$display}_isVoiceMailEnabled() && !frm_{$display}_isValidVoicemailPass()", "failvalidationmsg" => $msgInvalidVmPwd, "canbeempty" => false, "class" => "$class confidential", "disable" => $disable];
$el = ["elemname" => "vmpwd", "prompttext" => _('Voicemail Password'), "helptext" => sprintf(_("This is the password used to access the Voicemail system.%sThis password can only contain numbers.%sIf the password is prefixed by '-', then it is locked. Otherwise a user can change the password you enter here after logging into the Voicemail system (%s) with a phone."),"<br /><br />","<br /><br />",$fc_vm), "currentvalue" => $vmpwd, "jsvalidation" => "frm_{$display}_isVoiceMailEnabled() && !frm_{$display}_isValidVoicemailPass()", "failvalidationmsg" => $msgInvalidVmPwd, "canbeempty" => false, "class" => "$class confidential", "disable" => $disable];

$currentcomponent->addguielem($section, new gui_textbox([...$guidefaults, ...$el]),$category);
//for passwordless voicemail we need to check some settings
Expand Down
2 changes: 1 addition & 1 deletion page.voicemail.php
Original file line number Diff line number Diff line change
Expand Up @@ -287,7 +287,7 @@
"vm-reenterpassword" => _("Customize which sound file is used instead of the default prompt that says: \"Please re-enter your password followed by the pound key\""),
"volgain" => _("Emails bearing the Voicemail may arrive in a volume too quiet to be heard. This parameter allows you to specify how much gain to add to the message when sending a Voicemail. NOTE: sox must be installed for this option to work.")
),
"account" => array("pwd" => _("This is the password used to access the Voicemail system.<br /><br />This password can only contain numbers.<br /><br />A user can change the password you enter here after logging into the Voicemail system (*98) with a phone."),
"account" => array("pwd" => _("This is the password used to access the Voicemail system.<br /><br />This password can only contain numbers.<br /><br />If the password is prefixed by '-', then it is locked. Otherwise a user can change the password you enter here after logging into the Voicemail system (*98) with a phone."),
"attach" => _("Option to attach Voicemails to email."),
"attachfmt" => _("Which format of audio file to attach to the email."),
"backupdeleted" => _("No. of deleted messages saved per mailbox (can be a number or yes/no, yes meaning MAXMSG, no meaning 0)."),
Expand Down
9 changes: 8 additions & 1 deletion ucp/Voicemail.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -570,7 +570,14 @@ public function ajaxHandler() {
$envelope = ($_POST['envelope'] == 'true') ? true : false;
$delete = ($_POST['vmdelete'] == 'true') ? true : false;
$attach = ($_POST['attach'] == 'true') ? true : false;
$status = $this->UCP->FreePBX->Voicemail->saveVMSettingsByExtension($ext, $_POST['pwd'], $_POST['email'], $_POST['pager'], $saycid, $envelope, $attach, $delete);
$settings = $this->UCP->FreePBX->Voicemail->getVoicemailBoxByExtension($ext);
if (str_starts_with($settings['pwd'], '-')) {
$pwd = $settings['pwd'];
}
else {
$pwd = $_POST['pwd'];
}
$status = $this->UCP->FreePBX->Voicemail->saveVMSettingsByExtension($ext, $pwd, $_POST['email'], $_POST['pager'], $saycid, $envelope, $attach, $delete);
$return = array( "status" => $status, "message" => "" );
break;
case "upload":
Expand Down
3 changes: 2 additions & 1 deletion ucp/views/vmsettings.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,9 @@
<div class="col-xs-12">
<div class="form-group">
<label for="pwd" class="help"><?php echo _('Voicemail Pin')?> <i class="fa fa-question-circle"></i></label>
<input name="pwd" type="number" class="form-control" id="pwd" value="<?php echo $settings['pwd']?>" autocapitalize="off" autocorrect="off">
<input name="pwd" type="number" class="form-control" id="pwd" value="<?php echo ltrim($settings['pwd'], '-'); ?>" autocapitalize="off" autocorrect="off"<?php if(str_starts_with($settings['pwd'], '-')) { echo " disabled";}?>>
<span class="help-block help-hidden" data-for="pwd"><?php echo _('Pin Used to Login to Voicemail. This pin can only contain numbers.')?></span>
<?php if(str_starts_with($settings['pwd'], '-')) { echo _('Password is locked by the system administrator!');}?>
</div>
<div class="form-group">
<label for="email" class="help"><?php echo _('Email Address')?> <i class="fa fa-question-circle"></i></label>
Expand Down