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

commit 1ab5ae398fe335fea2cd3bc2aec276beabd58fc0
tree c9ed81fa8a602ae26c4d5685c8cb02ede880af55
parent e2ab6c5f30b176cdebc4004824749d46eae7bb8a
author Engels Antonio <engels@majcms.org> 1277314195 +0800
committer Engels Antonio <engels@majcms.org> 1277314195 +0800

    maj-0.14-20080125-bb.zip

diff --git a/index.php b/index.php
index 27798e8..fab77ef 100644
--- a/index.php
+++ b/index.php
@@ -383,7 +383,7 @@ if (isset($_REQUEST['entry']) and !empty($_REQUEST['entry'])) {
                        fclose($fp_views);
                }
               
-               if (isset($_REQUEST['show']) and !empty($_REQUEST['show']) and isset($_REQUEST['captcha_put']) and !empty($_REQUEST['captcha_get']) and isset($_REQUEST['firstname']) and !empty($_REQUEST['firstname']) and isset($_REQUEST['lastname']) and !empty($_REQUEST['lastname']) and isset($_REQUEST['email']) and !empty($_REQUEST['email']) and isset($_REQUEST['new_comment']) and !empty($_REQUEST['new_comment']) and isset($_REQUEST['captcha_put']) and !empty($_REQUEST['captcha_put']) and ($_REQUEST['captcha_get'] == $_REQUEST['captcha_put']) and (ereg("@", $_REQUEST['email'])) and (ereg("\.", $_REQUEST['email']))) {
+               if (isset($_REQUEST['show']) and !empty($_REQUEST['show']) and isset($_POST['captcha_put']) and !empty($_REQUEST['captcha_get']) and isset($_POST['firstname']) and !empty($_POST['firstname']) and isset($_POST['lastname']) and !empty($_POST['lastname']) and isset($_POST['email']) and !empty($_POST['email']) and isset($_POST['new_comment']) and !empty($_POST['new_comment']) and isset($_POST['captcha_put']) and !empty($_POST['captcha_put']) and ($_REQUEST['captcha_get'] == $_POST['captcha_put']) and (ereg("@", $_POST['email'])) and (ereg("\.", $_POST['email']))) {
               
                if (!file_exists("$check/comments")) {
                        mkdir("$check/comments");
@@ -406,7 +406,7 @@ if (isset($_REQUEST['entry']) and !empty($_REQUEST['entry'])) {
 
                mkdir("$check/comments/pending/$comment_entry_dir");
 
-               $body_content = ucfirst($_REQUEST['new_comment']);
+               $body_content = ucfirst($_POST['new_comment']);
                $body_content = htmlentities($body_content, ENT_NOQUOTES);
                // $body_content = str_replace('href=', 'target=_maj href=', $body_content);
                $body_content = str_replace("\n", '<br />', $body_content);
@@ -431,7 +431,7 @@ if (isset($_REQUEST['entry']) and !empty($_REQUEST['entry'])) {
                fclose($fp_timestamp_txt);
 
                $fp_firstname_txt = fopen("$check/comments/pending/$comment_entry_dir/firstname.txt","w");
-               $firstname = strtolower($_REQUEST['firstname']);
+               $firstname = strtolower($_POST['firstname']);
                $firstname = ucwords($firstname);
                $firstname = trim($firstname);
                $firstname = htmlentities($firstname, ENT_NOQUOTES);
@@ -439,7 +439,7 @@ if (isset($_REQUEST['entry']) and !empty($_REQUEST['entry'])) {
                fclose($fp_firstname_txt);
 
                $fp_lastname_txt = fopen("$check/comments/pending/$comment_entry_dir/lastname.txt","w");
-               $lastname = strtolower($_REQUEST['lastname']);
+               $lastname = strtolower($_POST['lastname']);
                $lastname = ucwords($lastname);
                $lastname = trim($lastname);
                $lastname = htmlentities($lastname, ENT_NOQUOTES);
@@ -447,27 +447,27 @@ if (isset($_REQUEST['entry']) and !empty($_REQUEST['entry'])) {
                fclose($fp_lastname_txt);
 
                $fp_email_txt = fopen("$check/comments/pending/$comment_entry_dir/email.txt","w");
-               $email = str_replace('@', ' at ', $_REQUEST['email']);
+               $email = str_replace("@"," at ",$_POST['email']);
                $email = strtolower($email);
                $email = trim($email);
                $email = htmlentities($email, ENT_NOQUOTES);
                fwrite($fp_email_txt,$email);
                fclose($fp_email_txt);
 
-               if (isset($_REQUEST['url']) and !empty($_REQUEST['url']) and (ereg("\.", $_REQUEST['url']))) {
+               if (isset($_POST['url']) and !empty($_POST['url']) and (ereg("\.", $_POST['url']))) {
                        $fp_url_txt = fopen("$check/comments/pending/$comment_entry_dir/url.txt","w");
-                       $url = str_replace('http://', '', $_REQUEST['url']);
+                       $url = str_replace("http://","",$_POST['url']);
                        $url = strtolower($url);
                        $url = trim($url);
-                       $url = 'http://' . $url;
+                       $url = "http://" . $url;
                        $url = htmlentities($url, ENT_NOQUOTES);
                        fwrite($fp_url_txt,$url);
                        fclose($fp_url_txt);
                }
 
-               if (isset($_REQUEST['cauthor']) and !empty($_REQUEST['cauthor'])) {
+               if (isset($_POST['cauthor']) and !empty($_POST['cauthor'])) {
                        $fp_cauthor_txt = fopen("$check/comments/pending/$comment_entry_dir/author.txt","w");
-                       fwrite($fp_cauthor_txt,$_REQUEST['cauthor']);
+                       fwrite($fp_cauthor_txt,$_POST['cauthor']);
                        fclose($fp_cauthor_txt);
                }
 
@@ -476,7 +476,7 @@ if (isset($_REQUEST['entry']) and !empty($_REQUEST['entry'])) {
                fwrite($fp_key_txt,$key_rand);
                fclose($fp_key_txt);
 
-               $comment_quote = ucfirst($_REQUEST['new_comment']);
+               $comment_quote = ucfirst($_POST['new_comment']);
                //$comment_quote = htmlentities($comment_quote, ENT_NOQUOTES);
 
                $sig_author_file = "data/author.txt";
@@ -488,7 +488,7 @@ if (isset($_REQUEST['entry']) and !empty($_REQUEST['entry'])) {
                $sig_url = str_replace('//', '/', $sig_url);
                $sig_url = "http://" . $sig_url;
 
-               $email_to = strtolower($_REQUEST['email']);
+               $email_to = strtolower($_POST['email']);
                $email_to = '"' . "$firstname $lastname" . '" <' . $email_to . '>';
 
                if (file_exists("data/email.txt")) {
@@ -3186,7 +3186,7 @@ else {
 }
 
 if (!isset($_SESSION['logged_in']) or (isset($_SESSION['logged_in']) and ($_SESSION['logged_in'] != file_get_contents("data/username.txt") and file_exists("data/members/active/{$_SESSION['logged_in']}")))) {
-       if (isset($_REQUEST['show']) and !empty($_REQUEST['show']) and isset($_REQUEST['captcha_put']) and !empty($_REQUEST['captcha_get']) and isset($_REQUEST['firstname']) and !empty($_REQUEST['firstname']) and isset($_REQUEST['lastname']) and !empty($_REQUEST['lastname']) and isset($_REQUEST['email']) and !empty($_REQUEST['email']) and isset($_REQUEST['new_comment']) and !empty($_REQUEST['new_comment']) and isset($_REQUEST['captcha_put']) and !empty($_REQUEST['captcha_put']) and ($_REQUEST['captcha_get'] == $_REQUEST['captcha_put']) and (ereg("@", $_REQUEST['email'])) and (ereg("\.", $_REQUEST['email']))) {
+       if (isset($_REQUEST['show']) and !empty($_REQUEST['show']) and isset($_POST['captcha_put']) and !empty($_REQUEST['captcha_get']) and isset($_POST['firstname']) and !empty($_POST['firstname']) and isset($_POST['lastname']) and !empty($_POST['lastname']) and isset($_POST['email']) and !empty($_POST['email']) and isset($_POST['new_comment']) and !empty($_POST['new_comment']) and isset($_POST['captcha_put']) and !empty($_POST['captcha_put']) and ($_REQUEST['captcha_get'] == $_POST['captcha_put']) and (ereg("@", $_POST['email'])) and (ereg("\.", $_POST['email']))) {
                echo '<p><table border=0 cellspacing=0 cellpadding=0><tr><td><p><font style="font-size: 12px;"><b>Thanks!</b></font></p><p>Your comment has been submitted for approval.<br>Please check back soon to see if it has been posted.</p></td></tr></table></p>';
        }
 }
diff --git a/member.php b/member.php
index faccc0a..a605078 100644
--- a/member.php
+++ b/member.php
@@ -18,7 +18,7 @@ if (get_magic_quotes_gpc()) {
                }
        }
 
-       $_REQUEST = stripslashes_array($_REQUEST);
+       $_POST = stripslashes_array($_POST);
 }
 
 if (file_exists("data/lite.txt")) {
@@ -159,61 +159,61 @@ a:active {
 
 <?php if ($id == "all") {
 
-if (isset($_REQUEST['edit']) and !empty($_REQUEST['edit']) and ($_REQUEST['edit'] == "on") and isset($_REQUEST['username']) and !empty($_REQUEST['username']) and file_exists("data/members/active/{$_REQUEST['username']}") and isset($_SESSION['logged_in']) and !empty($_SESSION['logged_in']) and ($_SESSION['logged_in'] == file_get_contents("data/username.txt"))) {
+if (isset($_POST['edit']) and !empty($_POST['edit']) and ($_POST['edit'] == "on") and isset($_POST['username']) and !empty($_POST['username']) and file_exists("data/members/active/{$_POST['username']}") and isset($_SESSION['logged_in']) and !empty($_SESSION['logged_in']) and ($_SESSION['logged_in'] == file_get_contents("data/username.txt"))) {
 
-       if (isset($_REQUEST['rw']) and !empty($_REQUEST['rw']) and ($_REQUEST['rw'] == "on") and !file_exists("data/members/active/{$_REQUEST['username']}/rw.txt")) {
-               touch("data/members/active/{$_REQUEST['username']}/rw.txt");
+       if (isset($_POST['rw']) and !empty($_POST['rw']) and ($_POST['rw'] == "on") and !file_exists("data/members/active/{$_POST['username']}/rw.txt")) {
+               touch("data/members/active/{$_POST['username']}/rw.txt");
        }
 
-       if ((!isset($_REQUEST['rw']) or empty($_REQUEST['rw'])) and file_exists("data/members/active/{$_REQUEST['username']}/rw.txt")) {
-               unlink("data/members/active/{$_REQUEST['username']}/rw.txt");
+       if ((!isset($_POST['rw']) or empty($_POST['rw'])) and file_exists("data/members/active/{$_POST['username']}/rw.txt")) {
+               unlink("data/members/active/{$_POST['username']}/rw.txt");
        }
 
-       if (isset($_REQUEST['ul']) and !empty($_REQUEST['ul']) and ($_REQUEST['ul'] == "on") and !file_exists("data/members/active/{$_REQUEST['username']}/ul.txt")) {
-               touch("data/members/active/{$_REQUEST['username']}/ul.txt");
+       if (isset($_POST['ul']) and !empty($_POST['ul']) and ($_POST['ul'] == "on") and !file_exists("data/members/active/{$_POST['username']}/ul.txt")) {
+               touch("data/members/active/{$_POST['username']}/ul.txt");
        }
 
-       if ((!isset($_REQUEST['ul']) or empty($_REQUEST['ul'])) and file_exists("data/members/active/{$_REQUEST['username']}/ul.txt")) {
-               unlink("data/members/active/{$_REQUEST['username']}/ul.txt");
+       if ((!isset($_POST['ul']) or empty($_POST['ul'])) and file_exists("data/members/active/{$_POST['username']}/ul.txt")) {
+               unlink("data/members/active/{$_POST['username']}/ul.txt");
        }
 
-       if (isset($_REQUEST['noml']) and !empty($_REQUEST['noml']) and ($_REQUEST['noml'] == "on") and !file_exists("data/members/active/{$_REQUEST['username']}/noml.txt")) {
-               touch("data/members/active/{$_REQUEST['username']}/noml.txt");
+       if (isset($_POST['noml']) and !empty($_POST['noml']) and ($_POST['noml'] == "on") and !file_exists("data/members/active/{$_POST['username']}/noml.txt")) {
+               touch("data/members/active/{$_POST['username']}/noml.txt");
        }
 
-       if ((!isset($_REQUEST['noml']) or empty($_REQUEST['noml'])) and file_exists("data/members/active/{$_REQUEST['username']}/noml.txt")) {
-               unlink("data/members/active/{$_REQUEST['username']}/noml.txt");
+       if ((!isset($_POST['noml']) or empty($_POST['noml'])) and file_exists("data/members/active/{$_POST['username']}/noml.txt")) {
+               unlink("data/members/active/{$_POST['username']}/noml.txt");
        }
 
-       if (isset($_REQUEST['rank']) and !empty($_REQUEST['rank']) and (strtolower($_REQUEST['rank']) != "member")) {
-               $rank_file = "data/members/active/{$_REQUEST['username']}/rank.txt";
+       if (isset($_POST['rank']) and !empty($_POST['rank']) and (strtolower($_POST['rank']) != "member")) {
+               $rank_file = "data/members/active/{$_POST['username']}/rank.txt";
                $fp_rank_txt = fopen($rank_file,"w");
-               fwrite($fp_rank_txt,$_REQUEST['rank']);
+               fwrite($fp_rank_txt,$_POST['rank']);
                fclose($fp_rank_txt);
        }
 
-       if ((!isset($_REQUEST['rank']) or empty($_REQUEST['rank'])) and file_exists("data/members/active/{$_REQUEST['username']}/rank.txt")) {
-               unlink("data/members/active/{$_REQUEST['username']}/rank.txt");
+       if ((!isset($_POST['rank']) or empty($_POST['rank'])) and file_exists("data/members/active/{$_POST['username']}/rank.txt")) {
+               unlink("data/members/active/{$_POST['username']}/rank.txt");
        }
 
-       if (isset($_REQUEST['category']) and !empty($_REQUEST['category']) and (strtolower($_REQUEST['category']) != "none") and (file_exists("data/categories/{$_REQUEST['category']}"))) {
-               $category_file = "data/members/active/{$_REQUEST['username']}/category.txt";
+       if (isset($_POST['category']) and !empty($_POST['category']) and (strtolower($_POST['category']) != "none") and (file_exists("data/categories/{$_POST['category']}"))) {
+               $category_file = "data/members/active/{$_POST['username']}/category.txt";
                $fp_category_txt = fopen($category_file,"w");
-               fwrite($fp_category_txt,$_REQUEST['category']);
+               fwrite($fp_category_txt,$_POST['category']);
                fclose($fp_category_txt);
        }
 
-       if ((!isset($_REQUEST['category']) or empty($_REQUEST['category']) or ($_REQUEST['category'] == "none")) and file_exists("data/members/active/{$_REQUEST['username']}/category.txt")) {
-               unlink("data/members/active/{$_REQUEST['username']}/category.txt");
+       if ((!isset($_POST['category']) or empty($_POST['category']) or ($_POST['category'] == "none")) and file_exists("data/members/active/{$_POST['username']}/category.txt")) {
+               unlink("data/members/active/{$_POST['username']}/category.txt");
        }
 
        // start of upload privileges cleanup if ro and nocat (20071204)
-       if (file_exists("data/members/active/{$_REQUEST['username']}/ul.txt") and !file_exists("data/members/active/{$_REQUEST['username']}/rw.txt") and !file_exists("data/members/active/{$_REQUEST['username']}/category.txt")) {
-               unlink("data/members/active/{$_REQUEST['username']}/ul.txt");
+       if (file_exists("data/members/active/{$_POST['username']}/ul.txt") and !file_exists("data/members/active/{$_POST['username']}/rw.txt") and !file_exists("data/members/active/{$_POST['username']}/category.txt")) {
+               unlink("data/members/active/{$_POST['username']}/ul.txt");
        }
        // end of upload privileges cleanup if ro and nocat (20071204)
 
-       if (isset($_REQUEST['del']) and !empty($_REQUEST['del']) and ($_REQUEST['del'] == "on")) {
+       if (isset($_POST['del']) and !empty($_POST['del']) and ($_POST['del'] == "on")) {
                function rmdirr($recurse_dirname)
                {
               
@@ -238,7 +238,7 @@ if (isset($_REQUEST['edit']) and !empty($_REQUEST['edit']) and ($_REQUEST['edit'
                    $recurse_dir->close();
                    return rmdir($recurse_dirname);
                }
-               rmdirr("data/members/active/{$_REQUEST['username']}");
+               rmdirr("data/members/active/{$_POST['username']}");
        }
 }
 
 
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
32977 downloads
MAJ 1.0
26 files
13132 downloads
MAJ 0.14
45 files
35010 downloads