From f12585297974a994bd9b081cd1d70e8ab8d2365e Mon Sep 17 00:00:00 2001 From: jeremie kornobis Date: Mon, 26 Nov 2012 14:12:48 +0100 Subject: Add new identity level: one identity with edit only signature --- program/steps/settings/edit_identity.inc | 7 +++++++ program/steps/settings/save_identity.inc | 2 +- 2 files changed, 8 insertions(+), 1 deletion(-) (limited to 'program/steps') diff --git a/program/steps/settings/edit_identity.inc b/program/steps/settings/edit_identity.inc index aa1aeea5d..7e7be1f83 100644 --- a/program/steps/settings/edit_identity.inc +++ b/program/steps/settings/edit_identity.inc @@ -97,6 +97,13 @@ function rcube_identity_form($attrib) $form['addressing']['content']['email']['class'] = 'disabled'; } + if (IDENTITIES_LEVEL == 4) { + foreach($form['addressing']['content'] as $formfield => $value){ + $form['addressing']['content'][$formfield]['disabled'] = true; + $form['addressing']['content'][$formfield]['class'] = 'disabled'; + } + } + $IDENTITY_RECORD['email'] = rcube_idn_to_utf8($IDENTITY_RECORD['email']); // Allow plugins to modify identity form content diff --git a/program/steps/settings/save_identity.inc b/program/steps/settings/save_identity.inc index 8515c44f1..7ca54a179 100644 --- a/program/steps/settings/save_identity.inc +++ b/program/steps/settings/save_identity.inc @@ -26,7 +26,7 @@ $a_boolean_cols = array('standard', 'html_signature'); $updated = $default_id = false; // check input -if (empty($_POST['_name']) || (empty($_POST['_email']) && IDENTITIES_LEVEL != 1 && IDENTITIES_LEVEL != 3)) +if (IDENTITIES_LEVEL != 4 && (empty($_POST['_name']) || (empty($_POST['_email']) && IDENTITIES_LEVEL != 1 && IDENTITIES_LEVEL != 3))) { $OUTPUT->show_message('formincomplete', 'warning'); rcmail_overwrite_action('edit-identity'); -- cgit v1.2.3 From c753bc4a8bc96680e0534ab115cb2f0f1fc67512 Mon Sep 17 00:00:00 2001 From: jeremie kornobis Date: Mon, 26 Nov 2012 15:06:54 +0100 Subject: unset email address with new level entity 4 --- program/steps/settings/save_identity.inc | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'program/steps') diff --git a/program/steps/settings/save_identity.inc b/program/steps/settings/save_identity.inc index 7ca54a179..c3b8cc4a7 100644 --- a/program/steps/settings/save_identity.inc +++ b/program/steps/settings/save_identity.inc @@ -52,9 +52,18 @@ foreach ($a_boolean_cols as $col) } // unset email address if user has no rights to change it -if (IDENTITIES_LEVEL == 1 || IDENTITIES_LEVEL == 3) +if (IDENTITIES_LEVEL == 1 || IDENTITIES_LEVEL == 3 ) unset($save_data['email']); +if (IDENTITIES_LEVEL == 4 ){ + unset($save_data['name']); + unset($save_data['email']); + unset($save_data['organization']); + unset($save_data['reply-to']); + unset($save_data['bcc']); + unset($save_data['standard']); +} + // Validate e-mail addresses $email_checks = array(rcube_idn_to_ascii($save_data['email'])); foreach (array('reply-to', 'bcc') as $item) { -- cgit v1.2.3