forked from services/mlmmj-light-web-ecg
Initial commit for release of version 1.0
This commit is contained in:
@@ -1,5 +1,7 @@
|
||||
<?php
|
||||
|
||||
require("init.php");
|
||||
|
||||
$list_name = isset($_GET["list_name"]) ? $_GET["list_name"] : "";
|
||||
$domain = $_SESSION["domain"];
|
||||
|
||||
@@ -31,31 +33,32 @@ if( !is_dir("$lists_path/$domain/$list_name") )
|
||||
exit();
|
||||
}
|
||||
|
||||
# Check whether the user may edit this list as he owns it
|
||||
if (!in_array($list_name, $_SESSION["array_lists_owned"]))
|
||||
{
|
||||
$_SESSION["error_code"] = 11;
|
||||
header("Location: error.php");
|
||||
exit;
|
||||
}
|
||||
|
||||
// Get a subscribers list
|
||||
$subscribers = shell_exec("/usr/bin/mlmmj-list -L $lists_path/$domain/$list_name");
|
||||
// Remove trailing empty symbols
|
||||
$subscribers = trim($subscribers);
|
||||
|
||||
// Get a list type. There are three types of lists:
|
||||
// a closed moderated list (0), a newslist (1) and a conference (2)
|
||||
$list_type = file_get_contents("$lists_path/$domain/$list_name/list_type.txt");
|
||||
$list_type = trim($list_type);
|
||||
|
||||
// Select current list in select html elemant
|
||||
$list_type_selected = ["", "", ""];
|
||||
$list_type_selected[$list_type] = "selected";
|
||||
|
||||
// Get a footer
|
||||
$footer = file_get_contents("$lists_path/$domain/$list_name/control/footer-text");
|
||||
$footer = trim($footer);
|
||||
|
||||
// News list do not has moderators file
|
||||
if ($list_type !== "2")
|
||||
# Check whether there is a moderators file
|
||||
if (file_exists("$lists_path/$domain/$list_name/control/moderators"))
|
||||
{
|
||||
// Get a moderators list
|
||||
$moderators = file_get_contents("$lists_path/$domain/$list_name/control/moderators");
|
||||
// Remove trailing empty symbols
|
||||
$moderators = trim($moderators);
|
||||
|
||||
# If theres no @ inside the file it seems to be empty
|
||||
if (!preg_match("/[@]/", $moderators))
|
||||
{
|
||||
$moderators = NULL;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -67,16 +70,14 @@ $prefix = file_get_contents("$lists_path/$domain/$list_name/control/prefix");
|
||||
// Remove trailing empty symbols
|
||||
$prefix = trim($prefix);
|
||||
|
||||
$notmetoo_checked = file_exists("$lists_path/$domain/$list_name/control/notmetoo") ? "checked" : "";
|
||||
|
||||
// Load page
|
||||
$smarty->assign("headline", $headline);
|
||||
$smarty->assign("subscribers", $subscribers);
|
||||
$smarty->assign("list_name", $list_name);
|
||||
$smarty->assign("domain", $domain);
|
||||
$smarty->assign("list_type_selected", $list_type_selected);
|
||||
$smarty->assign("footer", $footer);
|
||||
$smarty->assign("moderators", $moderators);
|
||||
$smarty->assign("prefix", $prefix);
|
||||
$smarty->assign("notmetoo_checked", $notmetoo_checked);
|
||||
$smarty->assign("username", $_SESSION["username"]);
|
||||
$smarty->display("edit_list.tpl");
|
||||
|
||||
?>
|
||||
|
||||
Reference in New Issue
Block a user