From: Javier B. <jb...@us...> - 2004-11-24 07:40:14
|
Update of /cvsroot/openbash-org/openbash-org/modules In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv3649/modules Modified Files: Quote.php Validate.php View.php common.php Log Message: Arreglado parcialmente el bug del exit(); La validación parece funcionar bien pero han salido dos sub-bugs: en ?page=admin si no estás logueado el formulario aparece dos veces y el close_session funciona mal (muestra el admin_header porque ese include viene antes en el código). Index: Quote.php =================================================================== RCS file: /cvsroot/openbash-org/openbash-org/modules/Quote.php,v retrieving revision 1.16 retrieving revision 1.17 diff -C2 -d -r1.16 -r1.17 *** Quote.php 20 Nov 2004 10:20:42 -0000 1.16 --- Quote.php 24 Nov 2004 07:40:05 -0000 1.17 *************** *** 1,8 **** <?php ! /* ! * Quote class ! * 15/11/04 ! */ class Quote --- 1,8 ---- <?php ! /* ! * Quote class ! * 15/11/04 ! */ class Quote *************** *** 138,147 **** if(!strstr($_SERVER['HTTP_REFERER'], $_SERVER['SERVER_NAME'])) { ! $view = new View(); ! $view->view_score_forbidden(); ! return; } - /* * check last vote --- 138,146 ---- if(!strstr($_SERVER['HTTP_REFERER'], $_SERVER['SERVER_NAME'])) { ! $view = new View(); ! $view->view_score_forbidden(); ! return; } /* * check last vote *************** *** 162,169 **** } } else { ! $view = new View(); ! $view->view_score_twice(); ! } ! } --- 161,167 ---- } } else { ! $view = new View(); ! $view->view_score_twice(); ! } } Index: Validate.php =================================================================== RCS file: /cvsroot/openbash-org/openbash-org/modules/Validate.php,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** Validate.php 17 Nov 2004 11:43:32 -0000 1.1 --- Validate.php 24 Nov 2004 07:40:05 -0000 1.2 *************** *** 6,19 **** { $view = new view(); ! if(!isset($_SESSION['logged'])) { ! if (!isset($_POST['form']) || $_POST['form'] != 1) { $view->ask_login(); ! } else { ! if(!$this->check_login($_POST['login'], $_POST['passwd'])) { $view->ask_login();} } - } else { - if(isset($_POST['form']) && !$this->check_login($_POST['login'], $_POST['passwd'])) { $view->ask_login();} - if(!$this->check_session()) $view->ask_login(); } } --- 6,30 ---- { $view = new view(); ! if(!isset($_SESSION['logged'])) { /* if there's no session */ ! if (!isset($_POST['form']) || $_POST['form'] != 1) { /* ask for it */ $view->ask_login(); ! return (0); ! } else { /* if asked, verify */ ! if(!$this->check_login($_POST['login'], $_POST['passwd'])) { ! $view->ask_login(); ! return (0); ! } ! } ! } else { /* if there's session */ ! if(isset($_POST['form']) && !$this->check_login($_POST['login'], $_POST['passwd'])) { ! $view->ask_login(); ! return (0); ! } ! if(!$this->check_session()) { ! $view->ask_login(); ! return (0); } } + return (1); } Index: View.php =================================================================== RCS file: /cvsroot/openbash-org/openbash-org/modules/View.php,v retrieving revision 1.17 retrieving revision 1.18 diff -C2 -d -r1.17 -r1.18 *** View.php 23 Nov 2004 14:44:42 -0000 1.17 --- View.php 24 Nov 2004 07:40:05 -0000 1.18 *************** *** 125,129 **** <hr> <p><?=$login_language['msg']?></p> ! <form onsubmit="return autocheck(this)" action="?page=admin" method="post"> <input type="hidden" name="form" value="1"> <table border="0" width="50%"> --- 125,129 ---- <hr> <p><?=$login_language['msg']?></p> ! <form onsubmit="return autocheck(this)" action="?page=admin" method="post" autocomplete="off"> <input type="hidden" name="form" value="1"> <table border="0" width="50%"> *************** *** 138,142 **** </form> <?php ! exit(); // WTF? FIX THIS SHIT!!!!!! } --- 138,142 ---- </form> <?php ! //exit(); // WTF? FIX THIS SHIT!!!!!! } Index: common.php =================================================================== RCS file: /cvsroot/openbash-org/openbash-org/modules/common.php,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** common.php 21 Nov 2004 11:03:51 -0000 1.4 --- common.php 24 Nov 2004 07:40:05 -0000 1.5 *************** *** 83,95 **** } ! function spamcode($length) ! { ! for ($i = 1; $i <= $length; $i++) { ! if ($i == 1) { ! $randnum = rand(0, 9); ! } else { $randnum .= rand(0, 9); } ! } ! return ($randnum); ! } function utime () --- 83,87 ---- } ! function spamcode($length) { return (substr(md5(time()), 0, $length)); } function utime () |