Changeset 4165 for trunk/rms-web
- Timestamp:
- 07/16/05 00:50:48 (3 years ago)
- Location:
- trunk/rms-web
- Files:
-
- 1 added
- 9 modified
-
check_session.php (modified) (2 diffs)
-
index.php (modified) (2 diffs)
-
kses.php (added)
-
list.php (modified) (1 diff)
-
logout.php (modified) (1 diff)
-
lougout.php (modified) (1 diff)
-
message.php (modified) (3 diffs)
-
rms.php (modified) (5 diffs)
-
server.php (modified) (1 diff)
-
settings.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/rms-web/check_session.php
r4149 r4165 1 1 <? 2 session_start(); 2 3 /* clear any post/get input of identification */ 3 4 $username = ""; … … 10 11 //session_save_path( "/home/allusers/myself/htdocs/tmp" ); 11 12 session_set_cookie_params(60*60*5); // five hours 12 session_start(); 13 13 14 if ( isset( $_SESSION["username"] ) ) 14 15 { -
trunk/rms-web/index.php
r4149 r4165 1 1 <?php 2 2 include "check_session.php"; 3 3 include "config.php"; 4 include "check_session.php";5 4 include "rms.php"; 6 5 … … 60 59 } 61 60 62 header('Location: main.php');61 echo "<script>document.location.href='main.php'</script>"; 63 62 } 64 63 -
trunk/rms-web/list.php
r4149 r4165 1 1 <?php 2 2 include "check_session.php"; 3 3 include "config.php"; 4 include "check_session.php";5 4 include "rms.php"; 6 5 -
trunk/rms-web/logout.php
r4149 r4165 1 1 <?php 2 3 2 include "check_session.php"; 4 3 session_destroy(); 5 6 4 header("Location: index.php"); 7 8 5 ?> -
trunk/rms-web/lougout.php
r4149 r4165 1 1 <?php 2 3 2 include "check_session.php"; 4 3 session_destroy(); 5 4 header("location:index.php"); 6 7 5 ?> -
trunk/rms-web/message.php
r4149 r4165 1 2 1 <?php 3 2 include "check_session.php"; 4 3 include "config.php"; 5 include "check_session.php";6 4 include "rms.php"; 5 include "kses.php"; 7 6 8 7 function rmsHandleCommand($cmd, $id = "", $pp = "") … … 77 76 $packet = socket_read($sock, 1024, PHP_NORMAL_READ); 78 77 $packet = socket_read($sock, 1024, PHP_BINARY_READ); 79 $msg = substr($packet, 0, strpos($packet, '223'));80 78 81 $msg = str_replace("\r\n", "<BR>", $ msg);79 $msg = str_replace("\r\n", "<BR>", $packet); 82 80 $msg = str_replace("\n", "<BR>", $msg); 81 82 preg_match("/^(.*)<BR>223 Message Complete<BR>$/", $msg, $matches); 83 $msg = $matches[1]; 84 85 // kses input filtering 86 $allowed = array('b' => array(), 87 'i' => array(), 88 'a' => array('href' => 1, 'title' => 1), 89 'p' => array('align' => 1), 90 'br' => array()); 91 92 if (get_magic_quotes_gpc()) 93 $msg = stripslashes($msg); 94 $msg = kses($msg, $allowed); 95 // -- 83 96 84 97 $location = "message.php?command=MSG&id=" . $id . "&pp=" . $pp; … … 142 155 143 156 $packet = socket_read($sock, 1024, PHP_NORMAL_READ); 144 if (! strstr($packet, "302"))157 if (!preg_match("/^302\s{1}.*/", $packet)) 145 158 { 146 159 echo "<BR><B>Invalid response (" . $packet . ")</B><BR>\n"; -
trunk/rms-web/rms.php
r4149 r4165 34 34 $packet = socket_read($sock, 512, PHP_NORMAL_READ); 35 35 36 if (! strstr($packet, "300"))36 if (!preg_match("/^300\s{1}.*/", $packet)) 37 37 { 38 38 echo "Invalid response"; … … 48 48 $packet = socket_read($sock, 512, PHP_NORMAL_READ); 49 49 50 if (! strstr($packet, "301"))50 if (!preg_match("/^301\s{1}.*/", $packet)) 51 51 { 52 52 echo "Invalid response"; … … 61 61 $packet = socket_read($sock, 512, PHP_NORMAL_READ); 62 62 63 if (! strstr($packet, "200"))63 if (!preg_match("/^200\s{1}.*/", $packet)) 64 64 { 65 65 $errmsg = $packet; … … 87 87 $packet = socket_read($sock, 512, PHP_NORMAL_READ); 88 88 89 if ( strstr($packet, "202"))89 if (preg_match("/^202\s{1}.*/", $packet)) 90 90 { 91 91 //TODO Handle all the protocols seperately … … 134 134 $packet = socket_read($sock, 512, PHP_NORMAL_READ); 135 135 136 while (! strstr($packet, "206"))137 { 138 if ( strstr($packet, "204"))136 while (!preg_match("/^206$/", $packet)) 137 { 138 if (preg_match("/^204\s{1}.*/", $packet)) 139 139 { 140 140 $id = " "; -
trunk/rms-web/server.php
r4149 r4165 1 1 <?php 2 2 include "check_session.php"; 3 3 include "rms.php"; 4 4 include "config.php"; 5 include "check_session.php";6 5 7 6 $cmd = $_POST["cmd"]; -
trunk/rms-web/settings.php
r4149 r4165 10 10 $fc = file("config.php"); 11 11 $f = fopen("config.php", "w"); 12 if (!$f) 13 { 14 echo "config.php not writable"; 15 exit(); 16 } 12 17 13 18 foreach($fc as $line)
