help.verua.ch/include/staff/email.inc.php

200 lines
10 KiB
PHP
Raw Normal View History

2026-01-05 08:46:20 +01:00
<?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&uuml;r gemailte Tickets. F&uuml;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']?>">&nbsp;<font class="error">*&nbsp;<?=$errors['email']?></font>
</td>
</tr>
<tr><th>Email Name:</th>
<td>
<input type="text" name="name" size=30 value="<?=$info['name']?>">&nbsp;<font class="error">&nbsp;<?=$errors['name']?></font>
&nbsp;&nbsp;(<i>Optionaler Absendername.</i>)
</td>
</tr>
<tr><th>Priorit&auml;t f&uuml;r neue Tickets</th>
<td>
<select name="priority_id">
<option value=0>Priorit&auml;t w&auml;hlen</option>
<?
while (list($id,$name) = db_fetch_row($priorities)){
$selected = ($info['priority_id']==$id)?'selected':''; ?>
<option value="<?=$id?>"<?=$selected?>><?=$name?></option>
<?
}?>
</select>&nbsp;<font class="error">*&nbsp;<?=$errors['priority_id']?></font>
</td>
</tr>
<tr><th>Abteilung f&uuml;r neue Tickets</th>
<td>
<select name="dept_id">
<option value=0>Abteilung w&auml;hlen</option>
<?
while (list($id,$name) = db_fetch_row($depts)){
$selected = ($info['dept_id']==$id)?'selected':''; ?>
<option value="<?=$id?>"<?=$selected?>>Abteilung <?=$name?></option>
<?
}?>
</select>&nbsp;<font class="error">&nbsp;<?=$errors['dept_id']?></font>&nbsp;
</td>
</tr>
<tr><th>Automatische Antwort</th>
<td>
<input type="checkbox" name="noautoresp" value=1 <?=$info['noautoresp']? 'checked': ''?> ><b>Deaktiviert</b> automatische Antworten f&uuml;r diese Adresse.
&nbsp;&nbsp;(<i>&Uuml;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' >
&nbsp;<font class="error">&nbsp;<?=$errors['userid']?></font>
</td>
</tr>
<tr><th>Passwort</th>
<td>
<input type="password" name="userpass" size=35 value="<?=$info['userpass']?>" autocomplete='off'>
&nbsp;<font class="error">&nbsp;<?=$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&uuml;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">&nbsp;<?=$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>
&nbsp;<font class="error">&nbsp;<?=$errors['mail_active']?></font>
</td>
</tr>
<tr><th>Host</th>
<td><input type="text" name="mail_host" size=35 value="<?=$info['mail_host']?>">
&nbsp;<font class="error">&nbsp;<?=$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']:''?>">
&nbsp;<font class="error">&nbsp;<?=$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">&nbsp;<?=$errors['mail_protocol']?></font>
</td>
</tr>
<tr><th>Verschl&uuml;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">&nbsp;<?=$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&ouml;gerung in Minuten
&nbsp;<font class="error">&nbsp;<?=$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.
&nbsp;<font class="error">&nbsp;<?=$errors['mail_fetchmax']?></font>
</td>
</tr>
<tr><th>Nachrichten l&ouml;schen</th>
<td>
<input type="checkbox" name="mail_delete" value=1 <?=$info['mail_delete']? 'checked': ''?> >
L&ouml;sche abgeholte Mails (<i>Empfohlen bei Nutzung des POP-Protokolls</i>)
&nbsp;<font class="error">&nbsp;<?=$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&uuml;r ausgehende Mails genutzt.<br>
<b>Bitte haben Sie Geduld, das System wird versuchen sich mit den angegebenen Anmeldeinformationen anzumelden.</b>
<font class="error">&nbsp;<?=$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>
&nbsp;<font class="error">&nbsp;<?=$errors['smtp_active']?></font>
</td>
</tr>
<tr><th>SMTP Host</th>
<td><input type="text" name="smtp_host" size=35 value="<?=$info['smtp_host']?>">
&nbsp;<font class="error">&nbsp;<?=$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']:''?>">
&nbsp;<font class="error">&nbsp;<?=$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">&nbsp;<?=$errors['smtp_auth']?></font>
</td>
</tr>
<tr><th>Verschl&uuml;sselung</th>
<td>Beste verf&uuml;gbare Authentifizierungsmethode wird automatisch ausgew&auml;hlt, auf die Methode die vom Server unterst&uuml;tzt wird.</td>
</tr>
</table>
</td></tr>
<tr><td style="padding:10px 0 10px 220px;">
<input class="button" type="submit" name="submit" value="Best&auml;tigen">
<input class="button" type="reset" name="reset" value="Zur&uuml;cksetzen">
<input class="button" type="button" name="cancel" value="Abbrechen" onClick='window.location.href="admin.php?t=email"'>
</td>
</tr>
</form>
</table>