Verzeichnisstruktur phpBB-1.0.0


Veröffentlicht
15.12.2000

So funktioniert es


Auf das letzte Element klicken. Dies geht jeweils ein Schritt zurück

Auf das Icon klicken, dies öffnet das Verzeichnis. Nochmal klicken schließt das Verzeichnis.
Auf den Verzeichnisnamen klicken, dies zeigt nur das Verzeichnis mit Inhalt an

(Beispiel Datei-Icons)

Auf das Icon klicken um den Quellcode anzuzeigen

delpmsg.php

Zuletzt modifiziert: 09.10.2024, 12:50 - Dateigröße: 3.03 KiB


01  <?php
02  /***************************************************************************
03                            delpmsg.php  -  description
04                               -------------------
05      begin                : Wed June 19 2000
06      copyright            : (C) 2000 by James Atkinson
07      email                : james@totalgeek.org
08   
09      $Id: delpmsg.php,v 1.5 2000/11/15 04:57:15 thefinn Exp $
10   
11   ***************************************************************************/
12   
13  /***************************************************************************
14   *                                                                                         
15   *   This program is free software; you can redistribute it and/or modify      
16   *   it under the terms of the GNU General Public License as published by  
17   *   the Free Software Foundation; either version 2 of the License, or            
18   *   (at your option) any later version.
19   *
20   ***************************************************************************/
21   
22  /**
23   * delpmsg.php - Nathan Codding
24   * - Used for deleting private messages by users of the BB.
25   */
26  include('extention.inc');
27  include('functions.'.$phpEx);
28  include('config.'.$phpEx);
29  require('auth.'.$phpEx);
30  $pagetitle = "Private Messages";
31  $pagetype = "privmsgs";
32  include('page_header.'.$phpEx);
33   
34   
35  if (!$submit && !$user_logged_in) {
36  ?>
37   
38  Please enter your username and password to delete the private message
39  <FORM ACTION="<?php echo $PHP_SELF?>?msgid=<?php echo $msgid?>" METHOD="POST">
40  <b>Username: </b><INPUT TYPE="TEXT" NAME="username" SIZE="25" MAXLENGTH="40" VALUE="<?php echo $userdata[username]?>"><BR>
41  <b>Password: </b><INPUT TYPE="PASSWORD" NAME="password" SIZE="25" MAXLENGTH="25"><br><br>
42  <INPUT TYPE="SUBMIT" NAME="submit" VALUE="Submit">&nbsp;&nbsp;&nbsp;<INPUT TYPE="RESET" VALUE="Clear">
43  </FORM>
44   
45  <?php
46  } else {
47      if (!$user_logged_in) {
48          if ($username == '') {
49              die("You have to enter your username. Go back and do so.");
50          }
51          if ($password == '') {
52              die("You have to enter your password. Go back and do so.");
53          }
54          if (!check_username($username, $db)) {
55              die("Invalid username \"$username\". Go back and try again.");
56          }
57          if (!check_user_pw($username, $password, $db)) {
58              die("Invalid password. Go back and try again.");
59          }
60      
61          /* throw away user data from the cookie, use username from the form to get new data */
62          $userdata = get_userdata($username, $db);
63      }
64   
65      $sql = "SELECT to_userid FROM priv_msgs WHERE (msg_id = $msgid)";
66      $resultID = mysql_query($sql);
67      if (!$resultID) {
68          echo mysql_error() . "<br>\n";
69          die("Error during DB query (checking msg ownership)");
70      }
71      $row = mysql_fetch_array($resultID);
72      if ($userdata[user_id] != $row[to_userid]) {
73          die("That's not your message. You can't delete it.");
74      }
75   
76      $deleteSQL = "DELETE FROM priv_msgs WHERE (msg_id = $msgid)";
77      $success = mysql_query($deleteSQL);
78      if (!$success) {
79          echo mysql_error() . "<br>\n";
80          die("Error deleting from DB.");
81      }
82   
83      echo "Deletion successful. Click <a href=\"$url_phpbb/viewpmsg.$phpEx\">here</a> to go back to your messages.<br><br>\n";
84   
85  } // if/else (if submit)
86   
87  require('page_tail.'.$phpEx);
88  ?>
89