diff --git a/public/bin/editlist.php b/public/bin/editlist.php index 6d3efc4..ec57f50 100644 --- a/public/bin/editlist.php +++ b/public/bin/editlist.php @@ -38,7 +38,6 @@ if ($_SESSION['log'] == 1) { $eintrag = "UPDATE `alias_details` SET `name` = :newlistname, `owners` = :owners, `destinations` = :destinations, `security` = :security, `islist` = :islist WHERE `id` LIKE :editlistid"; // Aliasdaten in MailServer DB eintragen $sth = $dbh->prepare($eintrag); $sth->execute(array(':newlistname' => $_POST['newlistname'], ':owners' => $_POST['newlistowners'], ':destinations' => $_POST['newlistdestinations'], ':security' => $_POST['newlistsecurity'], ':islist' => $islist, ':editlistid' => $_POST['editlistid'])); - $newlistsource = explode('@', $_POST['newlistsource']); $eintrag = "DELETE FROM `alias_owner` WHERE `alias_id` LIKE :aliasid"; $sth = $dbh->prepare($eintrag); $sth->execute(array(':aliasid' => $_POST['editlistid'])); @@ -51,6 +50,13 @@ if ($_SESSION['log'] == 1) { $eintrag = "DELETE FROM `aliases` WHERE `alias_id` LIKE :aliasid"; $sth = $dbh->prepare($eintrag); $sth->execute(array(':aliasid' => $_POST['editlistid'])); + if (!$_SESSION['admin']) { + $abfrage = "SELECT `source_username`, `source_domain` FROM `aliases` WHERE `alias_id` LIKE :alias_id"; + $result = $dbh->prepare($abfrage); + $result->execute(array(':alias_id' => $_POST['editlistid'])); + $newlistsource = $result->fetch(); //bei fetch() werden im Array ['spaltenname'] und [#Nummer der Spalte] angelegt also ['source_usernam'] und [0] praktische Sache + } + else $newlistsource = explode('@', $_POST['newlistsource']); foreach (explode(' ', $_POST['newlistdestinations']) as $maillistdestination) { $maillistdestinationex = explode('@', $maillistdestination); $eintrag = "INSERT INTO `aliases` (`alias_id`, `source_username`, `source_domain`, `destination_username`, `destination_domain`) VALUES (:aliasid, :source_username, :source_domain, :destination_username, :destination_domain)"; // Aliasdaten in MailServer DB eintragen diff --git a/public/bin/editlistpre.php b/public/bin/editlistpre.php index c938ecf..68828fb 100644 --- a/public/bin/editlistpre.php +++ b/public/bin/editlistpre.php @@ -48,9 +48,11 @@ if ($_SESSION['log']) { $listdetails = $result2->fetch(); echo'
- - -
+ + '; + else echo $listdetails['source_username'] . '@' . $listdetails['source_domain'] . ' '; + echo '