[ Index ]

PHP Cross Reference of phpwcms V1.4.7 _r403 (01.11.10)

title

Body

[close]

/include/inc_act/ -> act_message.php (source)

   1  <?php
   2  /*************************************************************************************
   3     Copyright notice
   4     
   5     (c) 2002-2010 Oliver Georgi (oliver@phpwcms.de) // All rights reserved.
   6   
   7     This script is part of PHPWCMS. The PHPWCMS web content management system is
   8     free software; you can redistribute it and/or modify it under the terms of
   9     the GNU General Public License as published by the Free Software Foundation;
  10     either version 2 of the License, or (at your option) any later version.
  11    
  12     The GNU General Public License can be found at http://www.gnu.org/copyleft/gpl.html
  13     A copy is found in the textfile GPL.txt and important notices to the license 
  14     from the author is found in LICENSE.txt distributed with these scripts.
  15    
  16     This script is distributed in the hope that it will be useful, but WITHOUT ANY 
  17     WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
  18     PARTICULAR PURPOSE.  See the GNU General Public License for more details.
  19   
  20     This copyright notice MUST APPEAR in all copies of the script!
  21  *************************************************************************************/
  22  
  23  // session_name('hashID');
  24  session_start();
  25  $phpwcms = array();
  26  $ref = $_SESSION['REFERER_URL'];
  27  
  28  
  29  require_once ('../../config/phpwcms/conf.inc.php');
  30  require_once  ('../inc_lib/default.inc.php');
  31  require_once  (PHPWCMS_ROOT.'/include/inc_lib/dbcon.inc.php');
  32  
  33  require_once  (PHPWCMS_ROOT.'/include/inc_lib/general.inc.php');
  34  checkLogin();
  35  require_once  (PHPWCMS_ROOT.'/include/inc_lib/backend.functions.inc.php');
  36  
  37  list($do, $id, $wert) = explode(".", $_GET["do"]);
  38  $do        = intval($do);
  39  $id        = intval($id);
  40  
  41  //Message in den Papierkorb bewegen
  42  if($do == 1) {
  43      if(intval($wert)) {
  44          $sql =     "UPDATE ".DB_PREPEND."phpwcms_message SET ".
  45                  "msg_deleted=1, msg_tstamp=msg_tstamp, msg_read=1 WHERE ".
  46                  "msg_uid=".$_SESSION["wcs_user_id"]." AND ".
  47                  "msg_id=".$id.";";
  48          mysql_query($sql, $db) or die("error");
  49      }
  50  }
  51  
  52  //Durch User versendete Message in den Papierkorb bewegen
  53  if($do == 2) {
  54      if(intval($wert)) {
  55          $sql =     "UPDATE ".DB_PREPEND."phpwcms_message SET ".
  56                  "msg_from_del=1, msg_tstamp=msg_tstamp  WHERE ".
  57                  "msg_from=".$_SESSION["wcs_user_id"]." AND ".
  58                  "msg_id=".$id.";";
  59          mysql_query($sql, $db) or die("error");
  60      }
  61  }
  62  
  63  //Undo Normale Message
  64  if($do == 3) {
  65      if(intval($wert) == 0) {
  66          $sql =     "UPDATE ".DB_PREPEND."phpwcms_message SET ".
  67                  "msg_deleted=0, msg_tstamp=msg_tstamp WHERE ".
  68                  "msg_uid=".$_SESSION["wcs_user_id"]." AND ".
  69                  "msg_id=".$id.";";
  70          mysql_query($sql, $db) or die("error");
  71      }
  72  }
  73  
  74  //Undo Sent Message
  75  if($do == 4) {
  76      if(intval($wert) == 0) {
  77          $sql =     "UPDATE ".DB_PREPEND."phpwcms_message SET ".
  78                  "msg_from_del=0, msg_tstamp=msg_tstamp  WHERE ".
  79                  "msg_from=".$_SESSION["wcs_user_id"]." AND ".
  80                  "msg_id=".$id.";";
  81          mysql_query($sql, $db) or die("error");
  82      }
  83  }
  84  
  85  //Delete Normale Message
  86  if($do == 5) {
  87      if(intval($wert) == 9) {
  88          $sql =     "UPDATE ".DB_PREPEND."phpwcms_message SET ".
  89                  "msg_deleted=9, msg_tstamp=msg_tstamp WHERE ".
  90                  "msg_uid=".$_SESSION["wcs_user_id"]." AND ".
  91                  "msg_id=".$id." AND msg_deleted=1;";
  92          mysql_query($sql, $db) or die("error");
  93      }
  94  }
  95  
  96  //Delete sent message (Set del to 9)
  97  if($do == 6) {
  98      if(intval($wert) == 9) {
  99          $sql =     "UPDATE ".DB_PREPEND."phpwcms_message SET ".
 100                  "msg_from_del=9, msg_tstamp=msg_tstamp  WHERE ".
 101                  "msg_from=".$_SESSION["wcs_user_id"]." AND ".
 102                  "msg_id=".$id." AND msg_from_del=1;";
 103          mysql_query($sql, $db) or die("error");
 104      }
 105  }
 106  
 107  headerRedirect($ref);
 108  
 109  ?>


Generated: Tue Nov 16 22:51:00 2010 Cross-referenced by PHPXref 0.7