science-ation/committee_login.php

62 lines
1.5 KiB
PHP
Raw Normal View History

<?
require("common.inc.php");
if($_POST['action']=="login" )
{
if($_POST['pass'] && $_POST['email'])
{
$q=mysql_query("SELECT * FROM committees_members WHERE email='".$_POST['email']."' AND password='".$_POST['pass']."' AND deleted='N'");
if(mysql_num_rows($q)==1)
{
$r=mysql_fetch_object($q);
$_SESSION['email']=$r->email;
$_SESSION['committee_member_id']=$r->id;
send_header("Committee Login", array());
echo happy(i18n("Successfully logged in"));
echo i18n("Use the menu on the left to access the committee pages");
}
else
{
send_header("Committee Login", array());
echo error(i18n("Invalid Email/Password"));
}
}
else
{
send_header("Committee Login", array());
echo error(i18n("Email/Password missing"));
}
}
else if($_GET['action']=="logout")
{
unset($_SESSION['email']);
unset($_SESSION['committee_member_id']);
send_header("Committee Login", array());
echo notice(i18n("You have been successfully logged out"));
}
else
{
send_header("Committee Login", array());
?>
<form method="post" action="committee_login.php">
<input type="hidden" name="action" value="login" />
<table><tr><td>
<?=i18n("Email")?>:</td><td><input type="text" name="email" size="20" />
</td></tr>
<tr><td>
<?=i18n("Password")?>:</td><td><input type="password" size="20" name="pass" />
</td></tr>
<tr><td colspan=2>
2007-02-06 15:57:26 +00:00
<input type="submit" value=<?=i18n("Login")?> />
</td></tr>
</table>
</form>
<?
}
send_footer();
?>