I hate to dig up this thread, but this is killing me. Even after working over these steps several times, the email address is still written to the database in mixed case. Here's the related code:
include/client/login.inc.php
<?php
if(!defined('OSTCLIENTINC')) die('Kwaheri');
$e=Format:($_POST?$_POST:$_GET);
$t=Format:($_POST?$_POST:$_GET);
?>
<div>
<?if($errors) {?>
<p align="center" id="errormessage"><?=$errors?></p>
<?}elseif($warn) {?>
<p class="warnmessage"><?=$warn?></p>
<?}?>
</div>
<div style="margin 0px 100px 0;text-align; width%;">
<p align="center">
To view the status of a ticket, provide us with your login details below.<br/>
If this is your first time contacting us or you've lost the ticket ID, please <a href="open.php">click here</a> to open a new ticket.
</p>
<span class="error"><?=Format:($loginmsg)?></span>
<form action="login.php" method="post">
<table cellspacing="1" cellpadding="5" border="0" bgcolor="#000000" align="center">
<tr bgcolor="#EEEEEE">
<td>E-Mail:</td><td><input type="text" name="lemail" size="25" onBlur="javascript.value=this.value.toLowerCase();" value="<?=strtolower($e)?>"></td>
<td>Ticket ID:</td><td><input type="text" name="lticket" size="10" value="<?=$t?>"></td>
<td><input class="button" type="submit" value="View Status"></td>
</tr>
</table>
</form>
</div>
include/client/open.inc.php
<?php
if(!defined('OSTCLIENTINC')) die('Kwaheri rafiki!'); //Say bye to our friend..
$info=($_POST && $errors)?Format:($_POST)(); //on error...use the post data
?>
<div>
<?if($errors) {?>
<p align="center" id="errormessage"><?=$errors?></p>
<?}elseif($msg) {?>
<p align="center" id="infomessage"><?=$msg?></p>
<?}elseif($warn) {?>
<p id="warnmessage"><?=$warn?></p>
<?}?>
</div>
<div>Please fill in the form below to open a new ticket.</div><br>
<form action="open.php" method="POST" enctype="multipart/form-data">
<table align="left" cellpadding=2 cellspacing=1 width="90%">
<tr>
<th width="20%">Name (Last, First):</th>
<td>
<?if ($thisclient && ($name=$thisclient->getName())) {
?>
<input type="hidden" name="name" value="<?=$name?>"><?=$name?>
<?}else {?>
Change to auto populate name and email address from AD
J. Pastin 9-8-09
<input type="text" name="name" size="25" value="<?=$info?>">
<input type="text" id="name" name="name" size="25" value="<?=$info?>">
End Changes
<?}?>
<font class="error">* <?=$errors?></font>
</td>
</tr>
<tr>
<th nowrap >Email Address:</th>
<td>
<?if ($thisclient && ($email=$thisclient->getEmail())) {
?>
<input type="hidden" name="email" size="25" onBlur="javascript.value=this.value.toLowerCase();" value="<?=strtolower($e)?>"<?=$email?>">
<?}else {?>
START MOD06 Change to auto populate name and email address from AD
<input type="text" id="email" name="email" size="25" onBlur="javascript.value=this.value.toLowerCase();" value="<?=strtolower($e)?>"<?=$info?>">
END MOD06
<?}?>
<font class="error">* <?=$errors?></font>
</td>
</tr>
<tr>
<td><b>Telephone:</b></td>
<td><input type="text" name="phone" size="25" value="<?=$info?>">
<font class="error">*</font> Ext <input type="text" name="phone_ext" size="6" value="<?=$info?>">
<font class="error"> <?=$errors?></font></td>
</tr>
<tr height=2px><td align="left" colspan=2 > </td</tr>
<tr>
<th>Help Topic:</th>
<td>
<select name="topicId">
<option value="" selected >Select One</option>
<?
$services= db_query('SELECT topic_id,topic FROM '.TOPIC_TABLE.' WHERE isactive=1 ORDER BY topic');
if($services && db_num_rows($services)) {
while (list($topicId,$topic) = db_fetch_row($services)){
$selected = ($info==$topicId)?'selected':''; ?>
<option value="<?=$topicId?>"<?=$selected?>><?=$topic?></option>
<?
}
}else{?>
<option value="0" >General Inquiry</option>
<?}?>
</select>
<font class="error">* <?=$errors?></font>
</td>
</tr>
<tr>
<th>Subject:</th>
<td>
<input type="text" name="subject" size="35" value="<?=$info?>">
<font class="error">* <?=$errors?></font>
</td>
</tr>
<tr>
<th valign="top">Message:</th>
<td>
<? if($errors) {?> <font class="error"><b> <?=$errors?></b></font><br/><?}?>
<textarea name="message" cols="35" rows="8" wrap="soft" style="width%"><?=$info?></textarea></td>
</tr>
<?
if($cfg->allowPriorityChange() ) {
$sql='SELECT priority_id,priority_desc FROM '.TICKET_PRIORITY_TABLE.' WHERE ispublic=1 ORDER BY priority_urgency DESC';
if(($priorities=db_query($sql)) && db_num_rows($priorities)){ ?>
<tr>
<td>Priority:</td>
<td>
<select name="pri">
<?
$info=$info?$info:$cfg->getDefaultPriorityId(); //use system's default priority.
while($row=db_fetch_array($priorities)){ ?>
<option value="<?=$row?>" <?=$info==$row?'selected':''?> ><?=$row?></option>
<?}?>
</select>
</td>
</tr>
<? }
}?>
<?if(($cfg->allowOnlineAttachments() && !$cfg->allowAttachmentsOnlogin())
|| ($cfg->allowAttachmentsOnlogin() && ($thisclient && $thisclient->isValid()))){
?>
<tr>
<td>Attachment:</td>
<td>
<input type="file" name="attachment"><font class="error"> <?=$errors?></font>
</td>
</tr>
<?}?>
<?if($cfg && $cfg->enableCaptcha() && (!$thisclient || !$thisclient->isValid())) {
if($_POST && $errors && !$errors)
$errors='Please re-enter the text again';
?>
<tr>
<th valign="top">Captcha Text:</th>
<td><img src="captcha.php" border="0" align="left">
<span> <input type="text" name="captcha" size="7" value=""> <i>Enter the text shown on the image.</i></span><br/>
<font class="error"> <?=$errors?></font>
</td>
</tr>
<?}?>
<tr height=2px><td align="left" colspan=2 > </td</tr>
<tr>
<td></td>
<td>
<input class="button" type="submit" name="submit_x" value="Submit Ticket">
<input class="button" type="reset" value="Reset">
<input class="button" type="button" name="cancel" value="Cancel" onClick='window.location.href="index.php"'>
</td>
</tr>
</table>
</form>
</form>
<script type="text/javascript">
// START - MOD06 Active directory look up
var name_options = {
script: "./scp/userfind.php?maxEntries=10&",
varname: "name",
json: true,
delay: 10,
cache: false,
callback: function (obj) {document.getElementById('email').value=obj.info;}
};
var email_options = {
script: "./scp/userfind.php?maxEntries=10&",
varname: "mail",
json: true,
cache: false,
callback: function (obj) {document.getElementById('name').value=obj.info;}
};
var email_as=new bsn.AutoSuggest('email', email_options);
var name_as=new bsn.AutoSuggest('name', name_options);
// END - MOD06 Active directory look up
</script>
Any thoughts? Sorry about all the code, I'm just frustrated with it.