diff --git a/changelog.md b/changelog.md index 4b531f892..e610c8570 100755 --- a/changelog.md +++ b/changelog.md @@ -1,7 +1,8 @@ 2.1.27 - #1769 Installation issue - no admin account is created #1775 Can not decrypt a created crypted Backup - Improved encryption with Defuse + #1774 Announce this Item by email + #1769 Installation issue - no admin account is created New: Multiselection in Roles vs Folders matrix New: LDAP configuration test mode (in progress) diff --git a/items.load.php b/items.load.php index c2b7512cf..f60e0af0d 100755 --- a/items.load.php +++ b/items.load.php @@ -602,9 +602,6 @@ function AjouterItem() || $("#create_item_without_password").val() === "1" ) { - var annonce = 0; - if ($('#annonce').is(':checked')) annonce = 1; - //Manage restrictions var restriction = restriction_role = ""; $("#restricted_to_list option:selected").each(function () {console.log($(this).val()); @@ -675,7 +672,7 @@ function AjouterItem() '"login":"' + sanitizeString($('#item_login').val()) + '", "is_pf":"' + is_pf + '", ' + '"description":"' + (description) + '", "email":"' + $('#email').val() + '", "url":"' + url + '", "categorie":"' + selected_folder + '", ' + '"restricted_to":"' + restriction + '", "restricted_to_roles":"' + restriction_role + '", "salt_key_set":"' + $('#personal_sk_set').val()+ - '", "annonce":"' + annonce + '", "diffusion":"' + diffusion + '", "id":"' + $('#id_item').val() + '", ' + + '", "diffusion":"' + diffusion + '", "id":"' + $('#id_item').val() + '", ' + '"anyone_can_modify":"' + $('#anyone_can_modify:checked').val() + '", "tags":"' + sanitizeString($('#item_tags').val())+ '", "random_id_from_files":"' + $('#random_id').val() + '", "to_be_deleted":"' + to_be_deleted + '", "fields":"' + sanitizeString(fields) + '", ' + '"complexity_level":"' + parseInt($("#mypassword_complex").val()) + '"}'; diff --git a/sources/admin.queries.php b/sources/admin.queries.php index ffa50d0e5..30d886a89 100644 --- a/sources/admin.queries.php +++ b/sources/admin.queries.php @@ -1130,8 +1130,12 @@ * Test the email configuraiton */ case "admin_email_test_configuration": - require_once $_SESSION['settings']['cpassman_dir'].'/sources/main.functions.php'; - echo '[{"result":"email_test_conf", '.sendEmail($LANG['admin_email_test_subject'], $LANG['admin_email_test_body'], $_SESSION['user_email']).'}]'; + if (empty($_SESSION['user_email'])) { + echo '[{"result":"email_test_conf", "error":"error_mail_not_send" , "message":"User has no email defined!"}]'; + } else { + require_once $_SESSION['settings']['cpassman_dir'].'/sources/main.functions.php'; + echo '[{"result":"email_test_conf", '.sendEmail($LANG['admin_email_test_subject'], $LANG['admin_email_test_body'], $_SESSION['user_email']).'}]'; + } break; /* diff --git a/sources/items.queries.php b/sources/items.queries.php index 67220266c..9769945cb 100644 --- a/sources/items.queries.php +++ b/sources/items.queries.php @@ -309,7 +309,7 @@ } // Announce by email? - if ($dataReceived['annonce'] == 1) { + if ($dataReceived['diffusion'] !== "") { // get links url if (empty($_SESSION['settings']['email_server_url'])) { $_SESSION['settings']['email_server_url'] = $_SESSION['settings']['cpassman_url'];