diff options
author | Preston Cody <codeman@gentoo.org> | 2006-04-22 19:26:31 +0000 |
---|---|---|
committer | Preston Cody <codeman@gentoo.org> | 2006-04-22 19:26:31 +0000 |
commit | 6a12cd6dacc358cc26cfb2f93fa0d0bfb9587cbc (patch) | |
tree | 618261615e892bb3821ee382e335d0acf64652b1 /scire/login.php | |
parent | initial scire files and directory added. more will come soon (diff) | |
download | scire-6a12cd6dacc358cc26cfb2f93fa0d0bfb9587cbc.tar.gz scire-6a12cd6dacc358cc26cfb2f93fa0d0bfb9587cbc.tar.bz2 scire-6a12cd6dacc358cc26cfb2f93fa0d0bfb9587cbc.zip |
updating code
svn path=/; revision=42
Diffstat (limited to 'scire/login.php')
-rw-r--r-- | scire/login.php | 53 |
1 files changed, 53 insertions, 0 deletions
diff --git a/scire/login.php b/scire/login.php new file mode 100644 index 0000000..d520093 --- /dev/null +++ b/scire/login.php @@ -0,0 +1,53 @@ +<?php + +include('Smarty.class.php'); +include('DBInterface.php'); +#phpinfo(); +if ($_POST['username']) { + $users = array(); + $users = get_scire_users(); + foreach ($users as $user) { + if ($_POST['username'] == $user[0]) { + if ($_POST['passwd'] and (crypt($_POST['passwd'],447470567) == $user[1])) { + print "<h3>Found a match. Setting user's session now. ".$user[0]."</h3>"; + #session_start(); + #session_register('userid', $user[0]); + $_SESSION['userid'] = $user[0]; + session_write_close(); + print_r($_SESSION); + #header("Location: index.php"); + exit; + } + else { + session_unset(); + print "<h1>Invalid password supplied!</h1>"; + exit; + } + } + } + #session_unset(); + #print "<h1>Invalid user supplied!</h1>"; + +} + +include('main_smarty.php'); +$smarty->display('header.tpl'); +?> +<b>Please Login to use Scire:</b> +<form id="form1" name="form1" method="post" action="login.php"> + <label>Username + <input name="username" type="text" id="username" /> + </label> + <p> + <label>Password + <input name="passwd" type="password" id="passwd" /> + </label> + </p> + <p> + <input name="submit" type="Submit" label="Submit"> + </p> +</form> + +<?php +$smarty->display('leftbar.tpl'); +?> |