Changeset 2006 in subversion
- Timestamp:
- Oct 24, 2008 3:57:21 AM (5 years ago)
- Location:
- trunk/roundcubemail
- Files:
-
- 12 edited
-
CHANGELOG (modified) (1 diff)
-
config/main.inc.php.dist (modified) (1 diff)
-
installer/config.php (modified) (1 diff)
-
program/include/rcmail.php (modified) (1 diff)
-
program/js/app.js (modified) (1 diff)
-
program/steps/settings/edit_identity.inc (modified) (5 diffs)
-
program/steps/settings/func.inc (modified) (1 diff)
-
program/steps/settings/identities.inc (modified) (2 diffs)
-
program/steps/settings/save_identity.inc (modified) (4 diffs)
-
skins/default/settings.css (modified) (1 diff)
-
skins/default/templates/editidentity.html (modified) (2 diffs)
-
skins/default/templates/identities.html (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/roundcubemail/CHANGELOG
r2003 r2006 1 1 CHANGELOG RoundCube Webmail 2 2 --------------------------- 3 4 2008/10/24 (alec) 5 ---------- 6 - Added option 'identities_level', removed 'multiple_identities' 7 - Allow deleting identities when multiple_identities=false (#1485435) 3 8 4 9 2008/10/22 (alec) -
trunk/roundcubemail/config/main.inc.php.dist
r2005 r2006 286 286 $rcmail_config['dont_override'] = array(); 287 287 288 // allow users to add and delete sender identities 289 $rcmail_config['multiple_identities'] = true; 288 // Set identities access level: 289 // 0 - many identities with possibility to edit all params 290 // 1 - many identities with possibility to edit all params but not email address 291 // 2 - one identity with possibility to edit all params 292 // 3 - one identity with possibility to edit all params but not email address 293 $rcmail_config['identities_level'] = 0; 290 294 291 295 // try to load host-specific configuration -
trunk/roundcubemail/installer/config.php
r1977 r2006 123 123 </dd> 124 124 125 <dt class="propname">identities_level</dt> 126 <dd> 127 <?php 128 129 $input_ilevel = new html_select(array('name' => '_identities_level', 'id' => "cfgidentitieslevel")); 130 $input_ilevel->add('many identities with possibility to edit all params', 0); 131 $input_ilevel->add('many identities with possibility to edit all params but not email address', 1); 132 $input_ilevel->add('one identity with possibility to edit all params', 2); 133 $input_ilevel->add('one identity with possibility to edit all params but not email address', 3); 134 echo $input_ilevel->show($RCI->getprop('identities_level'), 0); 135 136 ?> 137 <div>Level of identities access</div> 138 <p class="hint">Defines what users can do with their identities.</p> 139 </dd> 140 125 141 </dl> 126 142 </fieldset> -
trunk/roundcubemail/program/include/rcmail.php
r1895 r2006 434 434 // lowercase username if it's an e-mail address (#1484473) 435 435 if (strpos($username, '@')) 436 $username = strtolower($username);436 $username = rc_strtolower($username); 437 437 438 438 // user already registered -> overwrite username -
trunk/roundcubemail/program/js/app.js
r2003 r2006 289 289 290 290 if (this.env.action=='identities' || this.env.action=='edit-identity' || this.env.action=='add-identity') { 291 this.enable_command('add', 'delete', this.env.multiple_identities);292 this.enable_command(' edit', true);291 this.enable_command('add', this.env.identities_level < 2); 292 this.enable_command('delete', 'edit', true); 293 293 } 294 294 -
trunk/roundcubemail/program/steps/settings/edit_identity.inc
r1859 r2006 20 20 */ 21 21 22 $OUTPUT->set_pagetitle(rcube_label('identities'));22 define('IDENTITIES_LEVEL', intval($RCMAIL->config->get('identities_level', 0))); 23 23 24 // edit-identity 24 25 if (($_GET['_iid'] || $_POST['_iid']) && $RCMAIL->action=='edit-identity') { 25 26 $IDENTITY_RECORD = $USER->get_identity(get_input_value('_iid', RCUBE_INPUT_GPC)); … … 28 29 $OUTPUT->set_env('iid', $IDENTITY_RECORD['identity_id']); 29 30 } 30 else if (!$RCMAIL->config->get('multiple_identities', true)) { 31 $OUTPUT->show_message('opnotpermitted', 'error'); 32 // go to identities page 33 rcmail_overwrite_action('identities'); 34 return; 31 // add-identity 32 else { 33 if (IDENTITIES_LEVEL > 1) { 34 $OUTPUT->show_message('opnotpermitted', 'error'); 35 // go to identities page 36 rcmail_overwrite_action('identities'); 37 return; 38 } 39 else if (IDENTITIES_LEVEL == 1) 40 $IDENTITY_RECORD['email'] = rcmail_get_email(); 35 41 } 36 37 $OUTPUT->include_script('list.js');38 42 39 43 … … 86 90 'standard' => array('type' => 'checkbox', 'label' => 'setdefault')); 87 91 88 92 // disable some field according to access level 93 if (IDENTITIES_LEVEL == 1 || IDENTITIES_LEVEL == 3) { 94 $a_show_cols['email']['disabled'] = true; 95 $a_show_cols['email']['class'] = 'disabled'; 96 } 97 89 98 // a specific part is requested 90 99 if ($attrib['part']) … … 132 141 } 133 142 143 $OUTPUT->include_script('list.js'); 134 144 $OUTPUT->add_handler('identityform', 'rcube_identity_form'); 145 $OUTPUT->set_env('identities_level', IDENTITIES_LEVEL); 135 146 136 147 $OUTPUT->set_pagetitle(rcube_label(($RCMAIL->action=='add-identity' ? 'newidentity' : 'edititem'))); … … 140 151 141 152 $OUTPUT->send('editidentity'); 153 142 154 ?> -
trunk/roundcubemail/program/steps/settings/func.inc
r2003 r2006 402 402 } 403 403 404 $OUTPUT->set_env('multiple_identities', $RCMAIL->config->get('multiple_identities', true)); 404 405 function rcmail_get_email() 406 { 407 global $RCMAIL; 408 409 if (strpos($RCMAIL->user->data['username'], '@')) 410 return $RCMAIL->user->data['username']; 411 else { 412 if ($RCMAIL->config->get('virtuser_file')) 413 $user_email = rcube_user::user2email($RCMAIL->user->data['username']); 414 415 if ($user_email == '') 416 $user_email = sprintf('%s@%s', $RCMAIL->user->data['username'], 417 $RCMAIL->config->mail_domain($_SESSION['imap_host'])); 418 419 return $user_email; 420 } 421 } 405 422 406 423 // register UI objects -
trunk/roundcubemail/program/steps/settings/identities.inc
r1871 r2006 19 19 20 20 */ 21 22 define('IDENTITIES_LEVEL', intval($RCMAIL->config->get('identities_level', 0))); 21 23 22 24 $OUTPUT->set_pagetitle(rcube_label('identities')); … … 41 43 42 44 $OUTPUT->add_handler('identityframe', 'rcmail_identity_frame'); 45 $OUTPUT->set_env('identities_level', IDENTITIES_LEVEL); 43 46 44 47 $OUTPUT->send('identities'); -
trunk/roundcubemail/program/steps/settings/save_identity.inc
r1987 r2006 20 20 */ 21 21 22 define('IDENTITIES_LEVEL', intval($RCMAIL->config->get('identities_level', 0))); 23 22 24 $a_save_cols = array('name', 'email', 'organization', 'reply-to', 'bcc', 'standard', 'signature', 'html_signature'); 23 25 $a_html_cols = array('signature'); … … 26 28 27 29 // check input 28 if (empty($_POST['_name']) || empty($_POST['_email']))30 if (empty($_POST['_name']) || (empty($_POST['_email']) && IDENTITIES_LEVEL != 1 && IDENTITIES_LEVEL != 3)) 29 31 { 30 32 $OUTPUT->show_message('formincomplete', 'warning'); … … 50 52 $save_data[$col] = 0; 51 53 } 54 55 // unset email address if user has no rights to change it 56 if (IDENTITIES_LEVEL == 1 || IDENTITIES_LEVEL == 3) 57 unset($save_data['email']); 52 58 53 59 … … 78 84 79 85 // insert a new identity record 80 else if ( $RCMAIL->config->get('multiple_identities', true))86 else if (IDENTITIES_LEVEL < 2) 81 87 { 82 if ($insert_id = $USER->insert_identity($save_data)) 88 if (IDENTITIES_LEVEL == 1) 89 $save_data['email'] = rcmail_get_email(); 90 91 if ($save_data['email'] && ($insert_id = $USER->insert_identity($save_data))) 83 92 { 84 93 $OUTPUT->show_message('successfullysaved', 'confirmation'); -
trunk/roundcubemail/skins/default/settings.css
r1903 r2006 160 160 text-align: right; 161 161 padding-right: 10px; 162 } 163 164 input.disabled 165 { 166 color: #999999; 162 167 } 163 168 -
trunk/roundcubemail/skins/default/templates/editidentity.html
r1912 r2006 18 18 19 19 <p id="listbuttons"> 20 <roundcube:button command="add" type="input" label="newidentity" class="button" condition="config: multiple_identities:true" />20 <roundcube:button command="add" type="input" label="newidentity" class="button" condition="config:identities_level:0<2" /> 21 21 </p> 22 22 … … 28 28 29 29 <p><br /> 30 <roundcube:button command="delete" type="input" class="button" label="delete" condition="env:action=='edit-identity' &&config:multiple_identities:true" style="margin-right:0.5em" />30 <roundcube:button command="delete" type="input" class="button" label="delete" condition="env:action=='edit-identity'" style="margin-right:0.5em" /> 31 31 <roundcube:button command="save" type="input" class="button mainaction" label="save" /> 32 32 </p> -
trunk/roundcubemail/skins/default/templates/identities.html
r1912 r2006 18 18 19 19 <p id="listbuttons"> 20 <roundcube:button command="add" type="input" label="newidentity" class="button" condition="config: multiple_identities:true" />20 <roundcube:button command="add" type="input" label="newidentity" class="button" condition="config:identities_level:0<2" /> 21 21 </p> 22 22
Note: See TracChangeset
for help on using the changeset viewer.
