Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100644 61 lines (55 sloc) 1.464 kb
01a7f58 @rosslagerwall Initial commit
authored
1 <?php
2 include("common.php");
3
4 $fileC = file("db/PMs/".$_SESSION['user']->getUserId().".dat",FILE_IGNORE_NEW_LINES);
5
6 $str = "";
7 $statusChange = false;
8 foreach ($fileC as $line)
9 {
10 $temp = new PM($line);
11 if ($temp->getMessageId() == $_GET['messageId'])
12 {
13 $pm = $temp;
14 if ($pm->isRead() == 'false')
15 {
16 $statusChange = true;
17 $lineArr = explode("~",$line);
18 $lineArr[4] = 'true';
19 $str .= implode("~",$lineArr)."\n";
20 }
21 }
22 else
23 {
24 $str .= $line."\n";
25 }
26 }
27
28 if ($statusChange)
29 {
30 file_put_contents("db/PMs/".$_SESSION['user']->getUserId().".dat",$str);
31 }
32
33 outHtml1("View Message");
34 outHtml2("View Message:","pmInbox.php");
35 ?>
36
37 <table class="tbl">
38 <tr>
39 <td class="tblleft">Sender</td>
40 <td class="tblright"><?php echo "<a href='viewUser.php?userId=".$pm->getSender()->getUserId()."'>".$pm->getSender()->getUserId()."</a>" ?></td>
41 </tr>
42 <tr>
43 <td class="tblleft">Date</td>
44 <td class="tblright"><?php echo $pm->getDate() ?></td>
45 </tr>
46 <tr>
47 <td class="tblleft">Subject</td>
48 <td class="tblright"><?php echo $pm->getSubject() ?></td>
49 </tr>
50 <tr>
51 <td class="tblleft">Message</td>
52 <td class="tblright"><?php echo $pm->getMessage() ?></td>
53 </tr>
54 </table>
55 <div id="controlDiv">
bd40072 @rosslagerwall Sanitize $_GET inputs for XSS attacks. Thanks to Bob van Dam for reporti...
authored
56 <a href="pmDelete.php?&messageId=<?php echo htmlentities($_GET['messageId']) ?>">Delete</a>
01a7f58 @rosslagerwall Initial commit
authored
57 </div>
58 <?php
59 outHtml3();
60 ?>
Something went wrong with that request. Please try again.