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 blob has been accessed 862 times via Git panel.

  1. <?php
  2.  
  3.  
  4. //session_regenerate_id();
  5.  
  6. header("Cache-control: private");
  7.  
  8. if (file_exists("data/lite.txt")) {
  9.         exit();
  10. }
  11.  
  12. if (!file_exists("data/reset.txt")) {
  13.         exit();
  14. }
  15.  
  16. error_reporting(E_ERROR);
  17.  
  18.         function stripslashes_array($data) {
  19.                 if (is_array($data)){
  20.                          foreach ($data as $key => $value){
  21.                                   $data[$key] = stripslashes_array($value);
  22.                          }
  23.                          return $data;
  24.                 }
  25.                 else{
  26.                          return stripslashes($data);
  27.                 }
  28.         }
  29.  
  30.         $_POST = stripslashes_array($_POST);
  31. }
  32.  
  33. if (file_exists("data/offset.txt")) {
  34.         $offset = file_get_contents("data/offset.txt");
  35. }
  36. else {
  37.         $offset = 0;
  38. }
  39.  
  40. if (file_exists("data/bb-min-age.txt")) {
  41.         $minage = file_get_contents("data/bb-min-age.txt");
  42. }
  43. else {
  44.         $minage = 5;
  45. }
  46.  
  47. if (file_exists("data/bb-max-age.txt")) {
  48.         $maxage = file_get_contents("data/bb-max-age.txt");
  49. }
  50. else {
  51.         $maxage = 125;
  52. }
  53.  
  54. ?>
  55.  
  56. <style>
  57. body {
  58.         color: #666666;
  59.         margin: 10px;
  60.         padding: 0px;
  61.         text-align: left;
  62.         font-family: <?php
  63.                                 if (file_exists("data/fonts/body.txt")) {
  64.                                         $font_body = file_get_contents("data/fonts/body.txt");
  65.                                         echo "{$font_body},";
  66.                                 }
  67.         ?> arial, helvetica, sans-serif;
  68.         background-color: #FFFFFF;
  69. }
  70.  
  71. p {
  72.         font-size: 11px;
  73. }
  74.  
  75. a {
  76.         font-weight: bold;
  77.         text-decoration: none;
  78. }
  79.  
  80. a:link, a:visited {
  81.         color: #666666;
  82. }
  83.  
  84. a:hover {
  85.         color: #336699;
  86. }
  87.  
  88. a:active {
  89.         color: #336699;
  90. }
  91.  
  92. .input {        
  93.         color: #666666;
  94.         background: #ffffff;
  95.         border: #999999 solid 1px;
  96.         width: 125px;
  97.         font-family: <?php
  98.                                 if (file_exists("data/fonts/input.txt")) {
  99.                                         $font_input = file_get_contents("data/fonts/input.txt");
  100.                                         echo "{$font_input},";
  101.                                 }
  102.         ?> arial, helvetica, sans-serif;
  103.         font-size: 11px;
  104. }
  105. </style>
  106.  
  107. <form enctype="multipart/form-data" action="<?php echo $_SERVER['PHP_SELF']; ?>" method="post">
  108. <input autocomplete=off class=input type=text name=username>
  109. <input autocomplete=off class=input type=text name=addr>
  110. <input autocomplete=off class=input type=text name=bday>
  111. <input class=input type=submit value=reset>
  112. </form>
  113.  
  114. <?php
  115.  
  116. if (isset($_POST['username']) and !empty($_POST['username']) and isset($_POST['addr']) and !empty($_POST['addr']) and file_exists("data/members/active/{$_POST['username']}") and file_exists("data/bb.txt") and (trim(strtolower($_POST['addr'])) == file_get_contents("data/members/active/{$_POST['username']}/email.txt")) and isset($_POST['bday']) and !empty($_POST['bday']) and file_exists("data/members/active/{$_POST['username']}/bday.txt") and (strlen($_POST['bday']) == "8") and is_numeric($_POST['bday']) and ((round((date("Ymd", time() + $offset) - $_POST['bday']) * 0.0001)) >= $minage) and ((round((date("Ymd", time() + $offset) - $_POST['bday']) * 0.0001)) <= $maxage) and ($_POST['bday'] == file_get_contents("data/members/active/{$_POST['username']}/bday.txt"))) {
  117.  
  118.         $username = $_POST['username'];
  119.  
  120.         function str_rand($length = 8, $seeds = 'abcdefghijklmnopqrstuvwxyz0123456789') {
  121.                 $str = '';
  122.                 $seeds_count = strlen($seeds);
  123.                
  124.                 list($usec, $sec) = explode(' ', microtime());
  125.                 $seed = (float) $sec + ((float) $usec * 100000);
  126.                 mt_srand($seed);
  127.                
  128.                 for ($i = 0; $length > $i; $i++) {
  129.                         $str .= $seeds{mt_rand(0, $seeds_count - 1)};
  130.                 }
  131.                
  132.                 return $str;
  133.         }
  134.  
  135.         $password = str_rand(16);
  136.        
  137.         /* Fun with crypt! */
  138.         $passwd = sha1($password);
  139.         $passwd = md5($passwd);
  140.         $passwd = crypt($passwd, $passwd);
  141.  
  142.         $fp_passwd_txt = fopen("data/members/active/$username/password.txt","w");
  143.         fwrite($fp_passwd_txt,$passwd);
  144.         fclose($fp_passwd_txt);
  145.  
  146.  
  147.         if (file_exists("data/members/active/$username/resetx.txt")) {
  148.                 $resetx = file_get_contents("data/members/active/$username/resetx.txt");
  149.         }
  150.         else {
  151.                 $resetx = 0;
  152.         }
  153.  
  154.         $resetx = $resetx + 1;
  155.  
  156.         $fp_resetx_txt = fopen("data/members/active/$username/resetx.txt","w");
  157.         fwrite($fp_resetx_txt,$resetx);
  158.         fclose($fp_resetx_txt);
  159.  
  160.         $resetl = date("Ymd", time() + $offset);
  161.         $fp_resetl_txt = fopen("data/members/active/$username/resetl.txt","w");
  162.         fwrite($fp_resetl_txt,$resetl);
  163.         fclose($fp_resetl_txt);
  164.  
  165.         $firstname = file_get_contents("data/members/active/$username/firstname.txt");
  166.         $lastname = file_get_contents("data/members/active/$username/lastname.txt");
  167.         $email = file_get_contents("data/members/active/$username/email.txt");
  168.         $from_email = file_get_contents("data/email.txt");
  169.  
  170.         $mailer = 'MAJ/0.14 (PHP/' . phpversion() . ')';
  171.  
  172.         $sig_author = file_get_contents("data/author.txt");
  173.  
  174.         $from_email = '"' . $sig_author . '" <' . $from_email . '>';
  175.         $email = '"' . "$firstname $lastname" . '" <' . $email . '>';
  176.  
  177.         $sig_url = $_SERVER['HTTP_HOST'] . dirname($_SERVER['PHP_SELF']) . "/";
  178.         $sig_url = str_replace('//', '/', $sig_url);
  179.         $sig_url = "http://" . $sig_url;
  180.  
  181.         $reset_notice = "Password for $username at $sig_url reset by $firstname $lastname.";
  182.         $reset_notice = wordwrap($reset_notice);
  183.  
  184.         $password_notice = "Hi $firstname,\n\nYour password for $sig_url has been reset as requested.\n\nThe new password for \"$username\" is \"$password\" (case-sensitive). Please change this as soon as possible. For security reasons, your password on record is encrypted - you're the only one who knows what it is.\n\nPlease feel free to e-mail me if you need further assistance.\n\nThanks!\n\n--\n$sig_author\n$sig_url\n";
  185.  
  186.         $password_notice = wordwrap($password_notice);
  187.  
  188.         mail($from_email, "password reset notice ($username)", $reset_notice,
  189.                 "From: $from_email\r\n" .
  190.                 "Reply-To: $from_email\r\n" .
  191.                 "X-Mailer: $mailer");
  192.  
  193.         mail($email, "password reset notice ($username)", $password_notice,
  194.                 "From: $from_email\r\n" .
  195.                 "Reply-To: $from_email\r\n" .
  196.                 "X-Mailer: $mailer");
  197.  
  198.         echo "<p><font style=\"font-size: 12px;\"><b>Password Reset</b></font></p><p>Check your ";
  199.         readfile("data/members/active/$username/email.txt");
  200.         echo " account for your new password.";
  201. }
  202. else {
  203.         echo "<p>Enter your username, e-mail address, and birthdate (YYYYMMDD) above to reset your password.";
  204. }
  205.  
  206. ?>
  207.  
  208. <br>Click <a href=login.php>here</a> to login. Click <a href=index.php>here</a> to go to the index page.</p>
  209.  
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
35387 downloads
MAJ 1.0
26 files
14152 downloads
MAJ 0.14
45 files
36716 downloads