forked from services/mlmmj-light-web-ecg
Initial commit for release of version 1.0
This commit is contained in:
37
index.php
37
index.php
@@ -1,4 +1,5 @@
|
||||
<?php
|
||||
|
||||
require("init.php");
|
||||
|
||||
if (!isset($_SESSION["auth"]) || $_SESSION["auth"] != 1)
|
||||
@@ -13,24 +14,40 @@ $domain = $_SESSION["domain"];
|
||||
// Are there any lists?
|
||||
if ( count( glob("$lists_path/$domain/*") ) !== 0 )
|
||||
{
|
||||
// Get all folders and tranform into array
|
||||
$lists = explode("\n", shell_exec("cd $lists_path/$domain; ls -1d */ | cut -f1 -d'/'"));
|
||||
// Get all folders and tranform into array
|
||||
$lists = explode("\n", shell_exec("cd $lists_path/$domain; ls -1d */ | cut -f1 -d'/'"));
|
||||
}
|
||||
|
||||
if ( isset($lists) )
|
||||
if (isset($lists))
|
||||
{
|
||||
// If the last string is empty then delete it
|
||||
if ( end($lists) === "" )
|
||||
{
|
||||
array_pop($lists);
|
||||
}
|
||||
// If the last string is empty then delete it
|
||||
if (end($lists) === "")
|
||||
{
|
||||
array_pop($lists);
|
||||
}
|
||||
|
||||
$lists_new = [];
|
||||
foreach($lists as $list)
|
||||
{
|
||||
if (!in_array($list, $_SESSION["array_lists_owned"]))
|
||||
{
|
||||
$lists_new[$list] = 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
$lists_new[$list] = 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
$lists = NULL;
|
||||
$lists = NULL;
|
||||
}
|
||||
|
||||
$smarty->assign("lists", $lists);
|
||||
$smarty->assign("headline", $headline);
|
||||
$smarty->assign("lists", $lists_new);
|
||||
$smarty->assign("domain", $domain);
|
||||
$smarty->assign("username", $_SESSION["username"]);
|
||||
$smarty->display("index.tpl");
|
||||
|
||||
?>
|
||||
|
||||
Reference in New Issue
Block a user