islist Option eingeführt um Maillisten und reine Umleitungen zu untescheiden
This commit is contained in:
		
							parent
							
								
									29cf6612eb
								
							
						
					
					
						commit
						d7f757b6ab
					
				| 
						 | 
				
			
			@ -23,9 +23,11 @@ try {
 | 
			
		|||
}
 | 
			
		||||
session_start();
 | 
			
		||||
if ($_SESSION['log'] == 1 && $_SESSION['admin']) {
 | 
			
		||||
    $eintrag = "INSERT INTO `alias_details` (`name`, `owners`, `destinations`, `security`) VALUES (:newlistname, :owners, :destinations, :security)"; // Aliasdaten in MailServer DB eintragen
 | 
			
		||||
    if (!isset($_POST['newlistislist'])) $islist = 0; // wenn die checkbox nicht ausgewählt wurde ist die Post Variable nicht gesetzt, dass stört die Datenbank, deshalb wird Null eingertragen
 | 
			
		||||
    else $islist = $_POST['newlistislist'];
 | 
			
		||||
    $eintrag = "INSERT INTO `alias_details` (`name`, `owners`, `destinations`, `security`, `islist`) VALUES (:newlistname, :owners, :destinations, :security, :islist)"; // Aliasdaten in MailServer DB eintragen
 | 
			
		||||
    $sth = $dbh->prepare($eintrag);
 | 
			
		||||
    $sth->execute(array(':newlistname' => $_POST['newlistname'], ':owners' => $_POST['newlistowners'], ':destinations' => $_POST['newlistdestinations'], ':security' => $_POST['newlistsecurity']));
 | 
			
		||||
    $sth->execute(array(':newlistname' => $_POST['newlistname'], ':owners' => $_POST['newlistowners'], ':destinations' => $_POST['newlistdestinations'], ':security' => $_POST['newlistsecurity'], ':islist' => $islist));
 | 
			
		||||
    $newlistid = $dbh->lastInsertID();
 | 
			
		||||
    foreach (explode(' ', $_POST['newlistowners']) as $maillistowner) {
 | 
			
		||||
        $maillistownerex = explode('@', $maillistowner);
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -32,10 +32,12 @@ if ($_SESSION['log'] == 1) {
 | 
			
		|||
            exit;
 | 
			
		||||
        }
 | 
			
		||||
    }
 | 
			
		||||
    $newlistowner = explode('@', $_POST['newlistowner']);
 | 
			
		||||
    $eintrag = "UPDATE `alias_details` SET `name` = :newlistname, `owners` = :owners, `destinations` = :destinations, `security` = :security WHERE `id` LIKE :editlistid"; // Aliasdaten in MailServer DB eintragen
 | 
			
		||||
    $newlistowner = explode('@', $_POST['newlistowners']);
 | 
			
		||||
    if (!isset($_POST['newlistislist'])) $islist = 0; // wenn die checkbox nicht ausgewählt wurde ist die Post Variable nicht gesetzt, dass stört die Datenbank, deshalb wird Null eingertragen
 | 
			
		||||
    else $islist = $_POST['newlistislist'];
 | 
			
		||||
    $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'], ':editlistid' => $_POST['editlistid']));
 | 
			
		||||
    $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);
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -38,7 +38,7 @@ if ($_SESSION['log']) {
 | 
			
		|||
    </head>
 | 
			
		||||
    <body>
 | 
			
		||||
    <a href="maillistsettings.php"><h3>Zurück zur Maillistoberfläche (Editieren abbrechen)</h3></a><br>';
 | 
			
		||||
    $abfrage = "SELECT `name`, `owners`, `security` FROM `alias_details` WHERE `id` LIKE :editlistid";
 | 
			
		||||
    $abfrage = "SELECT `name`, `owners`, `security`, `islist` FROM `alias_details` WHERE `id` LIKE :editlistid";
 | 
			
		||||
    $result = $dbh->prepare($abfrage);
 | 
			
		||||
    $result->execute(array(':editlistid' => $_GET['editlistid']));
 | 
			
		||||
    while ($lists = $result->fetch()) {
 | 
			
		||||
| 
						 | 
				
			
			@ -71,6 +71,9 @@ if ($_SESSION['log']) {
 | 
			
		|||
        if ($lists['security'] == 2) echo ' selected';
 | 
			
		||||
        echo '>2 (Der Besitzer der Liste kann Mails an die Liste schicken)</option>
 | 
			
		||||
        </select></label><br>
 | 
			
		||||
        <label>Ist eine Maillingliste, keine einfache Umleitung<input type="checkbox" name="newlistislist" value="1"';
 | 
			
		||||
        if ($lists['islist'] == 1) echo ' checked';
 | 
			
		||||
        echo '/></label>
 | 
			
		||||
        <input type="hidden" name="editlistid" value="' . $_GET['editlistid'] . '"/>
 | 
			
		||||
        <input type="submit" name="submit" value="Editieren"/>
 | 
			
		||||
        </body>
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -55,12 +55,13 @@ if ($_SESSION['log'] == 1) {
 | 
			
		|||
        }
 | 
			
		||||
        echo '</select></label>
 | 
			
		||||
        <label>Listenbesitzer:<textarea rows="1" cols="50" name="newlistowners"></textarea></label><br>
 | 
			
		||||
        <label>Listenempfänger (durch Leerzeichen getrennt):<br><textarea rows="4" cols="50" name="newlistdestinations"></textarea></label>
 | 
			
		||||
        <label>Listenempfänger (durch Leerzeichen getrennt):<br><textarea rows="4" cols="50" name="newlistdestinations"></textarea></label><br>
 | 
			
		||||
        <label>Listensicherheitseinstellungen:<select name="newlistsecurity">
 | 
			
		||||
        <option value="0">0 (Jeder kann Mails an die Liste schicken)</option>
 | 
			
		||||
        <option value="1">1 (Mitglieder und Besitzer der Liste können Mails an die Liste schicken)</option>
 | 
			
		||||
        <option value="2">2 (Nur Besitzer der Liste können Mails an die Liste schicken)</option>
 | 
			
		||||
        </select></label><br>
 | 
			
		||||
        <label>Ist eine Maillingliste, keine einfache Umleitung:<input type="checkbox" name="newlistislist" value="1" checked/></label><br>
 | 
			
		||||
        <input type="submit" name="submit" value="Hinzufügen"/></form>
 | 
			
		||||
        <br><h3>Bestehende Listen:</h3>';
 | 
			
		||||
    }
 | 
			
		||||
| 
						 | 
				
			
			@ -68,15 +69,15 @@ if ($_SESSION['log'] == 1) {
 | 
			
		|||
        echo '<a href="../settings.php"><h3>Zurück</h3></a><br><h3>Meine bestehenden Listen:</h3>';
 | 
			
		||||
    }
 | 
			
		||||
    if ($_SESSION['admin']) {
 | 
			
		||||
        $abfrage = "SELECT `id`, `name`, `owners`, `destinations`, `security` FROM `alias_details`";
 | 
			
		||||
        $abfrage = "SELECT `id`, `name`, `owners`, `destinations`, `security`, `islist` FROM `alias_details`";
 | 
			
		||||
        $result = $dbh->query($abfrage);
 | 
			
		||||
    }
 | 
			
		||||
    else {
 | 
			
		||||
        $abfrage = "SELECT `id`, `name`, `owners`, `destinations`, `security` FROM `alias_details` WHERE `id` REGEXP :aliasid";
 | 
			
		||||
        $abfrage = "SELECT `id`, `name`, `owners`, `destinations`, `security`, `islist` FROM `alias_details` WHERE `id` REGEXP :aliasid";
 | 
			
		||||
        $result = $dbh->prepare($abfrage);
 | 
			
		||||
        $result->execute(array(':aliasid' => substr($aliasids, 0, -1)));
 | 
			
		||||
    }
 | 
			
		||||
    echo '<table border="1" style="text-align: center; vertical-align: middle;"><tr><th>Listenname</th><th>Listenadresse</th><th>Listenempfänger</th><th>Listenbesitzer</th><th>Listensicherheit</th><th>Optionen</th></tr>';
 | 
			
		||||
    echo '<table border="1" style="text-align: center; vertical-align: middle;"><tr><th>Listenname</th><th>Listenadresse</th><th>Listenempfänger</th><th>Listenbesitzer</th><th>Listensicherheit</th><th>Ist Maillingliste</th></ht><th>Optionen</th></tr>';
 | 
			
		||||
    while ($lists = $result->fetch()) {
 | 
			
		||||
        $abfrage2 = "SELECT `source_username`, `source_domain` FROM `aliases` WHERE `alias_id` LIKE :aliasid";
 | 
			
		||||
        $result2 = $dbh->prepare($abfrage2);
 | 
			
		||||
| 
						 | 
				
			
			@ -90,7 +91,7 @@ if ($_SESSION['log'] == 1) {
 | 
			
		|||
        foreach (explode(' ', $lists['owners']) as $owner) {
 | 
			
		||||
            echo $owner . '<br>';
 | 
			
		||||
        }
 | 
			
		||||
        echo '</td><td>' . $lists['security'] . '</td><td><a href="dellist.php?dellistid=' . $lists['id'] . '">Löschen</a><br><a href="editlistpre.php?editlistid=' . $lists['id'] . '">Editieren</a></td></tr>';
 | 
			
		||||
        echo '</td><td>' . $lists['security'] . '</td><td>' . $lists['islist'] . '</td><td><a href="dellist.php?dellistid=' . $lists['id'] . '">Löschen</a><br><a href="editlistpre.php?editlistid=' . $lists['id'] . '">Editieren</a></td></tr>';
 | 
			
		||||
    }
 | 
			
		||||
    echo '</table>';
 | 
			
		||||
    echo '</body>
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
		Reference in New Issue