- <form method="post" action="<?php echo $default->base_url; ?>">
- <?php
- $form_mode = PIMP_MAIL_PREF_SERVER;
- $name = 'session_id';
- $value = $session_id;
- include( './templates/form/form_hidden_elem.inc' );
- $current_server_settings = new MailServerSettings();
- if (
- $mail_server_name != '' ||
- $mail_user_name != '' ||
- $mail_user_password != '' ||
- $mail_from_address != '' ||
- $mail_from_name != '' ||
- $server_type != ''
- ) {
- /* Perform a modify */
- $ret_vals = $server_settings_db->Get( $user_obj->user_id );
- if ( $ret_vals[ 0 ] == 1 ) {
- $current_server_settings = $ret_vals[ 1 ];
- }
- $current_server_settings->user_id = $user_obj->user_id;
- if ( $default->pimp->user_change_server == 1 ) {
- $current_server_settings->server_name = $mail_server_name;
- }
- if ( $default->pimp->user_change_username == 1 ) {
- $current_server_settings->server_username = $mail_user_name;
- }
- if ( $default->pimp->user_change_password == 1 ) {
- $current_server_settings->server_password = $mail_user_password;
- }
- if ( $default->pimp->user_change_server_type == 1) {
- $current_server_settings->server_type = $server_type;
- }
- if ( $default->pimp->user_change_email_address == 1 ) {
- $current_server_settings->from_address = $mail_from_address;
- }
- if ( $default->pimp->user_change_from_name == 1 ) {
- $current_server_settings->from_name = $mail_from_name;
- }
- if ( $default->pimp->user_change_server_type == 1 ) {
- $current_server_settings->server_type = $mail_type;
- }
- $server_settings_db->Modify( $current_server_settings );
- }
- $ret_vals = $server_settings_db->Get( $user_obj->user_id );
- if ( $ret_vals[ 0 ] == 0 ) {
- $current_server_settings->user_id = $user_obj->user_id;
- $server_settings_db->Add( $current_server_settings );
- } else {
- $current_server_settings = $ret_vals[ 1 ];
- }
- if ( $default->pimp->user_change_server == 1) {
- $desc_text = 'Server Name';
- $desc = 'This is the remote server that your mail is stored on.';
- $size = 50;
- $name = 'mail_server_name';
- $value = $current_server_settings->server_name;
- include( './templates/form/form_text_elem.inc' );
- }
- if ( $default->pimp->user_change_username == 1 ) {
- $desc_text = 'User Name';
- $desc = '
- This is the user name that you authenticate with. Leaving this blank
- defaults you to using the same user name as you are currently logged
- in with.
- ';
- $size = 50;
- $name = 'mail_user_name';
- $value = $current_server_settings->server_username;
- include( './templates/form/form_text_elem.inc' );
- }
- if ( $default->pimp->user_change_password == 1 ) {
- $desc_text = 'Password';
- $desc = '
- This is the password that you authenticate with. Leaving this blank
- defaults you to using the same password as you are currently logged
- in with.
- ';
- $size = 50;
- $name = 'mail_user_password';
- $value = $current_server_settings->server_password;
- include( './templates/form/form_password_elem.inc' );
- }
- if ( $default->pimp->user_change_from_name == 1 ) {
- $desc_text = 'From email-address';
- $desc = '
- This is the email address that will show up in the from field.
- ';
- $size = 50;
- $name = 'mail_from_address';
- $value = $current_server_settings->from_address;
- include( './templates/form/form_text_elem.inc' );
- }
- if ( $default->pimp->user_change_from_name == 1 ) {
- $desc_text = 'From name';
- $desc = 'This is the name that will show up in the from field.';
- $size = 50;
- $value = $current_server_settings->from_name;
- $name = 'mail_from_name';
- include( './templates/form/form_text_elem.inc' );
- }
- if ( $default->pimp->user_change_server_type == 1 ) {
- $name = 'server_type';
- $value = $current_server_settings->server_type;
- $possible = Array(
- 'Internet Mailbox Access Protocol',
- 'Post Office Protocol'
- );
- $possible_vals = Array( 'IMAP', 'POP3' );
- $desc_text = 'Server type';
- $desc = '
- The server type that is supported by your server,
- IMAP4 is the only currently supported server protocol.';
- include( './templates/form/form_multiselect_elem.inc' );
- }
- if (
- $default->pimp->user_change_server == 0 &&
- $default->pimp->user_change_username == 0 &&
- $default->pimp->user_change_password == 0 &&
- $default->pimp->user_change_email_address == 0 &&
- $default->pimp->user_change_from_name == 0 &&
- $default->pimp->user_change_server_type == 0
- ) {
- ?>
- <tr <?php echo $template_obj->GetValue( 'default_bgcolor' ); ?>>
- <td colspan="2">
- <?php $template_obj->GetValue( 'default_font' ); ?>
- <center>
- <b>- You cannot change these -</b>
- </center>
- </td>
- </tr>
- <?php
- } else {
- ?>
- <tr <?php echo $template_obj->GetValue( 'default_bgcolor' ); ?>>
- <td colspan="2">
- <?php $template_obj->GetValue( 'default_font' ); ?>
- <center>
- <input type="submit" value="Commit Changes">
- <input type="reset" value="Reset">
- </center>
- </td>
- </tr>
- <?php } ?>
- </form>