home *** CD-ROM | disk | FTP | other *** search
/ Chip 2004 April / CMCD0404.ISO / Software / Freeware / Programare / groupoffice-com-2.01 / modules / email / notification.php < prev    next >
PHP Script  |  2004-03-08  |  3KB  |  82 lines

  1. <?php
  2. /*
  3. Copyright Intermesh 2003
  4. Author: Merijn Schering <mschering@intermesh.nl>
  5. Version: 1.0 Release date: 08 July 2003
  6.  
  7. This program is free software; you can redistribute it and/or modify it
  8. under the terms of the GNU General Public License as published by the
  9. Free Software Foundation; either version 2 of the License, or (at your
  10. option) any later version.
  11. */
  12.  
  13. require("../../Group-Office.php");
  14. $GO_SECURITY->authenticate();
  15. $GO_MODULES->authenticate('email');
  16. require($GO_LANGUAGE->get_language_file('email'));
  17. if ($_SERVER['REQUEST_METHOD'] == "POST")
  18. {
  19.     require($GO_CONFIG->class_path."users.class.inc");
  20.     $users = new users;
  21.     $profile = $users->get_user($GO_SECURITY->user_id);
  22.  
  23.     $middle_name = $profile['middle_name'] == '' ? '' : ' '.$profile['middle_name'];
  24.     $body = $ml_displayed.$profile["first_name"]." ".$middle_name.$profile['last_name']." <".$profile["email"].">\r\n\r\n";
  25.     $body .= $ml_subject.": ".$_POST['subject']."\r\n".$strDate.": ".$_POST['date'];
  26.  
  27.     if (!sendmail($_POST['email'], $profile["email"], $profile["first_name"]." ".$profile['last_name'], $ml_notify, $body))
  28.     {
  29.         $feedback = '<p class="Error">'.$ml_send_error.'</p>';
  30.     }else
  31.     {
  32.         echo "<script type=\"text/javascript\">\nwindow.close();\n</script>";
  33.         exit;
  34.     }
  35. }else
  36. {
  37.     $pattern[0]="/(.*)</";
  38.     $pattern[1]="/>/";
  39.     $replace="";
  40.     $email = preg_replace($pattern, $replace, $_REQUEST['notification']);
  41. }
  42.  
  43. $page_title=$ml_notify;
  44. require($GO_THEME->theme_path."header.inc");
  45. ?>
  46. <form method="post" name="notify" action="<?php echo $_SERVER['PHP_SELF']; ?>">
  47. <input type="hidden" name="email" value="<?php echo $email; ?>" />
  48. <input type="hidden" name="date" value="<?php echo $_REQUEST['date']; ?>" />
  49. <input type="hidden" name="subject" value="<?php echo $_REQUEST['subject']; ?>" />
  50.  
  51. <table border="0" cellspacing="0" cellpadding="5" align="center">
  52. <tr>
  53.     <td><img src="<?php echo $GO_THEME->images['questionmark']; ?>" border="0" /></td><td><h2><?php echo $ml_notify; ?></h2></td>
  54. </tr>
  55. </table>
  56. <?php
  57. if (isset($feedback))
  58. {
  59.     echo "<tr><td colspan=\"2\">".$feedback."</td></tr>\n";
  60. }
  61. ?>
  62. <table border="0" cellspacing="0" cellpadding="5" align="center">
  63. <tr>
  64.     <td colspan="2">
  65.     <?php echo $ml_ask_notify; ?>
  66.     </td>
  67. </tr>
  68. <tr>
  69.     <td colspan="2" align="center">
  70.     <?php
  71.     $button = new button($cmdOk, "javascript:document.forms[0].submit()");
  72.     echo '  ';
  73.     $button = new button($cmdCancel, "javascript:window.close()");
  74.     ?>
  75.     </td>
  76. </tr>
  77. </table>
  78. </form>
  79. <?php
  80. require($GO_THEME->theme_path."simple_footer.inc");
  81. ?>
  82.