<?php
/************************************************************************/
/* Maximus CMS: Web Portal System                                       */
/* ==============================                                       */
/*                                                                      */
/* Copyright (c) 2002 - 2006                                            */
/* http://www.php-maximus.fr                                            */
/* 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                                 */
/************************************************************************/
defined('MAXIMUS') or die ('Access denied block login MAXIMUS directly...');

global $sitekey, $gfx_chk, $admin_file;

mt_srand ((double)microtime()*1000000);
$maxran  = 1000000;
$random_num = mt_rand(0, $maxran);
$datekey = date("F j");
$rcode   = hexdec(md5($_SERVER['HTTP_USER_AGENT'] . $sitekey . $random_num . $datekey));
$code    = substr($rcode, 2, 6);

$content = "<form action=\"modules.php?name=Your_Account\" method=\"post\">";
$content .= "<center><font class=\"content\">"._NICKNAME."<br />";
$content .= "<input type=\"text\" name=\"username\" size=\"10\" maxlength=\"25\" /><br />";
$content .= ""._PASSWORD."<br />";
$content .= "<input type=\"password\" name=\"user_password\" size=\"10\" maxlength=\"20\" /><br />";
if (extension_loaded("gd") AND ($gfx_chk == 2 OR $gfx_chk == 4 OR $gfx_chk == 5 OR $gfx_chk == 7)) {
    $content .= ""._SECURITYCODE.": <img src='./?gfx=gfx&amp;random_num=$random_num' border='1' alt='"._SECURITYCODE."' title='"._SECURITYCODE."' /><br />\n";
    $content .= ""._TYPESECCODE."<br /><input type=\"text\" name=\"gfx_check\" size=\"7\" maxlenght=\"6\" />\n";
    $content .= "<input type=\"hidden\" name=\"random_num\" value=\"$random_num\" /><br />\n";
} else {
    $content .= "<input type=\"hidden\" name=\"random_num\" value=\"$random_num\" />";
    $content .= "<input type=\"hidden\" name=\"gfx_check\" value=\"$code\" />";
}
$content .= "<input type=\"hidden\" name=\"op\" value=\"login\" />";
$content .= "<input type=\"submit\" value=\""._LOGIN."\" /></font></center></form>";
$content .= "<center><font class=\"content\">"._ASREGISTERED."</font></center>";

if (defined('ADMIN_ALLOW') AND defined('USER_ALLOW')) {
    $content = "<center>"._ADMIN."<br />[ <a href=\"".$admin_file.".php?op=logout\">"._LOGOUT."</a> ]</center>";
}