science-ation/committee_login.php
dave 2715d67aef - Fix login check for an expired password
- Allow user_personal.php to handle committee members
- Add password field if the editer in user_personal has access_super
- Allow a committee member to edit anyone in user_personal.php
- Convert auth_required to user_auth_required, and check for both a user type
  and an access level (if committee)
- Convert the committee to the new user system (BIG change :)
- Remove the ^M from admin/committees.php
2007-11-17 21:59:59 +00:00

62 lines
1.5 KiB
PHP

<?
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>
<input type="submit" value=<?=i18n("Login")?> />
</td></tr>
</table>
</form>
<?
}
send_footer();
?>