[rt-users] Non-users creating tickets via Web with RT-1.3.70

Dale Bewley dale at bewley.net
Tue May 1 21:29:16 EDT 2001


On Tue, 1 May 2001, Eric Mandel wrote:
> I have been able to setup RT 1.3.7. I have granted the correct rights to
> allow anyone create tickets via e-mail. I was wondering if there is a link
> within RT that anonymous users can go to create tickets without being
> prompted for a username. 
> 
> I came across similar requests in the in the archives but I didn't see a
> solution. I am not really a programmer, so it would be a great struggle
> (understatement) to put something together. Any help or pointers is greatly
> appreciated. Thanks a lot.

I haven't tried RT2 so I don't know about links it may or may not have,
but, the simplest way to do that is just create a form and a CGI that
emails a ticket request. You said you aren't a programmer, so attached is
a little php script to do just that. You should be able to pick it appart
and adjust to your liking.

I ripped out some site specific information and haven't tested it after
that, so there may be a little bug or two in it.


--
Dale Bewley - Bewley Internet Solutions Inc. http://bewley.net/
-------------- next part --------------
<?php
//<!-- --------------------------------------------------------- -->
// set cookies for convenience
if (! empty($name)) {
 setcookie("requestor[name]", $name, time() + 5184000, "/", ".YOURDOMAIN.com" );
}
if (! empty($email)) {
 setcookie("requestor[email]", $email, time() + 5184000, "/", ".YOURDOMAIN.com" );
}
if (! empty($phone)) {
 setcookie("requestor[phone]", $phone, time() + 5184000, "/", ".YOURDOMAIN.com" );
}
if (! empty($office)) {
 setcookie("requestor[office]", $office, time() + 5184000, "/", ".YOURDOMAIN.com" );
}


if ($sendmail == 'yes') {

  // build the email message
  $message = "
--
  Requestor: $name <$email> $phone
     Office: $office @ $REMOTE_ADDR

   Severity: $severity
    Summary: $summary

   Comments: $comments


";

  mail("help-rt at rt.YOURDOMAIN.com", ($severity == 'Minimal' ? '' : $severity . ' ') . '-' . $summary, $message, "From: \"" . 
    $name . "\" <" .$email . ">\n" .
    "X-URL: http://" . $HTTP_HOST . $PHP_SELF);

  if ($severity == 'Critical') {
    // you might want to send a page at this point
  }
}
//<!-- --------------------------------------------------------- -->
?>
<html>
<head><title>Report a Problem</title></head>
<body>
<h1>Report a Problem</h1>

<!-- --------------------------------------------------------- -->
<?php if ($sendmail != 'yes'): ?>

<form method="GET">
<table>
<tr>
	  <td>Your Name</td>
	  <td><input type="text" name="name" value="<?php echo $requestor['name'] ?>" size="40"></td>
</tr>
<tr>
	  <td>Your Email</td>
	  <td><input type="text" name="email" value="<?php echo $requestor['email'] ?>" size="40"></td>
</tr>
<tr>
	  <td>Your Phone</td>
	  <td><input type="text" name="phone" value="<?php echo $requestor['phone'] ?>" size="40"></td>
</tr>
<tr>
	  <td>Your Office</td>
	  <td><input type="text" name="office" value="<?php echo $requestor['office'] ?>" size="40"></td>
</tr>

<tr><td> </td><td> </td></tr>

<tr>
          <td>Severity</td>
          <td>
          <select name="severity">
           <option>Minimal
           <option>Severe
           <option>Critical
          </select>
          </td>
</tr>           

<tr>
	  <td>Problem Summary</td>
	  <td><input type="text" name="summary" value="" size="40" max="50"></td>
</tr>

<tr valign=top>
	  <td>Comments</td>
	  <td><textarea name="comments" rows="5" cols="40" wrap="hard"></textarea></td>
</tr>
</table>

<input type=hidden name="sendmail" value="yes">
<input type="submit" value="Submit Request">
<input type="reset">
</form>
<!-- --------------------------------------------------------- -->
<?php else: ?>

<h2>Thank you</h2>

You will receive an email containing your ticket number shortly.
Please use this number in future correspondance.


<h3><a href="<?php echo $PHP_SELF; ?>">Report another problem.</a></h3>
<!-- --------------------------------------------------------- -->
<?php 
endif; 
?>
</body>
</html>


More information about the rt-users mailing list