diff --git a/index.php b/index.php --- a/index.php +++ b/index.php @@ -83,6 +83,7 @@ if (!$is_admin) { span.label { width: 100px; display: inline-block; + vertical-align: top; } hr.sep { width: 550px; @@ -155,20 +156,30 @@ if ($forward_active) if (!file_exists($vacation_msg_file)) { $vacation_msg = get_text('vacation'); + $decode = False; } else { $vacation_msg = file_get_contents($vacation_msg_file); + $decode = True; } -$lines = explode("\n", $vacation_msg); -$vacation_subject = array_shift($lines); -$vacation_subject = preg_replace('/^[Ss]ubject: */', '', $vacation_subject); -while (True) { - $line = array_shift($lines); - if (empty($line)) { - break; - } -} -$vacation_body = implode($lines, "\n"); +// $lines = explode("\n", $vacation_msg); +// $vacation_subject = array_shift($lines); +// $vacation_subject = preg_replace('/^[Ss]ubject: */', '', $vacation_subject); +// $vacation_headers = Array(); +// // remove additional headers +// while (True) { +// $line = array_shift($lines); +// if (empty($line)) { +// break; +// } +// $vacation_headers[] = $line; +// } +// $vacation_body = implode($lines, "\n"); + +$vacation_parts = vacation_split($vacation_msg, $decode); +$vacation_subject = $vacation_parts[0]; +$vacation_headers = $vacation_parts[1]; +$vacation_body = $vacation_parts[2]; // -------------------------------------------------- // |||:sec:||| Set vacation(1) parameters @@ -192,7 +203,7 @@ if ($vacation_setup || $vacation_clear) if ($vacation_clear) { system(sprintf( '%s -u %s %s %s -i', - $SUDO_CMD, $SUDO_OPT_H, $user, $VACATION_CMD)); + $SUDO_CMD, $user, $SUDO_OPT_H, $VACATION_CMD)); break; } if (empty ($vacation_subject)) { @@ -210,8 +221,7 @@ if ($vacation_setup || $vacation_clear) sprintf($VACATION_FORWARD_ENTRY, $user)); // Prepare vacation(1) message - $vacation_msg = sprintf( - "Subject: %s\n\n%s\n", $vacation_subject, $vacation_body); + $vacation_msg = vacation_join($vacation_subject, $vacation_body); $vacation_msg_pipe = popen(sprintf( '%s -u %s %s %s %s', $SUDO_CMD, $user, $SUDO_OPT_H, $WRITE_TO_CMD, $vacation_msg_file), @@ -269,8 +279,10 @@ if ($_debug) { } // column names -$form[] = ''; -$form[] = ''; +$form[] = ''; +$form[] = sprintf('', get_text('refresh')); +$form[] = ''; +$form[] = '
'; $trow = Array(); $trow[] = get_text('user'); $trow[] = get_text('forward_to'); @@ -337,14 +349,14 @@ if ($forward_active) { // subject $form[] = sprintf('%s*:', get_text('subject')); $form[] = ( - '
'); // message $form[] = sprintf('%s*:', get_text('message')); $form[] = ( '
'); + .' style="vertical-align: top;">' . htmlspecialchars($vacation_body, ENT_NOQUOTES, "UTF-8") . '
'); $form[] = ' '; $form[] = ( @@ -355,7 +367,6 @@ if ($forward_active) { // actions $form[] = '
'; $form[] = ' '; -$form[] = sprintf('', get_text('refresh')); $form[] = sprintf('
', get_text('save')); $form[] = '
'; @@ -374,7 +385,7 @@ pclose($vacation_ausgabe); if (!empty ($vacation_list)) { $form[] = shl(get_text('reply_history')); - $form[] = '
'; + // $form[] = '
'; $form[] = '
';
     $form[] = $vacation_list;
     $form[] = '
'; @@ -382,7 +393,7 @@ if (!empty ($vacation_list)) { $form[] = ' '; $form[] = sprintf('
', get_text('delete')); if ($is_admin) { - echo ('
'); + $form[] = ('
'); } } else { $form[] = shl(get_text('reply_history_empty')); @@ -396,6 +407,7 @@ echo implode($form, "\n"); // -------------------------------------------------- if ($is_admin) { + echo shl(get_text('manual_headline')); echo (sprintf('%s
'."\n", get_text('manual_link'), get_text('manual'))); }