Location: PHPKode > scripts > SelectaPix Image Gallery > admin/member.php
<?php
/* +----------------------------------------------------------------------+
   |SelectaPix Open Source Gallery	                                      |
   +----------------------------------------------------------------------+
   | Copyright (c) 2004 OutOfTheTrees			                          |
   |                                                                      |
   | http://www.outofthetrees.co.uk/index.php                             |
   | 												                      |
   +----------------------------------------------------------------------+
   | This source file is subject to version 2.0 of the GPL license,       |
   | that is bundled with this package in the file LICENSE, and is        |
   | available through the world-wide-web at the following url:           |
   | http://www.outofthetrees.co.uk/license/2_0.txt.                      |
   | If you did not receive a copy of the SelectaPix license and are 	  |
   | unable to obtain it through the world-wide-web, please send a note   |
   | to hide@address.com so we can mail you a copy immediately.|
   +----------------------------------------------------------------------+ */
require_once("includes/inc_global_fns.php");
session_start();
if ($_POST['username'] && $_POST['passwd']) {
	// they have just tried logging in
	if (($news = $user->login($_POST['username'], $_POST['passwd'])) == 'true') {
      	// if they are in the database register the username & RoleLevel
      	if ($user->check_first_logon($_POST['username'], $_POST['passwd'])) {
			//does user need to change their password? if yes - show 'em the form
			do_html_header("First logon - please change your password");
			$user->check_valid_user(1);
	      	do_html_heading("<span>".SITE_NAME."</span> Admin");
			echo '<div id="breadcrumbtrail">Login</div>';
			echo '<p class="goodnews">This is the first time you have logged in with this password<br />';
			echo 'For reasons of security, please change your password now:</p>';
	 		display_password_form();
	 		do_html_footer('1', 'nokwikenav');
		}
		else {
			//otherwise let 'em in
			do_html_header('Admin home page');
			$user->check_valid_user(1);
			do_html_heading("<span>".SITE_NAME."</span> Admin");
			echo '<div id="breadcrumbtrail">Main Admin Area</div>';
			display_user_menu();
			do_html_footer('4');
		}
    }
    else {
      	// unsuccessful login
      	do_html_header("Problem");
		echo '<p>You are not logged in</p>';
      	do_html_heading("<span>".SITE_NAME."</span> Admin");
		echo '<div id="breadcrumbtrail">Login</div>';
		if($news == false) {
      		echo '<p class="badnews">You could not be logged in&#8212;you entered an incorrect Username or Password.<br />
              	Please contact the site administrator if you feel you received this message in error. Repeated entry of incorrect details will result in your IP address being logged and notification sent to the site administrator.<br />';
		}
		else {
			echo $news;
		}
		do_html_url("login.php", "Return to Login Page");
		if($news == false) {
			echo '</p>';
		}
		do_html_footer('1', 'nokwikenav');
      	exit;
    }
}
else {
	//otherwise let 'em in
	do_html_header('Admin home page');
	$user->check_valid_user(1);
	do_html_heading("<span>".SITE_NAME."</span> Admin");
	echo '<div id="breadcrumbtrail">Main Admin Area</div>';
	display_user_menu();
	do_html_footer('4');
}
?>
Return current item: SelectaPix Image Gallery