diff --git a/Rocksolid_Light/common/header.php b/Rocksolid_Light/common/header.php
index 9c5e27c..ed8bbae 100644
--- a/Rocksolid_Light/common/header.php
+++ b/Rocksolid_Light/common/header.php
@@ -8,6 +8,7 @@ if (basename(getcwd()) == 'mods') {
}
include($rootdir.'common/config.inc.php');
+
$CONFIG = include $config_file;
?>
getMessage();
+ exit;
+ }
+ $dbh->exec("CREATE TABLE IF NOT EXISTS messages(
+ id INTEGER PRIMARY KEY,
+ msgid TEXT UNIQUE,
+ mail_from TEXT,
+ mail_viewed TEXT,
+ rcpt_to TEXT,
+ rcpt_viewed TEXT,
+ rcpt_target TEXT,
+ date TEXT,
+ subject TEXT,
+ message TEXT,
+ from_hide TEXT,
+ to_hide TEXT)");
+ return($dbh);
+}
+
function rslight_db_open($database, $table='overview') {
try {
$dbh = new PDO('sqlite:'.$database);
diff --git a/Rocksolid_Light/rslight/links.conf b/Rocksolid_Light/rslight/links.conf
index b393d40..c249033 100644
--- a/Rocksolid_Light/rslight/links.conf
+++ b/Rocksolid_Light/rslight/links.conf
@@ -1,7 +1,7 @@
# These are the links at the top right of the site
# display name:url
-mail:/rocksolid/mail.php
-files:/rocksolid/files.php
+mail:/spoolnews/mail.php
+files:/spoolnews/files.php
register:/common/register.php
nodelist:/common/nodelist.php
faq:/common/faq.txt
diff --git a/Rocksolid_Light/rocksolid/files.php b/Rocksolid_Light/spoolnews/files.php
similarity index 100%
rename from Rocksolid_Light/rocksolid/files.php
rename to Rocksolid_Light/spoolnews/files.php
diff --git a/Rocksolid_Light/spoolnews/head.inc b/Rocksolid_Light/spoolnews/head.inc
new file mode 120000
index 0000000..bf8f5c9
--- /dev/null
+++ b/Rocksolid_Light/spoolnews/head.inc
@@ -0,0 +1 @@
+../rocksolid/head.inc
\ No newline at end of file
diff --git a/Rocksolid_Light/rocksolid/mail.php b/Rocksolid_Light/spoolnews/mail.php
similarity index 93%
rename from Rocksolid_Light/rocksolid/mail.php
rename to Rocksolid_Light/spoolnews/mail.php
index ae25cf8..b84e998 100644
--- a/Rocksolid_Light/rocksolid/mail.php
+++ b/Rocksolid_Light/spoolnews/mail.php
@@ -34,8 +34,9 @@ include "head.inc";
var authcookie = "";
var savename = "";
var auth_expire = "";
- document.cookie = "mail_auth="+authcookie+"; max-age="+auth_expire;
- document.cookie = "mail_name="+savename;
+ var name_expire = "7776000";
+ document.cookie = "mail_auth="+authcookie+"; max-age="+auth_expire+"; path=/";
+ document.cookie = "mail_name="+savename+"; max-age="+name_expire+"; path=/";
';
if(($row['mail_from'] != $user) && ($row['rcpt_to'] != $user)) {
continue;
}
+ $istrue = 'true';
if($row['mail_from'] == $user) {
- $sql_update = $dbh->prepare('UPDATE messages SET from_hide=? WHERE id=?');
- } elseif($row['rcpt_to'] == $user) {
- $sql_update = $dbh->prepare('UPDATE messages SET to_hide=? WHERE id=?');
+ $sql_update = $dbh->prepare('UPDATE messages SET from_hide=:from_hide WHERE id=:row_id');
+ $sql_update->execute(array(':from_hide' => $istrue, ':row_id' => $row['id']));
+ }
+ if($row['rcpt_to'] == $user) {
+ $sql_update = $dbh->prepare('UPDATE messages SET to_hide=:to_hide WHERE id=:row_id');
+ $sql_update->execute(array(':to_hide' => $istrue, ':row_id' => $row['id']));
}
- $sql_update->execute(array('true', $row['id']));
}
$dbh = null;
}
@@ -162,10 +166,12 @@ echo '';
echo '';
if($row['mail_from'] == $user) {
$sql_update = $dbh->prepare('UPDATE messages SET mail_viewed=? WHERE msgid=?');
- } elseif($row['rcpt_to'] == $user) {
+ $sql_update->execute(array('true', $row['msgid']));
+ }
+ if($row['rcpt_to'] == $user) {
$sql_update = $dbh->prepare('UPDATE messages SET rcpt_viewed=? WHERE msgid=?');
+ $sql_update->execute(array('true', $row['msgid']));
}
- $sql_update->execute(array('true', $row['msgid']));
}
$dbh = null;
@@ -173,7 +179,7 @@ echo '';
if (isSet($_POST['sendMessage'])) {
if (isSet($_POST['to']) && $_POST['to'] != '' && isSet($_POST['from']) && $_POST['from'] != '' && isSet($_POST['message']) && $_POST['message'] != '') {
if(($to = get_config_value('aliases.conf', strtolower($_POST['to']))) == false) {
- $to = $_POST['to'];
+ $to = strtolower($_POST['to']);
}
$userlist = scandir($config_dir.'/users/');
$found = 0;
@@ -297,27 +303,4 @@ echo '';
}
echo '
';
include "tail.inc";
-
-function mail_db_open($database, $table='messages') {
- try {
- $dbh = new PDO('sqlite:'.$database);
- } catch (PDOExeption $e) {
- echo 'Connection failed: '.$e->getMessage();
- exit;
- }
- $dbh->exec("CREATE TABLE IF NOT EXISTS messages(
- id INTEGER PRIMARY KEY,
- msgid TEXT UNIQUE,
- mail_from TEXT,
- mail_viewed TEXT,
- rcpt_to TEXT,
- rcpt_viewed TEXT,
- rcpt_target TEXT,
- date TEXT,
- subject TEXT,
- message TEXT,
- from_hide TEXT,
- to_hide TEXT)");
- return($dbh);
-}
?>
diff --git a/Rocksolid_Light/rocksolid/upload.php b/Rocksolid_Light/spoolnews/upload.php
similarity index 100%
rename from Rocksolid_Light/rocksolid/upload.php
rename to Rocksolid_Light/spoolnews/upload.php