Hi there,
This is prob simple to do, but i cant for the life of me work it out.
What i want to be able to do is have the admin page redirect anybody who isnt logged in to the login page.
This is because i've removed the login.php link as the site's locked down, and i want admins to still be able to login to the site easily.
Any info appreicated.
Cheers
Fatmcgav
You can edit admin.php :
go to line 45 and change this:
if (!GALLERY_ADMIN_MODE) cpg_die(ERROR, $lang_errors['access_denied'], __FILE__, __LINE__);
with this
//if (!GALLERY_ADMIN_MODE) cpg_die(ERROR, $lang_errors['access_denied'], __FILE__, __LINE__); // Comment for redirecting
if (!GALLERY_ADMIN_MODE) header("Location: http://" . $_SERVER['HTTP_HOST']. dirname($ORIGINAL_PHP_SELF). "/login.php") ;
It should work ;)
Sweet, that worked a treat.
Made one slight tweak to it, to add a referer onto the login.php link so that it will automatically go back through to the admin page once logged in.
Many thanks.
Cheers
Quote from: Sami on March 16, 2007, 08:33:02 AM
You can edit admin.php :
go to line 45 and change this:
if (!GALLERY_ADMIN_MODE) cpg_die(ERROR, $lang_errors['access_denied'], __FILE__, __LINE__);
with this
//if (!GALLERY_ADMIN_MODE) cpg_die(ERROR, $lang_errors['access_denied'], __FILE__, __LINE__); // Comment for redirecting
if (!GALLERY_ADMIN_MODE) header("Location: http://" . $_SERVER['HTTP_HOST']. dirname($ORIGINAL_PHP_SELF). "/login.php") ;
It should work ;)