This commit has been accessed 568 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
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