]*script*\"?[^>]*>", $check_url)) || (eregi("<[^>]*object*\"?[^>]*>", $check_url)) || (eregi("<[^>]*iframe*\"?[^>]*>", $check_url)) || (eregi("<[^>]*applet*\"?[^>]*>", $check_url)) || (eregi("<[^>]*meta*\"?[^>]*>", $check_url)) || (eregi("<[^>]*style*\"?[^>]*>", $check_url)) || (eregi("<[^>]*form*\"?[^>]*>", $check_url)) || (eregi("\([^>]*\"?[^)]*\)", $check_url)) || (eregi("\"", $check_url))) die ("Hijacking attempt, dying....");
}
unset($check_url);
// Installs the common functions
require_once "./LightNEasy/common.php";
// Opens the database
$sqldbdb=opendb();
// Reads the setup to the global array $set
$set = array();
readsetup();
if($set['language']=="") $set['language']="en_US";
if($set['langeditor']=="") $set['langeditor']="en";
// Checks if this file is not called remotely
if (!eregi($set['indexfile'], sv('PHP_SELF')) && !eregi('index.php', sv('PHP_SELF')))
die ('Access Denied!');
// Reads the language file
require_once "./languages/lang_".$set['language'].".php";
if($_GET['do']=="logout") {
logout();
unset($_GET['do']);
}
// Checks if there was a login attempt or a login cookie exists
login();
// Disables $_GET and $_POST if the user is not logged in, except for the allowed posts
// Disables $_GET except for login and sitemap
if($_GET['do']!="profile" && $_GET['do']!="login" && $_GET['do']!="sitemap" && $_SESSION['adminlevel'] < 4) unset ($_GET['do']);
// Disables $_POST['submit'] except for login, send message and send comment
if($_POST['submit']!="Send message" && $_POST['submit']!="sendcomment" && $_POST['submit']!="saveprofile" && $_SESSION[$set['password']] != "1") unset ($_POST['submit']);
### LightNEay global variables: ###
// $set - settings
// $langmessage - the language file
// edit these 2 following values to your convenience
$max_upload_file_size=2500000;
$max_upload_image_size=250000;
// Global variable containing messages to the user;
$message="";
// $menu - contains the menu
$menu=array(array('m1','m2','m3','link','name'));
// JSS added title and keywords field identifiers
$selected=array('index','m2','m3','link','name','description','template','title','keywords');
// $selected - contains the information of the current page
// $pagenum - the file name of the current page
$pagenum=sanitize($_GET['page']);
if($pagenum=="") $pagenum="index";
$myserver=$_SERVER['SERVER_NAME'];
// $out - String containing the page to be sent to the browser
$out="";
### End of global variables ###
// treats the several possible inputs
switch($_POST['submit']) {
case "saveprofile":
if($_SESSION['adminlevel']>=2)
$message=saveprofile();
else
$message=$langmessage[98];
break;
default:
}
// read the menu
readmenu();
// reads the admin functions if the user is logged in
if($_SESSION['adminlevel']>3) {
require_once "./LightNEasy/admin.php";
//call admin functions for treating inputs if logged in
treat_posts();
}
// Sets the path to the template file
if($selected['template']=="") $selected['template']=$set['template'];
$templatepath="./templates/".$selected['template']."/template.php";
//defaults to lightneasy template if selected template not found
if (!file_exists($templatepath)) $templatepath="templates/lightneasy/template.php";
if (!file_exists($templatepath)) die ($templatepath." ".$langmessage[109]);
if(file_exists("LightNEasy/install.php"))
if(!@unlink("LightNEasy/install.php"))
$message=$langmessage[24]."
".$message;
else
@unlink("LightNEasy/install1.php");
if($_GET['do']=="generate") generate();
//if($_GET['do']=="generate") $message="Function disabled";
if($admintemplate) {
$selected['template']="admintemplate";
$templatepath="templates/".$selected['template']."/template.php";
}
//Read the template and execute the template markers
$page=file_get_contents($templatepath);
while($page != "") {
if($pagearray=explode($set['openfield'],stripslashes($page),2)) {
$out.=$pagearray[0];
$page=$pagearray[1];
if($pagearray=explode($set['closefield'],$page,2)) {
$command=trim($pagearray[0]);
$page=$pagearray[1];
switch($command) {
case "content": $out .= content(); break;
case "expmenu": $out .= expmenu(0); break;
case "extra": $out .= extra(); break;
case "footer": $out .= $set['footer']; break;
case "fullmenu": $out .= fullmenu(0); break;
case "header": $out .= printheader(0,$selected['name']); break;
case "homelink": $out .= '$langmessage[111]"; break;
case "image": $out .= "./templates/".$selected['template']."/images/"; break;
case "login": $out .= loginout(); break;
case "loginform": $out .= loginform(); break;
case "mainmenu": $out .= mainmenu(0); break;
case "mainmenu1": $out.= mainmenu(0,1); break;
case "mainmenu2": $out.= mainmenu(0,2); break;
case "mainmenu3": $out.= mainmenu(0,3); break;
case "subtitle": $out .= $set['subtitle']; break;
case "title": $out .= ''.$set['title'].''; break;
case "selected": $out .= $selected['name']; break;
case "sitemap": $out .= sitemap(0); break;
case "submenu": $out .= submenu(0); break;
case "treemenu": $out.= treemenu(0); break;
default: {
if(strpos($command, "plugin")!== false) {
$aa=explode(" ",$command,2);
$pluginpath="plugins/".trim($aa[1]);
if(file_exists($pluginpath."/first.mod"))
$out=file_get_contents($pluginpath."/first.mod").$out;
if(file_exists($pluginpath."/header.mod"))
$out=str_replace("",file_get_contents($pluginpath."/header.mod")."\n",$out);
if(file_exists($pluginpath."/onload.mod"))
$out=str_replace("