Schöhnheitsänderungen am Admininterface

This commit is contained in:
Humorhenker 2019-11-26 00:08:56 +01:00
parent 212c76429a
commit df0493007b
2 changed files with 17 additions and 11 deletions

View File

@ -39,7 +39,7 @@ if ($_SESSION['log'] == 1 and $_SESSION['admin'] == 1) {
echo '<h3>Mailadresse aktivieren:</h3> echo '<h3>Mailadresse aktivieren:</h3>
<form name="activatemail" method=POST action="bin/activatemail.php"> <form name="activatemail" method=POST action="bin/activatemail.php">
<label>Activate Mail:<select name="mailuserID">'; <label>Activate Mail:<select name="mailuserID">';
$abfrage = "SELECT `id`, `username`, `domain` FROM `accounts` WHERE `enabled` LIKE 0"; $abfrage = "SELECT `id`, `username`, `domain` FROM `accounts` WHERE `enabled` LIKE 0 ORDER by `domain`, `username` ASC";
$result = $dbh->query($abfrage); $result = $dbh->query($abfrage);
while ($emails = $result->fetch()) { while ($emails = $result->fetch()) {
echo '<option value="' . htmlentities($emails['id']) . '">' . htmlentities($emails['username']) . '@' . htmlentities($emails['domain']) . '</option>'; echo '<option value="' . htmlentities($emails['id']) . '">' . htmlentities($emails['username']) . '@' . htmlentities($emails['domain']) . '</option>';
@ -51,7 +51,7 @@ if ($_SESSION['log'] == 1 and $_SESSION['admin'] == 1) {
<h3>Mailadresse deaktivieren:</h3> <h3>Mailadresse deaktivieren:</h3>
<form name="deactivatemail" method=POST action="bin/deactivatemail.php"> <form name="deactivatemail" method=POST action="bin/deactivatemail.php">
<label>Deactivate Mail:<select name="mailuserID">'; <label>Deactivate Mail:<select name="mailuserID">';
$abfrage = "SELECT `id`, `username`, `domain` FROM `accounts` WHERE `enabled` LIKE 1"; $abfrage = "SELECT `id`, `username`, `domain` FROM `accounts` WHERE `enabled` LIKE 1 ORDER by `domain`, `username` ASC";
$result = $dbh->query($abfrage); $result = $dbh->query($abfrage);
while ($emails = $result->fetch()) { while ($emails = $result->fetch()) {
echo '<option value="' . htmlentities($emails['id']) . '">' . htmlentities($emails['username']) . '@' . htmlentities($emails['domain']) . '</option>'; echo '<option value="' . htmlentities($emails['id']) . '">' . htmlentities($emails['username']) . '@' . htmlentities($emails['domain']) . '</option>';
@ -62,7 +62,7 @@ if ($_SESSION['log'] == 1 and $_SESSION['admin'] == 1) {
<h3>Emailadresse hinzufügen:</h3> <h3>Emailadresse hinzufügen:</h3>
<form name="createmailuser" method=POST action="bin/createmailuser.php"> <form name="createmailuser" method=POST action="bin/createmailuser.php">
<label>Neue email<input type="text" name="newmailusername"/>@<select name="newmaildomainid">'; <label>Neue email<input type="text" name="newmailusername"/>@<select name="newmaildomainid">';
$abfrage = "SELECT `id`, `domain` FROM `domains`"; $abfrage = "SELECT `id`, `domain` FROM `domains` ORDER by `preselectorder` DESC, `domain` ASC";
$result = $dbh->query($abfrage); $result = $dbh->query($abfrage);
while ($domains = $result->fetch()) { while ($domains = $result->fetch()) {
echo '<option value="' . htmlentities($domains['id']) . '">' . htmlentities($domains['domain']) . '</option>'; echo '<option value="' . htmlentities($domains['id']) . '">' . htmlentities($domains['domain']) . '</option>';
@ -70,13 +70,13 @@ if ($_SESSION['log'] == 1 and $_SESSION['admin'] == 1) {
echo '</select> (benutze nicht ' . "'" . ')</label> echo '</select> (benutze nicht ' . "'" . ')</label>
<label>Neues Passwort<input type="password" name="newmailpw"/>(min. 8 Zeichen, benutze nicht ' . "'" . ')</label> <label>Neues Passwort<input type="password" name="newmailpw"/>(min. 8 Zeichen, benutze nicht ' . "'" . ')</label>
<label>Neues Passwort wiederholen<input type="password" name="newmailpwrep"/></label> <label>Neues Passwort wiederholen<input type="password" name="newmailpwrep"/></label>
<label>Passwortänderung erzwingen:<input type="checkbox" name="forcepwreset"/></label> <label>Passwortänderung erzwingen:<input type="checkbox" name="forcepwreset" value="1"/></label>
<input type="submit" name="submit" value="Hinzufügen"/> <input type="submit" name="submit" value="Hinzufügen"/>
</form> </form>
<h3>Passwort einer Email-Adresse ändern:</h3> <h3>Passwort einer Email-Adresse ändern:</h3>
<form name="changemailpwadm" method=POST action="bin/changemailpwadm.php"> <form name="changemailpwadm" method=POST action="bin/changemailpwadm.php">
<label>Zu ändernde Mail:<select name="changemailid">'; <label>Zu ändernde Mail:<select name="changemailid">';
$abfrage = "SELECT `id`, `username`, `domain` FROM `accounts`"; $abfrage = "SELECT `id`, `username`, `domain` FROM `accounts` ORDER by `domain`, `username` ASC";
$result = $dbh->query($abfrage); $result = $dbh->query($abfrage);
while ($emails = $result->fetch()) { while ($emails = $result->fetch()) {
echo '<option value="' . htmlentities($emails['id']) . '">' . htmlentities($emails['username']) . '@' . $emails['domain'] . '</option>'; echo '<option value="' . htmlentities($emails['id']) . '">' . htmlentities($emails['username']) . '@' . $emails['domain'] . '</option>';
@ -88,7 +88,7 @@ echo '</select> (benutze nicht ' . "'" . ')</label>
<h3>Emailadresse entfernen:</h3> <h3>Emailadresse entfernen:</h3>
<form name="deletemail" method=POST action="bin/deletemail.php"> <form name="deletemail" method=POST action="bin/deletemail.php">
<label>Delete Mail:<select name="mailuserID">'; <label>Delete Mail:<select name="mailuserID">';
$abfrage = "SELECT `id`, `username`, `domain` FROM `accounts`"; $abfrage = "SELECT `id`, `username`, `domain` FROM `accounts` ORDER by `domain`, `username` ASC";
$result = $dbh->query($abfrage); $result = $dbh->query($abfrage);
while ($emails = $result->fetch()) { while ($emails = $result->fetch()) {
echo '<option value="' . htmlentities($emails['id']) . '">' . htmlentities($emails['username']) . '@' . $emails['domain'] . '</option>'; echo '<option value="' . htmlentities($emails['id']) . '">' . htmlentities($emails['username']) . '@' . $emails['domain'] . '</option>';
@ -97,7 +97,13 @@ echo '</select> (benutze nicht ' . "'" . ')</label>
<input type="submit" name="submit" value="ENTFERNEN"/> <input type="submit" name="submit" value="ENTFERNEN"/>
</form> </form>
<a href="bin/maillistsettings.php"><h3>Maillisten Einstellungen</h3></a> <a href="bin/maillistsettings.php"><h3>Maillisten Einstellungen</h3></a>
</body> <table><caption>Emailadressen:</caption><tr><th>Email-Adresse</th><th>quota</th><th>enabled</th><th>sendonly</th><th>forcepwreset</th><th>admin</th></tr>';
$abfrage = "SELECT `id`, `username`, `domain`, `quota`, `enabled`, `sendonly`, `forcepwreset`, `admin` FROM `accounts` ORDER by `domain`, `username` ASC";
$result = $dbh->query($abfrage);
while ($emails = $result->fetch()) {
echo '<tr><td>' . htmlentities($emails['username']) . '@' . htmlentities($emails['domain']) . '</td><td>' . htmlentities($emails['quota']) . '</td><td>' . htmlentities($emails['enabled']) . '</td><td>' . htmlentities($emails['sendonly']) . '</td><td>' . htmlentities($emails['forcepwreset']) . '</td><td>' . htmlentities($emails['admin']) . '</td></tr>';
}
echo '</table></body>
</html>'; </html>';
exit; exit;
} }

View File

@ -87,16 +87,16 @@ function createmailuser($newmailusername, $newmaildomainid, $newmailpw, $newmail
$eintrag = "INSERT INTO `accounts` (`username`, `domain`, `password`, `quota`, `enabled`, `forcepwreset`, `sendonly`, `admin`) VALUES (:newmailusername, :newmaildomain, :newmailpwhashed, '2048', '1', :forcepwreset, '0', '0')"; // Maildaten in MailServer DB eintragen $eintrag = "INSERT INTO `accounts` (`username`, `domain`, `password`, `quota`, `enabled`, `forcepwreset`, `sendonly`, `admin`) VALUES (:newmailusername, :newmaildomain, :newmailpwhashed, '2048', '1', :forcepwreset, '0', '0')"; // Maildaten in MailServer DB eintragen
$sth = $dbh->prepare($eintrag); $sth = $dbh->prepare($eintrag);
$sth->execute(array(':newmailusername' => $newmailusername, ':newmaildomain' => $newmaildomain, ':newmailpwhashed' => $newmailpwhashed, ':forcepwreset' => $newmailforcepwreset)); $sth->execute(array(':newmailusername' => $newmailusername, ':newmaildomain' => $newmaildomain, ':newmailpwhashed' => $newmailpwhashed, ':forcepwreset' => $newmailforcepwreset));
//$maildirpath = $config['mailfolderpath'] . $newmailusername; //$maildirpath = $config['mailfolderpath'] . $newmailusername;
// umask(0); // umask(0);
// mkdir($maildirpath, 0770); // mkdir($maildirpath, 0770);
//} //}
//$sth = $dbh->prepare($eintrag); //$sth = $dbh->prepare($eintrag);
//$sth->execute(array(':newmailusernamefull' => $newmailusernamefull)); //$sth->execute(array(':newmailusernamefull' => $newmailusernamefull));
$adminmailadress = $config['adminadress'];
$adresse = $config['domain'] . '/admin.php';
// eine Mail an den Admin verschicken, damit er die Mail freischalten kann
if ($config['sendactivationinfo']) { if ($config['sendactivationinfo']) {
$adminmailadress = $config['adminadress'];
$adresse = $config['domain'] . '/admin.php';
// eine Mail an den Admin verschicken, damit er die Mail freischalten kann
mail($adminmailadress, "Neue Mailadresse erstellt", "Eine neue Mailadresse wurde erstellt und muss freigeschaltet werden. \n \n" . htmlspecialchars($newmailusernamefull) . "\n " . $adresse, "From: mailservice"); mail($adminmailadress, "Neue Mailadresse erstellt", "Eine neue Mailadresse wurde erstellt und muss freigeschaltet werden. \n \n" . htmlspecialchars($newmailusernamefull) . "\n " . $adresse, "From: mailservice");
} }
if ($admin == 1) { if ($admin == 1) {