[imp] Code submittal: External link to compose.php

davidpcollins at yahoo.com davidpcollins at yahoo.com
Mon Nov 10 05:58:01 PST 2003


 
Below are two patches to imp/compose.php and imp/lib/IMP.php which add support for having an external link fill-in the To, Cc, etc fields in compose.php.  I'm not sure what bad things it may do though.  So submitted for your review.. and it probably needs it.  Note the timestamp.  Yes, I've been up all night working on various projects (did this to give myself a break) so brain no working right. :)

These patches are against the latest RELENG_3 though.  Can't get anything from cvs at this time.

David Collins


*** IMP.php     Fri Oct 31 20:02:45 2003
--- IMP.php-new Mon Nov 10 07:37:15 2003
***************
*** 307,311 ****
              } else {
                  $url = Horde::applicationUrl(IMP::logoutUrl('login.php', $reason), true);
!                 $url = IMP::addParameter($url, 'url=' . urlencode(Horde::selfUrl()));
                  header('Location: ' . $url);
              }
--- 307,316 ----
              } else {
                  $url = Horde::applicationUrl(IMP::logoutUrl('login.php', $reason), true);
!                 if (preg_match("/compose.php/i", Horde::selfUrl())) {
!                  $url = Horde::addParameter($url, 'url=' . urlencode($_SESSION['composeurl']));
!                  unset($_SESSION['composeurl']);
!               } else {
!                  $url = Horde::addParameter($url, 'url=' . urlencode(Horde::selfUrl()));
!               }
                  header('Location: ' . $url);
              }


*** compose.php Tue Jul  8 14:40:20 2003
--- compose.php-new     Mon Nov 10 07:34:20 2003
***************
*** 408,413 ****
--- 408,418 ----
  require_once 'PEAR.php';

+ $_SESSION['composeurl'] = $_SERVER['REQUEST_URI'];

  IMP::checkAuthentication();
+
+ if (isset($_SESSION['composeurl'])) {
+     unset($_SESSION['composeurl']);
+ }

  $msg = '';




More information about the imp mailing list