<?php
/************************************
 pragmaMx  Content Management System
 Copyright (c) 2006 pragmaMx Dev Team - http://pragmaMx.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, or
 (at your option) any later version.
 ***********************************
 $Source: /cvsroot/pragmamx/stable/blocks/block-Admin_Login.php,v $
 $Author: $Author: Stallion44, modified for pragmamx 0.1.9 by Alphaman $
 $Date: 2006/12/11 21:40:00 $

***************************************
** File for Pragmamx 0.1.10 modified **
***************************************

*/

global $prefix, $user_prefix, $multilingual;
if (!defined("mxMainFileLoaded")) die ("You can't access this file directly...");

$mxblockcache = TRUE;
$thisfile=basename(__file__);
mxGetLangfile("admin");

if(!isset($mxShowPragmaMxNews)) $mxShowPragmaMxNews=1; // falls noch gespeichert > einschalten
define('adminpragmamxinfourl','http://www.pragmamx.de/infonews.php?v='.urlencode(MX_VERSION).'&amp;lang='.urlencode($GLOBALS['currentlang']).'');


if (defined("MX_CO_ERROR")) {
mxErrorScreen(_ADMIN_BADLOGIN3);
}
mt_srand((double)microtime()*1000000);
$xcv = mt_rand();
mxSessionSetVar("reqcheck", $xcv);
$formmessage = mxSessionGetVar("formmessage");
mxSessionDelVar("formmessage");
    require_once("secureurl.class.php");
    $secure = new decryptor; 
    // Original-URL verschluesseln
    $crypted = base64_encode(MX_HOME_URL . $_SERVER["REQUEST_URI"]);


if (mxIsAdmin()) {
/*
extract(mxGetAdminSession());
	// $blockfiletitle = "<tr><td><strong>ADMIN BEREICH</strong></td></tr>";
	$content1 = "";

	$content = "\n<!-- $thisfile output start -->\n";
	$content .= "<div align='left'><font class=\"boxcontent\">";
	if ($GLOBALS['vkpUserregoption']==2){
		list($num) = sql_fetch_row(sql_query("select count(uid) from ${user_prefix}_users WHERE user_stat=0"));
		if(!empty($num)) $content1 .= "<img src=\"images/menu/oarrow.gif\" alt=\"\" border=\"0\">&nbsp;<b>$num</b>&nbsp;<a href=\"admin.php?op=mod_users\">"._AB_NEWUSERS."</a><br>";
		$num=0;
		}
	list($num) = sql_fetch_row(sql_query("select count(qid) from ${prefix}_queue"));
	if(!empty($num)) $content1 .= "<img src=\"images/menu/oarrow.gif\" alt=\"\" border=\"0\">&nbsp;<b>$num</b>&nbsp;<a href=\"admin.php?op=submissions\">"._AB_SUBMISSIONS."</a><br>";
	$num=0;
	list($num) = sql_fetch_row(sql_query("select count(id) from ${prefix}_reviews WHERE active='0';"));
	if(!empty($num)) $content1 .= "<img src=\"images/menu/oarrow.gif\" alt=\"\" border=\"0\">&nbsp;<b>$num</b>&nbsp;<a href=\"admin.php?op=reviews\">"._WREVIEWS."</a><br>";
	$num=0;
	list($num) = sql_fetch_row(sql_query("select count(lid) from ${prefix}_links_newlink;"));
	if(!empty($num)) $content1 .= "<img src=\"images/menu/oarrow.gif\" alt=\"\" border=\"0\">&nbsp;<b>$num</b>&nbsp;<a href=\"admin.php?op=Links\">"._AB_WLINKS."</a><br>";
	$num=0;
	list($num) = sql_fetch_row(sql_query("select count(requestid) from ${prefix}_links_modrequest where brokenlink=0;"));
	if(!empty($num)) $content1 .= "<img src=\"images/menu/oarrow.gif\" alt=\"\" border=\"0\">&nbsp;<b>$num</b>&nbsp;<a href=\"admin.php?op=LinksListModRequests\">"._AB_MODREQLINKS."</a><br>";
	$num=0;
	list($num) = sql_fetch_row(sql_query("select count(requestid) from ${prefix}_links_modrequest where brokenlink=1;"));
	if(!empty($num)) $content1 .= "<img src=\"images/menu/oarrow.gif\" alt=\"\" border=\"0\">&nbsp;<b>$num</b>&nbsp;<a href=\"admin.php?op=LinksListBrokenLinks\">"._AB_BROKENLINKS."</a><br>";
	$num=0;
	list($num) = sql_fetch_row(sql_query("select count(lid) from ${prefix}_downloads_newdownload"));
	if(!empty($num)) $content1 .= "<img src=\"images/menu/oarrow.gif\" alt=\"\" border=\"0\">&nbsp;<b>$num</b>&nbsp;<a href=\"admin.php?op=downloads\">"._AB_UDOWNLOADS."</a><br>";
	$num=0;
	list($num) = sql_fetch_row(sql_query("select count(requestid) from ${prefix}_downloads_modrequest where brokendownload=0;"));
	if(!empty($num)) $content1 .= "<img src=\"images/menu/oarrow.gif\" alt=\"\" border=\"0\">&nbsp;<b>$num</b>&nbsp;<a href=\"admin.php?op=DownloadsListModRequests\">"._AB_MODREQDOWN."</a><br>";
	$num=0;
	list($num) = sql_fetch_row(sql_query("select count(requestid) from ${prefix}_downloads_modrequest where brokendownload=1;"));
	if(!empty($num)) $content1 .= "<img src=\"images/menu/oarrow.gif\" alt=\"\" border=\"0\">&nbsp;<b>$num</b>&nbsp;<a href=\"admin.php?op=DownloadsListBrokenDownloads\">"._AB_BROKENDOWN."</a><br>";
	$num=0;
	list($num) = sql_fetch_row(sql_query("select count(pid) from ${prefix}_gallery_pictures_newpicture;"));
	if(!empty($num)) $content1 .=  "<img src=\"images/menu/oarrow.gif\" alt=\"\" border=\"0\">&nbsp;<b>$num</b>&nbsp;<a href=\"admin.php?op=GallAdmin\">"._AB_PICTURES."</a><br>";
	$num=0;
	list($num) = sql_fetch_row(sql_query("select count(faq_id) from ${prefix}_faqnew;"));
	if(!empty($num)) $content1 .=  "<img src=\"images/menu/oarrow.gif\" alt=\"\" border=\"0\">&nbsp;<b>$num</b>&nbsp;<a href=\"admin.php?op=FaqAnswerNew\">"."FAQ's"."</a><br>";
	$num=0;
	list($num) = sql_fetch_row(sql_query("select count(id) from ${prefix}_nukebook_queue;"));
	if(!empty($num)) $content1 .=  "<img src=\"images/menu/oarrow.gif\" alt=\"\" border=\"0\">&nbsp;<b>$num</b>&nbsp;<a href=\"admin.php?op=GuestBookAdmin\">"._GUESTBOOK."</a><br>";
	$num=0;
	if (mxModuleAllowed("Kalender")) {
		list($num) = sql_fetch_row(sql_query("SELECT Count(eid) FROM ${prefix}_events WHERE activ=0;"));
		if(!empty($num)) $content1 .=  "<img src=\"images/menu/oarrow.gif\" alt=\"\" border=\"0\">&nbsp;<b>$num</b>&nbsp;<a href=\"admin.php?op=CalendarAdmin\">"._AB_EVENTS."</a><br>";
		$num=0;
		}
	if (mxModuleAllowed("Webring")) {
		list($num) = sql_fetch_row(sql_query("select count(ringid) from ${prefix}_webring where activ=0;"));
		if(!empty($num)) $content1 .=  "<img src=\"images/menu/oarrow.gif\" alt=\"\" border=\"0\">&nbsp;<b>$num</b>&nbsp;<a href=\"modules.php?name=Webring&ring=1&file=index&mode=adminNewentry\">"._AB_WEBRING."</a><br>";
		$num=0;
		}

	if(!empty($content1)){
		$content .= "<tr><td>$content1</td></tr>";
		}
	$content .=  "<tr><td><a href=\"admin.php\"><img src=\"images/menu/sarrow.gif\" alt=\"\" border=\"0\">"._AB_TITLEBAR."</td></tr>\n";
	$content .=  "<tr><td><a href=\"admin.php?op=resetBlockCache\"><img src=\"images/menu/sarrow.gif\" alt=\"\" border=\"0\">"._AB_RESETBCACHE."</td></tr>\n";
	$content .=  "<tr><td><a href=\"admin.php?op=messages\"><img src=\"images/menu/barrow.gif\" alt=\"\" border=\"0\">"._AB_MESSAGE."</td></tr>\n";
	$content .=  "<tr><td><a href=\"admin.php?op=Configure\"><img src=\"images/menu/barrow.gif\" alt=\"\" border=\"0\">"._AB_SETTINGS."</td></tr>\n";
	$content .=  "<tr><td><a href=\"admin.php?op=logout\"><img src=\"images/menu/rarrow.gif\" alt=\"\" border=\"0\">"._AB_LOGOUT."</td></tr>\n";

	if(empty($content1)) $content .=  "<tr><td></td></tr>";

	$content .=  "</font></div>";
	$content .= "\n<!-- $thisfile output end -->\n";
*/
}
else
{
$content = "\n<!-- $thisfile output start -->\n";
$content .= "<div align='left'><font class=\"boxcontent\">";

    
$content .= "<form action=\"admin.php\" method=\"post\" name=\"adminlogin\"><table border=\"0\"><tr><td><font color=\"#000000\"><B>"._ADMINID."</B></font></td><td><input type=\"text\" NAME=\"aid\" size=\"10\" maxlength=\"25\"></td></tr><tr><td><font color=\"#00000\"><B>"._PASSWORD."</B></font></td><td><input type=\"hidden\" name=\"uri\" value=\"" . $crypted . "\"><input type=\"password\" NAME=\"pwd\" size=\"10\" maxlength=\"20\"></td></tr><tr><td><input type=\"hidden\" NAME=\"op\" value=\"login\"><input type=\"hidden\" NAME=\"check\" value=\"".MD5($xcv)."\"><input type=\"hidden\" NAME=\"sess\" value=\"".MD5(session_id())."\"><input type=\"submit\" VALUE=\""._LOGIN."\"></td></tr></table></form>";
$content .= "<script language='JavaScript' type='text/javascript'>\n<!--\ndocument.adminlogin.aid.focus();\n//-->\n</script>";

$content .=  "</font></div>";
$content .= "\n<!-- $thisfile output end -->\n";
}

?>