Location: PHPKode > projects > Basic Announce > Basic Announce Version 4.0/login.php
<?php
################################################################################
##              -= YOU MAY NOT REMOVE OR CHANGE THIS NOTICE =-                 #
## --------------------------------------------------------------------------- #
##  ApPHP AdminPanel Pro                                                       #
##  Developed by:  ApPHP <hide@address.com>                                      #
##  License:       GNU LGPL v.3                                                #
##  Site:          http://www.apphp.com/php-adminpanel/                        #
##  Copyright:     ApPHP AdminPanel (c) 2006-2011. All rights reserved.        #
##                                                                             #
################################################################################

    include_once("inc/functions.inc.php");    

    session_start();

    require_once("inc/config.inc.php");
    require_once("inc/settings.inc.php");
	require_once("inc/languages/".$SETTINGS['site_language'].".php");

	$log 			= (isset($_REQUEST['log'])) ? "out" : "";
    $msg 			= (isset($_REQUEST['msg'])) ? (int)$_REQUEST['msg'] : "";   
    $adm_logged 	= (isset($_SESSION['adm_logged'])) ? $_SESSION['adm_logged'] : false;
    $login_type 	= isset($_GET['login_type']) ? prepare_input($_GET['login_type']) : "";
	$ses_logins_timeout = isset($SETTINGS['excessive_logins_timeout']) ? (int)$SETTINGS['excessive_logins_timeout'] : "";
	$admin_username = "";
	$admin_password = "";
	$user_type      = "";
	$remember_me    = "";
	
    if($adm_logged == true){	    
		exit;    		
    }

	if($SETTINGS['allow_remember_me'] && $log == ""){
		// check if name and password were saved
		$admin_username = (isset($_COOKIE['rem_name']) && check_bad_chars($_COOKIE['rem_name'])) ? base64_decode($_COOKIE['rem_name']) : "";
		$admin_password = (isset($_COOKIE['rem_password']) && check_bad_chars($_COOKIE['rem_password'])) ? base64_decode($_COOKIE['rem_password']) : "";
		$user_type      = (isset($_COOKIE['rem_user_type']) && check_bad_chars($_COOKIE['rem_user_type'])) ? base64_decode($_COOKIE['rem_user_type']) : "";
		$remember_me    = (isset($_COOKIE['rem_name']) && ($_COOKIE['rem_name'] != "")) ? "checked" : "";
	}
	if($login_type == "") $login_type = $user_type;
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3c.org/TR/1999/REC-html401-19991224/loose.dtd">
<html>
<head>
    <title><?php echo $SETTINGS['site_name']; ?> :: <?php echo lang('admin_panel'); ?> :: <?php echo lang('login'); ?></title>
    <meta http-equiv=Content-Type content="text/html; charset=utf-8">
    <link href="styles/<?php echo $SETTINGS['css_style'];?>/style.css" type="text/css" rel="stylesheet">

	<script type='text/javascript' src='modules/datagrid/modules/jsafv/lang/jsafv-en.js'></script>
	<script type='text/javascript' src='modules/datagrid/modules/jsafv/chars/diactric_chars_utf8.js'></script>
	<script type='text/javascript' src='modules/datagrid/modules/jsafv/form.scripts.js'></script>
    
	<script type="text/javascript" src="js/functions.js"></script>
    <script type="text/javascript" src="js/base64.js"></script>

    <script type="text/javascript" >
	function onSubmitMyCheck(val){
		if(onSubmitCheck(document.forms['frmLogin'], false, false)){
			return true;
		}else{
			return false;
		}
	}	 
    </script>
</head>
<body>
<table cellspacing="1" cellpadding="6" width="100%" height="75%" align="center" border="0">
<tbody>
<tr>
    <td valign="middle" nowrap>            
		<?php
			if($msg == "1"){
				draw_message("error", lang('error_wrong_username_password'), true, "370px");
			}else if($msg == "2"){
				draw_message("error", str_replace("_MIN_", $ses_logins_timeout, lang('error_login_attempts_exceeded')), true, "370px");
			}
		?>
		<br />
		<form class="login_form" name="frmLogin" action="check_login.php" method="post">                                    
		<input type="hidden" value="login" name="do"> 
		<table class="tborder" cellspacing="1" cellpadding="0" width="370px" align="center" border="0">
		<tbody>
		<tr>
			<td class="tcat" style="padding:7px;padding-top:7px;" colspan="2" align="center"><strong><?php echo lang('msg_enter_username_password'); ?></strong></td>
		</tr>
		<tr>
			<td class="tcat2" style="padding:6px;">		
				<table cellspacing="0" align="center" width="93%" border="0" style="margin-top:7px;margin-bottom:2px;">
				<tbody>
				<tr valign="top">
					<td colSpan="3"><?php echo lang('username'); ?>:<br /><input type="text" style="width:325px;margin-top:2px; margin-bottom:3px;" maxlength="100" id="rt_admin_username" name="rt_admin_username" value="<?php echo $admin_username; ?>" title="<?php echo lang('username'); ?>" autocomplete="off"></td>
				</tr>
				<tr valign="top">
					<td colSpan="3"><?php echo lang('password'); ?>:<br /><input type="password" style="width:325px;margin-top:2px; margin-bottom:3px;" maxlength="100" id="rt_admin_password" name="rt_admin_password" value="<?php echo $admin_password; ?>" title="<?php echo lang('password'); ?>" autocomplete="off"></td>
				</tr>
				<tr><td nowrap height='5px' colspan="3"></td></tr>
				<tr>				
					<?php
						if($SETTINGS['allow_remember_me']){
							echo "<td valign='top' width='20px'><input type='checkbox' style='margin-left:1px;' value='1' id='st_remember' name='st_remember' ".$remember_me." title='".lang('remember_me')."' /></td>";
							echo "<td align='left'><label for='st_remember'>".lang('remember_me')."</label></td>";
						}else{
							echo "<td colsapn='2'></td>";
						}
					?>
					<td align="right" style="padding-right:0px;">
						<?php echo lang('login_as'); ?>:
						<select name="login_type">
							<option value='admin' <?php echo ($login_type == "admin") ? "selected='selected'" : ""; ?>><?php echo lang('admin'); ?></option>
							<?php if(module_istalled('users')){ ?>
							<option value='user' <?php echo ($login_type == "user") ? "selected='selected'" : ""; ?>><?php echo lang('user'); ?></option>
							<?php } ?>
						</select>
					</td>
				</tr>			
				<tr valign="top">
					<td align="center" colspan="3">
						<table style="margin-top:8px; padding-top:8px; width:100%;" cellspacing='0'>
						<tr>
							<td></td>
							<td rowspan="2" align="right" valign="bottom" width="48px"><img src="images/lock.png" style="margin-right:-7px;" alt="" /></td>
						</tr>
						<tr>
							<td align="left" style="border-top:1px solid #a7a7a7;">
								<input accessKey="s" type="submit" value="<?php echo lang('login');?>" onClick="return onSubmitMyCheck()" />
								<?php
									if($SETTINGS['allow_password_recovery']){
										echo "&nbsp;<a href='forgot_password.php'>".lang('forgot_password')."?</a>";	
									}
								?>
							</td>
						</tr>
						</table>
					</td>
				</tr>			
				</tbody>
				</table>			
			</td>
		</tr>
		</tbody>
		</table>
		</form>    
    </td>
</tr>
</tbody>
</table>          
</body>
</html>

<script type="text/javascript">
<!--
<?php if($remember_me == "checked"){ ?>
	document.getElementById("rt_admin_password").focus();
<?php }else{ ?>
	document.getElementById("rt_admin_username").focus();
<?php } ?>
//-->
</script>
Return current item: Basic Announce