Profile
MAJ is an Open Source, PHP-based content management system (CMS) that can be deployed as a blog, bulletin or message board, Internet forum, and wiki. It is extensible via PHP panels and is HTML5 and CSS3 ready.
Git
This commit has been accessed 873 times via Git panel.

commit 9b48a4ab9c39f749881c3cb5ab6f525d3144f57d
tree 69d6fd36ba78a5b732712682db583d2eeb4345ff
parent 9b1cef1618a57db27af2c7446cb25e5209b610e2
author Engels Antonio <engels@majcms.org> 1277314203 +0800
committer Engels Antonio <engels@majcms.org> 1277314203 +0800

    maj-1.0-20081125-bb.zip

diff --git a/index.php b/index.php
index eeee3dd..2a0836e 100644
--- a/index.php
+++ b/index.php
@@ -82,8 +82,9 @@ else {
 }
 
 $wside = "175";
+$wspace = "10";
 
-$wtable = $wside + $wmain + $wside;
+$wtable = $wside + $wspace + $wmain + $wspace + $wside;
 
 $default_blog_title = "My Activity Journal";
 $default_username = "maj";
@@ -1429,7 +1430,9 @@ if (file_exists("data/header.txt")) {
 
 }
 
-echo "<table border=\"0\" cellspacing=\"10\" cellpadding=\"0\" width=\"$wtable\"><tr><td width=\"$wside\" valign=\"top\">";
+echo "<table border=\"0\" cellspacing=\"0\" cellpadding=\"0\" width=\"$wtable\">";
+echo "<tr><td width=\"$wside\" height=\"10\"></td><td width=\"$wspace\" height=\"10\"></td><td width=\"$wmain\" height=\"10\"></td><td width=\"$wspace\" height=\"10\"></td><td width=\"$wside\" height=\"10\"></td></tr>";
+echo "<tr><td width=\"$wside\" valign=\"top\">";
 
 if (file_exists("data/round.txt")) {
        echo "<b class=\"rbtop\"><b class=\"rb1t\"></b><b class=\"rb2t\"></b><b class=\"rb3t\"></b><b class=\"rb4t\"></b></b><div class=\"xtitle\">";
@@ -1762,14 +1765,13 @@ if (file_exists("data/panels")) {
                }
        }
 }
-?>
 
-</td>
+echo "</td><td width=\"$wspace\"></td>";
 
-<td valign="top" width="<?php echo $wmain; ?>">
+// main
+
+echo "<td valign=\"top\" width=\"$wmain\">";
 
-<?php
-      
 if ($count_top_panels > 0) {
 
        foreach ($top_panels as $top_panel) {
@@ -1940,10 +1942,6 @@ if ($dh_items = opendir("data/items")) {
                                        continue;
                                }
 
-                               if (file_exists("data/items/$item/member.txt") and (!isset($_SESSION['logged_in']))) {
-                                       continue;
-                               }
-
                                $private_categories = "0";
 
                                if (file_exists("data/items/$item/categories")) {
@@ -1969,10 +1967,6 @@ if ($dh_items = opendir("data/items")) {
 
                                $latest[] = $item;
 
-                               if (file_exists("data/nocat.txt") and file_exists("data/items/$item/categories") and !file_exists("data/items/$item/cat.txt") and (!isset($req_category) or empty($req_category)) and (!isset($req_entry) or empty($req_entry)) and (!isset($req_author) or empty($req_author))) {
-                                       continue;
-                               }
-
                                if (file_exists("data/items/$item/album")) {
                                        $albums[] = $item;
                                }
@@ -1980,6 +1974,14 @@ if ($dh_items = opendir("data/items")) {
                                $random[] = $item;
                                $archives[] = substr($item,0,6);
 
+                               if (file_exists("data/items/$item/member.txt") and (!isset($_SESSION['logged_in']))) {
+                                       continue;
+                               }
+
+                               if (file_exists("data/nocat.txt") and file_exists("data/items/$item/categories") and !file_exists("data/items/$item/cat.txt") and (!isset($req_category) or empty($req_category)) and (!isset($req_entry) or empty($req_entry)) and (!isset($req_author) or empty($req_author))) {
+                                       continue;
+                               }
+
                                if (isset($req_entry) or isset($req_category) or isset($req_archive) or isset($req_find) or isset($req_author)) {
       
                                        if (isset($req_entry) and file_exists("data/items/$req_entry")) {
@@ -2014,6 +2016,17 @@ reset($grand);
 
 $count_grand = count($grand);
 
+if (isset($req_entry) and file_exists("data/items/$req_entry")) {
+
+       if (file_exists("data/items/$req_entry/private.txt") and (!isset($_SESSION['logged_in']) or ($_SESSION['logged_in'] != $login_username))) {
+               unset($items);
+       }
+
+       if (file_exists("data/items/$req_entry/member.txt") and !isset($_SESSION['logged_in'])) {
+               unset($items);
+       }
+}
+
 $items = array_unique($items);
 $items = array_values($items);
 
@@ -4061,7 +4074,7 @@ if ($end < sizeof($items)) {
 
 // right side
 
-echo "</tr></table></td><td width=\"$wside\" valign=\"top\">";
+echo "</tr></table></td><td width=\"$wspace\"></td><td width=\"$wside\" valign=\"top\">";
 
 if (isset($_SESSION['logged_in']) and ($_SESSION['logged_in'] == $login_username)) {
        if ($dh_pending_comment_flags = opendir("data/comments/pending")) {
@@ -4654,7 +4667,7 @@ if (!file_exists("data/xrand.txt")) {
 
 <?php
 
-if (($count_archives > 0) and ($count_latest > $increase) and ($count_latest > 0)) {
+if (($count_archives > 0) and ($count_latest > $increase) and ($count_latest > 0) and (!file_exists("data/xarc.txt") or isset($_SESSION['logged_in']))) {
 
        $archive_entries = implode(" ",$archives);
 
diff --git a/move.php b/move.php
index 05c47b2..b997755 100644
--- a/move.php
+++ b/move.php
@@ -175,6 +175,20 @@ if (isset($_POST['target']) and !empty($_POST['target'])) {
        exit();
 }
 
+if ($dh_items = opendir("data/items")) {
+
+       while (($entry_item = readdir($dh_items)) !== false) {
+
+               if ($entry_item != "." && $entry_item != ".." && ($_REQUEST['entry'] != $entry_item)) {
+                       $target_items[] = $entry_item;
+               }
+       }
+       closedir($dh_items);
+}
+
+rsort($target_items);
+reset($target_items);
+
 ?>
 
 <title>Move</title>
@@ -259,20 +273,6 @@ if (isset($_REQUEST['comment']) and !empty($_REQUEST['comment']) and isset($_REQ
 
 <?php
 
-if ($dh_items = opendir("data/items")) {
-
-       while (($entry_item = readdir($dh_items)) !== false) {
-
-               if ($entry_item != "." && $entry_item != ".." && ($_REQUEST['entry'] != $entry_item)) {
-                       $target_items[] = $entry_item;
-               }
-       }
-       closedir($dh_items);
-}
-
-rsort($target_items);
-reset($target_items);
-
 foreach ($target_items as $target_entry) {
 
        echo "<option value=\"$target_entry\">";
diff --git a/rel.txt b/rel.txt
index 8048ae6..9383d12 100644
--- a/rel.txt
+++ b/rel.txt
@@ -1 +1 @@
-20081124
\ No newline at end of file
+20081125
\ No newline at end of file
 
Credits
Sunday, Sep 18, 2005, 12:00 AM (Revision 11 - Thursday, Jul 14, 2011, 7:30 PM)
Open Source enables software developers to stand on the shoulders of giants instead of reinventing the wheel, so to speak. Kudos and many thanks to the folks who made their work freely available for reuse in MAJ.

read more
Bugs and Exploits
Friday, Aug 26, 2005, 12:00 AM (Revision 23 - Wednesday, May 29, 2013, 5:25 AM)
Although MAJ started as a family project, care has been taken to make it as "safe" as possible. With more people now working on MAJ, bugs and exploitable code may sometimes slip in. We invite you to poke around and see if you can find any. Generally, there are two things you can do when you find a MAJ or PHP-related bug or exploit:

1. Take advantage of it. But hey, what's so exciting about messing up someone's blog? Ho-hum, right?
2. Report it here so that we can work on a fix and make MAJ better.

read more
Search
Download
MAJ 2.0
75 files
33012 downloads
MAJ 1.0
26 files
13143 downloads
MAJ 0.14
45 files
35025 downloads