Skip to content

Commit c2ae7e4

Browse files
authored
Fix multiple small bugs (hestiacp#2052)
* Issue with jQuery + Add user page * Use name of user instead "Hestia control user" * Update changelog
1 parent 09d760e commit c2ae7e4

File tree

11 files changed

+25
-18
lines changed

11 files changed

+25
-18
lines changed

CHANGELOG.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,10 @@ All notable changes to this project will be documented in this file.
1010

1111
### Bugfixes
1212

13-
- Fixed UI issues after upgrade jQuery + jQuery UI to last version (#2021 and #2032)
13+
- Fixed UI issues after upgrade jQuery + jQuery UI to last version (#2021 and #2032) + [forum](https://forum.hestiacp.com/t/confusion-about-send-welcome-email-checkbox/4259/11)
1414
- Fixed security issues in caching templates of Nginx when used as Reverse Proxy
15+
- Fixed an issue with deleting multiple mail accounts (#2047)
16+
- Fixed an issue with phpmailer + non latin characters (#2050) thanks @Faymir
1517

1618
## [1.4.9] - Service release
1719

web/add/user/index.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@
114114
}
115115

116116
$mailtext .= sprintf(_('ACCOUNT_READY'),$_SERVER['HTTP_HOST'],$_POST['v_username'],$_POST['v_password']);
117-
send_email($to, $subject, $mailtext, $from, $from_name);
117+
send_email($to, $subject, $mailtext, $from, $from_name, $_POST['name']);
118118
putenv("LANGUAGE=".detect_user_language());
119119
}
120120

web/inc/main.php

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -294,8 +294,7 @@ function get_percentage($used,$total) {
294294
return $percent;
295295
}
296296

297-
function send_email($to, $subject, $mailtext, $from, $from_name) {
298-
297+
function send_email($to, $subject, $mailtext, $from, $from_name, $to_name = '') {
299298
$mail = new PHPMailer();
300299

301300
if (isset($_SESSION['USE_SERVER_SMTP']) && $_SESSION['USE_SERVER_SMTP'] == "true") {
@@ -314,7 +313,11 @@ function send_email($to, $subject, $mailtext, $from, $from_name) {
314313

315314
$mail->IsHTML(true);
316315
$mail->ClearReplyTos();
317-
$mail->AddAddress($to, "Hestia Control Panel User");
316+
if (empty($to_name)){
317+
$mail->AddAddress($to);
318+
}else{
319+
$mail->AddAddress($to, $to_name);
320+
}
318321
$mail->SetFrom($from, $from_name);
319322

320323
$mail->CharSet = "utf-8";

web/js/init.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -198,7 +198,7 @@ $(document).ready(function(){
198198
}
199199
}
200200
else {
201-
if ($('.l-unit .ch-toggle:eq(0)').attr('checked')) {
201+
if ($('.l-unit .ch-toggle:eq(0)').prop('checked')) {
202202
$('.l-unit').removeClass('selected');
203203
$('.l-unit .ch-toggle').prop('checked', false);
204204
}

web/js/jquery/jquery.finder.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -214,7 +214,7 @@
214214
shortcut.add("Ctrl+a", function(evt){
215215
if(jQuery('.ch-toggle:checked').length > 0) {
216216
f.t.unHAll(p, o);
217-
jQuery('.ch-toggle:checked').attr('checked', false);
217+
jQuery('.ch-toggle:checked').prop('checked', false);
218218
} else {
219219
f.t.hAll(p,o);
220220
}
@@ -231,7 +231,7 @@
231231
//if(f.detect.alt(e)) {
232232
if(jQuery('.ch-toggle:checked').length > 0) {
233233
f.t.unHAll(p, o);
234-
jQuery('.ch-toggle:checked').attr('checked', false);
234+
jQuery('.ch-toggle:checked').prop('checked', false);
235235
} else {
236236
f.t.hAll(p,o);
237237
}

web/js/pages/add_user.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
$(function() {
22
$('#v_email').change(function() {
3-
if($('#v_email_notify').attr('checked')){
3+
if($('#v_email_notify').prop('checked')){
44
document.getElementById('v_notify').value = document.getElementById('v_email').value;
55
}
66
});
77
$('#v_email_notify').change(function() {
8-
if($('#v_email_notify').attr('checked')){
8+
if($('#v_email_notify').prop('checked')){
99
document.getElementById('v_notify').value = document.getElementById('v_email').value;
1010
}else{
1111
document.getElementById('v_notify').value = '';

web/js/pages/add_web.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,7 @@ App.Actions.WEB.remove_ftp_user = function(elm) {
158158

159159

160160
App.Actions.WEB.toggle_additional_ftp_accounts = function(elm) {
161-
if ($(elm).attr('checked')) {
161+
if ($(elm).prop('checked')) {
162162
$('.ftptable-nrm, .v-add-new-user, .add-new-ftp-user-button').show();
163163
$('.ftptable-nrm').each(function(i, elm) {
164164
var login = $(elm).find('.v-ftp-user');
@@ -193,7 +193,7 @@ App.Actions.WEB.toggle_additional_ftp_accounts = function(elm) {
193193
}
194194

195195
App.Actions.WEB.toggle_letsencrypt = function(elm) {
196-
if ($(elm).attr('checked')) {
196+
if ($(elm).prop('checked')) {
197197
$('#ssltable textarea[name=v_ssl_crt],#ssltable textarea[name=v_ssl_key], #ssltable textarea[name=v_ssl_ca]').attr('disabled', 'disabled');
198198
$('#generate-csr').hide();
199199
$('.lets-encrypt-note').show();

web/js/pages/edit_mail.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
App.Actions.MAIL.toggle_letsencrypt = function(elm) {
2-
if ($(elm).attr('checked')) {
2+
if ($(elm).prop('checked')) {
33
$('#ssltable textarea[name=v_ssl_crt],#ssltable textarea[name=v_ssl_key], #ssltable textarea[name=v_ssl_ca]').attr('disabled', 'disabled');
44
$('#generate-csr').hide();
55
if(!$('.lets-encrypt-note').hasClass('enabled')){

web/js/pages/edit_web.js

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -294,9 +294,11 @@ function FTPrandom(elm) {
294294
App.Actions.WEB.randomPasswordGenerated && App.Actions.WEB.randomPasswordGenerated(elm);
295295
}
296296

297-
function elementHideShow(elementToHideOrShow){
298-
var el = document.getElementById(elementToHideOrShow);
299-
el.style.display = el.style.display === 'none' ? 'block' : 'none';
297+
function elementHideShow(element){
298+
if ( document.getElementById(element)){
299+
var el = document.getElementById(element);
300+
el.style.display = el.style.display === 'none' ? 'block' : 'none';
301+
}
300302
}
301303

302304
$('.v-redirect-custom-value').change( function(){

web/reset/index.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@
4343
}
4444
if (in_array(str_replace(':'.$_SERVER['SERVER_PORT'],'.conf',$_SERVER['HTTP_HOST']), array_merge(scandir('/etc/nginx/conf.d'),scandir('/etc/nginx/conf.d/domains'),scandir('/etc/apache2/conf.d/domains'),scandir('/etc/apache2/conf.d')))){
4545
$mailtext .= sprintf(_('PASSWORD_RESET_REQUEST'),$_SERVER['HTTP_HOST'],$user,$rkey,$_SERVER['HTTP_HOST'],$user,$rkey);
46-
if (!empty($rkey)) send_email($to, $subject, $mailtext, $from, $from_name);
46+
if (!empty($rkey)) send_email($to, $subject, $mailtext, $from, $from_name, $data[$user]['NAME']);
4747
header("Location: /reset/?action=code&user=".$_POST['user']);
4848
exit;
4949
} else {

0 commit comments

Comments
 (0)