<?php
|
|
/**
|
|
* @package Galeria Suczawa 2009
|
|
* @file admin/index.php
|
|
* @version $Id$
|
|
**/
|
|
|
|
define('IN_ACP', true); #ochrona przed atakami
|
|
|
|
require_once('./../init.php'); #init stuff
|
|
|
|
#user is logged?
|
|
|
|
if (!$_SESSION['logged'] && empty($_GET['mode']))
|
|
{
|
|
Przekieruj('index.php?mode=login');
|
|
}
|
|
|
|
#brak wyboru opcji - przekierowanie na administracje galeria
|
|
if (empty($_GET['mode']))
|
|
{
|
|
Przekieruj('index.php?mode=admin_gallery');
|
|
}
|
|
|
|
switch($_GET['mode'])
|
|
{
|
|
#logowanie
|
|
case 'login':
|
|
{
|
|
if (!$_SESSION['logged'])
|
|
{
|
|
require('./login.php');
|
|
}
|
|
else
|
|
{
|
|
Przekieruj('index.php?mode=admin_gallery');
|
|
}
|
|
|
|
break;
|
|
}
|
|
|
|
#wylogowywanie
|
|
case 'logout':
|
|
{
|
|
if ($_SESSION['logged'])
|
|
{
|
|
$_SESSION['logged'] = false;
|
|
Przekieruj('index.php?mode=admin_gallery', 'Zostałeś poprawnie wylogowany');
|
|
}
|
|
else
|
|
{
|
|
Przekieruj('index.php?mode=admin_gallery');
|
|
}
|
|
|
|
break;
|
|
}
|
|
|
|
#strona glowna administracji galeria
|
|
case 'admin_gallery':
|
|
{
|
|
die('Na razie tu nic nie ma, ale będzie :]');
|
|
|
|
#sprawdz, czy jest podopcja
|
|
if (empty($_GET['submode']))
|
|
{
|
|
Przekieruj('index.php?mode=admin_gallery&submode=view');
|
|
}
|
|
|
|
switch($_GET['submode'])
|
|
{
|
|
case 'view':
|
|
{
|
|
require('./gallery_view.php');
|
|
break;
|
|
}
|
|
|
|
case 'add':
|
|
{
|
|
require('./gallery_item_add.php';
|
|
break
|
|
}
|
|
|
|
case 'edit':
|
|
{
|
|
require('./gallery_item_edit.php';
|
|
break
|
|
}
|
|
|
|
case 'delete':
|
|
{
|
|
require('./gallery_item_delete.php';
|
|
break
|
|
}
|
|
}
|
|
|
|
break;
|
|
}
|
|
|
|
#strona administracji uzytkownikow
|
|
case 'admin_users':
|
|
{
|
|
die('Na razie tu nic nie ma, ale będzie :]');
|
|
|
|
#sprawdz, czy jest podopcja
|
|
if (empty($_GET['submode']))
|
|
{
|
|
Przekieruj('index.php?mode=admin_users&submode=list');
|
|
}
|
|
|
|
switch($_GET['submode'])
|
|
{
|
|
case 'list':
|
|
{
|
|
require('./users_list.php');
|
|
break;
|
|
}
|
|
|
|
case 'add':
|
|
{
|
|
require('./user_add.php';
|
|
break
|
|
}
|
|
|
|
case 'edit':
|
|
{
|
|
require('./user_edit.php';
|
|
break
|
|
}
|
|
|
|
case 'delete':
|
|
{
|
|
require('./user_delete.php';
|
|
break
|
|
}
|
|
}
|
|
|
|
break;
|
|
}
|
|
|
|
default:
|
|
{
|
|
die('Haking attempt!');
|
|
break;
|
|
}
|
|
}
|
|
|
|
?>
|