<?php
/************************************************************************/
/* Maximus CMS: Web Portal System                                       */
/* ==============================                                       */
/*                                                                      */
/* Copyright (c) 2002 - 2007                                            */
/* http://www.php-maximus.org                                           */
/* dev@php-maximus.org                                                  */
/*                                                                      */
/* This program is free software. You can redistribute it and/or modify */
/* it under the terms of the GNU General Public License as published by */
/* the Free Software Foundation; either version 2 of the License.       */
/************************************************************************/
/* Based on PHP-NUKE: Web Portal System                                 */
/************************************************************************/
/* Portage Coppermine Photo Gallery                                     */
/************************************************************************/
defined('MAXIMUS') or require_once("mainfile.php");
if ( !defined('USER_ALLOW') ) { redirect_url('modules.php?name=Coppermine');}
if ( !defined('ADMIN_ALLOW') ) { redirect_url('modules.php?name=Coppermine');}

$pagetitle = "- Coppermine";

define('IN_COPPERMINE', true);
define('ADMIN_PHP', true);

switch($func) {
default:

incoh();
require('modules/Coppermine/include/init.inc.php');

if (!USER_CAN_CREATE_ALBUMS && !USER_IS_ADMIN) cpg_die(ERROR, $lang_errors['access_denied'], __FILE__, __LINE__);

if(!isset($_GET['admin_mode']) || !isset($_GET['referer'])) cpg_die(CRITICAL_ERROR, $lang_errors['param_missing'], __FILE__, __LINE__);

$admin_mode = (int)$_GET['admin_mode'] ? 1 : 0;
$referer = $_GET['referer'] ? $_GET['referer'] : "".get_referer()."";
$USER['am'] = $admin_mode;
if (!$admin_mode) $referer = "".get_referer()."";

pageheader($lang_info,"<meta http-equiv=\"refresh\" content=\"0;url=$referer\">");
msg_box($lang_info, $lang_admin_php[$admin_mode], $lang_continue, $referer);
pagefooter();
ob_end_flush();
incof();
break;
}