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 976 times via Git panel.

commit 7c6900f07fda98936889b0e7b7e3bf6a16478aab
tree 0b32424b164b8b84cd775d4e0dbbb75fbeda1ce2
parent 390bc7342f04cf08d1f451eac7ff9021390c20ed
author Engels Antonio <engels@majcms.org> 1277314215 +0800
committer Engels Antonio <engels@majcms.org> 1277314215 +0800

    maj-2.0-201006171846.zip

diff --git a/edit.php b/edit.php
index dac72f8..8e3ea52 100644
--- a/edit.php
+++ b/edit.php
@@ -281,9 +281,21 @@ if (isset($_POST['auth_member']) and !empty($_POST['auth_member']) and isset($_P
       
        if (($_POST['auth_toggle'] == "ack") and file_exists("data/members/active/{$_POST['auth_member']}")) {
 
+               if (!file_exists("data/items/{$_REQUEST['entry']}/members")) {
+                       mkdir("data/items/{$_REQUEST['entry']}/members");
+               }
+
                if (!file_exists("data/items/{$_REQUEST['entry']}/members/{$_POST['auth_member']}")) {
                        mkdir("data/items/{$_REQUEST['entry']}/members/{$_POST['auth_member']}");
                }
+
+               if (!file_exists("data/items/{$_REQUEST['entry']}/imembers")) {
+                       mkdir("data/items/{$_REQUEST['entry']}/imembers");
+               }
+
+               if (!file_exists("data/items/{$_REQUEST['entry']}/imembers/{$_POST['auth_member']}")) {
+                       mkdir("data/items/{$_REQUEST['entry']}/imembers/{$_POST['auth_member']}");
+               }
        }
 
         if (($_POST['auth_toggle'] == "nak") and file_exists("data/members/active/{$_POST['auth_member']}")) {
@@ -291,17 +303,73 @@ if (isset($_POST['auth_member']) and !empty($_POST['auth_member']) and isset($_P
                 if (file_exists("data/items/{$_REQUEST['entry']}/members/{$_POST['auth_member']}")) {
                         rmdirr("data/items/{$_REQUEST['entry']}/members/{$_POST['auth_member']}");
                 }
+
+                if (file_exists("data/items/{$_REQUEST['entry']}/imembers/{$_POST['auth_member']}")) {
+                        rmdirr("data/items/{$_REQUEST['entry']}/imembers/{$_POST['auth_member']}");
+                }
         }
 }
 
 if (isset($_POST['category']) and !empty($_POST['category'])) {
 
+       if (file_exists("data/categories/{$_REQUEST['category']}/members")) {
+
+               if ($dh_cat_members = opendir("data/categories/{$_REQUEST['category']}/members")) {
+              
+                       while (($get_cat_member = readdir($dh_cat_members)) !== false) {
+              
+                               if ($get_cat_member != "." && $get_cat_member != "..") {
+
+                                       if (file_exists("data/members/active/$get_cat_member")) {
+                                               $get_cat_members[] = $get_cat_member;                                  
+                                       }
+                                       else {
+                                               rmdirr("data/categories/{$_REQUEST['category']}/members/$get_cat_member");
+                                       }
+                               }
+                       }
+                       closedir($dh_cat_members);
+               }
+       }
+
        if (($_POST['do'] == "unfile") and file_exists("data/items/{$_REQUEST['entry']}/categories/{$_REQUEST['category']}")) {
+
                rmdirr("data/items/{$_REQUEST['entry']}/categories/{$_REQUEST['category']}");
 
                if (count(glob("data/items/{$_REQUEST['entry']}/categories/*")) < 1) {
                        rmdirr("data/items/{$_REQUEST['entry']}/categories");
                }
+
+               if (file_exists("data/categories")) {
+
+                       if ($dh_get_categories = opendir("data/categories")) {
+              
+                               while (($get_category = readdir($dh_get_categories)) !== false) {
+              
+                                       if ($get_category != "." && $get_category != "..") {
+                                               $get_categories[] = $get_category;
+                                       }
+                               }
+                               closedir($dh_get_categories);
+                       }
+
+                       foreach ($get_cat_members as $get_cat_mem) {
+
+                               $count_mem = 0;
+
+                               foreach ($get_categories as $get_category) {
+
+                                       if (file_exists("data/categories/$get_category/members/$get_cat_mem") and ($_REQUEST['category'] != $get_category) and file_exists("data/items/{$_REQUEST['entry']}/categories/$get_category")) {
+                                               $count_mem = $count_mem + 1;
+                                       }
+                               }
+
+                               if (($count_mem < 1) and !file_exists("data/items/{$_REQUEST['entry']}/imembers/$get_cat_mem")) {
+                                       rmdirr("data/items/{$_REQUEST['entry']}/members/$get_cat_mem");
+                               }
+                       }
+
+               }
        }
 
        if (($_POST['do'] == "file") and !file_exists("data/items/{$_REQUEST['entry']}/categories/{$_REQUEST['category']}")) {
@@ -311,6 +379,13 @@ if (isset($_POST['category']) and !empty($_POST['category'])) {
                }
 
                mkdir("data/items/{$_REQUEST['entry']}/categories/{$_REQUEST['category']}");
+
+               foreach ($get_cat_members as $get_cat_mem) {
+
+                       if (!file_exists("data/items/{$_REQUEST['entry']}/members/$get_cat_mem")) {
+                               mkdir("data/items/{$_REQUEST['entry']}/members/$get_cat_mem");
+                       }
+               }
        }
 }
 
@@ -605,7 +680,7 @@ if (file_exists("data/categories")) {
 
                while (($entry_cat = readdir($dh_cat)) !== false) {
       
-                       if ($entry_cat != "." && $entry_cat != ".." && fnmatch("*", $entry_cat)) {
+                       if ($entry_cat != "." && $entry_cat != "..") {
 
                                if (file_exists("data/categories/$entry_cat/private.txt") and ($login_username != $_SESSION['logged_in'])) {
                                        continue;
@@ -688,7 +763,13 @@ if (file_exists("data/members/active")) {
                while (($ack_member = readdir($dh_ack_members)) !== false) {
 
                        if ($ack_member != "." && $ack_member != "..") {
-                               $ack_members[] = $ack_member;
+
+                               if (file_exists("data/members/active/$ack_member")) {
+                                       $ack_members[] = $ack_member;
+                               }
+                               else {
+                                       rmdirr("data/items/{$_REQUEST['entry']}/members/$ack_member");
+                               }
                        }
                }
                closedir($dh_ack_members);
diff --git a/rel.txt b/rel.txt
index 5ba4979..3ea4ea2 100644
--- a/rel.txt
+++ b/rel.txt
@@ -1 +1 @@
-201006170704
+201006171846
 
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
35645 downloads
MAJ 1.0
26 files
14253 downloads
MAJ 0.14
45 files
36877 downloads