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
/
cpwd.php,v
< prev
next >
Wrap
Text File
|
2003-10-20
|
8KB
|
442 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.26; 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.04.07.26.59; 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.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: cpwd.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 allow an administrator to change
// his/her password.
//
// 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_CHANGE_PASSWORD']) {
unset($_SESSION['NODUP_CHANGE_PASSWORD']);
$web->redirect("admin.php");
exit;
}
?>
<html>
<head>
<title>Bahasa Indonesia Dictionary: Change Password</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.change_password.name.value;
name = trim(name);
if (is_white_space(name)) {
alert("You must enter your name.");
document.change_password.name.focus();
return(false);
}
var old_password = document.change_password.old_password.value;
if (is_white_space(old_password)) {
alert("You must enter your old password.");
document.change_password.old_password.focus();
return(false);
}
var new_password = document.change_password.new_password.value;
if (is_white_space(new_password)) {
alert("You must enter a new password.");
document.change_password.new_password.focus();
return(false);
}
if ((new_password.length < 5) || (new_password.length > 50)) {
alert(
"The new password value must 5-50 characters in length!");
document.change_password.new_password.focus();
return(false);
}
var confirm_new_password =
document.change_password.confirm_new_password.value;
if (is_white_space(confirm_new_password)) {
alert(
"You must enter your new password again for confirmation.");
document.change_password.confirm_new_password.focus();
return(false);
}
if (new_password != confirm_new_password) {
alert(
"Your confirmation password does not match your " +
"new password.");
document.change_password.confirm_new_password.focus();
return(false);
}
return(true);
}
//////////////////////////////////////////////////////////////////////////////
// -->
</script>
</head>
<html>
<body>
<?
$web->show_logo("Change Password");
?>
<a href="admin.php">Administration</a>
<?
if (
isset($_POST['name']) &&
isset($_POST['old_password']) &&
isset($_POST['new_password']) &&
isset($_POST['confirm_new_password'])) {
if ($_SESSION['ADMIN'] != $_POST['name']) {
print
"<br><hr><b>You are not allowed to change password!" .
"</b><hr><br>\n";
} else {
$errstr =
$indonesia->change_password(
$_POST['name'], $_POST['old_password'], $_POST['new_password'],
$_POST['confirm_new_password']);
if ($errstr != "") {
print "<br><hr><b>${errstr}</b><hr><br>\n";
} else {
print
"<br><hr><b>Your password has " .
"been changed!</b><hr><br>\n";
$_SESSION['NODUP_CHANGE_PASSWORD'] = 1;
}
}
} else {
show_change_password_form();
}
?>
</body>
</html>
<?
function show_change_password_form() {
print <<<EOFSCPF
<form name="change_password" method="post" onSubmit='return verify()'>
<table cellpadding="3" cellspacing="3" border="0">
<tr>
<td>Name:</td>
<td>
<input type="text" name="name">
</td>
</tr>
<tr>
<td>Old Password:</td>
<td>
<input type="password" name="old_password">
</td>
</tr><tr>
<td>New Password (5-50 characters):</td>
<td>
<input type="password" name="new_password" maxlength="50">
</td>
</tr><tr>
<td>Type New Password Again:</td>
<td>
<input type="password" name="confirm_new_password" maxlength="50">
</td>
</tr><tr>
<td colspan="2" align="right">
<input type="submit" value="Change Password!">
</td>
</tr>
</table>
</form>
<script language="Javascript" type="text/javascript">
document.change_password.name.focus();
</script>
EOFSCPF;
return;
}
?>
@
1.6
log
@*** empty log message ***
@
text
@d12 1
a12 1
// Modified: October 17, 2003
d71 2
@
1.5
log
@*** empty log message ***
@
text
@d12 1
a12 1
// Modified: October 05, 2003
a38 1
d70 3
a72 3
<title>
Bahasa Indonesia Dictionary: Change Password
</title>
d75 2
a76 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);
}
d150 2
a151 1
@
1.4
log
@*** empty log message ***
@
text
@d12 1
a12 1
// Modified: September 30, 2003
d180 3
a182 1
<h2>Bahasa Indonesia Dictionary: Change Password</h2>
@
1.3
log
@*** empty log message ***
@
text
@d12 1
a12 1
// Modified: September 03, 2003
d42 1
a42 1
if (!session_is_registered("ADMIN")) {
d60 1
a60 1
if (session_is_registered("NODUP_CHANGE_PASSWORD")) {
d62 1
a62 1
session_unregister("NODUP_CHANGE_PASSWORD");
d213 1
a213 3
$NODUP_CHANGE_PASSWORD = 1;
session_register("NODUP_CHANGE_PASSWORD");
@
1.2
log
@*** empty log message ***
@
text
@d12 1
a12 1
// Modified: August 18, 2003
d210 2
a211 1
"<br><hr><b>Your password has changed!</b><hr><br>\n";
@
1.1
log
@Initial revision
@
text
@d5 34
a269 1
@
1.1.1.1
log
@Bahasa Indonesia Dictionary
@
text
@@