diff --git a/public/bin/editlist.php b/public/bin/editlist.php index 6d3efc4..6d7d861 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'])); @@ -48,6 +47,14 @@ if ($_SESSION['log'] == 1) { $sth = $dbh->prepare($eintrag); $sth->execute(array(':aliasid' => $_POST['editlistid'], ':owner_username' => $maillistownerex[0], ':owner_domain' => $maillistownerex[1])); } + if ($_SESSION['admin']) { + $newlistsource = explode('@', $_POST['newlistsource']); + } else { + $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 + } $eintrag = "DELETE FROM `aliases` WHERE `alias_id` LIKE :aliasid"; $sth = $dbh->prepare($eintrag); $sth->execute(array(':aliasid' => $_POST['editlistid'])); 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'