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
/
email.php,v
< prev
next >
Wrap
Text File
|
2003-10-26
|
10KB
|
552 lines
head 1.11;
access;
symbols
Initial:1.1.1.1 bule:1.1.1;
locks; strict;
comment @# @;
1.11
date 2003.10.26.01.53.10; author bule; state Exp;
branches;
next 1.10;
1.10
date 2003.10.20.00.21.45; author bule; state Exp;
branches;
next 1.9;
1.9
date 2003.10.18.00.33.41; author bule; state Exp;
branches;
next 1.8;
1.8
date 2003.10.17.00.39.36; author bule; state Exp;
branches;
next 1.7;
1.7
date 2003.10.06.00.39.26; author bule; state Exp;
branches;
next 1.6;
1.6
date 2003.10.01.06.51.29; author bule; state Exp;
branches;
next 1.5;
1.5
date 2003.09.11.05.28.22; author bule; state Exp;
branches;
next 1.4;
1.4
date 2003.09.04.07.26.59; author bule; state Exp;
branches;
next 1.3;
1.3
date 2003.08.21.06.18.07; 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.11
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: email.php
// Author(s): John L. Whiteman
// Created: June 23, 2003
// Modified: October 20, 2003
// Description: The purpose of this unrestricted access PHP web
// client page is allow a client to send you e-mail
// via a web interface.
//
// 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['NODUP_SEND_EMAIL']) &&
(isset($_POST['id']))) {
if ($_SESSION['NODUP_SEND_EMAIL'] == $_POST['id']) {
unset($_SESSION['NODUP_SEND_EMAIL']);
$web->redirect("search.php");
}
}
$indonesia = new Indonesia();
$status = $indonesia->get_dictionary_status();
if (
($status["status"] == 1) ||
($status["status"] == 2) ||
($status["status"] == 3)) {
$web->redirect("offline.php");
exit;
}
?>
<html>
<head>
<title>Bahasa Indonesia Dictionary: E-mail</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() {
email_adx = document.email.email_adx.value;
email_adx = trim(email_adx);
if (is_white_space(email_adx)) {
alert(
"You must provide your e-mail address!");
document.email.email_adx.focus();
return(false);
}
if (!is_email(email_adx)) {
alert(
"Your e-mail address doesn't appear to be valid!");
document.email.email_adx.focus();
return(false);
}
if (email_adx.length > 255) {
alert(
"Your e-mail address doesn't appear to be valid! Too long.");
document.email.email_adx.focus();
return(false);
}
subject = document.email.subject.value;
subject = trim(subject);
if (is_white_space(subject)) {
alert(
"Please provide a subject in your e-mail!");
document.email.subject.focus();
return(false);
}
if (subject.length > 255) {
alert(
"Please keep your subject 255 characters or less!");
document.email.subject.focus();
return(false);
}
message = document.email.message.value;
message = trim(message);
if (is_white_space(message)) {
alert(
"Please provide a message in your e-mail!");
document.email.message.focus();
return(false);
}
if (message.length > 500) {
alert(
"Please keep your message 500 characters or less!");
document.email.message.focus();
return(false);
}
return(true);
}
//////////////////////////////////////////////////////////////////////////////
// -->
</script>
</head>
<body>
<?
$web->show_logo("E-mail");
?>
<a class="menu" href="search.php">Search Dictionary</a>
|
<a class="menu" href="reference.php">Reference</a>
|
<a class="menu" href="request.php">Request a New Word</a>
|
<a class="menu" href="admin.php">Administration</a>
<br><br>
<?
if (
(isset($_POST['email_adx'])) &&
(isset($_POST['subject'])) &&
(isset($_POST['message'])) &&
(isset($_POST['id']))) {
$errstr =
$indonesia->send_email(
$_POST['email_adx'], $_POST['subject'],
$_POST['message'], $_SERVER['REMOTE_ADDR']);
if ($errstr != "") {
print "<br><hr><b>${errstr}</b><hr><br>\n";
} else {
print "<br><hr><b>Your e-mail has been sent!</b><hr><br>\n";
$_SESSION['NODUP_SEND_EMAIL'] = $_POST['id'];
}
} else {
show_email_form();
}
$web->show_footer();
?>
</body>
</html>
<?
//////////////////////////////////////////////////////////////////////////////
function show_email_form() {
$id = uniqid(rand(), true);
print <<<EOFSEF
<form name="email" method="post" onsubmit='return verify()'>
<table cellpadding="3" cellspacing="3" border="0">
<tr>
<td>Your E-mail Address:</td>
<td>
<input type="text" name="email_adx" size="35" maxlength="255">
</td>
</tr><tr>
<td>Subject:</td>
<td>
<input type="text" name="subject" size="50" maxlength="255">
</td>
</tr><tr>
<td colspan="2> align="left">Message (500 characters maximum):</td>
</tr><tr>
<td colspan="2> align="left">
<textarea name="message" cols="55" rows="10" wrap="soft"></textarea>
</td>
</tr><tr>
<td colspan="2" align="right">
<input type="reset" value="Clear Form">
<input type="submit" value="Send E-mail!">
</td>
</tr>
</table>
<input type="hidden" name="id" value="${id}">
</form>
<script language="Javascript" type="text/javascript">
document.email.email_adx.focus();
</script>
EOFSEF;
return;
}
//////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////
?>
@
1.10
log
@*** empty log message ***
@
text
@d12 1
a12 1
// Modified: October 19, 2003
d172 1
a172 1
<a href="search.php">Search Dictionary</a>
d174 1
a174 1
<a href="reference.php">Reference</a>
d176 1
a176 1
<a href="request.php">Request a New Word</a>
d178 1
a178 1
<a href="admin.php">Administration</a>
@
1.9
log
@*** empty log message ***
@
text
@d12 1
a12 1
// Modified: October 17, 2003
d68 3
a70 3
<title>
Bahasa Indonesia Dictionary: E-mail
</title>
@
1.8
log
@*** empty log message ***
@
text
@d12 1
a12 1
// Modified: October 15, 2003
a70 3
<script language="Javascript" type="text/javascript">
//////////////////////////////////////////////////////////////////////////////
function is_email(token) {
d72 1
a72 1
var regexp = /^\w+([\.-]?\w+)*@@\w+([\.-]?\w+)*(\.\w{2,3})+$/;
d74 2
a75 29
if (regexp.test(token)) return(true);
return(false);
}
//////////////////////////////////////////////////////////////////////////////
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);
}
d164 1
@
1.7
log
@*** empty log message ***
@
text
@d12 1
a12 1
// Modified: October 05, 2003
d237 2
@
1.6
log
@*** empty log message ***
@
text
@d12 1
a12 1
// Modified: September 30, 2003
d197 3
a199 2
<h2>Bahasa Indonesia Dictionary: E-mail</h2>
@
1.5
log
@*** empty log message ***
@
text
@d12 1
a12 1
// Modified: September 05, 2003
d41 1
a41 1
(session_is_registered("NODUP_SEND_EMAIL")) &&
d46 1
a46 1
session_unregister("NODUP_SEND_EMAIL");
d229 1
a229 3
$NODUP_SEND_EMAIL = $_POST['id'];
session_register("NODUP_SEND_EMAIL");
@
1.4
log
@*** empty log message ***
@
text
@d12 1
a12 1
// Modified: September 03, 2003
d201 7
@
1.3
log
@*** empty log message ***
@
text
@d12 1
a12 1
// Modified: August 19, 2003
d200 1
a200 1
<a href="search.php">Search</a>
@
1.2
log
@*** empty log message ***
@
text
@d40 5
a44 1
if (session_is_registered("NODUP_SEND_EMAIL")) {
d46 1
a46 1
session_unregister("NODUP_SEND_EMAIL");
d48 2
a49 1
$web->redirect("search.php");
d206 2
a207 1
(isset($_POST['message']))) {
d222 1
a222 2
$NODUP_SEND_EMAIL = 1;
d238 1
d265 4
a268 1
</tr></table></form>
@
1.1
log
@Initial revision
@
text
@d5 33
a37 1
a269 2
@
1.1.1.1
log
@Bahasa Indonesia Dictionary
@
text
@@