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
/
admin.php,v
next >
Wrap
Text File
|
2003-10-20
|
17KB
|
963 lines
head 1.14;
access;
symbols
Initial:1.1.1.1 bule:1.1.1;
locks; strict;
comment @# @;
1.14
date 2003.10.20.00.21.44; author bule; state Exp;
branches;
next 1.13;
1.13
date 2003.10.18.00.33.41; author bule; state Exp;
branches;
next 1.12;
1.12
date 2003.10.06.00.39.26; author bule; state Exp;
branches;
next 1.11;
1.11
date 2003.10.01.06.51.28; author bule; state Exp;
branches;
next 1.10;
1.10
date 2003.09.11.05.28.22; author bule; state Exp;
branches;
next 1.9;
1.9
date 2003.09.05.06.42.30; author bule; state Exp;
branches;
next 1.8;
1.8
date 2003.09.04.07.26.59; author bule; state Exp;
branches;
next 1.7;
1.7
date 2003.09.03.07.11.10; author bule; state Exp;
branches;
next 1.6;
1.6
date 2003.09.02.07.07.24; author bule; state Exp;
branches;
next 1.5;
1.5
date 2003.08.31.18.48.47; author bule; state Exp;
branches;
next 1.4;
1.4
date 2003.08.30.00.33.38; author bule; state Exp;
branches;
next 1.3;
1.3
date 2003.08.28.20.04.48; author bule; state Exp;
branches;
next 1.2;
1.2
date 2003.08.19.06.42.07; 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.14
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: admin.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 provide an interface to various
// administrative features for this project.
//
// 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']) && (!$_SESSION['DB_ADMIN'])) {
$web->redirect("login.php");
exit;
}
foreach($_SESSION as $name => $value) {
if (preg_match("/NODUP/", $name)) {
unset($_SESSION[$name]);
}
}
$indonesia = new Indonesia();
$status = $indonesia->get_dictionary_status();
?>
<html>
<head>
<title>Bahasa Indonesia Dictionary: Administration</title>
<link href="bahasa.css" rel="stylesheet" type="text/css">
</head>
<body>
<?
$web->show_logo("Administration");
?>
<a href="search.php">Search Dictionary</a>
<?
print <<<EOFSA
<h4>Dictionary Status:</h4>
<table cellpadding="1" cellspacing="1" border="0">
<tr>
<td>Code:</td>
<td>$status[status]</td>
</tr><tr>
<td>Description:</td>
<td>$status[description]</td>
</tr><tr>
<td>Error:</td>
<td>$status[error]</td>
</tr></table>
EOFSA;
if (($_SESSION['DB_ADMIN']) && ($status["status"] == 1)) {
print <<<EOFSB
<h4>Oophs!</h4>
<pre>
Cannot connect to the database server!
Here's a few suggestions:
<ul>
<li>Make sure the MYSQL server is running.
<li>Make sure you created a database for the dictionary.
<li>Make sure you granted correct permissions:
</ul>
Here is a MYSQL examples for setting permissions:
GRANT SELECT, INSERT, UPDATE, DELETE, CREATE, DROP ON
<i>database name</i>.* TO <i>database user</i>@@<i>database hostname</i>
IDENTIFIED BY '<i>database user password</i>';
Make sure the <i>install directory</i>/php/Dictionary.pm class file
contains the correct database hostname, database name, database user, and
database user password. These values can be found in the
class constructor, function Dictionary(), near the top
of the page as:
\$this->configuration["DB_HOST"] =
"Enter database server name or ip";
\$this->configuration["DB_NAME"] =
"Enter database name";
\$this->configuration["DB_PASSWORD"] =
"Enter database user's password";
\$this->configuration["DB_USER"] =
"Enter database user name";
\$this->configuration["INSTALLATION_DIRECTORY"] =
"Enter project's installation directory";
</pre>
EOFSB;
} else if (($_SESSION['DB_ADMIN']) || ($status["status"] == 2)) {
print <<<EOFSC
<table cellpadding="3" cellspacing="3" border="0">
<tr>
<td>
<form action="logout.php" method="post">
<input type="submit" value="Logout!">
</form>
</td>
</tr>
</table>
<h4>Administration</h4>
<table cellpadding="1" cellspacing="1" border="0">
<tr>
<td>
<form action="dictionary.php" method="post">
<input type="submit" value="Create Dictionary">
<input type="hidden" name="create" value="1">
</form>
</td>
</tr>
</table>
EOFSC;
} else {
print <<<EOFSD
<br>
<form action="logout.php" method="post">
<input type="submit" value="Logout!">
</form>
<hr>
<h4>Dictionary Data Operations</h4>
<table cellpadding="1" cellspacing="1" border="0">
<tr>
<td>
<form action="editor.php" method="post">
<input type="submit" value="Search">
</form>
</td>
<td>
<form action="insert.php" method="post">
<input type="submit" value="Insert">
</form>
</td>
<td>
<form action="update.php" method="post">
<input type="submit" value="Update">
</form>
</td>
<td>
<form action="delete.php" method="post">
<input type="submit" value="Delete">
</form>
</td>
<td>
<form action="misses.php" method="post">
<input type="submit" value="Missed Searches">
</form>
</td>
<td>
<form action="requests.php" method="post">
<input type="submit" value="Requested Entries">
</form>
</td>
</tr>
</table>
<hr>
<h4>Other Data Operations</h4>
<table cellpadding="1" cellspacing="1" border="0">
<tr>
<td>
<form action="pos.php" method="post">
<input type="submit" value="Parts of Speech">
</form>
</td>
<td>
<form action="pronunciations.php" method="post">
<input type="submit" value="Pronunciations">
</form>
</td>
<td>
<form action="backup.php" method="post">
<input type="submit" value="Backup Tables">
</form>
</td>
</tr>
</table>
<hr>
<h4>Statistics:</h4>
<table cellpadding="1" cellspacing="1" border="0">
<tr>
<td>
<form action="statistics.php" method="post">
<input type="submit" value="Database">
<input type="hidden" name="database" value="1">
</form>
</td>
<td>
<form action="statistics.php" method="post">
<input type="submit" value="Dictionary">
<input type="hidden" name="dictionary" value="1">
</form>
</td>
<td>
<form action="statistics.php" method="post">
<input type="submit" value="PHP">
<input type="hidden" name="php" value="1">
</form>
</td>
<td>
<form action="statistics.php" method="post">
<input type="submit" value="Searches">
<input type="hidden" name="searches" value="1">
</form>
</td>
<td>
<form action="statistics.php" method="post">
<input type="submit" value="Visitors">
<input type="hidden" name="visitors" value="1">
</form>
</td>
</tr>
</table>
<hr>
<h4>Database Table Operations</h4>
<table cellpadding="1" cellspacing="1" border="0">
<tr>
<td>
<form action="dictionary.php" method="post">
<input type="submit" value="Destroy">
<input type="hidden" name="destroy" value="1">
</form>
</td>
<td>
<form action="dictionary.php" method="post">
<input type="submit" value="Recreate">
<input type="hidden" name="recreate" value="1">
</form>
</td>
</tr>
</table>
<hr>
<h4>SQL File Operations</h4>
<table cellpadding="1" cellspacing="1" border="0">
<tr>
<td>
<form action="download.php" method="post">
<input type="submit" value="Download">
</form>
</td>
<td>
<form action="upload.php" method="post">
<input type="submit" value="Upload">
</form>
</td>
</tr>
</table>
<hr>
<h4>Administration</h4>
<table cellpadding="1" cellspacing="1" border="0">
<tr>
<td>
<form action="admins.php" method="post">
<input type="submit" value="Administrators">
</form>
</td>
<td>
<form action="cpwd.php" method="post">
<input type="submit" value="Change Password">
</form>
</td>
<td>
<form action="online.php" method="post">
<input type="submit" value="Online/Offline">
</form>
</td>
<td>
<form action="sql.php" method="post">
<input type="submit" value="SQL">
</form>
</td>
<td>
<form action="tasks.php" method="post">
<input type="submit" value="Tasks">
</form>
</td>
</tr>
</table>
<hr>
EOFSD;
}
?>
</body>
</html>
@
1.13
log
@*** empty log message ***
@
text
@d12 1
a12 1
// Modified: October 17, 2003
d63 3
@
1.12
log
@*** empty log message ***
@
text
@d12 1
a12 1
// Modified: October 05, 2003
d62 1
a62 3
<title>
Bahasa Indonesia Dictionary: Administration
</title>
@
1.11
log
@*** empty log message ***
@
text
@d12 1
a12 1
// Modified: September 30, 2003
d67 3
a69 1
<h2>Bahasa Indonesia Dictionary: Administration</h2>
@
1.10
log
@*** empty log message ***
@
text
@d12 1
a12 1
// Modified: September 05, 2003
d40 1
a40 3
if (
(!session_is_registered("ADMIN")) &&
(!session_is_registered("DB_ADMIN"))) {
d51 1
a51 1
session_unregister("$name");
d86 1
a86 3
if (
(session_is_registered("DB_ADMIN")) &&
($status["status"] == 1)) {
d133 1
a133 3
} else if (
(session_is_registered("DB_ADMIN")) ||
($status["status"] == 2)) {
@
1.9
log
@*** empty log message ***
@
text
@d12 1
a12 1
// Modified: September 04, 2003
d70 1
a70 1
<a href="search.php">Search</a>
d234 1
a234 1
<input type="submit" value="Pronunciation">
@
1.8
log
@*** empty log message ***
@
text
@d12 1
a12 1
// Modified: September 03, 2003
d229 6
@
1.7
log
@*** empty log message ***
@
text
@d12 1
a12 1
// Modified: September 02, 2003
d49 1
a49 1
//WE CAN PUT THIS IN A LOOP AND LOOK FOR NODUP_
d51 1
a51 1
if (session_is_registered("NODUP_ADMINS")) {
d53 2
a54 76
session_unregister("NODUP_ADMINS");
}
if (session_is_registered("NODUP_DELETES")) {
session_unregister("NODUP_DELETES");
}
if (session_is_registered("NODUP_DELETE_MISS")) {
session_unregister("NODUP_DELETE_MISS");
}
if (session_is_registered("NODUP_MISSES")) {
session_unregister("NODUP_MISSES");
}
if (session_is_registered("NODUP_INSERT_ENTRY")) {
session_unregister("NODUP_INSERT_ENTRY");
}
if (session_is_registered("NODUP_OFFLINE_STATUS")) {
session_unregister("NODUP_OFFLINE_STATUS");
}
if (session_is_registered("NODUP_POS_ENTRY")) {
session_unregister("NODUP_POS_ENTRY");
}
if (session_is_registered("NODUP_PURGE_DATA")) {
session_unregister("NODUP_PURGE_DATA");
}
if (session_is_registered("NODUP_REQUEST_ENTRY")) {
session_unregister("NODUP_REQUEST_ENTRY");
}
if (session_is_registered("NODUP_DELETE_REQUEST")) {
session_unregister("NODUP_DELETE_REQUEST");
}
if (session_is_registered("NODUP_UPDATES")) {
session_unregister("NODUP_UPDATES");
}
if (session_is_registered("NODUP_BACKUP_TABLE")) {
session_unregister("NODUP_BACKUP_TABLE");
}
if (session_is_registered("NODUP_DICTIONARY")) {
session_unregister("NODUP_DICTIONARY");
}
if (session_is_registered("NODUP_CHANGE_PASSWORD")) {
session_unregister("NODUP_CHANGE_PASSWORD");
}
if (session_is_registered("NODUP_SEND_EMAIL")) {
session_unregister("NODUP_SEND_EMAIL");
}
if (session_is_registered("NODUP_UPLOAD")) {
session_unregister("NODUP_UPLOAD");
d234 1
a234 1
<input type="submit" value="Backup Database">
a241 39
<h4>Administration</h4>
<table cellpadding="1" cellspacing="1" border="0">
<tr>
<td>
<form action="admins.php" method="post">
<input type="submit" value="Administrators">
</form>
</td>
<td>
<form action="cpwd.php" method="post">
<input type="submit" value="Change Password">
</form>
</td>
<td>
<form action="online.php" method="post">
<input type="submit" value="Online/Offline">
</form>
</td>
<td>
<form action="sql.php" method="post">
<input type="submit" value="SQL">
</form>
</td>
<td>
<form action="tasks.php" method="post">
<input type="submit" value="Tasks">
</form>
</td>
</tr>
</table>
<hr>
d326 39
@
1.6
log
@*** empty log message ***
@
text
@d12 1
a12 1
// Modified: September 01, 2003
d49 2
d101 1
a101 1
if (session_is_registered("NODUP_UPDATE_ENTRY")) {
d103 1
a103 1
session_unregister("NODUP_UPDATE_ENTRY");
d192 5
a196 1
\$this->configuration["DB_HOST"] = "database hostname";
d198 2
a199 1
\$this->configuration["DB_NAME"] = "database name";
d201 2
a202 1
\$this->configuration["DB_USER"] = "database user";
d204 2
a205 1
\$this->configuration["DB_PASSWORD"] = "database user's password";
d250 2
a251 1
<h4>Administration</h4>
d256 8
a263 2
<form action="admins.php" method="post">
<input type="submit" value="Administrators">
d268 2
a269 2
<form action="cpwd.php" method="post">
<input type="submit" value="Change Password">
d274 2
a275 2
<form action="online.php" method="post">
<input type="submit" value="Online/Offline">
d280 2
a281 2
<form action="sql.php" method="post">
<input type="submit" value="SQL">
d286 2
a287 2
<form action="tasks.php" method="post">
<input type="submit" value="Tasks">
d296 1
a296 1
<h4>Statistics:</h4>
d301 2
a302 3
<form action="statistics.php" method="post">
<input type="submit" value="Database">
<input type="hidden" name="database" value="1">
d307 2
a308 3
<form action="statistics.php" method="post">
<input type="submit" value="Dictionary">
<input type="hidden" name="dictionary" value="1">
d312 8
d321 2
a322 3
<form action="statistics.php" method="post">
<input type="submit" value="PHP">
<input type="hidden" name="php" value="1">
d327 2
a328 3
<form action="statistics.php" method="post">
<input type="submit" value="Searches">
<input type="hidden" name="searches" value="1">
d333 2
a334 3
<form action="statistics.php" method="post">
<input type="submit" value="Visitors">
<input type="hidden" name="visitors" value="1">
a337 8
</tr>
</table>
<hr>
<h4>Dictionary Data Operations</h4>
<table cellpadding="1" cellspacing="1" border="0">
<tr>
d339 2
a340 2
<form action="editor.php" method="post">
<input type="submit" value="Dictionary Editor">
d345 2
a346 2
<form action="insert.php" method="post">
<input type="submit" value="Insert">
d350 9
d360 3
a362 2
<form action="update.php" method="post">
<input type="submit" value="Update">
d367 3
a369 2
<form action="delete.php" method="post">
<input type="submit" value="Delete">
d374 3
a376 2
<form action="misses.php" method="post">
<input type="submit" value="Missed Searches">
d381 3
a383 2
<form action="requests.php" method="post">
<input type="submit" value="Requested Entries">
a386 8
</tr>
</table>
<hr>
<h4>Other Data Operations</h4>
<table cellpadding="1" cellspacing="1" border="0">
<tr>
d388 3
a390 2
<form action="pos.php" method="post">
<input type="submit" value="Parts of Speech">
a393 1
a397 1
a400 6
<td>
<form action="backup.php" method="post">
<input type="submit" value="Backup">
</form>
</td>
@
1.5
log
@*** empty log message ***
@
text
@d12 1
a12 1
// Modified: August 31, 2003
d54 1
a54 1
if (session_is_registered("NODUP_DELETE_ENTRY")) {
d56 1
a56 1
session_unregister("NODUP_DELETE_ENTRY");
d326 1
d328 2
a329 2
<form action="delete.php" method="post">
<input type="submit" value="Delete">
d340 8
a347 2
<form action="misses.php" method="post">
<input type="submit" value="Missed Searches">
d352 2
a353 2
<form action="requests.php" method="post">
<input type="submit" value="Client Requests">
d358 2
a359 2
<form action="update.php" method="post">
<input type="submit" value="Update">
@
1.4
log
@*** empty log message ***
@
text
@d12 1
a12 1
// Modified: August 29, 2003
d323 1
a323 1
<h4>Data Operations</h4>
d340 1
a340 1
<input type="submit" value="Missed Search Entries">
d345 2
a346 2
<form action="pos.php" method="post">
<input type="submit" value="Parts of Speech">
d351 2
a352 2
<form action="requests.php" method="post">
<input type="submit" value="Requests">
d356 8
d365 2
a366 2
<form action="update.php" method="post">
<input type="submit" value="Update">
d370 1
d374 1
@
1.3
log
@*** empty log message ***
@
text
@d12 1
a12 1
// Modified: August 28, 2003
d208 1
a208 1
<table cellpadding="3" cellspacing="3" border="1">
@
1.2
log
@*** empty log message ***
@
text
@d12 1
a12 1
// Modified: August 18, 2003
d64 5
d340 1
a340 1
<input type="submit" value="Misses">
@
1.1
log
@Initial revision
@
text
@d5 33
a37 1
a412 1
@
1.1.1.1
log
@Bahasa Indonesia Dictionary
@
text
@@