200 lines
10 KiB
PHP
200 lines
10 KiB
PHP
|
|
<?php
|
||
|
|
if(!defined('OSTADMININC') || basename($_SERVER['SCRIPT_NAME'])==basename(__FILE__)) die('Habari/Jambo rafiki? '); //Say hi to our friend..
|
||
|
|
if(!$thisuser || !$thisuser->isadmin()) die('Zugriff verweigert');
|
||
|
|
|
||
|
|
$info=($_POST && $errors)?$_POST:array(); //Re-use the post info on error...savekeyboards.org
|
||
|
|
if($email && $_REQUEST['a']!='new'){
|
||
|
|
$title='Email editieren';
|
||
|
|
$action='update';
|
||
|
|
if(!$info) {
|
||
|
|
$info=$email->getInfo();
|
||
|
|
$info['userpass']=$info['userpass']?Misc::decrypt($info['userpass'],SECRET_SALT):'';
|
||
|
|
}
|
||
|
|
$qstr='?t=email&id='.$email->getId();
|
||
|
|
}else {
|
||
|
|
$title='Neue Email';
|
||
|
|
$action='create';
|
||
|
|
$info['smtp_auth']=isset($info['smtp_auth'])?$info['smtp_auth']:1;
|
||
|
|
}
|
||
|
|
|
||
|
|
$info=Format::htmlchars($info);
|
||
|
|
//get the goodies.
|
||
|
|
$depts= db_query('SELECT dept_id,dept_name FROM '.DEPT_TABLE);
|
||
|
|
$priorities= db_query('SELECT priority_id,priority_desc FROM '.TICKET_PRIORITY_TABLE);
|
||
|
|
?>
|
||
|
|
<div class="msg"><?=$title?></div>
|
||
|
|
<table width="100%" border="0" cellspacing=0 cellpadding=0>
|
||
|
|
<form action="admin.php<?=$qstr?>" method="post">
|
||
|
|
<input type="hidden" name="do" value="<?=$action?>">
|
||
|
|
<input type="hidden" name="a" value="<?=Format::htmlchars($_REQUEST['a'])?>">
|
||
|
|
<input type="hidden" name="t" value="email">
|
||
|
|
<input type="hidden" name="email_id" value="<?=$info['email_id']?>">
|
||
|
|
<tr><td>
|
||
|
|
<table width="100%" border="0" cellspacing=0 cellpadding=2 class="tform">
|
||
|
|
<tr class="header"><td colspan=2>Email Info</td></tr>
|
||
|
|
<tr class="subheader">
|
||
|
|
<td colspan=2 >Einstellungen sind vor allem für gemailte Tickets. Für die Online-/ Web-Tickets schauen Sie unter den Hilfethemen.</td>
|
||
|
|
</tr>
|
||
|
|
<tr><th>Email Adressen</th>
|
||
|
|
<td>
|
||
|
|
<input type="text" name="email" size=30 value="<?=$info['email']?>"> <font class="error">* <?=$errors['email']?></font>
|
||
|
|
</td>
|
||
|
|
</tr>
|
||
|
|
<tr><th>Email Name:</th>
|
||
|
|
<td>
|
||
|
|
<input type="text" name="name" size=30 value="<?=$info['name']?>"> <font class="error"> <?=$errors['name']?></font>
|
||
|
|
(<i>Optionaler Absendername.</i>)
|
||
|
|
</td>
|
||
|
|
</tr>
|
||
|
|
<tr><th>Priorität für neue Tickets</th>
|
||
|
|
<td>
|
||
|
|
<select name="priority_id">
|
||
|
|
<option value=0>Priorität wählen</option>
|
||
|
|
<?
|
||
|
|
while (list($id,$name) = db_fetch_row($priorities)){
|
||
|
|
$selected = ($info['priority_id']==$id)?'selected':''; ?>
|
||
|
|
<option value="<?=$id?>"<?=$selected?>><?=$name?></option>
|
||
|
|
<?
|
||
|
|
}?>
|
||
|
|
</select> <font class="error">* <?=$errors['priority_id']?></font>
|
||
|
|
</td>
|
||
|
|
</tr>
|
||
|
|
<tr><th>Abteilung für neue Tickets</th>
|
||
|
|
<td>
|
||
|
|
<select name="dept_id">
|
||
|
|
<option value=0>Abteilung wählen</option>
|
||
|
|
<?
|
||
|
|
while (list($id,$name) = db_fetch_row($depts)){
|
||
|
|
$selected = ($info['dept_id']==$id)?'selected':''; ?>
|
||
|
|
<option value="<?=$id?>"<?=$selected?>>Abteilung <?=$name?></option>
|
||
|
|
<?
|
||
|
|
}?>
|
||
|
|
</select> <font class="error"> <?=$errors['dept_id']?></font>
|
||
|
|
</td>
|
||
|
|
</tr>
|
||
|
|
<tr><th>Automatische Antwort</th>
|
||
|
|
<td>
|
||
|
|
<input type="checkbox" name="noautoresp" value=1 <?=$info['noautoresp']? 'checked': ''?> ><b>Deaktiviert</b> automatische Antworten für diese Adresse.
|
||
|
|
(<i>Überschreibt Abteilungseinstellungen</i>)
|
||
|
|
</td>
|
||
|
|
</tr>
|
||
|
|
<tr class="subheader">
|
||
|
|
<td colspan=2 ><b>Anmeldeinformation (optional)</b>: Erforderlich wenn IMAP/POP und/oder SMTP aktiviert ist.</td>
|
||
|
|
</tr>
|
||
|
|
<tr><th>Nutzername</th>
|
||
|
|
<td><input type="text" name="userid" size=35 value="<?=$info['userid']?>" autocomplete='off' >
|
||
|
|
<font class="error"> <?=$errors['userid']?></font>
|
||
|
|
</td>
|
||
|
|
</tr>
|
||
|
|
<tr><th>Passwort</th>
|
||
|
|
<td>
|
||
|
|
<input type="password" name="userpass" size=35 value="<?=$info['userpass']?>" autocomplete='off'>
|
||
|
|
<font class="error"> <?=$errors['userpass']?></font>
|
||
|
|
</td>
|
||
|
|
</tr>
|
||
|
|
<tr class="header"><td colspan=2>Mail-Account (Optional)</b></td></tr>
|
||
|
|
<tr class="subheader"><td colspan=2>
|
||
|
|
Einstellungen für das Holen eingehender E-Mails. Um Mails zu holen muss autocron oder ein externes cron-Script aktiviert werden.<br>
|
||
|
|
<b>Bitte haben Sie Geduld, das System wird versuchen sich mit den angegebenen Anmeldeinformationen anzumelden.</b>
|
||
|
|
<font class="error"> <?=$errors['mail']?></font></td></tr>
|
||
|
|
<tr><th>Status</th>
|
||
|
|
<td>
|
||
|
|
<label><input type="radio" name="mail_active" value="1" <?=$info['mail_active']?'checked':''?> />Aktivieren</label>
|
||
|
|
<label><input type="radio" name="mail_active" value="0" <?=!$info['mail_active']?'checked':''?> />Deaktivieren</label>
|
||
|
|
<font class="error"> <?=$errors['mail_active']?></font>
|
||
|
|
</td>
|
||
|
|
</tr>
|
||
|
|
<tr><th>Host</th>
|
||
|
|
<td><input type="text" name="mail_host" size=35 value="<?=$info['mail_host']?>">
|
||
|
|
<font class="error"> <?=$errors['mail_host']?></font>
|
||
|
|
</td>
|
||
|
|
</tr>
|
||
|
|
<tr><th>Port</th>
|
||
|
|
<td><input type="text" name="mail_port" size=6 value="<?=$info['mail_port']?$info['mail_port']:''?>">
|
||
|
|
<font class="error"> <?=$errors['mail_port']?></font>
|
||
|
|
</td>
|
||
|
|
</tr>
|
||
|
|
<tr><th>Protokoll</th>
|
||
|
|
<td>
|
||
|
|
<select name="mail_protocol">
|
||
|
|
<option value='POP'>Auswahl</option>
|
||
|
|
<option value='POP' <?=($info['mail_protocol']=='POP')?'selected="selected"':''?> >POP</option>
|
||
|
|
<option value='IMAP' <?=($info['mail_protocol']=='IMAP')?'selected="selected"':''?> >IMAP</option>
|
||
|
|
</select>
|
||
|
|
<font class="error"> <?=$errors['mail_protocol']?></font>
|
||
|
|
</td>
|
||
|
|
</tr>
|
||
|
|
|
||
|
|
<tr><th>Verschlüsselung</th>
|
||
|
|
<td>
|
||
|
|
<label><input type="radio" name="mail_encryption" value="NONE"
|
||
|
|
<?=($info['mail_encryption']!='SSL')?'checked':''?> />Keine</label>
|
||
|
|
<label><input type="radio" name="mail_encryption" value="SSL"
|
||
|
|
<?=($info['mail_encryption']=='SSL')?'checked':''?> />SSL</label>
|
||
|
|
<font class="error"> <?=$errors['mail_encryption']?></font>
|
||
|
|
</td>
|
||
|
|
</tr>
|
||
|
|
<tr><th>Abrufinterval</th>
|
||
|
|
<td>
|
||
|
|
<input type="text" name="mail_fetchfreq" size=4 value="<?=$info['mail_fetchfreq']?$info['mail_fetchfreq']:''?>"> Verzögerung in Minuten
|
||
|
|
<font class="error"> <?=$errors['mail_fetchfreq']?></font>
|
||
|
|
</td>
|
||
|
|
</tr>
|
||
|
|
<tr><th>Maximale Emails pro Abruf</th>
|
||
|
|
<td>
|
||
|
|
<input type="text" name="mail_fetchmax" size=4 value="<?=$info['mail_fetchmax']?$info['mail_fetchmax']:''?>"> Maximale zu holende Anzahl an Emails pro Abruf.
|
||
|
|
<font class="error"> <?=$errors['mail_fetchmax']?></font>
|
||
|
|
</td>
|
||
|
|
</tr>
|
||
|
|
<tr><th>Nachrichten löschen</th>
|
||
|
|
<td>
|
||
|
|
<input type="checkbox" name="mail_delete" value=1 <?=$info['mail_delete']? 'checked': ''?> >
|
||
|
|
Lösche abgeholte Mails (<i>Empfohlen bei Nutzung des POP-Protokolls</i>)
|
||
|
|
<font class="error"> <?=$errors['mail_delete']?></font>
|
||
|
|
</td>
|
||
|
|
</tr>
|
||
|
|
<tr class="header"><td colspan=2>SMTP-Einstellungen (Optional)</b></td></tr>
|
||
|
|
<tr class="subheader"><td colspan=2>
|
||
|
|
Wenn der <b>externe Email-Account</b> aktiviert ist, wird der SMTP-Server anstelle der internen PHP-Mail-Funktion für ausgehende Mails genutzt.<br>
|
||
|
|
<b>Bitte haben Sie Geduld, das System wird versuchen sich mit den angegebenen Anmeldeinformationen anzumelden.</b>
|
||
|
|
<font class="error"> <?=$errors['smtp']?></font></td></tr>
|
||
|
|
<tr><th>Status</th>
|
||
|
|
<td>
|
||
|
|
<label><input type="radio" name="smtp_active" value="1" <?=$info['smtp_active']?'checked':''?> />Aktivieren</label>
|
||
|
|
<label><input type="radio" name="smtp_active" value="0" <?=!$info['smtp_active']?'checked':''?> />Deaktivieren</label>
|
||
|
|
<font class="error"> <?=$errors['smtp_active']?></font>
|
||
|
|
</td>
|
||
|
|
</tr>
|
||
|
|
<tr><th>SMTP Host</th>
|
||
|
|
<td><input type="text" name="smtp_host" size=35 value="<?=$info['smtp_host']?>">
|
||
|
|
<font class="error"> <?=$errors['smtp_host']?></font>
|
||
|
|
</td>
|
||
|
|
</tr>
|
||
|
|
<tr><th>SMTP Port</th>
|
||
|
|
<td><input type="text" name="smtp_port" size=6 value="<?=$info['smtp_port']?$info['smtp_port']:''?>">
|
||
|
|
<font class="error"> <?=$errors['smtp_port']?></font>
|
||
|
|
</td>
|
||
|
|
</tr>
|
||
|
|
<tr><th>Authentifizierung erforderlich?</th>
|
||
|
|
<td>
|
||
|
|
|
||
|
|
<label><input type="radio" name="smtp_auth" value="1"
|
||
|
|
<?=$info['smtp_auth']?'checked':''?> />Ja</label>
|
||
|
|
<label><input type="radio" name="smtp_auth" value="0"
|
||
|
|
<?=!$info['smtp_auth']?'checked':''?> />Nein</label>
|
||
|
|
<font class="error"> <?=$errors['smtp_auth']?></font>
|
||
|
|
</td>
|
||
|
|
</tr>
|
||
|
|
<tr><th>Verschlüsselung</th>
|
||
|
|
<td>Beste verfügbare Authentifizierungsmethode wird automatisch ausgewählt, auf die Methode die vom Server unterstützt wird.</td>
|
||
|
|
</tr>
|
||
|
|
</table>
|
||
|
|
</td></tr>
|
||
|
|
<tr><td style="padding:10px 0 10px 220px;">
|
||
|
|
<input class="button" type="submit" name="submit" value="Bestätigen">
|
||
|
|
<input class="button" type="reset" name="reset" value="Zurücksetzen">
|
||
|
|
<input class="button" type="button" name="cancel" value="Abbrechen" onClick='window.location.href="admin.php?t=email"'>
|
||
|
|
</td>
|
||
|
|
</tr>
|
||
|
|
</form>
|
||
|
|
</table>
|