When you use a WebSSO, it can send users information via HTTP headers. This patch just get the default email address of the user from HTTP_USER_EMAIL if this variable is set. (I use it with LemonLDAP::NG so my users do not have to manually type their email address)

--
Daniel Berteaud
FIREWALL-SERVICES SARL.
Société de Services en Logiciels Libres
Technopôle Montesquieu
33650 MARTILLAC
Tel : 05 56 64 15 32
Fax : 05 56 64 15 32
Web : http://www.firewall-services.com

diff -Nur -x '*.orig' -x '*.rej' dl-0.11/htdocs/include/newgrants.php mezzanine_patched_dl-0.11/htdocs/include/newgrants.php
--- dl-0.11/htdocs/include/newgrants.php	2013-05-29 21:02:30.000000000 +0200
+++ mezzanine_patched_dl-0.11/htdocs/include/newgrants.php	2013-11-19 15:10:29.396660366 +0100
@@ -19,10 +19,12 @@
       <?php
         $error = ((@$_POST["submit"] === $act) && empty($_POST["nt"]));
         $class = "description required" . ($error? " error": "");
+        if (isset($_SERVER['HTTP_USER_EMAIL']))
+            $email = $_SERVER['HTTP_USER_EMAIL'];
       ?>
       <label class="<?php echo $class; ?>"><?php echo T_("Notification e-mail"); ?></label>
       <div>
-	<input name="notify" class="element text required" type="email" required multiple maxlength="255" value=""/>
+	<input name="notify" class="element text required" type="email" required multiple maxlength="255" value="<?php echo $email?>"/>
       </div>
       <p class="guidelines"><small>
 	  <?php
diff -Nur -x '*.orig' -x '*.rej' dl-0.11/htdocs/include/newtickets.php mezzanine_patched_dl-0.11/htdocs/include/newtickets.php
--- dl-0.11/htdocs/include/newtickets.php	2013-05-29 21:02:30.000000000 +0200
+++ mezzanine_patched_dl-0.11/htdocs/include/newtickets.php	2013-11-19 15:17:18.951094913 +0100
@@ -146,7 +146,12 @@
     <li>
       <label class="description"><?php echo T_("Get notified by e-mail"); ?></label>
       <div>
-	<input name="notify" class="element text" type="email" multiple maxlength="255" value=""/>
+        <?php
+          $email = '';
+          if(isset($_SERVER['HTTP_USER_EMAIL']))
+            $email = $_SERVER['HTTP_USER_EMAIL'];
+        ?>
+	<input name="notify" class="element text" type="email" multiple maxlength="255" value="<?php echo $email?>"/>
       </div>
       <p class="guidelines"><small>
 	  <?php

Reply via email to