//ACC Målselv
if (!$sm) $sm = 0;
if (is_array($_GET)) extract($_GET);
if (is_array($_POST)) extract($_POST);
if (is_array($_COOKIE)) extract($_COOKIE);
if (!$PHP_SELF) $PHP_SELF = $_SERVER["PHP_SELF"];
if (!$m) $m = 0;
include("./config.php");
if ($index_action == "ishow" || $index_action == "ihide")
{
$file = fopen("./config.php", "r");
if (filesize("./config.php")) $data = fread($file, filesize("./config.php"));
else $data = "";
fclose($file);
$data = preg_split("/\r*\n/", $data);
while (list($key, $rec) = each($data))
{
if (trim($rec))
{
if (preg_match("/\\\$([\w]+)\s*=\s*urldecode\(\"[\s\S]*\"\);/i", $rec, $values))
{
if ($values[1] == "show_instructions")
{
$data[$key] = preg_replace("/\\\$([\w]+)\s*=\s*urldecode\(\"[\s\S]*\"\);/", "\$" . $values[1] . " = urldecode(\"" . urlencode($index_action == "ishow" ? "yes" : "no") . "\");", $rec);
}
}
}
}
$data = join("\r\n", $data);
@$file = fopen("config.php", "w");
fwrite($file, $data);
fclose($file);
$query = preg_replace("/&index_action=[^&]+/", "", $_SERVER["QUERY_STRING"]);
header("Location: " . $PHP_SELF . "?" . $query);
exit;
}
if (!$installed)
{
header("Location: install.php");
exit;
}
include("./menu.php");
my_session_start();
extract($_SESSION);
if ($action == "logout")
{
my_session_unset();
Header("Location: index.php");
exit;
}
if ($action == "login" && $login && $password)
{
$total_user = $login;
$total_password = $password;
}
if ($total_user && $total_password)
{
if ($total_user == $admin_login && $total_password == $admin_password)
{
$total_user_id = 0;
$total_group = "admin";
my_session_register();
if ($action == "login")
{
Header("Location: index.php");
exit;
}
}
else
{
if ($action == "login") $login_error = "Feil brukernavn eller passord";
my_session_unset();
}
}
else
{
my_session_unset();
}
if ($index_action == "return")
{
header("Location: index.php?" . $_SERVER["QUERY_STRING"]);
exit;
}
if ($total_group == "admin" && $index_action == "preview")
{
?>
ACC Målselv - annonseadmin
include("./preview.php");
?>
[Close window ]
exit;
}
ob_start();
?>
ACC Målselv
if ($total_group == "admin")
{
if ($index_action == "insert_image")
{
$link_parameters = "index_action=insert_image";
?>
include("insert_images.php");
}
else
{
?>
$temp = $admin_menu;
$image = "title2.gif";
$count = count($temp);
?>
$i = 0;
while (list($key, $rec) = each($temp))
{
?>
$i++;
}
?>
if ($total_group == "users") $temp = $user_instructions[$m][$sm];
elseif ($total_group == "submiters") $temp = $submiter_instructions[$m][$sm];
else $temp = $admin_instructions[$m][$sm];
if (!empty($temp) && $show_instructions == "yes")
{
?>
}
elseif (!empty($temp))
{
?>
}
else echo " ";
?>
$temp = $admin_content[$m][$sm];
if ($temp == "logout")
{
Header("Location: $PHP_SELF?action=logout");
}
elseif (preg_match("/[\w]+\.php/", $temp))
{
$link_parameters = "m=" . $m;
if ($sm) $link_parameters .= "&sm=" . $sm;
include($temp);
}
else
{
echo $temp;
}
?>
}
}
else
{
?>
}
?>
Her vil du kunne logge inn, redigere og fjerne annonser. Vi ber Dem om ikke å misbruke tilliten ved å endre andre sine annonser! Du kan også legge til bilde (inntil 30KB). Copyright © ACC Målselv
ob_end_flush();
function my_session_start()
{
session_name("NEWS");
session_start();
}
function my_session_unset()
{
global $total_user, $total_user_id, $total_password, $total_group;
unset($_SESSION["total_user"]);
unset($_SESSION["total_user_id"]);
unset($_SESSION["total_password"]);
unset($_SESSION["total_group"]);
unset($total_user);
unset($total_user_id);
unset($total_password);
unset($total_group);
}
function my_session_register()
{
global $total_user, $total_user_id, $total_password, $total_group;
$_SESSION["total_user"] = $total_user;
$_SESSION["total_user_id"] = $total_user_id;
$_SESSION["total_password"] = $total_password;
$_SESSION["total_group"] = $total_group;
}
?>