Code Search for Developers
 
 
  

login.php from Brim at Krugle


Show login.php syntax highlighted

<?php

require_once 'framework/model/AdminServices.php';
require_once 'framework/util/BrowserUtils.php';
//
// If you wish another language on your login screen, change the following two
// lines to include the appropriate dictionaries (and optionally translate them ;-)
//
include 'framework/i18n/messages_en.php';
include 'framework/i18n/dictionary_en.php';

/**
 * The login screen
 *
 * This file is part of the Brim project.
 * The brim-project is located at the following
 * location: {@link http://www.brim-project.org/ http://www.brim-project.org/}
 *
 * <pre> Enjoy :-) </pre>
 *
 * @author Barry Nauta
 * @package org.brim-project.framework
 *
 * @copyright [brim-project.org] - Copyright (c) 2003 - 2006 Barry Nauta
 *
 * @license http://opensource.org/licenses/gpl-license.php
 * The GNU Public License
 */
$adminServices = new AdminServices ();
$browserUtils = new BrowserUtils ();

$allowAnonymous = $adminServices->getAdminConfig ('allow_account_creation');
$allowAnonymousSignon = false;
if (!is_bool ($allowAnonymous))
{
	if ($allowAnonymous == 1)
	{
		$allowAnonymousSignon = TRUE;
	}
}
else
{
	$allowAnonymousSignon = $allowAnonymous;
}
if ($browserUtils->browserIsPDA ())
{
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
        "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
	<title>Brim - login</title>
	<style type="text/css" media="screen"
		>@import "framework/view/css/loginpda.css";</style>
</head>
<body>
<div id="content">
	<h1>
	<?php
   		if (isset ($_GET['message']))
   		{
   			$messageId = $_GET['message'];
   			$message = $dictionary[$messageId];
			if (isset ($message))
			{
				echo ($message);
			}
			else
			{
				echo ($dictionary['msg_unknownError']);
			}
		}
		else
		{
			echo ($dictionary['msg_provideUsernameAndPassword']);
		}
		?>
	</h1>
	<form action="loginAction.php" method="post">
		<table class="login">
		<?php
			if ($allowAnonymousSignon)
			{
		?>
			<tr>
				<td>
					<?php echo ($dictionary['msg_name']); ?>:
				</td>
			</tr>
			<tr>
	   			<td> <input type="text" name="username" tabindex="1" id="username"
				/> </td>
			</tr>
			<tr>
				<td> <input type="Checkbox" name="signUp" /> </td>
			</tr>
			<tr>
				<td>
					<?php echo ($dictionary['msg_signUp']); ?>:
				</td>
			</tr>
			<tr>
				<td>
					<?php echo ($dictionary['msg_password']); ?>:
				</td>
			</tr>
			<tr>
				<td> <input type="password" name="password" tabindex="2"
				/> </td>
			</tr>
			<tr>
				<td> <input type="Checkbox" name="rememberMe" /> </td>
			</tr>
			<tr>
				<td>
					<?php echo ($dictionary['msg_rememberMe']); ?>:
				</td>
			</tr>
			<tr>
				<td> &nbsp; </td>
			</tr>
			<tr>
				<td colspan="2"> <input type="submit" 
					value="<?php echo $dictionary['msg_submit'] ?>" 
					name="submit" /> </td>
			</tr>
			<tr>
				<td> <a href="lostPassword.php"
					><?php echo ($dictionary['msg_lostPassword']); ?></a> </td>
			</tr>
		<?php
			} else {
		?>
			<tr>
				<td>
					<?php echo ($dictionary['msg_name']); ?>:
					<input type="text" id="username" name="username" tabindex="1" /> </td>
			</tr>
			<tr>
				<td>
					<?php echo ($dictionary['msg_password']); ?>:
					<input type="password" name="password" tabindex="2" /> </td>
			</tr>
			<tr>
				<td>
					<?php echo ($dictionary['msg_rememberMe']); ?>:
					<input type="Checkbox" name="rememberMe" />
					<input type="submit" value="Submit" name="submit" />
				</td>
			</tr>
			<tr>
				<td>
					<a href="lostPassword.php"
						><?php echo ($dictionary['msg_lostPassword']); ?></a>
				</td>
			</tr>
		<?php
			}
		?>
		</table>
	</form>
	<!--
		The GPL license states that copyright information
		may not be removed. Please be kind and
		provide the copyright notice (you can of course modify it so it fits
		in your layout...)
	-->
	<div id="copyright">
		Brim <?php echo ($dictionary['version']) ?>.
		<?php echo ($dictionary['msg_copyright']); ?>
	</div>
</div>
<script type="text/javascript">
	document.getElementById ("username").focus();
</script>
</body>
</html>
<?php
}
else
{
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
        "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
	<title>Brim - login</title>
	<script type="text/javascript" src="ext/jQuery/jquery.js"></script>
	<script type="text/javascript" src="ext/jQuery/jq-corner.js"></script>
	<script type="text/javascript">
		window.onload=function()
		{
			$("div#content").corner("20px");
		}
	</script>
	<style type="text/css" media="screen"
		>@import "framework/view/css/login.css";</style>
</head>
<body>
<div id="content">
	<img src="framework/view/pics/login/logo.gif" 
		alt="[brim-project]" width="571" height="76"><br />
	<h1>
	<?php
   		if (isset ($_GET['message']))
   		{
   			$messageId = $_GET['message'];
   			$message = $dictionary[$messageId];
			if (isset ($message))
			{
				echo ($message);
			}
			else
			{
				echo ($dictionary['msg_unknownError']);
			}
		}
		else
		{
			echo ($dictionary['msg_provideUsernameAndPassword']);
		}
		?>
	</h1>
	<!--
		Welcome to the demo-site of brim. 
		You can login using username 'test' and password 'test'.
	-->
	<form action="loginAction.php" method="post">
		<table class="login">
		<?php
			if ($allowAnonymousSignon)
			{
		?>
			<tr>
				<td>
					<?php echo ($dictionary['msg_name']); ?>:
				</td>
	   			<td> <input type="text" name="username" tabindex="1" id="username"
				/> </td>
				<td> <input type="Checkbox" name="signUp" /> </td>
				<td>
					<?php echo ($dictionary['msg_signUp']); ?>:
				</td>
			</tr>
			<tr>
				<td>
					<?php echo ($dictionary['msg_password']); ?>:
				</td>
				<td> <input type="password" name="password" tabindex="2"
				/> </td>
				<td> <input type="Checkbox" name="rememberMe" /> </td>
				<td>
					<?php echo ($dictionary['msg_rememberMe']); ?>:
				</td>
			</tr>
			<tr>
				<td> &nbsp; </td>
				<td colspan="2"> <input type="submit" 
					value="<?php echo $dictionary['msg_submit'] ?>" 
					name="submit" /> </td>
				<td> <a href="lostPassword.php"
					><?php echo ($dictionary['msg_lostPassword']); ?></a> </td>
			</tr>
		<?php
			} else {
		?>
			<tr>
				<td>
					<?php echo ($dictionary['msg_name']); ?>:
					<input type="text" id="username" name="username" tabindex="1" /> </td>
				<td>
					<?php echo ($dictionary['msg_password']); ?>:
					<input type="password" name="password" tabindex="2" /> </td>
			</tr>
			<tr>
				<td>
					<?php echo ($dictionary['msg_rememberMe']); ?>:
					<input type="Checkbox" name="rememberMe" />
					<input type="submit" value="Submit" name="submit" />
				</td>
				<td>
					<a href="lostPassword.php"
						><?php echo ($dictionary['msg_lostPassword']); ?></a>
				</td>
			</tr>
		<?php
			}
		?>
		</table>
	</form>
	<!--
		The GPL license states that copyright information
		may not be removed. Please be kind and
		provide the copyright notice (you can of course modify it so it fits
		in your layout...)
	-->
	<div id="copyright">
		Brim <?php echo ($dictionary['version']) ?>.
		<?php echo ($dictionary['msg_copyright']); ?>
	</div>
</div>
<script type="text/javascript">
	document.getElementById ("username").focus();
</script>
</body>
</html>
<?php } ?>




See more files for this project here

Brim

BRIM is a MVC framework, written in PHP and based on items with a hierarchical relationship. The list of plugins make BRIM a Information Manager with plugins like bookmarks, a calendar, contacts tasks, notes, RSS etc. The application is multilingual.

Project homepage: http://sourceforge.net/projects/brim
Programming language(s): JavaScript,PHP,SQL
License: other

  documentation/
    css/
      brim.css
      index.php
    pics/
      background.jpg
      design.png
      feet_booby.jpg
      index.php
      mvc.gif
      question_booby.gif
      question_booby.jpg
      shadow.gif
      shadow2.gif
      shadowAlpha.png
      sleeping_booby.jpg
      treeback.jpg
      white_boobies.jpg
    booby2brim_changes.txt
    changelog.txt
    coding_conventions.html
    contributions.html
    design.html
    directory_structure.html
    faq.html
    gpl.html
    how_to_enable_calendar_reminders_per_email.html
    how_to_enable_calendar_reminders_per_email.txt
    how_to_write_a_template.html
    how_to_write_a_template.txt
    index.php
    installation_guide.html
    mvc.html
    security.html
    todo.txt
    uninstall.html
    upgrade_guide.html
    used_versions.txt
    which_package.html
  ext/
    File/
      IMC/
        Build/
          vCard.php
        Parse/
          vCalendar.php
          vCard.php
        Build.php
        Parse.php
      IMC.php
    Savant/
      Savant/
        docs/
          README
          index.php
        filters/
          Savant_Filter_colorizeCode.php
          Savant_Filter_trimwhitespace.php
          index.php
        plugins/
          Savant_Plugin_ahref.php
          Savant_Plugin_checkbox.php
          Savant_Plugin_checkboxes.php
          Savant_Plugin_cycle.php
          Savant_Plugin_dateformat.php
          Savant_Plugin_image.php
          Savant_Plugin_input.php
          Savant_Plugin_javascript.php
          Savant_Plugin_modify.php
          Savant_Plugin_options.php
          Savant_Plugin_radios.php
          Savant_Plugin_stylesheet.php
          Savant_Plugin_textarea.php
          index.php
        Filter.php
        Plugin.php
        index.php
      Savant.php
      index.php
    adodb/
      contrib/
      datadict/
      drivers/
      lang/
      pear/
      perf/
      session/
      xsl/
      adodb-csvlib.inc.php
    jQuery/
    javascript/
    overlib/
    simpletest/
    JSON.php
    PEAR.php
    index.php
    json.js
    package.xml
  framework/
  plugins/
  templates/
  tools/
  AboutController.php
  AdminController.php
  BookmarkController.php
  BookmarkSidebarController.php
  HelpController.php
  PluginController.php
  PreferenceController.php
  README.txt
  SearchController.php
  SysinfoController.php
  TranslateController.php
  UPGRADE.txt
  UserController.php
  brim.php
  favicon.ico
  index.php
  install.php
  login.php
  loginAction.php
  logout.php
  lostPassword.php
  lostPasswordAction.php
  signup.php
  signupAction.php
  test.php