home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
ftp.ee.pdx.edu
/
2014.02.ftp.ee.pdx.edu.tar
/
ftp.ee.pdx.edu
/
oss
/
cvs-2004
/
bahasa
/
web
/
login.php,v
< prev
next >
Wrap
Text File
|
2003-10-20
|
7KB
|
392 lines
head 1.7;
access;
symbols
Initial:1.1.1.1 bule:1.1.1;
locks; strict;
comment @# @;
1.7
date 2003.10.20.00.21.45; author bule; state Exp;
branches;
next 1.6;
1.6
date 2003.10.18.00.33.41; author bule; state Exp;
branches;
next 1.5;
1.5
date 2003.10.06.00.39.27; author bule; state Exp;
branches;
next 1.4;
1.4
date 2003.10.01.06.51.29; author bule; state Exp;
branches;
next 1.3;
1.3
date 2003.09.11.05.28.22; author bule; state Exp;
branches;
next 1.2;
1.2
date 2003.08.19.19.05.16; author bule; state Exp;
branches;
next 1.1;
1.1
date 2003.08.12.19.18.23; author bule; state Exp;
branches
1.1.1.1;
next ;
1.1.1.1
date 2003.08.12.19.18.23; author bule; state Exp;
branches;
next ;
desc
@@
1.7
log
@*** empty log message ***
@
text
@<?
session_start();
require_once("../php/Indonesia.php");
require_once("../php/Web.php");
//////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////
// Project Name: Bahasa Indonesia Dictionary
// Directory: bahasa/web
// File Name: login.php
// Author(s): John L. Whiteman
// Created: June 23, 2003
// Modified: October 19, 2003
// Description: The purpose of this unrestricted access PHP web
// client page is allow administrators to log into
// the restricted web pages.
//
// Copyright (c) 2003 John L. Whiteman
//
// Permission is herby granted, free of charge, to any person obtaining a
// copy of this software, data, and associated documentation files
// (the "Software"), to deal in the Software without restriction,
// including without limitation the rights to use, copy, modify, merge,
// publish, distribute, sublicense, and/or sell copies of Software, and to
// permit persons to whom the Software is furnished to do so, subject to
// the following conditions:
//
// The above copyright notice and this permission notice shall be
// included in all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
// IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR
// ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHERE IN AN ACTION OF CONTRACT,
// TORT OR OTHERWISE, ARISING IN THE SOFTWARE.
//////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////
$indonesia = new Indonesia();
$web = new Web();
if (($_SESSION['ADMIN']) || ($_SESSION['DB_ADMIN'])) {
$web->redirect("admin.php");
exit;
} else if (
(isset($_POST['name'])) &&
(isset($_POST['password'])) &&
(isset($_POST['user_flag']))) {
$errstr =
$indonesia->login($_POST['name'], $_POST['password']);
if ($errstr == "") {
if ($_POST['user_flag'] == "admin") {
$_SESSION['ADMIN'] = $_POST['name'];
$web->redirect("admin.php");
exit;
} else {
$_SESSION['DB_ADMIN'] = $_POST['name'];
$web->redirect("admin.php");
exit;
}
}
}
?>
<html>
<head>
<title>Bahasa Indonesia Dictionary: Login</title>
<link href="bahasa.css" rel="stylesheet" type="text/css">
<script type="text/javascript" src="bahasa.js"></script>
<script language="Javascript" type="text/javascript">
<!--
//////////////////////////////////////////////////////////////////////////////
function verify() {
var name = document.login.name.value;
name = trim(name);
if (is_white_space(name)) {
alert("You must enter your name.");
document.login.name.focus();
return(false);
}
var password = document.login.password.value;
if (is_white_space(password)) {
alert("You must enter your password.");
document.login.password.focus();
return(false);
}
return(true);
}
//////////////////////////////////////////////////////////////////////////////
// -->
</script>
</head>
<html>
<body>
<?
$status = $indonesia->get_dictionary_status();
$user_flag = "";
$user = "";
if (
($status["status"] == 1) ||
($status["status"] == 2) ||
($status["status"] == 3)) {
$web->show_logo("Database Administrator Login");
$user_flag = "database";
$user = "Login as Database Administrator!";
} else {
$web->show_logo("Web Administrator Login");
$user_flag = "admin";
$user = "Login as an Administrator!";
}
?>
<a href="search.php">Search Dictionary</a>
<form name="login" method="post" onSubmit='return verify()'>
<table cellpadding="3" cellspacing="3" border="0">
<tr>
<td>Name:</td>
<td>
<input type="text" name="name" size="50" maxlength="255">
</td>
</tr>
<tr>
<td>Password:</td>
<td>
<input type="password" name="password" size="50" maxlength="255">
</td>
</tr>
<tr>
<td colspan="2" align="right">
<input type="submit" value="<?echo ${user};?>">
</td>
</tr>
</table>
<input type="hidden" name="user_flag" value=<?print "\"${user_flag}\"";?>>
</form>
<script language="Javascript" type="text/javascript">
document.login.name.focus();
</script>
</body>
</html>
@
1.6
log
@*** empty log message ***
@
text
@d12 1
a12 1
// Modified: October 17, 2003
d80 2
@
1.5
log
@*** empty log message ***
@
text
@d12 1
a12 1
// Modified: October 05, 2003
d79 3
a81 3
<title>
Bahasa Indonesia Dictionary: Login
</title>
d84 2
a85 26
function is_white_space(stoken) {
if (stoken == null) return(true);
if (stoken == '') return(true);
if (stoken == "") return(true);
return(false);
}
function trim(stoken) {
if (is_white_space(stoken)) {
return(stoken);
}
stoken = stoken.replace(/^\s*/, "");
stoken = stoken.replace(/\s*&/, "");
return(stoken);
}
d114 2
a115 1
@
1.4
log
@*** empty log message ***
@
text
@d12 1
a12 1
// Modified: September 30, 2003
d156 1
a156 2
print "
<h2>Bahasa Indonesia Dictionary: Database Login</h2>\n";
d164 1
a164 2
print "
<h2>Bahasa Indonesia Dictionary: Administrator Login</h2>\n";
@
1.3
log
@*** empty log message ***
@
text
@d12 1
a12 1
// Modified: September 05, 2003
d42 1
a42 3
if (
(session_is_registered("ADMIN")) ||
(session_is_registered("DB_ADMIN"))) {
d60 1
a60 3
$ADMIN = $_POST['name'];
session_register("ADMIN");
d68 1
a68 3
$DB_ADMIN = $_POST['name'];
session_register("DB_ADMIN");
@
1.2
log
@*** empty log message ***
@
text
@d12 1
a12 1
// Modified: August 19, 2003
d155 2
d167 2
d175 2
d180 1
a180 1
<a href="search.php">Search</a>
d187 1
a187 1
<input type="text" name="name">
d193 1
a193 1
<input type="password" name="password">
d197 2
a198 2
<td colspan="2" align="center">
<input type="submit" value="Login">
@
1.1
log
@Initial revision
@
text
@d5 33
a37 1
a202 1
@
1.1.1.1
log
@Bahasa Indonesia Dictionary
@
text
@@