You can subscribe to this list here.
2004 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
(20) |
Sep
|
Oct
(7) |
Nov
(81) |
Dec
(6) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2005 |
Jan
(4) |
Feb
|
Mar
(6) |
Apr
(1) |
May
(2) |
Jun
|
Jul
|
Aug
(4) |
Sep
|
Oct
|
Nov
|
Dec
|
From: José M. M. <ri...@us...> - 2004-11-25 14:31:59
|
Update of /cvsroot/openbash-org/openbash-org/modules In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv7858/modules Modified Files: Validate.php Log Message: Arreglado (creo) el bug del formulario de validación doble Index: Validate.php =================================================================== RCS file: /cvsroot/openbash-org/openbash-org/modules/Validate.php,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** Validate.php 24 Nov 2004 08:37:06 -0000 1.3 --- Validate.php 25 Nov 2004 14:31:45 -0000 1.4 *************** *** 3,7 **** class validate { ! function validate() { $view = new view(); --- 3,7 ---- class validate { ! function do_validate() { $view = new view(); |
From: José M. M. <ri...@us...> - 2004-11-24 20:41:26
|
Update of /cvsroot/openbash-org/openbash-org In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv13616 Modified Files: AUTHORS Log Message: Index: AUTHORS =================================================================== RCS file: /cvsroot/openbash-org/openbash-org/AUTHORS,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** AUTHORS 24 Nov 2004 18:48:45 -0000 1.1 --- AUTHORS 24 Nov 2004 20:41:08 -0000 1.2 *************** *** 1,3 **** --- 1,4 ---- Javier Barrio < coder at valenciawireless dot net > Juan Cayetano Delgado Roldán < hnzekto at mundolinux dot net > + José María Mateos < chema at sl-form dot com > |
From: Juan C. D. R. <hn...@us...> - 2004-11-24 18:48:56
|
Update of /cvsroot/openbash-org/openbash-org In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv19152/openbash-org Added Files: AUTHORS INSTALL LICENSE README Log Message: Añadidas típicos ficheros de información, licencia y tal Quien falte que se vaya añadiendo a AUTHORS --- NEW FILE: README --- OpenBash.org Quote Database --- NEW FILE: INSTALL --- RTFM --- NEW FILE: LICENSE --- GNU GENERAL PUBLIC LICENSE Version 2, June 1991 Copyright (C) 1989, 1991 Free Software Foundation, Inc. 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. Preamble The licenses for most software are designed to take away your freedom to share and change it. By contrast, the GNU General Public License is intended to guarantee your freedom to share and change free software--to make sure the software is free for all its users. This General Public License applies to most of the Free Software Foundation's software and to any other program whose authors commit to using it. (Some other Free Software Foundation software is covered by the GNU Library General Public License instead.) You can apply it to your programs, too. When we speak of free software, we are referring to freedom, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for this service if you wish), that you receive source code or can get it if you want it, that you can change the software or use pieces of it in new free programs; and that you know you can do these things. To protect your rights, we need to make restrictions that forbid anyone to deny you these rights or to ask you to surrender the rights. These restrictions translate to certain responsibilities for you if you distribute copies of the software, or if you modify it. For example, if you distribute copies of such a program, whether gratis or for a fee, you must give the recipients all the rights that you have. You must make sure that they, too, receive or can get the source code. And you must show them these terms so they know their rights. We protect your rights with two steps: (1) copyright the software, and (2) offer you this license which gives you legal permission to copy, distribute and/or modify the software. Also, for each author's protection and ours, we want to make certain that everyone understands that there is no warranty for this free software. If the software is modified by someone else and passed on, we want its recipients to know that what they have is not the original, so that any problems introduced by others will not reflect on the original authors' reputations. Finally, any free program is threatened constantly by software patents. We wish to avoid the danger that redistributors of a free program will individually obtain patent licenses, in effect making the program proprietary. To prevent this, we have made it clear that any patent must be licensed for everyone's free use or not licensed at all. The precise terms and conditions for copying, distribution and modification follow. GNU GENERAL PUBLIC LICENSE TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 0. This License applies to any program or other work which contains a notice placed by the copyright holder saying it may be distributed under the terms of this General Public License. The "Program", below, refers to any such program or work, and a "work based on the Program" means either the Program or any derivative work under copyright law: that is to say, a work containing the Program or a portion of it, either verbatim or with modifications and/or translated into another language. (Hereinafter, translation is included without limitation in the term "modification".) Each licensee is addressed as "you". Activities other than copying, distribution and modification are not covered by this License; they are outside its scope. The act of running the Program is not restricted, and the output from the Program is covered only if its contents constitute a work based on the Program (independent of having been made by running the Program). Whether that is true depends on what the Program does. 1. You may copy and distribute verbatim copies of the Program's source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice and disclaimer of warranty; keep intact all the notices that refer to this License and to the absence of any warranty; and give any other recipients of the Program a copy of this License along with the Program. You may charge a fee for the physical act of transferring a copy, and you may at your option offer warranty protection in exchange for a fee. 2. You may modify your copy or copies of the Program or any portion of it, thus forming a work based on the Program, and copy and distribute such modifications or work under the terms of Section 1 above, provided that you also meet all of these conditions: a) You must cause the modified files to carry prominent notices stating that you changed the files and the date of any change. b) You must cause any work that you distribute or publish, that in whole or in part contains or is derived from the Program or any part thereof, to be licensed as a whole at no charge to all third parties under the terms of this License. c) If the modified program normally reads commands interactively when run, you must cause it, when started running for such interactive use in the most ordinary way, to print or display an announcement including an appropriate copyright notice and a notice that there is no warranty (or else, saying that you provide a warranty) and that users may redistribute the program under these conditions, and telling the user how to view a copy of this License. (Exception: if the Program itself is interactive but does not normally print such an announcement, your work based on the Program is not required to print an announcement.) These requirements apply to the modified work as a whole. If identifiable sections of that work are not derived from the Program, and can be reasonably considered independent and separate works in themselves, then this License, and its terms, do not apply to those sections when you distribute them as separate works. But when you distribute the same sections as part of a whole which is a work based on the Program, the distribution of the whole must be on the terms of this License, whose permissions for other licensees extend to the entire whole, and thus to each and every part regardless of who wrote it. Thus, it is not the intent of this section to claim rights or contest your rights to work written entirely by you; rather, the intent is to exercise the right to control the distribution of derivative or collective works based on the Program. In addition, mere aggregation of another work not based on the Program with the Program (or with a work based on the Program) on a volume of a storage or distribution medium does not bring the other work under the scope of this License. 3. You may copy and distribute the Program (or a work based on it, under Section 2) in object code or executable form under the terms of Sections 1 and 2 above provided that you also do one of the following: a) Accompany it with the complete corresponding machine-readable source code, which must be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or, b) Accompany it with a written offer, valid for at least three years, to give any third party, for a charge no more than your cost of physically performing source distribution, a complete machine-readable copy of the corresponding source code, to be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or, c) Accompany it with the information you received as to the offer to distribute corresponding source code. (This alternative is allowed only for noncommercial distribution and only if you received the program in object code or executable form with such an offer, in accord with Subsection b above.) The source code for a work means the preferred form of the work for making modifications to it. For an executable work, complete source code means all the source code for all modules it contains, plus any associated interface definition files, plus the scripts used to control compilation and installation of the executable. However, as a special exception, the source code distributed need not include anything that is normally distributed (in either source or binary form) with the major components (compiler, kernel, and so on) of the operating system on which the executable runs, unless that component itself accompanies the executable. If distribution of executable or object code is made by offering access to copy from a designated place, then offering equivalent access to copy the source code from the same place counts as distribution of the source code, even though third parties are not compelled to copy the source along with the object code. 4. You may not copy, modify, sublicense, or distribute the Program except as expressly provided under this License. Any attempt otherwise to copy, modify, sublicense or distribute the Program is void, and will automatically terminate your rights under this License. However, parties who have received copies, or rights, from you under this License will not have their licenses terminated so long as such parties remain in full compliance. 5. You are not required to accept this License, since you have not signed it. However, nothing else grants you permission to modify or distribute the Program or its derivative works. These actions are prohibited by law if you do not accept this License. Therefore, by modifying or distributing the Program (or any work based on the Program), you indicate your acceptance of this License to do so, and all its terms and conditions for copying, distributing or modifying the Program or works based on it. 6. Each time you redistribute the Program (or any work based on the Program), the recipient automatically receives a license from the original licensor to copy, distribute or modify the Program subject to these terms and conditions. You may not impose any further restrictions on the recipients' exercise of the rights granted herein. You are not responsible for enforcing compliance by third parties to this License. 7. If, as a consequence of a court judgment or allegation of patent infringement or for any other reason (not limited to patent issues), conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot distribute so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not distribute the Program at all. For example, if a patent license would not permit royalty-free redistribution of the Program by all those who receive copies directly or indirectly through you, then the only way you could satisfy both it and this License would be to refrain entirely from distribution of the Program. If any portion of this section is held invalid or unenforceable under any particular circumstance, the balance of the section is intended to apply and the section as a whole is intended to apply in other circumstances. It is not the purpose of this section to induce you to infringe any patents or other property right claims or to contest validity of any such claims; this section has the sole purpose of protecting the integrity of the free software distribution system, which is implemented by public license practices. Many people have made generous contributions to the wide range of software distributed through that system in reliance on consistent application of that system; it is up to the author/donor to decide if he or she is willing to distribute software through any other system and a licensee cannot impose that choice. This section is intended to make thoroughly clear what is believed to be a consequence of the rest of this License. 8. If the distribution and/or use of the Program is restricted in certain countries either by patents or by copyrighted interfaces, the original copyright holder who places the Program under this License may add an explicit geographical distribution limitation excluding those countries, so that distribution is permitted only in or among countries not thus excluded. In such case, this License incorporates the limitation as if written in the body of this License. 9. The Free Software Foundation may publish revised and/or new versions of the General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. Each version is given a distinguishing version number. If the Program specifies a version number of this License which applies to it and "any later version", you have the option of following the terms and conditions either of that version or of any later version published by the Free Software Foundation. If the Program does not specify a version number of this License, you may choose any version ever published by the Free Software Foundation. 10. If you wish to incorporate parts of the Program into other free programs whose distribution conditions are different, write to the author to ask for permission. For software which is copyrighted by the Free Software Foundation, write to the Free Software Foundation; we sometimes make exceptions for this. Our decision will be guided by the two goals of preserving the free status of all derivatives of our free software and of promoting the sharing and reuse of software generally. NO WARRANTY 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. END OF TERMS AND CONDITIONS How to Apply These Terms to Your New Programs If you develop a new program, and you want it to be of the greatest possible use to the public, the best way to achieve this is to make it free software which everyone can redistribute and change under these terms. To do so, attach the following notices to the program. It is safest to attach them to the start of each source file to most effectively convey the exclusion of warranty; and each file should have at least the "copyright" line and a pointer to where the full notice is found. <one line to give the program's name and a brief idea of what it does.> Copyright (C) <year> <name of author> This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA Also add information on how to contact you by electronic and paper mail. If the program is interactive, make it output a short notice like this when it starts in an interactive mode: Gnomovision version 69, Copyright (C) year name of author Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. This is free software, and you are welcome to redistribute it under certain conditions; type `show c' for details. The hypothetical commands `show w' and `show c' should show the appropriate parts of the General Public License. Of course, the commands you use may be called something other than `show w' and `show c'; they could even be mouse-clicks or menu items--whatever suits your program. You should also get your employer (if you work as a programmer) or your school, if any, to sign a "copyright disclaimer" for the program, if necessary. Here is a sample; alter the names: Yoyodyne, Inc., hereby disclaims all copyright interest in the program `Gnomovision' (which makes passes at compilers) written by James Hacker. <signature of Ty Coon>, 1 April 1989 Ty Coon, President of Vice This General Public License does not permit incorporating your program into proprietary programs. If your program is a subroutine library, you may consider it more useful to permit linking proprietary applications with the library. If this is what you want to do, use the GNU Library General Public License instead of this License. --- NEW FILE: AUTHORS --- (This appears to be a binary file; contents omitted.) |
From: Juan C. D. R. <hn...@us...> - 2004-11-24 18:32:22
|
Update of /cvsroot/openbash-org/openbash-org In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv15041/openbash-org Modified Files: TODO Log Message: Añadidas varias opciones Index: TODO =================================================================== RCS file: /cvsroot/openbash-org/openbash-org/TODO,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** TODO 24 Nov 2004 08:37:06 -0000 1.1 --- TODO 24 Nov 2004 18:31:52 -0000 1.2 *************** *** 2,3 **** --- 2,14 ---- - close session on ?page=admin&a_opt=close shows admin_header + * integration with mod_rewrite / clean urls + · .htaccess + · config => vble=value + · link function ^ + · admin option to config + + * admin zone + · user/role admin + · quote moderation + · some configuration + |
From: Javier B. <jb...@us...> - 2004-11-24 08:37:24
|
Update of /cvsroot/openbash-org/openbash-org/modules In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv13394/modules Modified Files: Validate.php Log Message: cambios en bbdd y paso a md5 Index: Validate.php =================================================================== RCS file: /cvsroot/openbash-org/openbash-org/modules/Validate.php,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** Validate.php 24 Nov 2004 07:40:05 -0000 1.2 --- Validate.php 24 Nov 2004 08:37:06 -0000 1.3 *************** *** 34,42 **** $nick = variable_clean($nick); $pass = variable_clean($pass); ! $con = "SELECT * FROM users WHERE login LIKE \"$nick\" AND passwd LIKE \"$pass\" LIMIT 1"; $res = $bd->_Execute($con); $res->Close(); if (!$res) return (0); ! if (!strcmp($nick, $res->fields['login']) && !strcmp($pass, $res->fields['passwd'])) { $_SESSION['logged'] = 1; return (1); --- 34,43 ---- $nick = variable_clean($nick); $pass = variable_clean($pass); ! $con = "SELECT * FROM users WHERE login LIKE \"$nick\" AND passwd LIKE MD5(\"$pass\")"; $res = $bd->_Execute($con); $res->Close(); if (!$res) return (0); ! //if (!strcmp($nick, $res->fields['login']) && !strcmp(md5($pass), md5($res->fields['passwd']))) { ! if ($res->RecordCount() == 1) { $_SESSION['logged'] = 1; return (1); |
From: Javier B. <jb...@us...> - 2004-11-24 08:37:20
|
Update of /cvsroot/openbash-org/openbash-org In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv13394 Modified Files: config.php openbash-org.mysql Added Files: TODO Log Message: cambios en bbdd y paso a md5 Index: openbash-org.mysql =================================================================== RCS file: /cvsroot/openbash-org/openbash-org/openbash-org.mysql,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** openbash-org.mysql 18 Nov 2004 17:21:31 -0000 1.11 --- openbash-org.mysql 24 Nov 2004 08:37:06 -0000 1.12 *************** *** 1,5 **** ! CREATE DATABASE `openbash-org`; ! USE openbash-org; CREATE TABLE `quote` ( --- 1,5 ---- ! CREATE DATABASE `openbash`; ! USE openbash; CREATE TABLE `quote` ( *************** *** 29,40 **** CREATE TABLE `users` ( `login` VARCHAR( 255 ) NOT NULL , `passwd` VARCHAR( 255 ) NOT NULL , `role` INT DEFAULT 1 , ! PRIMARY KEY ( `login` ) ) TYPE = InnoDB; ! INSERT INTO `users` VALUES ('admin', '', 1); ! INSERT INTO `users` VALUES ('moderator', '', 2); CREATE TABLE `roles` ( --- 29,41 ---- CREATE TABLE `users` ( + `id` INT UNSIGNED NOT NULL AUTO_INCREMENT, `login` VARCHAR( 255 ) NOT NULL , `passwd` VARCHAR( 255 ) NOT NULL , `role` INT DEFAULT 1 , ! PRIMARY KEY ( `id` ) ) TYPE = InnoDB; ! INSERT INTO `users` VALUES ('', 'admin', MD5('openbash-org'), 1); ! INSERT INTO `users` VALUES ('', 'moderator', MD5('openbash-org'), 2); CREATE TABLE `roles` ( Index: config.php =================================================================== RCS file: /cvsroot/openbash-org/openbash-org/config.php,v retrieving revision 1.16 retrieving revision 1.17 diff -C2 -d -r1.16 -r1.17 *** config.php 17 Nov 2004 10:28:40 -0000 1.16 --- config.php 24 Nov 2004 08:37:06 -0000 1.17 *************** *** 3,11 **** $title = 'OpenBash.org'; ! $hostbd = 'localhost'; # host where the database is running ! $userbd = 'openbash'; # a user with full privileges to access the database ! $passbd = '02jdf9234y9'; # the user's password database ! $namedb = 'openbash-org'; # the database name ! $tipobd = 'mysql'; # type of database: mysql, pgsql, etc $lang = 'spanish'; --- 3,11 ---- $title = 'OpenBash.org'; ! $hostbd = 'localhost'; # host where the database is running ! $userbd = 'openbash'; # a user with full privileges to access the database ! $passbd = '02jdf9234y9'; # the user's password database ! $namedb = 'openbash'; # the database name ! $tipobd = 'mysql'; # type of database: mysql, pgsql, etc $lang = 'spanish'; --- NEW FILE: TODO --- - login form on ?page=admin appears twice - close session on ?page=admin&a_opt=close shows admin_header |
From: Javier B. <jb...@us...> - 2004-11-24 07:40:15
|
Update of /cvsroot/openbash-org/openbash-org In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv3649 Modified Files: index.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: index.php =================================================================== RCS file: /cvsroot/openbash-org/openbash-org/index.php,v retrieving revision 1.15 retrieving revision 1.16 diff -C2 -d -r1.15 -r1.16 *** index.php 15 Nov 2004 12:09:42 -0000 1.15 --- index.php 24 Nov 2004 07:40:04 -0000 1.16 *************** *** 1,3 **** --- 1,4 ---- <?php /* vim: set sts=2 ts=8 sw=2 noexpandtab: */ + session_start(); include ('config.php'); include ('modules/common.php'); |
From: Javier B. <jb...@us...> - 2004-11-24 07:40:14
|
Update of /cvsroot/openbash-org/openbash-org/pages In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv3649/pages Modified Files: admin.php admin_close.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: admin_close.php =================================================================== RCS file: /cvsroot/openbash-org/openbash-org/pages/admin_close.php,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** admin_close.php 17 Nov 2004 18:00:20 -0000 1.1 --- admin_close.php 24 Nov 2004 07:40:05 -0000 1.2 *************** *** 1,6 **** <?php ! session_destroy(); ! $view = new view(); ! $view->ask_login(); ?> <!--<meta http-equiv="refresh" content="0;index.php">--> --- 1,7 ---- <?php ! $validate = new validate(); ! if ($validate->validate()) { session_destroy(); } ! //$view = new view(); ! //$view->ask_login(); ?> <!--<meta http-equiv="refresh" content="0;index.php">--> Index: admin.php =================================================================== RCS file: /cvsroot/openbash-org/openbash-org/pages/admin.php,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** admin.php 19 Nov 2004 10:15:39 -0000 1.5 --- admin.php 24 Nov 2004 07:40:05 -0000 1.6 *************** *** 3,26 **** include ("modules/Validate.php"); $validate = new validate(); - $validate->validate(); ! /* ! * The user is logged in ! */ ! if (isset($_GET['a_opt'])) { ?> ! <h1><?=$admin['title']?></h1><? ! switch ($_GET['a_opt']) { ! case 'quotes': $admin_page = 'quotes'; break; ! case 'news' : $admin_page = 'news'; break; ! case 'users' : $admin_page = 'users'; break; ! case 'close' : $admin_page = 'close'; break; ! default : $admin_page = 'general';break; ! } ! } else { ! $admin_page = 'general'; ! } ! ! include ("pages/admin_header.php"); ! include ('pages/admin_'.$admin_page.'.php'); ?> --- 3,28 ---- include ("modules/Validate.php"); $validate = new validate(); ! if ($validate->validate()) { ! ! /* ! * The user is logged in ! */ ! ! if (isset($_GET['a_opt'])) { ?> ! <h1><?=$admin['title']?></h1><? ! switch ($_GET['a_opt']) { ! case 'quotes': $admin_page = 'quotes'; break; ! case 'news' : $admin_page = 'news'; break; ! case 'users' : $admin_page = 'users'; break; ! case 'close' : $admin_page = 'close'; break; ! default : $admin_page = 'general';break; ! } ! } else { ! $admin_page = 'general'; ! } ! include ("pages/admin_header.php"); ! include ('pages/admin_'.$admin_page.'.php'); ! } ?> |
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 () |
From: Juan C. D. R. <hn...@us...> - 2004-11-23 14:45:03
|
Update of /cvsroot/openbash-org/openbash-org/modules In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv1472/openbash-org/modules Modified Files: View.php Log Message: Añadida validación del mail TODO: CORREGIR LO DEL exit() EN EL METODO ask_login() Index: View.php =================================================================== RCS file: /cvsroot/openbash-org/openbash-org/modules/View.php,v retrieving revision 1.16 retrieving revision 1.17 diff -C2 -d -r1.16 -r1.17 *** View.php 23 Nov 2004 14:02:58 -0000 1.16 --- View.php 23 Nov 2004 14:44:42 -0000 1.17 *************** *** 22,26 **** <div><label for="quote"><?=$add['please_insert']?></label></div> <div><textarea id="quote" name="quote" class="textarea" cols="60%" rows="10" onblur="requireValue(this)"></textarea></div> ! <p><input type="text" id="author" name="author" onblur="requireValue(this)" maxlength="100" /> <label for="author"><?=$add['author'];?></label></p> <p><input type="text" id="channel" name="channel" onblur="requireValue(this)" maxlength="50" /> <label for="channel"><?=$add['channel'];?></label></p> <p><input type="text" id="network" name="network" onblur="requireValue(this)" maxlength="50" /> <label for="network"><?=$add['network'];?></label></p> --- 22,26 ---- <div><label for="quote"><?=$add['please_insert']?></label></div> <div><textarea id="quote" name="quote" class="textarea" cols="60%" rows="10" onblur="requireValue(this)"></textarea></div> ! <p><input type="text" id="author" name="author" onblur="requireValue(this)*checkEmail(this)" maxlength="100" /> <label for="author"><?=$add['author'];?></label></p> <p><input type="text" id="channel" name="channel" onblur="requireValue(this)" maxlength="50" /> <label for="channel"><?=$add['channel'];?></label></p> <p><input type="text" id="network" name="network" onblur="requireValue(this)" maxlength="50" /> <label for="network"><?=$add['network'];?></label></p> *************** *** 138,142 **** </form> <?php ! exit(); } --- 138,142 ---- </form> <?php ! exit(); // WTF? FIX THIS SHIT!!!!!! } *************** *** 158,161 **** --- 158,163 ---- /* * auxiliar functions + * + * TODO: multiple translations of validate.js */ |
From: Juan C. D. R. <hn...@us...> - 2004-11-23 14:03:14
|
Update of /cvsroot/openbash-org/openbash-org/modules In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv19927/openbash-org/modules Modified Files: View.php Log Message: Añadida validación de formulario por javascript mediante las funciones definidas en validate.js De momento solo se valida campos requeridos, y esto no exime la validación por parte de los script PHP. Y para que quede constancia.... coder & Rinzewind putas Index: View.php =================================================================== RCS file: /cvsroot/openbash-org/openbash-org/modules/View.php,v retrieving revision 1.15 retrieving revision 1.16 diff -C2 -d -r1.15 -r1.16 *** View.php 21 Nov 2004 11:36:36 -0000 1.15 --- View.php 23 Nov 2004 14:02:58 -0000 1.16 *************** *** 14,24 **** function ask_quote() { ! global $add;?> ! <form id="addquote" action="?page=quote&action=insert" method="post"> <div><label for="quote"><?=$add['please_insert']?></label></div> ! <div><textarea id="quote" name="quote" class="textarea" cols="60%" rows="10"></textarea></div> ! <p><input type="text" id="author" name="author" /> <label for="author"><?=$add['author'];?></label></p> ! <p><input type="text" id="channel" name="channel" /> <label for="channel"><?=$add['channel'];?></label></p> ! <p><input type="text" id="network" name="network" /> <label for="network"><?=$add['network'];?></label></p> <p> <input type="button" id="preview" value="<?=$add['preview'];?>" /> --- 14,28 ---- function ask_quote() { ! global $add; ! ! $this->add_validate(); // adds the javascript file ! ! ?> ! <form id="addquote" onsubmit="return autocheck(this)" action="?page=quote&action=insert" method="post"> <div><label for="quote"><?=$add['please_insert']?></label></div> ! <div><textarea id="quote" name="quote" class="textarea" cols="60%" rows="10" onblur="requireValue(this)"></textarea></div> ! <p><input type="text" id="author" name="author" onblur="requireValue(this)" maxlength="100" /> <label for="author"><?=$add['author'];?></label></p> ! <p><input type="text" id="channel" name="channel" onblur="requireValue(this)" maxlength="50" /> <label for="channel"><?=$add['channel'];?></label></p> ! <p><input type="text" id="network" name="network" onblur="requireValue(this)" maxlength="50" /> <label for="network"><?=$add['network'];?></label></p> <p> <input type="button" id="preview" value="<?=$add['preview'];?>" /> *************** *** 114,129 **** { global $login_language; ?> <h5 align="center"><?=$login_language['title']?></h5> <hr> <p><?=$login_language['msg']?></p> ! <form action="?page=admin" method="post"> <input type="hidden" name="form" value="1"> <table border="0" width="50%"> <tr class="textoficha"> <td><?=$login_language['login']?></td> ! <td><input type="text" name="login" class="textfield" maxlength="20" /></td> <td><?=$login_language['passwd']?></td> ! <td><input type="password" name="passwd" class="textfield" maxlength="20" /><td> <td><input type="submit" name="submit" class="submit" value="<?=$login_language['submit']?>" /></td> </tr> --- 118,136 ---- { global $login_language; + + $this->add_validate(); // adds the javascript file + ?> <h5 align="center"><?=$login_language['title']?></h5> <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%"> <tr class="textoficha"> <td><?=$login_language['login']?></td> ! <td><input type="text" name="login" class="textfield" maxlength="20" onblur="requireValue(this)" /></td> <td><?=$login_language['passwd']?></td> ! <td><input type="password" name="passwd" class="textfield" maxlength="20" onblur="requireValue(this)" /><td> <td><input type="submit" name="submit" class="submit" value="<?=$login_language['submit']?>" /></td> </tr> *************** *** 147,149 **** --- 154,170 ---- } + + + /* + * auxiliar functions + */ + + function add_validate() + { + ?> + <script type="text/javascript" src="validate.js"></script> + <?php + } + + } |
From: José M. M. <ri...@us...> - 2004-11-23 11:45:02
|
Update of /cvsroot/openbash-org/openbash-org/css In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv17128/css Modified Files: styles.css Log Message: - Ahora quedan más bonitos los inputs. RinzeWind con alma de decoradora XD Index: styles.css =================================================================== RCS file: /cvsroot/openbash-org/openbash-org/css/styles.css,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** styles.css 21 Nov 2004 10:47:00 -0000 1.11 --- styles.css 23 Nov 2004 11:44:52 -0000 1.12 *************** *** 20,23 **** --- 20,28 ---- } + + input:focus, textarea:focus { + background-color: #fff; + } + a.admin { color: black; *************** *** 85,90 **** .smalltext {font-family: arial, helvetica, sans-serif;font-size: 10px;background-color: #f0f0f0;color: #000000} .seltext {font-family: arial, helvetica, sans-serif;font-size: 10px;background-color: #ffffff;color: #000000} - input.text {color: #000000; background-color: #ffffff;} - textarea {color: #000000; background-color: #ffffff;} select {color: #000000; background-color: #ffffff;} .qt { --- 90,93 ---- |
From: Juan C. D. R. <hn...@us...> - 2004-11-22 14:24:33
|
Update of /cvsroot/openbash-org/openbash-org In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv19164 Added Files: validate.js Log Message: Versión inicial del validate.js para validar formularios via javascript --- NEW FILE: validate.js --- // validate.js v 1.82 // a generic form validator // by Brian Lalonde - 2004-07-02 // instructions/details at http://webcoder.info/ function formFocus() { // convenient way to start the form onLoad if(!document.forms.length) return; var els= document.forms[0].elements; for(var i= 0; i < els.length; i++) if(els[i].type != 'hidden') { els[i].focus(); return; } } function requireValue(fld) { // disallow a blank field if(fld.disabled) return true; if(!fld.value.length) { status= 'The '+fld.name+' field cannot be left blank.'; return false; } return true; } function requireChecked(fld) { // require a checkbox to be checked if(fld.disabled) return true; if(!fld.checked) { status= 'The '+fld.name+' checkbox must be checked.'; return false; } return true; } function requireRadio(radios) { // require at least one radio in this group to be checked if(!radios.length) return true; // invalid parameter var visible= false, enabled= false; for(var i= 0; i < radios.length; i++) { if(!enabled) enabled= !radios[i].disabled; if(radios[i].checked) return true; else if(radios[i].offsetWidth == undefined || radios[i].offsetWidth > 0) visible= true; } if(!visible||!enabled) return true; // no visible/enabled options in this group status= 'You must select one of the '+radios[0].name+' options.'; return false; } function requireLength(fld,min,max) { // set minimum and/or maximum field lengths if(fld.disabled) return true; var len= fld.value.length; if(min > -1 && len < min) { status= 'The '+fld.name+' field must be at least '+min+ ' characters long; it is currently '+len+' characters long.'; return false; } if(max > -1 && len > max) { status= 'The '+fld.name+' field must be no more than '+max+ ' characters long; it is currently '+len+' characters long.'; return false; } return true; } function dependants(enabled,elements) { // convenience function to enable/disable dependant fields, passed in as an array if(!elements.length) return true; for(var i= 0; i < elements.length; i++) elements[i].disabled= !enabled; } function allowChars(fld,chars) { // provide a string of acceptable chars for a field if(fld.disabled) return true; for(var i= 0; i < fld.value.length; i++) { if(chars.indexOf(fld.value.charAt(i)) == -1) { status= 'The '+fld.name+' field may not contain "'+fld.value.charAt(i)+'" characters.'; return false; } } return true; } function disallowChars(fld,chars) { // provide a string of unacceptable chars for a field if(fld.disabled) return true; for(var i= 0; i < fld.value.length; i++) { if(chars.indexOf(fld.value.charAt(i)) != -1) { status= 'The '+fld.name+' field may not contain "'+fld.value.charAt(i)+'" characters.'; return false; } } return true; } function checkEmail(fld) { // simple email check if(!fld.value.length||fld.disabled) return true; // blank fields are the domain of requireValue var phony= /@(\w+\.)*example\.(com|net|org)$/i; if(phony.test(fld.value)) { status= 'Please enter your email address in the '+fld.name+' field.'; return false; } var emailfmt= /^\w+([.-]\w+)*@\w+([.-]\w+)*\.\w{2,8}$/; if(!emailfmt.test(fld.value)) { status= 'The '+fld.name+' field must contain a valid email address.'; return false; } return true; } function checkIntRange(fld,minVal,maxVal,sep) { if(!fixInt(fld)) return false; var val= parseInt(fld.value); if(val < minVal) { status= 'The '+fld.name+' field must be no less than '+minVal+'.'; return false; } if(val > maxVal) { status= 'The '+fld.name+' field must be no greater than than '+maxVal+'.'; return false; } return true; } function checkFloatRange(fld,minVal,maxVal,sep) { if(!fixFloat(fld)) return false; var val= parseFloat(fld.value); if(val < minVal) { status= 'The '+fld.name+' field must be no less than '+minVal+'.'; return false; } if(val > maxVal) { status= 'The '+fld.name+' field must be no greater than than '+maxVal+'.'; return false; } return true; } function fixInt(fld,sep) { // integer check/complainer if(!fld.value.length||fld.disabled) return true; // blank fields are the domain of requireValue var val= fld.value; if(typeof(sep)!='undefined') val= val.replace(new RegExp(sep,'g'),''); val= parseInt(val); if(isNaN(val)) { // parse error status= 'The '+fld.name+' field must contain a whole number.'; return false; } fld.value= val; return true; } function fixFloat(fld,sep) { // decimal number check/complainer if(!fld.value.length||fld.disabled) return true; // blank fields are the domain of requireValue var val= fld.value; if(typeof(sep)!='undefined') val= val.replace(new RegExp(sep,'g'),''); val= parseFloat(fld.value); if(isNaN(val)) { // parse error status= 'The '+fld.name+' field must contain a number.'; return false; } fld.value= val; return true; } function fixMoney(fld,sep) { // monetary field check if(!fld.value.length||fld.disabled) return true; // blank fields are the domain of requireValue var val= fld.value; if(typeof(sep)!='undefined') val= val.replace(new RegExp(sep,'g'),''); if(val.indexOf('$') == 0) val= parseFloat(val.substring(1,40)); else val= parseFloat(val); if(isNaN(val)) { // parse error status= 'The '+fld.name+' field must contain a dollar amount.'; return false; } var sign= ( val < 0 ? '-': '' ); val= Number(Math.round(Math.abs(val)*100)).toString(); while(val.length < 2) val= '0'+val; var len= val.length; val= sign + ( len == 2 ? '0' : val.substring(0,len-2) ) + '.' + val.substring(len-2,len+1); fld.value= val; return true; } function fixFixed(fld,dec,sep) { // fixed decimal fields if(!fld.value.length||fld.disabled) return true; // blank fields are the domain of requireValue var val= fld.value; if(typeof(sep)!='undefined') val= val.replace(new RegExp(sep,'g'),''); val= parseFloat(fld.value); if(isNaN(val)) { // parse error status= 'The '+fld.name+' field must contain a number.'; return false; } var sign= ( val < 0 ? '-': '' ); val= Number(Math.round(Math.abs(val)*Math.pow(10,dec))).toString(); while(val.length < dec) val= '0'+val; var len= val.length; val= sign + ( len == dec ? '0' : val.substring(0,len-dec) ) + '.' + val.substring(len-dec,len+1); fld.value= val; return true; } function fixDate(fld) { // tenacious date correction if(!fld.value.length||fld.disabled) return true; // blank fields are the domain of requireValue var val= fld.value; var dt= new Date(val.replace(/\D/g,'/')); if(!dt.valueOf()) { // the date was unparseable status= 'The '+fld.name+' field has the wrong date.'; return false; } fld.value= (dt.getMonth()+1)+'/'+dt.getDate()+'/'+dt.getFullYear(); return true; } function fixRecentDate(fld,minyear) { // tenacious date correction if(!fld.value.length||fld.disabled) return true; // blank fields are the domain of requireValue var val= fld.value; var dt= new Date(val.replace(/\D/g,'/')); if(!dt.valueOf()) { // the date was unparseable status= 'The '+fld.name+' field has the wrong date.'; return false; } while(dt.getFullYear() < minyear) { dt.setFullYear(dt.getFullYear()+100); } fld.value= (dt.getMonth()+1)+'/'+dt.getDate()+'/'+dt.getFullYear(); return true; } function fixTime(fld,starthour) { // tenacious time correction if(!fld.value.length||fld.disabled) return true; // blank fields are the domain of requireValue var hour= 0; var mins= 0; var ampm= 'am'; val= fld.value; var dt= new Date('1/1/2000 ' + val); if(('9'+val) == parseInt('9'+val)) { hour= val; } else if(dt.valueOf()) { hour= dt.getHours(); mins= dt.getMinutes(); } else { val= val.replace(/\D+/g,':'); hour= parseInt(val); mins= parseInt(val.substring(val.indexOf(':')+1,20)); if(val.indexOf('pm') > -1) ampm= 'pm'; if(isNaN(hour)) hour= 0; if(isNaN(mins)) mins= 0; } if(hour < starthour) { ampm= 'pm'; } while(hour > 12) { hour-= 12; ampm= 'pm'; } while(mins > 60) { mins-= 60; hour++; } if(mins < 10) mins= '0' + mins; if(!hour) { // the date was unparseable status= 'The '+fld.name+' field has the wrong time.'; return false; } fld.value= hour + ':' + mins + ampm; return true; } function fixTime24(fld) { // tenacious time correction if(!fld.value.length||fld.disabled) return true; // blank fields are the domain of requireValue var hour= 0; var mins= 0; val= fld.value; var dt= new Date('1/1/2000 ' + val); if(('9'+val) == parseInt('9'+val)) { hour= val; } else if(dt.valueOf()) { hour= dt.getHours(); mins= dt.getMinutes(); } else { val= val.replace(/\D+/g,':'); hour= parseInt(val); mins= parseInt(val.substring(val.indexOf(':')+1,20)); if(isNaN(hour)) hour= 0; if(isNaN(mins)) mins= 0; if(val.indexOf('pm') > -1) hour+= 12; } hour%= 24; mins%= 60; if(mins < 10) mins= '0' + mins; fld.value= hour + ':' + mins; return true; } function fixPhone(fld,defaultAreaCode,sep,noext) { // tenacious phone # correction if(!fld.value.length||fld.disabled) return true; // blank fields are the domain of requireValue if(typeof(sep)=='undefined') sep= '-'; if(typeof(defaultAreaCode)!='undefined') defaultAreaCode= defaultAreaCode + sep; var ext= '', val= fld.value.toLowerCase(); if(val.indexOf('x') > 0) { if(!noext) ext= ' x'+val.substr(val.indexOf('x')).replace(/\D/g,''); val= val.substr(0,val.indexOf('x')); } val= val.replace(/\D/g,''); if(val.length == 7) { fld.value= defaultAreaCode + val.substring(0,3) + sep + val.substring(3,20) + ext; return true; } if(val.length == 10) { fld.value= val.substring(0,3) + sep + val.substring(3,6) + sep + val.substring(6,20) + ext; return true; } if(val.length < 7) { status= 'The phone number you supplied for the '+fld.name+' field was too short.'; return false; } if(val.length > 10) { status= 'The phone number you supplied for the '+fld.name+' field was too long.'; return false; } status= 'The phone number you supplied for the '+fld.name+' field was wrong.'; return false; } function fixSSN(fld) { // tenacious SSN correction; fieldname isn't a big consideration, probably only one SSN per form if(!fld.value.length||fld.disabled) return true; // blank fields are the domain of requireValue var val= fld.value; val= val.replace(/\D/g,''); if( val.length < 9 ) { status= 'The Social Security Number you provided is not long enough.'; return false; } if( val.length > 9 ) { status= 'The Social Security Number you provided is too long.'; return false; } fld.value= val.substring(0,3)+'-'+val.substring(3,5)+'-'+val.substring(5,12); return true; } function fixCreditCard(fld) { // tenacious credit card correction; fieldname isn't a big consideration, probably only one card per form if(!fld.value.length||fld.disabled) return true; // blank fields are the domain of requireValue var val= fld.value, ctype= 'credit card'; val= val.replace(/\D/g,''); var prefix2= parseInt(val.substr(0,2)); if( val.substr(0,1) == '4' ) { // Visa ctype= 'Visa\xae'; if( val.length == 16 ); else if( val.length == 13 ); // very old #, should be reassigned else if( val.length < 13 ) { status= 'The Visa\xae number you provided is not long enough.'; return false; } else if( val.length > 16 ) { status= 'The Visa\xae number you provided is too long.'; return false; } else { status= 'The Visa\xae number you provided is either not long enough, or too long.'; return false; } } else if( prefix2 >= 51 && prefix2 <= 55 ) { // MC ctype= 'MasterCard\xae'; if( val.length < 16 ) { status= 'The MasterCard\xae number you provided is not long enough.'; return false; } else if( val.length > 16 ) { status= 'The MasterCard\xae number you provided is too long.'; return false; } } else if( (prefix2 == 34) || (prefix2 == 37) ) { // AmEx ctype= 'American Express\xae card'; if( val.length < 15 ) { status= 'The American Express\xae card number you provided is not long enough.'; return false; } else if( val.length > 15 ) { status= 'The American Express\xae card number you provided is too long.'; return false; } } else if( val.substr(0,4) == '6011' ) { // Novus/Discover ctype= 'Discover\xae card'; if( val.length < 16 ) { status= 'The Discover\xae card number you provided is not long enough.'; return false; } else if( val.length > 16 ) { status= 'The Discover\xae card number you provided is too long.'; return false; } } else { // other if( val.length < 13 ) { status= 'The credit card number you provided is not long enough.'; return false; } if( val.length > 19 ) { status= 'The credit card number you provided is too long.'; return false; } } var sum= 0, dbl= false; for(var i= val.length-1; i >= 0; i--) { var digit= parseInt(val.charAt(i))*((dbl=!dbl)?1:2); sum+= ( digit > 9 ? (digit%10)+1 : digit ); } if(sum%10) { status= 'The '+ctype+' number you provided is not valid.\nPlease double-check it and try again.'; return false; } fld.value= val; return true; } function nameContains(name,str) { // Check for nontrivial inclusion // OK, *some* trivial cases must be handled... if(name == str || name.toLowerCase() == str.toLowerCase()) return true; var nlen= name.length; var slen= str.length; var endat= nlen - slen; // too small to fit? if(nlen > str) return false; if(name.toLowerCase() == name || name.toUpperCase() == name) { // all lower/upper case name? underscores separate if(name.indexOf('_') == -1) return false; str= str.toLowerCase(); if( name.indexOf(str+'_') == 0 || name.indexOf('_'+str+'_') > -1 || name.substring(endat-1,nlen+1) == ('_'+str) ) return true; } else { // proper case name? uppercase starts new words var sep= name.substring(slen,slen+1); if( name.indexOf(str) == 0 && sep == sep.toUpperCase() ) return true; if( name.indexOf(str.toLowerCase()) == 0 && sep == sep.toUpperCase() ) return true; var sep= name.substring(endat-1,endat); if( name.substring(endat,nlen+1) == str ) return true; for(var index= name.indexOf(str); index > -1; index= name.indexOf(str,index+1)) { // for each occurence of the word, is it followed by a non-lowercase char? endat= index+slen; sep= name.substring(endat,endat+1); if(sep == sep.toUpperCase()) return true; } } return false; } function autocheckByName(frm) { // uses names of form elements to determine type for(var index= 0; index < frm.elements.length; index++) { var el= frm.elements[index]; if(!el.type) continue; if(el.type == 'text' || el.type == 'password') { // text fields if(( el.name.substring(0,1) == el.name.substring(0,1).toUpperCase() || nameContains(el.name,'Required')) && el.value.length == 0) { alert('The '+el.name+' field cannot be left blank.'); el.focus(); return false; } if(nameContains(el.name,'Date') && !fixDate(el)) { alert(status); el.focus(); return false; } if(nameContains(el.name,'Time24') && !fixTime24(el)) { alert(status); el.focus(); return false; } if(nameContains(el.name,'Time') && !fixTime(el)) { alert(status); el.focus(); return false; } if(nameContains(el.name,'SSN') && !fixSSN(el)) { alert(status); el.focus(); return false; } if(nameContains(el.name,'CC') && !fixCreditCard(el)) { alert(status); el.focus(); return false; } if(nameContains(el.name,'Email') && !checkEmail(el)) { alert(status); el.focus(); return false; } if( ( nameContains(el.name,'Phone') || nameContains(el.name,'Fax') || nameContains(el.name,'Pager') ) && !fixPhone(el)) { alert(status); el.focus(); return false; } } // handle required select and select-multiple else if(el.type.substring(0,3) == 'sel' && (el.name.substring(0,1) == el.name.substring(0,1).toUpperCase() || nameContains(el.name,'Required')) && el.selectedIndex == -1) { alert(status); el.focus(); return false; } // handle required checkbox else if(el.type == 'checkbox' && (el.name.substring(0,1) == el.name.substring(0,1).toUpperCase() || nameContains(el.name,'Required')) && !requireChecked(el)) { alert(status); el.focus(); return false; } else if(el.type == 'radio' && !requireRadio(frm[el.name])) { alert(status); frm.elements[index].focus(); return false; } } for(var index= 0; index < frm.elements.length; index++) if(frm.elements[index].type == 'submit') frm.elements[index].disabled= true; return true; } function isMemberOf(elem,classname) { // checks to see if elem is a member of the (style) class // trivial cases first: no membership or simple equality if(!elem.className) return false else if(elem.className == classname) return true; else if(elem.className.indexOf(' ') > -1) { // multiple class names; use split, if avail if(parseInt(navigator.appVersion) >= 4) { var names= elem.className.split(' '); for(var index= 0; index < names.length; index++) if(names[index] == classname) return true; } // older browsers can fake it // WARNING: "fine" can be found in "oldRefined" else if(elem.className.indexOf(classname) > -1) return true; } return false; } function checkClass(el) { // validate the field, based on class membership if(el.type == 'text' || el.type == 'password') { // text fields if(isMemberOf(el,'required') && !requireValue(el)) return false; if(isMemberOf(el,'date') && !fixDate(el)) return false; if(isMemberOf(el,'time') && !fixTime(el)) return false; if(isMemberOf(el,'time24') && !fixTime24(el)) return false; if(isMemberOf(el,'ssn') && !fixSSN(el)) return false; if(isMemberOf(el,'cc') && !fixCreditCard(el)) return false; if(isMemberOf(el,'phone') && !fixPhone(el)) return false; if(isMemberOf(el,'money') && !fixMoney(el)) return false; if(isMemberOf(el,'int') && !fixInt(el)) return false; if(isMemberOf(el,'float') && !fixFloat(el)) return false; if(isMemberOf(el,'email') && !checkEmail(el)) return false; } // handle required select and select-multiple else if(el.type == 'checkbox' && isMemberOf(el,'required') && !requireChecked(el)) return false; else if(el.type.substring(0,3) == 'sel' && isMemberOf(el,'required') && el.selectedIndex == -1) return false; return true; } function autocheckByClass(frm) { // uses the CSS class of form elements to determine type for(var index= 0; index < frm.elements.length; index++) { var el= frm.elements[index]; if(!el.type) continue; if(el.type == 'radio' && !requireRadio(frm[el.name])) { alert(status); frm.elements[index].focus(); return false; } else if(!checkClass(frm.elements[index])) { alert(status); frm.elements[index].focus(); return false; } } for(var index= 0; index < frm.elements.length; index++) if(frm.elements[index].type == 'submit') frm.elements[index].disabled= true; return true; } function autocheckByBlur(frm) { // uses the onBlur handler of form elements to check value status= ''; for(var index= 0; index < frm.elements.length; index++) { var el= frm.elements[index]; if(!el.type) continue; if(el.type == 'radio' && !requireRadio(frm[el.name])) { alert(status); frm.elements[index].focus(); return false; } else if(el.type != 'hidden' && el.name && el.onblur) { el.onblur(); if(status) { alert(status); el.focus(); return false; } } } for(var index= 0; index < frm.elements.length; index++) if(frm.elements[index].type == 'submit') frm.elements[index].disabled= true; return true; } function canCheckByBlur(frm) { // determines whether programmatic invocation of form element onblur is available for(var index= 0; index < frm.elements.length; index++) { var el= frm.elements[index]; if(!el.type) continue; if(el.type != 'hidden' && el.name && typeof(el.onblur)=='function') return true; } return false; } function autocheck(frm) { // uses the best available method to check form values var bchar= navigator.appName.substring(0,1); if(isMemberOf(frm,'autocheck')) { return autocheckByClass(frm); } else if(canCheckByBlur(frm)) { return autocheckByBlur(frm); } else { return autocheckByName(frm); } } |
From: José M. M. <ri...@us...> - 2004-11-21 11:36:53
|
Update of /cvsroot/openbash-org/openbash-org/modules In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv18265 Modified Files: View.php Log Message: Cambiado el botón de reset por un botón de reset de verdad Index: View.php =================================================================== RCS file: /cvsroot/openbash-org/openbash-org/modules/View.php,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** View.php 21 Nov 2004 11:04:36 -0000 1.14 --- View.php 21 Nov 2004 11:36:36 -0000 1.15 *************** *** 24,28 **** <input type="button" id="preview" value="<?=$add['preview'];?>" /> <input type="submit" id="submit" value="<?=$add['submit'];?>" /> ! <input type="button" id="reset" value="<?=$add['reset'];?>" /> </p> </form> --- 24,28 ---- <input type="button" id="preview" value="<?=$add['preview'];?>" /> <input type="submit" id="submit" value="<?=$add['submit'];?>" /> ! <input type="reset" id="reset" value="<?=$add['reset'];?>" /> </p> </form> |
From: Juan C. D. R. <hn...@us...> - 2004-11-21 11:05:32
|
Update of /cvsroot/openbash-org/openbash-org/modules In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv13020/openbash-org/modules Modified Files: View.php Log Message: Añadido método para mostrar errores. Index: View.php =================================================================== RCS file: /cvsroot/openbash-org/openbash-org/modules/View.php,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** View.php 20 Nov 2004 10:20:42 -0000 1.13 --- View.php 21 Nov 2004 11:04:36 -0000 1.14 *************** *** 6,10 **** */ ! class view { /* --- 6,10 ---- */ ! class View { /* *************** *** 123,130 **** <tr class="textoficha"> <td><?=$login_language['login']?></td> ! <td><input type="text" name="login" class="textfield" maxlength="20"></td> <td><?=$login_language['passwd']?></td> ! <td><input type="password" name="passwd" class="textfield" maxlength="20"><td> ! <td><input type="submit" name="submit" class="submit" value="<?=$login_language['submit']?>"></td> </tr> </table> --- 123,130 ---- <tr class="textoficha"> <td><?=$login_language['login']?></td> ! <td><input type="text" name="login" class="textfield" maxlength="20" /></td> <td><?=$login_language['passwd']?></td> ! <td><input type="password" name="passwd" class="textfield" maxlength="20" /><td> ! <td><input type="submit" name="submit" class="submit" value="<?=$login_language['submit']?>" /></td> </tr> </table> *************** *** 134,136 **** --- 134,149 ---- } + + /* + * function related to errors + */ + + function show_error($msg) + { + global $errors; + ?> + <span style="error"><?=$errors['$msg']?></span> + <?php + + } } |
From: Juan C. D. R. <hn...@us...> - 2004-11-21 11:05:16
|
Update of /cvsroot/openbash-org/openbash-org/modules In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv12859/openbash-org/modules Modified Files: common.php Log Message: Eliminando salidas de texto para que haga uso de la clase View y los mensajes de error Index: common.php =================================================================== RCS file: /cvsroot/openbash-org/openbash-org/modules/common.php,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** common.php 15 Nov 2004 20:26:28 -0000 1.3 --- common.php 21 Nov 2004 11:03:51 -0000 1.4 *************** *** 27,31 **** { if (!ereg("^http://w{0,3}\.?[0-9A-Za-z]+\.?[0-9A-Za-z]+\.[0-9A-Za-z]{3}/?.*", $url)) { ! echo "La página web introducida no es correcta, corríjala"; return (0); } --- 27,31 ---- { if (!ereg("^http://w{0,3}\.?[0-9A-Za-z]+\.?[0-9A-Za-z]+\.[0-9A-Za-z]{3}/?.*", $url)) { ! View::show_error("bad_url"); return (0); } *************** *** 42,46 **** for ($i = 1; $i <= 3; $i++) { if (!(substr($ip, 0, strpos($ip, ".")) >= "0" && substr($ip, 0, strpos($ip, ".")) <= "255")) { ! echo "La supuesta IP ".$i.". NO es válida, corríjala"; return (0); } --- 42,46 ---- for ($i = 1; $i <= 3; $i++) { if (!(substr($ip, 0, strpos($ip, ".")) >= "0" && substr($ip, 0, strpos($ip, ".")) <= "255")) { ! View::show_error("ip_no_valid"); return (0); } *************** *** 48,56 **** } if (!($ip >= "0" && $ip <= "255")) { ! echo "Ninguna cifra de una IP puede superar el número 255 ni ser menor que 0, vuelva atrás y escriba una IP correcta"; return (0); } } else { ! echo "Esa IP no es válida, vuelva atrás y corríjala."; return (0); } --- 48,56 ---- } if (!($ip >= "0" && $ip <= "255")) { ! View::show_error("bad_range"); return (0); } } else { ! View::show_error("ip_no_valid"); return (0); } *************** *** 68,73 **** $email = strtolower( $email ); if (!eregi("^[a-z0-9]+([_\\.-][a-z0-9]+)*". "@([a-z0-9]+([\.-][a-z0-9]+))*$",$email)) { ! $feedback = 'Error: "' . $email . '" no es una dirección de email válida'; ! echo $feedback; return (0); } else { --- 68,72 ---- $email = strtolower( $email ); if (!eregi("^[a-z0-9]+([_\\.-][a-z0-9]+)*". "@([a-z0-9]+([\.-][a-z0-9]+))*$",$email)) { ! View::show_error ("bad_mail"); return (0); } else { *************** *** 76,81 **** if ((gethostbyname($domain) == $domain)) { if (gethostbyname("www." . $domain) == "www." . $domain) { ! $feedback = 'Error: "' . $domain . '" no parece ser un dominio válido'; ! echo $feedback; return (0); } --- 75,79 ---- if ((gethostbyname($domain) == $domain)) { if (gethostbyname("www." . $domain) == "www." . $domain) { ! View::show_error("bad_domain"); return (0); } |
From: Juan C. D. R. <hn...@us...> - 2004-11-21 11:04:28
|
Update of /cvsroot/openbash-org/openbash-org/language In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv12724/openbash-org/language Modified Files: english.php Log Message: Añadido array de errores y corregido error de compilación.... Index: english.php =================================================================== RCS file: /cvsroot/openbash-org/openbash-org/language/english.php,v retrieving revision 1.15 retrieving revision 1.16 diff -C2 -d -r1.15 -r1.16 *** english.php 20 Nov 2004 10:20:42 -0000 1.15 --- english.php 21 Nov 2004 11:03:01 -0000 1.16 *************** *** 44,49 **** $quote_language = array ( permalink => 'Permanent link to this quote.', ! review => 'Flag quote for review?' ! inserted => 'The quote has been saved and marked as pending. Moderators have been emailed<br/><br>/'. 'and the will check your text as soon as possible, thank you for participating.<br/><br/>'. 'In the next page you will be able to check the quote status to see if it has been aproved or not', --- 44,49 ---- $quote_language = array ( permalink => 'Permanent link to this quote.', ! review => 'Flag quote for review?', ! inserted => 'The quote has been saved and marked as pending. Moderators have been emailed<br/><br/>'. 'and the will check your text as soon as possible, thank you for participating.<br/><br/>'. 'In the next page you will be able to check the quote status to see if it has been aproved or not', *************** *** 66,68 **** --- 66,76 ---- ); + $errors = array ( + bad_url => 'The webpage url is not valid. Fix it.', + ip_no_valid => 'IP no valid. Fix it.', + bad_range => 'The IP number must be between 0 and 255.', + bad_mail => 'Mail address no valid.', + bad_domain => 'Domain name no valid.' + ); + ?> |
From: Juan C. D. R. <hn...@us...> - 2004-11-21 11:03:33
|
Update of /cvsroot/openbash-org/openbash-org/language In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv12595/openbash-org/language Modified Files: spanish.php Log Message: Añadido array de errores Index: spanish.php =================================================================== RCS file: /cvsroot/openbash-org/openbash-org/language/spanish.php,v retrieving revision 1.25 retrieving revision 1.26 diff -C2 -d -r1.25 -r1.26 *** spanish.php 20 Nov 2004 10:20:42 -0000 1.25 --- spanish.php 21 Nov 2004 11:02:17 -0000 1.26 *************** *** 43,47 **** news => 'Administrar noticias', users => 'Administrar usuarios', ! close => 'Cerrar sesión' ); --- 43,47 ---- news => 'Administrar noticias', users => 'Administrar usuarios', ! close => 'Cerrar sesión' ); *************** *** 69,71 **** --- 69,79 ---- ); + $errors = array ( + bad_url => 'La página web introducida no es correcta. Corríjala.', + ip_no_valid => 'IP no válida. Corríjala.', + bad_range => 'Las IP deben contener cifras entre 0 y 255.', + bad_mail => 'Dirección de email no válida.', + bad_domain => 'Nombre de dominio no válido.' + ); + ?> |
From: Juan C. D. R. <hn...@us...> - 2004-11-21 10:47:51
|
Update of /cvsroot/openbash-org/openbash-org/css In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv9772/openbash-org/css Modified Files: styles.css Log Message: Añadida clase para errores Index: styles.css =================================================================== RCS file: /cvsroot/openbash-org/openbash-org/css/styles.css,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** styles.css 20 Nov 2004 20:22:46 -0000 1.10 --- styles.css 21 Nov 2004 10:47:00 -0000 1.11 *************** *** 81,84 **** --- 81,86 ---- } + .error { font-weight: bold; color: #900 } + .smalltext {font-family: arial, helvetica, sans-serif;font-size: 10px;background-color: #f0f0f0;color: #000000} .seltext {font-family: arial, helvetica, sans-serif;font-size: 10px;background-color: #ffffff;color: #000000} |
From: Juan C. D. R. <hn...@us...> - 2004-11-20 20:22:59
|
Update of /cvsroot/openbash-org/openbash-org/css In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv17479/openbash-org/css Modified Files: styles.css Log Message: Añadidos estilos para los input y textareas Index: styles.css =================================================================== RCS file: /cvsroot/openbash-org/openbash-org/css/styles.css,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** styles.css 19 Aug 2004 18:14:49 -0000 1.9 --- styles.css 20 Nov 2004 20:22:46 -0000 1.10 *************** *** 15,18 **** --- 15,23 ---- a:visited { color: #c08000; } + input, textarea { + border: 1px solid #333; + background-color: #eee; + + } a.admin { color: black; |
From: José M. M. <ri...@us...> - 2004-11-20 10:20:52
|
Update of /cvsroot/openbash-org/openbash-org/language In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv28741/language Modified Files: english.php spanish.php Log Message: Ya sale texto cuando se vota una quote dos veces seguidas Index: spanish.php =================================================================== RCS file: /cvsroot/openbash-org/openbash-org/language/spanish.php,v retrieving revision 1.24 retrieving revision 1.25 diff -C2 -d -r1.24 -r1.25 *** spanish.php 20 Nov 2004 10:11:10 -0000 1.24 --- spanish.php 20 Nov 2004 10:20:42 -0000 1.25 *************** *** 57,61 **** updated => 'La puntuación ha sido tenida en cuenta', back => 'Volver', ! score_forbidden => 'No puedes cambiar la puntuación de una quote si no vienes de nuestro sitio' ); --- 57,62 ---- updated => 'La puntuación ha sido tenida en cuenta', back => 'Volver', ! score_forbidden => 'No puedes cambiar la puntuación de una quote si no vienes de nuestro sitio', ! score_twice => 'Ya has votado por esta quote, Calma y Tranquilidad, ¿eh?' ); Index: english.php =================================================================== RCS file: /cvsroot/openbash-org/openbash-org/language/english.php,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** english.php 20 Nov 2004 10:11:10 -0000 1.14 --- english.php 20 Nov 2004 10:20:42 -0000 1.15 *************** *** 54,58 **** back => 'Back', score_forbidden => 'You cannot change a quote score if you are not refering ! from our site' ); --- 54,59 ---- back => 'Back', score_forbidden => 'You cannot change a quote score if you are not refering ! from our site', ! score_twice => 'You have already voted for this quote. Slow down, cowboy' ); |
From: José M. M. <ri...@us...> - 2004-11-20 10:20:52
|
Update of /cvsroot/openbash-org/openbash-org/modules In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv28741/modules Modified Files: Quote.php View.php Log Message: Ya sale texto cuando se vota una quote dos veces seguidas Index: View.php =================================================================== RCS file: /cvsroot/openbash-org/openbash-org/modules/View.php,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** View.php 20 Nov 2004 10:11:10 -0000 1.12 --- View.php 20 Nov 2004 10:20:42 -0000 1.13 *************** *** 92,95 **** --- 92,103 ---- <?php } + + function view_score_twice() + { + global $quote_language;?> + <p><?=$quote_language['score_twice']?></p> + <?php + + } function view_redirect($url) Index: Quote.php =================================================================== RCS file: /cvsroot/openbash-org/openbash-org/modules/Quote.php,v retrieving revision 1.15 retrieving revision 1.16 diff -C2 -d -r1.15 -r1.16 *** Quote.php 20 Nov 2004 10:11:10 -0000 1.15 --- Quote.php 20 Nov 2004 10:20:42 -0000 1.16 *************** *** 155,165 **** case 'sux': $sql2 = "UPDATE quote SET points=points-1,voter='$ip' WHERE id='$score_id'"; break; case 'rev': $this->mail_revision_quote($score_id); break; ! } ! if (isset($sql2)) { $view = new view(); $bd->_Execute($sql2); $view->view_updated_quote(); } } } --- 155,169 ---- case 'sux': $sql2 = "UPDATE quote SET points=points-1,voter='$ip' WHERE id='$score_id'"; break; case 'rev': $this->mail_revision_quote($score_id); break; ! } ! if (isset($sql2)) { $view = new view(); $bd->_Execute($sql2); $view->view_updated_quote(); } + } else { + $view = new View(); + $view->view_score_twice(); } + } |
From: José M. M. <ri...@us...> - 2004-11-20 10:11:24
|
Update of /cvsroot/openbash-org/openbash-org/modules In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv26862/modules Modified Files: Quote.php View.php Log Message: Se comprueba que las votaciones provienen de un link de nuestro sitio, no se puede votar a lo loco con enlaces externos. Index: View.php =================================================================== RCS file: /cvsroot/openbash-org/openbash-org/modules/View.php,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** View.php 20 Nov 2004 10:01:29 -0000 1.11 --- View.php 20 Nov 2004 10:11:10 -0000 1.12 *************** *** 82,88 **** <p><a href="javascript:;" onClick="history.back();"><?=$quote_language['back']?></a></p> --> ! <p><a href="<?=$_SERVER['HTTP_REFERER']?>"><?=$quote_language['back']?></p> <?php } function view_redirect($url) --- 82,95 ---- <p><a href="javascript:;" onClick="history.back();"><?=$quote_language['back']?></a></p> --> ! <p><a href="<?=$_SERVER['HTTP_REFERER']?>"><?=$quote_language['back']?></a></p> <?php } + + function view_score_forbidden() + { + global $quote_language;?> + <p><?=$quote_language['score_forbidden']?></p> + <?php + } function view_redirect($url) Index: Quote.php =================================================================== RCS file: /cvsroot/openbash-org/openbash-org/modules/Quote.php,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** Quote.php 18 Nov 2004 17:42:04 -0000 1.14 --- Quote.php 20 Nov 2004 10:11:10 -0000 1.15 *************** *** 137,140 **** --- 137,147 ---- $ip = get_ipaddr(); + if(!strstr($_SERVER['HTTP_REFERER'], $_SERVER['SERVER_NAME'])) { + $view = new View(); + $view->view_score_forbidden(); + return; + } + + /* * check last vote |
From: José M. M. <ri...@us...> - 2004-11-20 10:11:24
|
Update of /cvsroot/openbash-org/openbash-org/language In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv26862/language Modified Files: english.php spanish.php Log Message: Se comprueba que las votaciones provienen de un link de nuestro sitio, no se puede votar a lo loco con enlaces externos. Index: spanish.php =================================================================== RCS file: /cvsroot/openbash-org/openbash-org/language/spanish.php,v retrieving revision 1.23 retrieving revision 1.24 diff -C2 -d -r1.23 -r1.24 *** spanish.php 20 Nov 2004 09:38:22 -0000 1.23 --- spanish.php 20 Nov 2004 10:11:10 -0000 1.24 *************** *** 56,60 **** non_existent => 'Esa quote no existe loco! hale tira pal índice merluzo.', updated => 'La puntuación ha sido tenida en cuenta', ! back => 'Volver' ); --- 56,61 ---- non_existent => 'Esa quote no existe loco! hale tira pal índice merluzo.', updated => 'La puntuación ha sido tenida en cuenta', ! back => 'Volver', ! score_forbidden => 'No puedes cambiar la puntuación de una quote si no vienes de nuestro sitio' ); Index: english.php =================================================================== RCS file: /cvsroot/openbash-org/openbash-org/language/english.php,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** english.php 20 Nov 2004 09:38:22 -0000 1.13 --- english.php 20 Nov 2004 10:11:10 -0000 1.14 *************** *** 52,56 **** non_existent => 'The quote you are looking for does not exist on our database.', updated => 'Your vote has been accepted, thanks :D', ! back => 'Back' ); --- 52,58 ---- non_existent => 'The quote you are looking for does not exist on our database.', updated => 'Your vote has been accepted, thanks :D', ! back => 'Back', ! score_forbidden => 'You cannot change a quote score if you are not refering ! from our site' ); |
From: José M. M. <ri...@us...> - 2004-11-20 10:01:39
|
Update of /cvsroot/openbash-org/openbash-org/modules In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv25052/modules Modified Files: View.php Log Message: Se usa HTTP_REFERER para volver atrás en vez de history.back() Index: View.php =================================================================== RCS file: /cvsroot/openbash-org/openbash-org/modules/View.php,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** View.php 20 Nov 2004 09:51:24 -0000 1.10 --- View.php 20 Nov 2004 10:01:29 -0000 1.11 *************** *** 78,82 **** --- 78,86 ---- global $quote_language;?> <p><?=$quote_language['updated']?></p> + <!-- + NO JavaScript <p><a href="javascript:;" onClick="history.back();"><?=$quote_language['back']?></a></p> + --> + <p><a href="<?=$_SERVER['HTTP_REFERER']?>"><?=$quote_language['back']?></p> <?php } |