MOON
Server: Apache/2.2.21 (Unix) mod_ssl/2.2.21 OpenSSL/0.9.8e-fips-rhel5 mod_auth_passthrough/2.1 mod_bwlimited/1.4
System: Linux vps.panamaemb.org.sg 3.10.0-1160.80.1.vz7.191.4 #1 SMP Thu Dec 15 20:31:06 MSK 2022 x86_64
User: panama (500)
PHP: 5.2.17
Disabled: NONE
Upload Files
File: /home/panama/public_html_old/managesite/login.php
<?
	include("../include/config.php"); 
	include("../include/opner_admin.php");
	
	if(strlen(trim($_POST['btnlogin'])) > 0)
	{
		$db_check = new database();
		$db_check->where("username='".trim($functions->anti_injection(base64_encode($_POST['txtusername'])))."' and password='".trim($functions->anti_injection(base64_encode($_POST['txtpassword'])))."'");
		$db_check->selectstmt("admin_users");			

		if($db_check->row_count > 0)
		{
			$_SESSION['admin_user_name'] = $db_check->f_username; 
			$_SESSION['admin_user_id'] = $db_check->f_id;
			$_SESSION['is_superadmin'] = $db_check->f_isSuperAdmin;
			$_SESSION['is_report_authority'] = 1;
			
			$username = base64_decode($_SESSION['admin_user_name']);
			$userid = $_SESSION['admin_user_id'];
			$ip = $functions->getRealIpAddr();
			$host = $_SERVER['HTTP_HOST'];
			$start = date("Y-m-d h:m:s",$_SERVER['REQUEST_TIME']);
		
			$db = new database();			
			$db->data("admin_user_name",$functions->anti_injection($username));
			$db->data("admin_user_id",$functions->anti_injection($userid));
			$db->data("session_ip",$functions->anti_injection($ip));
			$db->data("session_host",$functions->anti_injection($host));
			$db->data("session_start",$functions->anti_injection($start));
			$db->addnew("admin_sessions");
			$inserted_id=mysql_insert_id();		
			$_SESSION['session_id']=$inserted_id;
			header("location:index.php");
		}
		else
		{
			$msg_error = "Invalid username or password";
		}
	}
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
	<title><?=SITE_ADMIN_TITLE?></title>
	<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
	<meta name="description" content="<?=META_DESCRIPTION?>" />
	<meta name="keywords" content="<?=META_KEYWORD?>" />
	<link href="css.css" rel="stylesheet" type="text/css" />
	<link rel="stylesheet" type="text/css" href="js/style.css" />
	
	<script type="text/javascript" src="js/lib/prototype.js"></script>
	<script type="text/javascript" src="js/src/effects.js"></script>
	<script type="text/javascript" src="js/validation.js"></script>
	<style>
	body{
	background: #ffffff url(images/html.jpg) repeat-x;
	}
	</style>
</head>
<body>
	<table border="0" cellpadding="0" cellspacing="0" width="100%">
	  <tr>
	  	<td height="30px;"><a title="<?=SITE_TITLE?>" href="../" class="backtosite">&larr; Back to the Embassy Website</a></td>
	  </tr>
	  <tr><td height="40"></td>
	  </tr>
	  <tr>
	  	<td align="center">
			<form name="frmlogin" id="frmlogin" method="post" enctype="multipart/form-data" action="login.php">
				<table align="center" border="0" cellpadding="0" cellspacing="0">
					<tr><td colspan="2" bgcolor="#990000" height="3px;"></td>
					</tr>
					<tr><td width="446" height="140" colspan="2" align="center" style="background-color:#C50500"><!--<img src="images/logo.jpg" width="262" height="113" />-->
					  <img src="images/logo.png" width="406" height="106" /></td>
					</tr>
					<tr>
						<td colspan="2" align="center" class="login_bg" valign="top">
							<table border="0" cellpadding="0" cellspacing="0" width="100%" align="center">
								<tr><td colspan="2">&nbsp;</td></tr>
								<tr><td colspan="2" align="center" valign="middle" class="welcome_msg">Welcome in Administrator Panel</td>
								</tr>
								<tr><td colspan="2" height="15px"></td></tr>
								<tr><td colspan="2" align="center" class="error"><?=$msg_error;?></td></tr>					
								<tr>
									<td width="32%" align="right" valign="top" class="login_text">User Name &nbsp;</td>
								  <td width="68%" align="left"><input type="text" name="txtusername" id="txtusername" class="loginrequired" title="Please provide username" /></td>
								</tr>
								<tr><td height="15px;"></td></tr>
								<tr>
									<td class="login_text" align="right" valign="top">Password &nbsp;</td>
									<td align="left"><input type="password" name="txtpassword" id="txtpassword" class="loginrequired" title="Please provide password" /></td>
								</tr>
								<tr><td height="15px;"></td></tr>
								<tr><td colspan="2" align="center"><input type="submit" class="btn" name="btnlogin" value="Login" style="border:none;" /></td></tr>
								<tr><td height="15px;"></td></tr>
								<tr><td colspan="2" align="center"><a href="forgotpassword.php" class="forget_pass">Lost your password?</a></td></tr>
						  </table>						</td>
					</tr>
					<tr>
					  <td colspan="2" align="center" valign="top" bgcolor="#353535" class="forget_pass">Copyright 2010 Embassy of Panama in Singapore </td>
				  </tr>
				</table>
			</form>
			<script type="text/javascript">
				function formCallback(result, form) {
					window.status = "valiation callback for form '" + form.id + "': result = " + result;
				}
				
				var valid = new Validation('frmlogin', {immediate : true, onFormValidate : formCallback});		
			</script>
		</td>
	  </tr>
	</table>
 </body>
</html>