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
/
online.php,v
< prev
next >
Wrap
Text File
|
2003-10-20
|
8KB
|
415 lines
head 1.6;
access;
symbols
Initial:1.1.1.1 bule:1.1.1;
locks; strict;
comment @# @;
1.6
date 2003.10.20.00.21.45; author bule; state Exp;
branches;
next 1.5;
1.5
date 2003.10.18.00.33.42; author bule; state Exp;
branches;
next 1.4;
1.4
date 2003.10.06.00.39.27; author bule; state Exp;
branches;
next 1.3;
1.3
date 2003.10.01.06.51.29; 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.6
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: online.php
// Author(s): John L. Whiteman
// Created: June 23, 2003
// Modified: October 19, 2003
// Description: The purpose of this restricted access PHP web
// client page is to allow the administrator to manually
// set the web site to offline or online. The client
// will be redirected of offline.php if offline is set on.
//
// 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.
//////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////
$web = new Web();
if (!$_SESSION['ADMIN']) {
$web->redirect("login.php");
exit;
}
$indonesia = new Indonesia();
$status = $indonesia->get_dictionary_status();
if ($status["status"] == 1 || $status["status"] == 2) {
$web->redirect("admin.php");
exit;
}
if ($_SESSION['NODUP_OFFLINE_STATUS']) {
unset($_SESSION['NODUP_OFFLINE_STATUS']);
$web->redirect("admin.php");
exit;
}
?>
<html>
<head>
<title>Bahasa Indonesia Dictionary: Online/Offline</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() {
password = document.status.password.value;
if (is_white_space(password)) {
alert(
"You must give a password value!");
document.status.password.focus();
return(false);
}
return(true);
}
//////////////////////////////////////////////////////////////////////////////
// -->
</script>
</head>
<body>
<?
$web->show_logo("Online/Offline");
?>
<a href="admin.php">Administration</a>
<?
if (
(isset($_POST['password'])) &&
(isset($_POST['action']))) {
$errstr = $indonesia->login($_SESSION['ADMIN'], $_POST['password']);
if ($errstr != "") {
print "<br><hr><b>Permission denied!</b><hr><br>\n";
} else {
if ($_POST['action'] == "offline") {
$errstr = $indonesia->set_offline();
if ($errstr != "") {
print "<br><hr><b>${errstr}</b><hr><br>\n";
} else {
print
"<br><hr><b>Dictionary is now offline!" .
"</b><br><hr>\n";
$_SESSION['NODUP_OFFLINE_STATUS'] = 1;
}
} else if ($_POST['action'] == "online") {
$errstr = $indonesia->set_online();
if ($errstr != "") {
print "<br><hr><b>${errstr}</b><hr><br>\n";
} else {
print
"<br><hr><b>Dictionary is now online!" .
"</b><br><hr>\n";
$_SESSION['NODUP_OFFLINE_STATUS'] = 1;
}
}
}
} else {
show_status_form($web, $indonesia);
}
?>
</body>
</html>
<?
//////////////////////////////////////////////////////////////////////////////
function show_status_form($web, $indonesia) {
$offline_status = "";
$errstr = $indonesia->get_offline_status($offline_status);
if ($errstr != "") {
print "<br><hr><b>${errstr}</b><hr><br>\n";
return;
}
if ($offline_status == 0) {
print <<<EOFSSFA
<form name="status" method="post" onsubmit='return verify()'>
<table cellpadding="3" cellspacing="3" border="0">
<tr>
<td>
Password:
</td>
<td>
<input type="password" name="password">
</td>
<td>
<input type="submit" value="Set OFFLINE!">
</td>
</tr>
</table>
<input type="hidden" name="action" value="offline">
</form>
<script language="Javascript" type="text/javascript">
document.status.password.focus();
</script>
EOFSSFA;
} else {
print <<<EOFSSFB
<form name="status" method="post" onsubmit='return verify()'>
<table cellpadding="3" cellspacing="3" border="0">
<tr>
<td>
Password:
</td>
<td>
<input type="password" name="password">
</td>
<td>
<input type="submit" value="Set ONLINE!">
</td>
</tr>
</table>
<input type="hidden" name="action" value="online">
</form>
<script language="Javascript" type="text/javascript">
document.status.password.focus();
</script>
EOFSSFB;
}
return;
}
//////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////
?>
@
1.5
log
@*** empty log message ***
@
text
@d12 1
a12 1
// Modified: October 17, 2003
d72 2
@
1.4
log
@*** empty log message ***
@
text
@d12 1
a12 1
// Modified: October 05, 2003
d71 1
a71 6
<title>
Bahasa Indonesia Dictionary: Online/Offline
</title>
<script language="Javascript" type="text/javascript">
//////////////////////////////////////////////////////////////////////////////
function is_white_space(stoken) {
d73 1
a73 1
if (stoken == null) return(true);
d75 2
a76 20
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);
}
d94 2
@
1.3
log
@*** empty log message ***
@
text
@d12 1
a12 1
// Modified: September 30, 2003
d120 3
a122 2
<h2>Bahasa Indonesia Dictionary: Online/Offline</h2>
@
1.2
log
@*** empty log message ***
@
text
@d12 1
a12 1
// Modified: August 19, 2003
d41 1
a41 1
if (!session_is_registered("ADMIN")) {
d59 1
a59 1
if (session_is_registered("NODUP_OFFLINE_STATUS")) {
d61 1
a61 1
session_unregister("NODUP_OFFLINE_STATUS");
d151 1
a151 3
$NODUP_OFFLINE_STATUS = 1;
session_register("NODUP_OFFLINE_STATUS");
a153 1
d168 1
a168 3
$NODUP_OFFLINE_STATUS = 1;
session_register("NODUP_OFFLINE_STATUS");
@
1.1
log
@Initial revision
@
text
@d5 34
a38 1
a256 2
@
1.1.1.1
log
@Bahasa Indonesia Dictionary
@
text
@@