phpwebapp-commits Mailing List for phpWebApp (Page 23)
Brought to you by:
dashohoxha
You can subscribe to this list here.
2001 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
(15) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2002 |
Jan
(2) |
Feb
|
Mar
|
Apr
(5) |
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2003 |
Jan
|
Feb
(43) |
Mar
|
Apr
|
May
|
Jun
(2) |
Jul
|
Aug
(194) |
Sep
(60) |
Oct
(6) |
Nov
|
Dec
(16) |
2004 |
Jan
(73) |
Feb
(13) |
Mar
(5) |
Apr
|
May
(5) |
Jun
|
Jul
(183) |
Aug
|
Sep
(5) |
Oct
(30) |
Nov
|
Dec
|
2005 |
Jan
|
Feb
|
Mar
|
Apr
(9) |
May
(1) |
Jun
(35) |
Jul
(17) |
Aug
(2) |
Sep
(6) |
Oct
(19) |
Nov
(108) |
Dec
|
2006 |
Jan
(10) |
Feb
(1) |
Mar
(5) |
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
From: Dashamir H. <das...@us...> - 2003-09-30 09:41:11
|
Update of /cvsroot/phpwebapp/top10/templates/edit_project In directory sc8-pr-cvs1:/tmp/cvs-serv15337/templates/edit_project Modified Files: edit_project.php edit_project.js edit_project.html edit_project.db Log Message: 'edit_project' finished Index: edit_project.php =================================================================== RCS file: /cvsroot/phpwebapp/top10/templates/edit_project/edit_project.php,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** edit_project.php 30 Sep 2003 07:06:02 -0000 1.1 --- edit_project.php 30 Sep 2003 09:41:07 -0000 1.2 *************** *** 27,31 **** function init() { ! $this->addSVar("mode", "add"); //it can be 'add' or 'edit' $this->addSVar("proj_id", UNDEFINED); } --- 27,31 ---- function init() { ! $this->addSVar("mode", "add"); //it can be 'add', 'edit' or 'done' $this->addSVar("proj_id", UNDEFINED); } *************** *** 47,53 **** } ! //insert the project and change the mode of the webbox WebApp::execDBCmd("insert_project", $event_args); ! //ToDo: insert also the project members $this->setSVar("proj_id", $proj_id); $this->setSVar("mode", "edit"); --- 47,56 ---- } ! //insert the project and save the members WebApp::execDBCmd("insert_project", $event_args); ! $members = $event_args["members"]; ! $this->save_proj_members($proj_id, $members); ! ! //change the mode of the webbox $this->setSVar("proj_id", $proj_id); $this->setSVar("mode", "edit"); *************** *** 56,72 **** function on_save($event_args) { $proj_id = $this->getSVar("proj_id"); ! if ($proj_id != $event_args["proj_id"]) ! { ! $msg = "You cannot change the project unix name"; ! WebApp::message($msg); ! return; ! } ! //... } function on_done($event_args) { ! } --- 59,104 ---- function on_save($event_args) { + WebApp::execDBCmd("update_project", $event_args); + + //save also the members $proj_id = $this->getSVar("proj_id"); ! $members = $event_args["members"]; ! $this->save_proj_members($proj_id, $members); } function on_done($event_args) { ! //save any latest changes ! $this->on_save($event_args); ! ! //notify admin by e-mail ! extract($event_args); ! $proj_id = $this->getSVar("proj_id"); ! $ip = $_SERVER["REMOTE_ADDR"]; ! $date = date("Y-m-d"); ! $subject = "Top10: New project: '$proj_id'"; ! $message = " ! date = '$date' ! ip = '$ip' ! proj_id = '$proj_id' ! proj_name = '$proj_name' ! group_id = '$group_id' ! category = '$category' ! license = '$license' ! prog_lang = '$prog_lang' ! register_date = '$register_date' ! proj_descr = '$proj_descr'"; ! mail(ADMIN_EMAIL, $subject, $message); ! ! //set the mode of edit_project to 'done' ! $this->setSVar("mode", "done"); ! ! //notification mesage to the user ! $msg = "Thank you for your submittion.\n" ! . "This project will be added in the list\n" ! . "after it is approved by the admin.\n" ! . "From now on it can be deleted or modified\n" ! . "only by admin: '".ADMIN_EMAIL."'."; ! WebApp::message($msg); } *************** *** 89,97 **** WebApp::addVars($tpl_vars); } ! else if ($mode=="edit") { $rs = WebApp::openRS("get_project"); WebApp::addVars($rs->Fields()); } } } --- 121,153 ---- WebApp::addVars($tpl_vars); } ! else { $rs = WebApp::openRS("get_project"); WebApp::addVars($rs->Fields()); + $rs = WebApp::openRS("get_proj_members"); + $arr_members = $rs->getColumn("username"); + WebApp::addVar("members", implode(",", $arr_members)); + } + } + + /** Saves the members of a project in the proj_members table. */ + function save_proj_members($proj_id, $members) + { + //first delete any existing members + WebApp::execDBCmd("del_proj_members", compact("proj_id")); + + if (trim($members)=='') return; //empty, nothing to save + + //insert the new members + $arr_insert_values = array(); + $arr_members = explode(",", $members); + for ($i=0; $i < sizeof($arr_members); $i++) + { + $username = trim($arr_members[$i]); + if ($username=='') continue; + $arr_insert_values[] = "('$proj_id', '$username')"; } + $insert_values = implode(",\n", $arr_insert_values); + WebApp::execDBCmd("save_proj_members", compact("insert_values")); } } Index: edit_project.js =================================================================== RCS file: /cvsroot/phpwebapp/top10/templates/edit_project/edit_project.js,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** edit_project.js 30 Sep 2003 07:06:02 -0000 1.1 --- edit_project.js 30 Sep 2003 09:41:07 -0000 1.2 *************** *** 3,7 **** function add_project() { ! save_project('add'); } --- 3,16 ---- function add_project() { ! var form = document.edit_project; ! ! //collect all the input in the form ! var event_args = getEventArgs(form); ! ! //save the input entered in the form, even if it is not ! //inserted in DB (e.g. because of any error) ! saveFormData(form); ! ! SendEvent("edit_project", "add", event_args); } *************** *** 11,28 **** } ! function save_project(event_name) { - if (event_name==null) event_name = "save"; - var form = document.edit_project; - - //collect all the input in the form var event_args = getEventArgs(form); ! ! //save the input entered in the form, even if it is not ! //inserted in DB (e.g. because of any error) ! saveFormData(form); ! ! SendEvent("edit_project", event_name, event_args); } --- 20,28 ---- } ! function save_project() { var form = document.edit_project; var event_args = getEventArgs(form); ! SendEvent("edit_project", "save", event_args); } *************** *** 34,38 **** if (!confirm(msg)) return; ! if (!no_empty_fields()) save_project('done'); } --- 34,43 ---- if (!confirm(msg)) return; ! if (no_empty_fields()) ! { ! var form = document.edit_project; ! var event_args = getEventArgs(form); ! SendEvent("edit_project", "done", event_args); ! } } Index: edit_project.html =================================================================== RCS file: /cvsroot/phpwebapp/top10/templates/edit_project/edit_project.html,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** edit_project.html 30 Sep 2003 07:06:02 -0000 1.1 --- edit_project.html 30 Sep 2003 09:41:07 -0000 1.2 *************** *** 4,8 **** </If> ! <If condition="'{{mode}}'=='edit'"> <h2>Project: <a href="http://sourceforge.net/projects/{{proj_id}}" target="_blank">{{proj_name}} ({{proj_id}})</a></h2> --- 4,8 ---- </If> ! <If condition="'{{mode}}'!='add'"> <h2>Project: <a href="http://sourceforge.net/projects/{{proj_id}}" target="_blank">{{proj_name}} ({{proj_id}})</a></h2> *************** *** 14,19 **** <td bgcolor="eeeeee">Project Unix Name:</td> <td bgcolor="#ffffff"> ! <input type="text" size="30" name="proj_id" value="{{proj_id}}" ! onfocus="select()"> </td> </tr> --- 14,24 ---- <td bgcolor="eeeeee">Project Unix Name:</td> <td bgcolor="#ffffff"> ! <If condition="'{{mode}}'=='add'"> ! <input type="text" size="30" name="proj_id" value="{{proj_id}}" ! onfocus="select()"> ! </If> ! <If condition="'{{mode}}'!='add'"> ! {{edit_project->proj_id}} ! </If> </td> </tr> *************** *** 84,87 **** --- 89,97 ---- <a class="button" href="javascript:save_project()">Save</a> <a class="button" href="javascript:done_editing()">Done</a> + </If> + <If condition="'{{mode}}'=='done'"> + <a class="button" href="javascript:SendEvent('module','add_new_project')"> + Add Another Project + </a> </If> Index: edit_project.db =================================================================== RCS file: /cvsroot/phpwebapp/top10/templates/edit_project/edit_project.db,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** edit_project.db 30 Sep 2003 07:06:02 -0000 1.1 --- edit_project.db 30 Sep 2003 09:41:07 -0000 1.2 *************** *** 8,11 **** --- 8,18 ---- </Recordset> + <Recordset ID="get_proj_members"> + <Query> + SELECT username FROM proj_members + WHERE proj_id = '{{edit_project->proj_id}}' + </Query> + </Recordset> + <Recordset ID="check_proj_id"> <Query> *************** *** 33,43 **** </dbCommand> ! <!--# --------------------------------- #--> ! <!--# members of the project #--> ! <Recordset ID="members"> <Query> ! SELECT username FROM proj_members WHERE proj_id = '{{proj_id}}' </Query> ! </Recordset> --- 40,69 ---- </dbCommand> ! <dbCommand ID="update_project"> ! <Query> ! UPDATE proj_list ! SET ! proj_name = '{{proj_name}}', ! proj_descr = '{{proj_descr}}', ! category = '{{category}}', ! license = '{{license}}', ! prog_lang = '{{prog_lang}}', ! register_date = '{{register_date}}', ! group_id = '{{group_id}}' ! WHERE proj_id = '{{edit_project->proj_id}}' ! </Query> ! </dbCommand> ! <dbCommand ID="del_proj_members"> <Query> ! DELETE FROM proj_members WHERE proj_id = '{{proj_id}}' </Query> ! </dbCommand> ! ! <dbCommand ID="save_proj_members"> ! <Query> ! INSERT INTO proj_members (proj_id, username) ! VALUES {{insert_values}} ! </Query> ! </dbCommand> |
From: Dashamir H. <das...@us...> - 2003-09-30 07:11:26
|
Update of /cvsroot/phpwebapp/web_app In directory sc8-pr-cvs1:/tmp/cvs-serv20128 Modified Files: class.WebApp.php Log Message: 'free events' modified Index: class.WebApp.php =================================================================== RCS file: /cvsroot/phpwebapp/web_app/class.WebApp.php,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** class.WebApp.php 8 Sep 2003 13:18:24 -0000 1.13 --- class.WebApp.php 30 Sep 2003 07:11:20 -0000 1.14 *************** *** 41,48 **** /** * A free event has target 'none', doesn't have a target webobject, ! * so no webobject can handle it. Instead, it is handled by the ! * function on_eventName($event), that is in the file 'on.eventName.php', ! * which is placed in the same folder as the target page or the source ! * page of the event. */ function callFreeEvent() --- 41,47 ---- /** * A free event has target 'none', doesn't have a target webobject, ! * so no webobject can handle it. Instead, it is handled by the ! * file 'on.eventName.php', which is placed in the same folder as the ! * source page of the event. */ function callFreeEvent() *************** *** 50,78 **** global $event; $file_name = "on.".$event->name.".php"; - $fun_name = "on_".$event->name; - - //look for the event handler in the path of targetPage - $path = TPL_PATH.dirname($event->targetPage); $fname = $path."/".$file_name; if (file_exists($fname)) { include_once $fname; - $fun_name($event); - return; } ! ! //look for the event handler in the path of sourcePage ! $path = TPL_PATH.dirname($event->sourcePage); ! $fname = $path."/".$file_name; ! if (file_exists($fname)) { ! include_once $fname; ! $fun_name($event); ! return; } - - //no event handler found - print WebApp::error_msg("event handler '$file_name' not found."); } --- 49,65 ---- global $event; + //look for the event handler in the path of sourcePage + $path = TPL_PATH.dirname($event->sourcePage); $file_name = "on.".$event->name.".php"; $fname = $path."/".$file_name; if (file_exists($fname)) { include_once $fname; } ! else { ! $err_msg = "WebApp::callFreeEvent(): File '$file_name' not found."; ! print WebApp::error_msg($err_msg); } } |
From: Dashamir H. <das...@us...> - 2003-09-30 07:11:26
|
Update of /cvsroot/phpwebapp/web_app/doc In directory sc8-pr-cvs1:/tmp/cvs-serv20128/doc Modified Files: changes_2.txt ToDo.txt Log Message: 'free events' modified Index: changes_2.txt =================================================================== RCS file: /cvsroot/phpwebapp/web_app/doc/changes_2.txt,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** changes_2.txt 24 Sep 2003 14:22:50 -0000 1.4 --- changes_2.txt 30 Sep 2003 07:11:20 -0000 1.5 *************** *** 103,105 **** --- 103,125 ---- dynamic recordsets. --------------------------------------------------------------- + * Free events are handled by the file 'on.eventName.php' which is + placed in the same folder as 'sourcePage'. This file now contains + global code (not the function on_eventName()). + + ToDo: Find another name (terminology) for free events. E.g. they + may be called 'independent events' (because the handler is not a + member function on any webbox), 'global events' (because they are + handled globally and before any page construction has started), + 'switches' or 'conditionals' (because they usually switch on some + conditions and decide which page to construct), etc. + --------------------------------------------------------------- + --------------------------------------------------------------- + --------------------------------------------------------------- + --------------------------------------------------------------- + --------------------------------------------------------------- + --------------------------------------------------------------- + --------------------------------------------------------------- + --------------------------------------------------------------- + --------------------------------------------------------------- + --------------------------------------------------------------- --------------------------------------------------------------- Index: ToDo.txt =================================================================== RCS file: /cvsroot/phpwebapp/web_app/doc/ToDo.txt,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** ToDo.txt 4 Aug 2003 12:06:13 -0000 1.4 --- ToDo.txt 30 Sep 2003 07:11:20 -0000 1.5 *************** *** 359,362 **** --- 359,366 ---- {{class_name}} to {{Class}} + - {{CurrentRecNr}} to {{RecNr}} + {{CurrentRowNr}} to {{RowNr}} + etc. + - Rename path constants from 'XYZ_PATH' to 'XYZ/'. (!?) *************** *** 370,382 **** like this. (Why is it better? Does it have any disadvantages?) ------------------------------------------------------------- ! * Improve the structure of the framework and the application so ! that two independent applications can comunicate easily with ! each other. E.g. one of the applications can include the other ! (like a webbox that can include another webbox) and both of them ! work independently in the same window. One of the applications ! can check or modify the state of the other application, can ! modify its behaviour, can use its resources (images, templates, ! etc.), etc. Such a capability would be useful for applications like "browse", --- 374,394 ---- like this. (Why is it better? Does it have any disadvantages?) + + - Find another name (terminology) for free events. E.g. they may be + called 'independent events' (because the handler is not a member + function on any webbox), 'global events' (because they are handled + globally and before any page construction has started), 'switches' + or 'conditionals' (because they usually switch on some conditions + and decide which page to construct), etc. + ------------------------------------------------------------- ! ! * Improve the structure of the framework and the application so that ! two independent applications can comunicate easily with each ! other. E.g. one of the applications can include the other (like a ! webbox that can include another webbox) and both of them work ! independently in the same window. One of the applications can check ! or modify the state of the other application, can modify its ! behaviour, can use its resources (images, templates, etc.), etc. Such a capability would be useful for applications like "browse", |
From: Dashamir H. <das...@us...> - 2003-09-30 07:07:02
|
Update of /cvsroot/phpwebapp/top10/docs In directory sc8-pr-cvs1:/tmp/cvs-serv19176/docs Modified Files: ToDo.txt Log Message: Index: ToDo.txt =================================================================== RCS file: /cvsroot/phpwebapp/top10/docs/ToDo.txt,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** ToDo.txt 26 Sep 2003 15:32:21 -0000 1.4 --- ToDo.txt 30 Sep 2003 07:06:58 -0000 1.5 *************** *** 1,27 **** ! * - Add the admin mode. ! * - Add the possibility to delete a comment (only admin, ! or owner of the comment with confirmation). ! * - Add the possibility to delete a project or ! to add a new project (only admin). ! * - Install it in SF (together with the DB) and contact SF support ! for further help (filling the database with the relevant data). ! Add a link from phpWebApp page to Top10 page. - Write a script that is executed periodically and updates the status of old pending requests to 'expired'. ! - Make periodic backups for the database. ! - Check for malicious requests. Username is given by the user ! and sometimes the project id as well; check their values so ! that it is not possible for them to have a malicious value. - If a user makes another request without confirming the first one, invalidate the first request. ! - Using browse.php everybody can read the password of the database ! and any other sensitive information. Find out how to fix this. --- 1,49 ---- ! - At 'List of Projects' there will be a button 'Add New Project', ! so that anybody can add a new project and its details. However ! this newly added project will have the status 'new' and will not ! be listed until the admin approves it and its status is changed ! to approved. So, there should be a way for admin to list only ! the newly added projects. Also, he should be notified (by email) ! whenever a new project is added. ! - The admin can also delete a new project or any other project. ! He can do this either from the list of projects or from the project ! details. ! - Only admin can edit the details of a project or he can pass the ! right to edit it to another person, by sending him by e-mail ! a confirmation url. ! - A comment can be deleted only by the user who submited it ! (sending him a confirmation e-mail). ! A comment can also be deleted by the admin. ! ! - Check for malicious requests. Username is given by the user ! and sometimes the project id as well; check their values so ! that it is not possible for them to have a malicious value. - Write a script that is executed periodically and updates the status of old pending requests to 'expired'. ! - Using browse.php everybody can read the password of the database ! and any other sensitive information. Find out how to fix this. ! - Make periodic backups for the database. - If a user makes another request without confirming the first one, invalidate the first request. ! - Keep the count of the comments when a new comment is added or ! deleted. ! - Add the field 'subject' (or 'title') in the table 'comments'. ! ! ------------------------------------------------------------------ ! ! - Finish Top10 and fill the database with the relevant data ! (also with the help of SF team). ! ! - Add a link from phpWebApp page to Top10 page. ! ! - Send a notification message to SF users about it. ! |
From: Dashamir H. <das...@us...> - 2003-09-30 07:06:06
|
Update of /cvsroot/phpwebapp/top10/templates/edit_project In directory sc8-pr-cvs1:/tmp/cvs-serv19008/templates/edit_project Added Files: edit_project.php edit_project.js edit_project.html edit_project.db edit_project.css Log Message: Adding a new project and modifying the data of an existing project. --- NEW FILE: edit_project.php --- <?php /* This file is part of Top10. Top10 is a web application for ranking and evaluating web application projects at SourceForge. Copyright 2003 Dashamir Hoxha, das...@us... Top10 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. Top10 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 Top10; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ include_once FORM_PATH."formWebObj.php"; class edit_project extends formWebObj { function init() { $this->addSVar("mode", "add"); //it can be 'add' or 'edit' $this->addSVar("proj_id", UNDEFINED); } function on_add($event_args) { //make sure that the given proj_id is unique $proj_id = $event_args["proj_id"]; $rs = WebApp::openRS("check_proj_id", compact("proj_id")); if (!$rs->EOF()) //there is another project with this id { $msg = "Another project with unix name '$proj_id' is already " . "registered.\n" . "Please change the unix name of the project, or, if you think " . "that there is \n" . "something wrong, contact the admin at '".ADMIN_EMAIL."'."; WebApp::message($msg); return; } //insert the project and change the mode of the webbox WebApp::execDBCmd("insert_project", $event_args); //ToDo: insert also the project members $this->setSVar("proj_id", $proj_id); $this->setSVar("mode", "edit"); } function on_save($event_args) { $proj_id = $this->getSVar("proj_id"); if ($proj_id != $event_args["proj_id"]) { $msg = "You cannot change the project unix name"; WebApp::message($msg); return; } //... } function on_done($event_args) { } function onRender() { $mode = $this->getSVar("mode"); if ($mode=="add") { $tpl_vars = array( "proj_id" => "", "proj_name" => "", "group_id" => "", "register_date" => date("Y-m-d"), "license" => "GPL", "prog_lang" => "PHP", "category" => "", "members" => "usr1,usr2,usr3", "proj_descr" => "" ); WebApp::addVars($tpl_vars); } else if ($mode=="edit") { $rs = WebApp::openRS("get_project"); WebApp::addVars($rs->Fields()); } } } ?> --- NEW FILE: edit_project.js --- // -*-C-*- //tell emacs to use C mode function add_project() { save_project('add'); } function cancel_adding() { select_tab('proj_list'); } function save_project(event_name) { if (event_name==null) event_name = "save"; var form = document.edit_project; //collect all the input in the form var event_args = getEventArgs(form); //save the input entered in the form, even if it is not //inserted in DB (e.g. because of any error) saveFormData(form); SendEvent("edit_project", event_name, event_args); } function done_editing() { var msg = "This project will be added in the list\n" + "after it is approved by the admin.\n" + "You will not be able to modify it anymore."; if (!confirm(msg)) return; if (!no_empty_fields()) save_project('done'); } function no_empty_fields() { var form = document.edit_project; var elem; for (i=0; form.elements[i]; i++) { elem = form.elements[i]; if (elem.value=='') { alert("Please fill the field '"+elem.name+"'."); eval('form.'+elem.name+'.select()'); return false; } } return true; } --- NEW FILE: edit_project.html --- <WebBox ID="edit_project"> <If condition="'{{mode}}'=='add'"> <h2>Add New Project</h2> </If> <If condition="'{{mode}}'=='edit'"> <h2>Project: <a href="http://sourceforge.net/projects/{{proj_id}}" target="_blank">{{proj_name}} ({{proj_id}})</a></h2> </If> <form name="edit_project" onsubmit="return false;"> <table cellspacing="1" cellpadding="2" bgcolor="#dddddd"> <tr> <td bgcolor="eeeeee">Project Unix Name:</td> <td bgcolor="#ffffff"> <input type="text" size="30" name="proj_id" value="{{proj_id}}" onfocus="select()"> </td> </tr> <tr> <td bgcolor="eeeeee">Project Name:</td> <td bgcolor="#ffffff"> <input type="text" size="70" name="proj_name" value="{{proj_name}}" onfocus="select()"> </td> </tr> <tr> <td bgcolor="eeeeee">SourceForge group id:</td> <td bgcolor="#ffffff"> <input type="text" size="30" name="group_id" value="{{group_id}}" onfocus="select()"> </td> </tr> <tr> <td bgcolor="eeeeee">Register Date:</td> <td bgcolor="#ffffff"> <input type="text" size="12" name="register_date" value="{{register_date}}" onfocus="select()"> </td> </tr> <tr> <td bgcolor="eeeeee">License:</td> <td bgcolor="#ffffff"> <input type="text" size="70" name="license" value="{{license}}" onfocus="select()"> </td> </tr> <tr> <td bgcolor="eeeeee">Language:</td> <td bgcolor="#ffffff"> <input type="text" size="30" name="prog_lang" value="{{prog_lang}}"> </td> </tr> <tr> <td bgcolor="eeeeee">Category:</td> <td bgcolor="#ffffff"> <input type="text" size="70" name="category" value="{{category}}" onfocus="select()"> </td> </tr> <tr> <td bgcolor="eeeeee">Members:</td> <td bgcolor="#ffffff"> <input type="text" size="70" name="members" value="{{members}}" onfocus="select()"> </td> </tr> <tr> <td bgcolor="eeeeee">Description:</td> <td bgcolor="#ffffff"> <textarea name="proj_descr" cols="70" rows="4" onfocus="select()">{{proj_descr}}</textarea> </td> </tr> </table> </form> <br> <If condition="'{{mode}}'=='add'"> <a class="button" href="javascript:add_project()">Add</a> <a class="button" href="javascript:cancel_adding()">Cancel</a> </If> <If condition="'{{mode}}'=='edit'"> <a class="button" href="javascript:save_project()">Save</a> <a class="button" href="javascript:done_editing()">Done</a> </If> <hr> </WebBox> --- NEW FILE: edit_project.db --- <!--# -*-SQL-*- #tell emacs to use SQL mode #--> <Recordset ID="get_project"> <Query> SELECT * FROM proj_list WHERE proj_id = '{{edit_project->proj_id}}' </Query> </Recordset> <Recordset ID="check_proj_id"> <Query> SELECT proj_id FROM proj_list WHERE proj_id = '{{proj_id}}' </Query> </Recordset> <dbCommand ID="insert_project"> <Query> INSERT INTO proj_list SET proj_id = '{{proj_id}}', proj_name = '{{proj_name}}', proj_descr = '{{proj_descr}}', category = '{{category}}', license = '{{license}}', prog_lang = '{{prog_lang}}', register_date = '{{register_date}}', group_id = '{{group_id}}', points = 0, nr_comments = 0, status = 'new' </Query> </dbCommand> <!--# --------------------------------- #--> <!--# members of the project #--> <Recordset ID="members"> <Query> SELECT username FROM proj_members WHERE proj_id = '{{proj_id}}' </Query> </Recordset> --- NEW FILE: edit_project.css --- input, textarea { border: none; font-family: arial, helvetica, sans-se; font-size: 12pt; color: #000044; } |
From: Dashamir H. <das...@us...> - 2003-09-30 07:06:06
|
Update of /cvsroot/phpwebapp/top10/templates In directory sc8-pr-cvs1:/tmp/cvs-serv19008/templates Modified Files: module.php Log Message: Adding a new project and modifying the data of an existing project. Index: module.php =================================================================== RCS file: /cvsroot/phpwebapp/top10/templates/module.php,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** module.php 24 Sep 2003 14:01:37 -0000 1.2 --- module.php 30 Sep 2003 07:06:02 -0000 1.3 *************** *** 31,34 **** --- 31,35 ---- } + /** Handles event 'proj_details' sent by proj_list. */ function on_proj_details($event_args) { *************** *** 40,43 **** --- 41,55 ---- } + /** Handles event 'add_new_project' sent by list_footer (of proj_list). */ + function on_add_new_project($event_args) + { + WebApp::setSVar("module", "edit_project"); + WebApp::setSVar("menu->selected", "proj_details"); + + WebApp::setSVar("edit_project->mode", "add"); + WebApp::setSVar("edit_project->proj_id", UNDEFINED); + } + + /** Handles event 'preference_list' sent by proj_details. */ function on_preference_list($event_args) { *************** *** 67,70 **** --- 79,85 ---- case "proj_details": $module_file = "proj_details/proj_details.html"; + break; + case "edit_project": + $module_file = "edit_project/edit_project.html"; break; case "preference_list": |
From: Dashamir H. <das...@us...> - 2003-09-30 07:03:18
|
Update of /cvsroot/phpwebapp/top10/templates/edit_project In directory sc8-pr-cvs1:/tmp/cvs-serv18575/templates/edit_project Log Message: Directory /cvsroot/phpwebapp/top10/templates/edit_project added to the repository |
From: Dashamir H. <das...@us...> - 2003-09-30 07:02:46
|
Update of /cvsroot/phpwebapp/top10/templates/proj_list/footer In directory sc8-pr-cvs1:/tmp/cvs-serv18460/templates/proj_list/footer Modified Files: list_footer.js list_footer.html Log Message: Index: list_footer.js =================================================================== RCS file: /cvsroot/phpwebapp/top10/templates/proj_list/footer/list_footer.js,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** list_footer.js 26 Sep 2003 15:32:20 -0000 1.2 --- list_footer.js 30 Sep 2003 07:02:41 -0000 1.3 *************** *** 21,24 **** --- 21,29 ---- */ + function add_new_project() + { + SendEvent("module", "add_new_project"); + } + function get_checked_projects() { *************** *** 65,74 **** uncheck_all_projects(); - } - - /** Used by admin to add new projects. */ - function add_project() - { - SendEvent("list_footer", "add"); } --- 70,73 ---- Index: list_footer.html =================================================================== RCS file: /cvsroot/phpwebapp/top10/templates/proj_list/footer/list_footer.html,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** list_footer.html 26 Sep 2003 15:32:20 -0000 1.2 --- list_footer.html 30 Sep 2003 07:02:41 -0000 1.3 *************** *** 26,33 **** <td align="right"> <If condition="'{{ADMIN}}'=='true'"> - <a class="button" href="javascript:add_project()">Add Project</a> - <a class="button" href="javascript:edit_selected()">Edit Selected</a> <a class="button" href="javascript:del_selected()">Delete Selected</a> </If> <a class="button" href="javascript:add_to_list()">Add to My List</a> </td> --- 26,33 ---- <td align="right"> <If condition="'{{ADMIN}}'=='true'"> <a class="button" href="javascript:del_selected()">Delete Selected</a> + <a class="button" href="javascript:edit_selected()">Edit Selected</a> </If> + <a class="button" href="javascript:add_new_project()">Add New Project</a> <a class="button" href="javascript:add_to_list()">Add to My List</a> </td> |
From: Dashamir H. <das...@us...> - 2003-09-30 07:01:00
|
Update of /cvsroot/phpwebapp/top10/templates In directory sc8-pr-cvs1:/tmp/cvs-serv18138/templates Modified Files: styles.css main.html Log Message: Added 'Best view with: Mozilla' Index: styles.css =================================================================== RCS file: /cvsroot/phpwebapp/top10/templates/styles.css,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** styles.css 23 Sep 2003 14:04:12 -0000 1.1.1.1 --- styles.css 30 Sep 2003 07:00:56 -0000 1.2 *************** *** 40,43 **** --- 40,59 ---- } + /* -------- footer -------------- */ + + .footer + { + margin: 0; + padding: 2px; + font-family: arial, helvetica, sans-se; + font-size: 10pt; + text-align: center; + text-decoration: none; + color: #aaaa99; + background-color: #eeeeee; + white-space: nowrap; + border: 1px solid #e4e4e4; + } + /* -------- button styles --------- */ Index: main.html =================================================================== RCS file: /cvsroot/phpwebapp/top10/templates/main.html,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** main.html 23 Sep 2003 14:04:12 -0000 1.1.1.1 --- main.html 30 Sep 2003 07:00:56 -0000 1.2 *************** *** 21,24 **** --- 21,33 ---- <Include SRC="{{./}}{{module_file}}" /> </WebBox> + + <table align="right" cellspacing="0" cellpadding="0" border="0"> + <tr> + <td class="footer"> + Best viewed with: + <a href="http://www.mozilla.org/" target="_blank">Mozilla</a> + </td> + </tr> + </table> </body> </html> |
From: Dashamir H. <das...@us...> - 2003-09-30 06:59:32
|
Update of /cvsroot/phpwebapp/top10/templates/proj_details In directory sc8-pr-cvs1:/tmp/cvs-serv17794/templates/proj_details Modified Files: header.html Log Message: Index: header.html =================================================================== RCS file: /cvsroot/phpwebapp/top10/templates/proj_details/header.html,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** header.html 24 Sep 2003 14:00:49 -0000 1.1 --- header.html 30 Sep 2003 06:59:29 -0000 1.2 *************** *** 3,7 **** <If condition="'{{proj_id}}'=='UNDEFINED'"> <td> ! No project selected! Please enter a project in the project textbox. </td> </If> --- 3,8 ---- <If condition="'{{proj_id}}'=='UNDEFINED'"> <td> ! <h3>No project selected! ! Please enter a project in the project textbox.</h3> </td> </If> *************** *** 9,19 **** <If condition="'{{proj_id}}'<>'UNDEFINED'"> <td> ! <h2><a href="http://sourceforge.net/projects/{{proj_id}}" target="_blank">{{proj_name}}</a></h2> </td> </If> ! <td align="right" valign="bottom"> <form name="change" onsubmit="change_project(); return false;"> ! Project: <input id="proj_id" type="text" size="15" value="{{proj_id}}"> <a class="button" href="javascript:change_project()">Change</a> --- 10,20 ---- <If condition="'{{proj_id}}'<>'UNDEFINED'"> <td> ! <h2>Project: <a href="http://sourceforge.net/projects/{{proj_id}}" target="_blank">{{proj_name}}</a></h2> </td> </If> ! <td align="right" valign="bottom" nowrap> <form name="change" onsubmit="change_project(); return false;"> ! Project unix name: <input id="proj_id" type="text" size="15" value="{{proj_id}}"> <a class="button" href="javascript:change_project()">Change</a> |
From: Dashamir H. <das...@us...> - 2003-09-26 15:32:27
|
Update of /cvsroot/phpwebapp/top10/templates/preference_list In directory sc8-pr-cvs1:/tmp/cvs-serv4736/templates/preference_list Modified Files: preference_list.php preference_list.html Log Message: Index: preference_list.php =================================================================== RCS file: /cvsroot/phpwebapp/top10/templates/preference_list/preference_list.php,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** preference_list.php 25 Sep 2003 06:51:26 -0000 1.2 --- preference_list.php 26 Sep 2003 15:32:21 -0000 1.3 *************** *** 84,88 **** //send a confirmation request e-mail $username = WebApp::getSVar("username"); ! $to = $username."@users.sourceforge.net"; $subject = "Top10: Confirmation Required"; $message = $this->get_message_body($request_id); --- 84,89 ---- //send a confirmation request e-mail $username = WebApp::getSVar("username"); ! //$to = $username."@users.sourceforge.net"; ! $to = "dasho"; $subject = "Top10: Confirmation Required"; $message = $this->get_message_body($request_id); Index: preference_list.html =================================================================== RCS file: /cvsroot/phpwebapp/top10/templates/preference_list/preference_list.html,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** preference_list.html 23 Sep 2003 14:04:14 -0000 1.1.1.1 --- preference_list.html 26 Sep 2003 15:32:21 -0000 1.2 *************** *** 16,20 **** </Header> <RepeatBody> ! <Var name="bgcolor">({{CurrentRecNr}} % 2 ? "#eeeee6" : "#f8f8ff")</Var> <tr bgcolor="{{bgcolor}}"> <td width="2%" align="center"> --- 16,20 ---- </Header> <RepeatBody> ! <Var name="bgcolor">({{CurrentRowNr}} % 2 ? "#eeeee6" : "#f8f8ff")</Var> <tr bgcolor="{{bgcolor}}"> <td width="2%" align="center"> |
From: Dashamir H. <das...@us...> - 2003-09-26 15:32:27
|
Update of /cvsroot/phpwebapp/top10/docs In directory sc8-pr-cvs1:/tmp/cvs-serv4736/docs Modified Files: ToDo.txt Log Message: Index: ToDo.txt =================================================================== RCS file: /cvsroot/phpwebapp/top10/docs/ToDo.txt,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** ToDo.txt 25 Sep 2003 06:51:27 -0000 1.3 --- ToDo.txt 26 Sep 2003 15:32:21 -0000 1.4 *************** *** 1,10 **** ! * - Add comments to "Project Details" and finish it. ! - Add the possibility to delete a comment (only owner ! of the comment or admin, with confirmation). * - Add the possibility to delete a project or to add a new project (only admin). - Maybe it is useful to add the admin mode. * - Install it in SF (together with the DB) and contact SF support --- 1,10 ---- ! * - Add the admin mode. ! ! * - Add the possibility to delete a comment (only admin, ! or owner of the comment with confirmation). * - Add the possibility to delete a project or to add a new project (only admin). * - Install it in SF (together with the DB) and contact SF support *************** *** 12,19 **** Add a link from phpWebApp page to Top10 page. - - Write a script that is executed periodically and updates the status of old pending requests to 'expired'. - Check for malicious requests. Username is given by the user and sometimes the project id as well; check their values so --- 12,20 ---- Add a link from phpWebApp page to Top10 page. - Write a script that is executed periodically and updates the status of old pending requests to 'expired'. + - Make periodic backups for the database. + - Check for malicious requests. Username is given by the user and sometimes the project id as well; check their values so *************** *** 23,25 **** one, invalidate the first request. ! --- 24,27 ---- one, invalidate the first request. ! - Using browse.php everybody can read the password of the database ! and any other sensitive information. Find out how to fix this. |
From: Dashamir H. <das...@us...> - 2003-09-26 15:32:26
|
Update of /cvsroot/phpwebapp/top10/templates/confirm In directory sc8-pr-cvs1:/tmp/cvs-serv4736/templates/confirm Modified Files: confirm.php Log Message: Index: confirm.php =================================================================== RCS file: /cvsroot/phpwebapp/top10/templates/confirm/confirm.php,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** confirm.php 23 Sep 2003 14:04:14 -0000 1.1.1.1 --- confirm.php 26 Sep 2003 15:32:21 -0000 1.2 *************** *** 51,55 **** $error_msg "; ! mail(ADMIN, "Top10: Error", $message_body); } --- 51,55 ---- $error_msg "; ! mail(ADMIN_EMAIL, "Top10: Error", $message_body); } *************** *** 88,92 **** $msg = "This request has been already completed.\n" . "If you think that there is something wrong,\n" ! . "please e-mail the admin at: '".ADMIN."'."; WebApp::message($msg); break; --- 88,92 ---- $msg = "This request has been already completed.\n" . "If you think that there is something wrong,\n" ! . "please e-mail the admin at: '".ADMIN_EMAIL."'."; WebApp::message($msg); break; |
From: Dashamir H. <das...@us...> - 2003-09-26 15:32:26
|
Update of /cvsroot/phpwebapp/top10 In directory sc8-pr-cvs1:/tmp/cvs-serv4736 Modified Files: global.php Log Message: Index: global.php =================================================================== RCS file: /cvsroot/phpwebapp/top10/global.php,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** global.php 25 Sep 2003 06:51:27 -0000 1.2 --- global.php 26 Sep 2003 15:32:21 -0000 1.3 *************** *** 9,12 **** /** E-mail of the admin of Top10. */ ! define("ADMIN", "das...@us..."); ?> --- 9,13 ---- /** E-mail of the admin of Top10. */ ! //define("ADMIN_EMAIL", "das...@us..."); ! define("ADMIN_EMAIL", "dasho"); ?> |
From: Dashamir H. <das...@us...> - 2003-09-26 15:32:26
|
Update of /cvsroot/phpwebapp/top10/templates/proj_list/footer In directory sc8-pr-cvs1:/tmp/cvs-serv4736/templates/proj_list/footer Modified Files: list_footer.js list_footer.html Log Message: Index: list_footer.js =================================================================== RCS file: /cvsroot/phpwebapp/top10/templates/proj_list/footer/list_footer.js,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** list_footer.js 23 Sep 2003 14:04:14 -0000 1.1.1.1 --- list_footer.js 26 Sep 2003 15:32:20 -0000 1.2 *************** *** 67,72 **** } ! /* ! function approve_selected() { var selected = get_checked_projects(); --- 67,78 ---- } ! /** Used by admin to add new projects. */ ! function add_project() ! { ! SendEvent("list_footer", "add"); ! } ! ! /** Used by admin to modify the data of the projects. */ ! function edit_selected() { var selected = get_checked_projects(); *************** *** 76,83 **** return; } ! SendEvent("list_footer", "approve", "selected="+selected); } ! function delete_selected() { var selected = get_checked_projects(); --- 82,90 ---- return; } ! SendEvent("list_footer", "edit", "selected="+selected); } ! /** Used by admin to delete projects. */ ! function del_selected() { var selected = get_checked_projects(); *************** *** 89,96 **** SendEvent("list_footer", "delete", "selected="+selected); } - - function approve_all() - { - SendEvent("list_footer", "approve_all"); - } - */ --- 96,97 ---- Index: list_footer.html =================================================================== RCS file: /cvsroot/phpwebapp/top10/templates/proj_list/footer/list_footer.html,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** list_footer.html 23 Sep 2003 14:04:14 -0000 1.1.1.1 --- list_footer.html 26 Sep 2003 15:32:20 -0000 1.2 *************** *** 25,35 **** </td> <td align="right"> ! <!--# ! <If condition="{{new}}"> ! <a class="button" href="javascript:approve_all()">Approve All</a> ! <a class="button" href="javascript:approve_selected()">Approve Selected</a> </If> - <a class="button" href="javascript:delete_selected()">Delete Selected</a> - #--> <a class="button" href="javascript:add_to_list()">Add to My List</a> </td> --- 25,33 ---- </td> <td align="right"> ! <If condition="'{{ADMIN}}'=='true'"> ! <a class="button" href="javascript:add_project()">Add Project</a> ! <a class="button" href="javascript:edit_selected()">Edit Selected</a> ! <a class="button" href="javascript:del_selected()">Delete Selected</a> </If> <a class="button" href="javascript:add_to_list()">Add to My List</a> </td> |
From: Dashamir H. <das...@us...> - 2003-09-26 15:32:25
|
Update of /cvsroot/phpwebapp/top10/templates/proj_details In directory sc8-pr-cvs1:/tmp/cvs-serv4736/templates/proj_details Modified Files: proj_details.html Log Message: Index: proj_details.html =================================================================== RCS file: /cvsroot/phpwebapp/top10/templates/proj_details/proj_details.html,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** proj_details.html 25 Sep 2003 15:50:26 -0000 1.3 --- proj_details.html 26 Sep 2003 15:32:20 -0000 1.4 *************** *** 3,7 **** <If condition="'{{proj_id}}'<>'UNDEFINED'"> ! <table cellspacing="1" cellpadding="2" bgcolor="#dddddd"> <tr> <td bgcolor="eeeeee" nowrap>General Info:</td> --- 3,7 ---- <If condition="'{{proj_id}}'<>'UNDEFINED'"> ! <table width="100%" cellspacing="1" cellpadding="2" bgcolor="#dddddd"> <tr> <td bgcolor="eeeeee" nowrap>General Info:</td> |
From: Dashamir H. <das...@us...> - 2003-09-26 15:32:25
|
Update of /cvsroot/phpwebapp/top10/templates/proj_list In directory sc8-pr-cvs1:/tmp/cvs-serv4736/templates/proj_list Modified Files: proj_list.php Log Message: Index: proj_list.php =================================================================== RCS file: /cvsroot/phpwebapp/top10/templates/proj_list/proj_list.php,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** proj_list.php 24 Sep 2003 14:01:36 -0000 1.2 --- proj_list.php 26 Sep 2003 15:32:20 -0000 1.3 *************** *** 23,31 **** class proj_list extends WebObject { - function init() - { - $this->addSVar("new", "true"); - } - function onRender() { --- 23,26 ---- |
From: Dashamir H. <das...@us...> - 2003-09-26 15:31:17
|
Update of /cvsroot/phpwebapp/top10/templates/admin/login In directory sc8-pr-cvs1:/tmp/cvs-serv4498/templates/admin/login Added Files: on.login.php login.js login.html login.css Log Message: Admin mode and authentication for the admin. --- NEW FILE: on.login.php --- <?php /* This file is part of Top10. Top10 is a web application for ranking and evaluating web application projects at SourceForge. Copyright 2003 Dashamir Hoxha, das...@us... Top10 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. Top10 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 Top10; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ $valid_user = validate_user($username, $password); if (!$valid_user) { //the user is not authenticated, go to the login page $event->targetPage = "admin/login/login.html"; WebApp::message("Wrong username or password!"); } else { //open the main page $event->targetPage = "main.html"; //$event->target = "main"; //$event->name = "login"; } /** * Checks if the given username and password are valid. * Returns true or false. */ function validate_user() { global $event; $username = $event->args["username"]; $password = $event->args["password"]; if ($username=='admin' and $password=='@dm|n') return true; else return false; } ?> --- NEW FILE: login.js --- // -*-C-*- //tell emacs to use C mode function log_in() { var form = document.login; var username = form.username.value; var password = form.password.value; var event_args = "username=" + username + ";" + "password=" + password; //send the event login to the framework //GoTo('thisPage?event=none.EvtLogin(username='+usr+';password='+pass+')'); SendEvent("none", "login", event_args); } --- NEW FILE: login.html --- <html> <head> <title>Top 10 Web Application Projects</title> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> <link rel="stylesheet" href="{{TPL_URL}}styles.css" type="text/css"> <link rel="stylesheet" href="{{./}}login.css" type="text/css"> <script language="javascript" src="{{./}}login.js"></script> </head> <body> <center> <form name="login" onsubmit="log_in(); return false;"> <table class="login_box" border="0" cellpadding="2"> <tr> <td colspan="2"><hr></td> </tr> <tr> <td nowrap><b>Username:</b></td> <td> <input type="text" name="username" size="15" maxlength="20" class="styletextbox"> </td> </tr> <tr> <td nowrap><b>Password:</b></td> <td> <input type="password" name="password" size="15" maxlength="20" class="styletextbox"> </td> </tr> <tr> <td colspan="2"><hr></td> </tr> <tr> <td colspan="2" align="center"> <a class="button" href="javascript:log_in()">Log In</a> </td> </tr> </table> </form> </center> </body> </html> --- NEW FILE: login.css --- body { margin: 10px; text-align: center; font-size: 8px; } .login_box { margin: 30px; padding: 20px; background-color: #f3f3f3; border: 1px solid #e3e3e3; } hr { border: 1px solid #f3f3f3; background-color: #aaaaaa } input { border: 1px solid #aaaaaa; } |
From: Dashamir H. <das...@us...> - 2003-09-26 15:31:17
|
Update of /cvsroot/phpwebapp/top10 In directory sc8-pr-cvs1:/tmp/cvs-serv4498 Added Files: admin.php Log Message: Admin mode and authentication for the admin. --- NEW FILE: admin.php --- <?php /* This file is part of Top10. */ if (!isset($_POST["targetPage"])) { $_POST["targetPage"] = "admin/login/login.html"; } define("ADMIN", "true"); include_once "index.php"; ?> |
From: Dashamir H. <das...@us...> - 2003-09-26 15:28:17
|
Update of /cvsroot/phpwebapp/top10/templates/admin/login In directory sc8-pr-cvs1:/tmp/cvs-serv3886/templates/admin/login Log Message: Directory /cvsroot/phpwebapp/top10/templates/admin/login added to the repository |
From: Dashamir H. <das...@us...> - 2003-09-26 15:27:15
|
Update of /cvsroot/phpwebapp/top10/templates/admin In directory sc8-pr-cvs1:/tmp/cvs-serv3727/templates/admin Log Message: Directory /cvsroot/phpwebapp/top10/templates/admin added to the repository |
From: Dashamir H. <das...@us...> - 2003-09-25 15:50:30
|
Update of /cvsroot/phpwebapp/top10/templates/proj_details/comments In directory sc8-pr-cvs1:/tmp/cvs-serv4503/templates/proj_details/comments Modified Files: new_comment.html comments.php comments.html comments.db Added Files: comments.js Log Message: Adding comments. --- NEW FILE: comments.js --- // -*-C-*- //tell emacs to use C mode function send_comment() { var form = document.new_comment; var username = form.username.value; var subject = form.subject.value; var comment = form.comment.value; if (comment=='') { alert("Please enter a comment!"); form.comment.focus(); return; } if (subject=='') { var msg = "You did not specify a subject. Send the comment anyway?"; if (!confirm(msg)) { form.subject.focus(); return; } } var event_args = "username=" + username + ";" + "subject=" + subject + ";" + "comment=" + comment; SendEvent("comments", "add_comment", event_args); } Index: new_comment.html =================================================================== RCS file: /cvsroot/phpwebapp/top10/templates/proj_details/comments/new_comment.html,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** new_comment.html 24 Sep 2003 14:00:46 -0000 1.1 --- new_comment.html 25 Sep 2003 15:50:25 -0000 1.2 *************** *** 1,11 **** ! <table width="100%"> ! <tr> ! <td colspan="2">Submit a new comment:</td> ! </tr> ! <form> <tr> <td>Username:</td> <td> ! <input type="text" size="20" value="{{username}}"> </td> </tr> --- 1,9 ---- ! <h4>Add a new comment:</h4> ! <table width="100%" bgcolor="#e6e6ee"> ! <form name="new_comment" onsubmit="send_comment(); return false;"> <tr> <td>Username:</td> <td> ! <input type="text" name="username" value="{{username}}" size="20"> </td> </tr> *************** *** 13,17 **** <td>Subject:</td> <td> ! <input type="text" size="80"> </td> </tr> --- 11,15 ---- <td>Subject:</td> <td> ! <input type="text" name="subject" size="80"> </td> </tr> *************** *** 19,23 **** <td valign="top">Comment:</td> <td> ! <textarea rows="10" cols="70"></textarea> </td> </tr> --- 17,21 ---- <td valign="top">Comment:</td> <td> ! <textarea name="comment" rows="10" cols="70"></textarea> </td> </tr> *************** *** 25,29 **** <td></td> <td> ! <a class="button" href="">Submit</a> </td> </tr> --- 23,27 ---- <td></td> <td> ! <a class="button" href="javascript:send_comment()">Submit</a> </td> </tr> Index: comments.php =================================================================== RCS file: /cvsroot/phpwebapp/top10/templates/proj_details/comments/comments.php,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** comments.php 24 Sep 2003 14:00:47 -0000 1.1 --- comments.php 25 Sep 2003 15:50:26 -0000 1.2 *************** *** 2,7 **** class comments extends WebObject { ! function onRender() { } } --- 2,14 ---- class comments extends WebObject { ! function on_add_comment($event_args) { + $params = $event_args; + $params["date"] = date("Y-m-d"); + $params["ip"] = $_SERVER["REMOTE_ADDR"]; + $comment = $params["comment"]; + $allowed_tags = "<b><i><a><br><p><ol><ul><li><hr>"; + $params["comment"] = strip_tags($comment, $allowed_tags); + WebApp::execDBCmd("insert_comment", $params); } } Index: comments.html =================================================================== RCS file: /cvsroot/phpwebapp/top10/templates/proj_details/comments/comments.html,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** comments.html 24 Sep 2003 14:00:47 -0000 1.1 --- comments.html 25 Sep 2003 15:50:26 -0000 1.2 *************** *** 2,13 **** <Repeat rs="comment_list"> <IfEmpty> ! No comments submitted yet.<br> </IfEmpty> ! Username: {{username}}, Date: {{date}} <br> ! Comment: <br> ! {{comment}} ! <hr> </Repeat> - <br> <Include SRC="{{./}}new_comment.html" /> --- 2,37 ---- <Repeat rs="comment_list"> <IfEmpty> ! <h4>No comments submitted yet.</h4> </IfEmpty> ! <Header> ! <h4>Comments:</h4> ! <table width="100%" border="0" cellspacing="1"> ! </Header> ! <RepeatBody> ! <Var name="bgcolor1">({{CurrentRowNr}} % 2 ? "#ddddd6" : "#e6e6ee")</Var> ! <Var name="bgcolor2">({{CurrentRowNr}} % 2 ? "#eeeee6" : "#f6f6ff")</Var> ! <tr> ! <td bgcolor="#dddddd" width="1%" nowrap><b>{{username}}</b></td> ! <td bgcolor="{{bgcolor1}}"> ! <table width="100%" cellspacing="0" cellpadding="0" border="0"> ! <tr> ! <td><b>{{subject}}</b></td> ! <td align="right"> ! <a class="button" href="del_comment('{{comment_id}}')">X</a> ! </td> ! </tr> ! </table> ! </td> ! </tr> ! <tr> ! <td bgcolor="#e4e4e4" width="1%" nowrap valign="top">{{date}}</td> ! <td bgcolor="{{bgcolor2}}">{{comment}}</td> ! </tr> ! <tr bgcolor="#ffffff"><td></td></tr> ! </RepeatBody> ! <Footer> ! </table> ! </Footer> </Repeat> <Include SRC="{{./}}new_comment.html" /> Index: comments.db =================================================================== RCS file: /cvsroot/phpwebapp/top10/templates/proj_details/comments/comments.db,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** comments.db 24 Sep 2003 14:00:47 -0000 1.1 --- comments.db 25 Sep 2003 15:50:26 -0000 1.2 *************** *** 8,9 **** --- 8,22 ---- </Query> </Recordset> + + <dbCommand ID="insert_comment"> + <Query> + INSERT INTO comments + SET + proj_id = '{{proj_id}}', + username = '{{username}}', + comment = '{{comment}}', + date = '{{date}}', + ip = '{{ip}}' + </Query> + </dbCommand> + <!--# ToDo: add the field 'subject' #--> |
From: Dashamir H. <das...@us...> - 2003-09-25 15:50:30
|
Update of /cvsroot/phpwebapp/top10/templates/proj_details In directory sc8-pr-cvs1:/tmp/cvs-serv4503/templates/proj_details Modified Files: proj_details.html Log Message: Adding comments. Index: proj_details.html =================================================================== RCS file: /cvsroot/phpwebapp/top10/templates/proj_details/proj_details.html,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** proj_details.html 24 Sep 2003 14:01:36 -0000 1.2 --- proj_details.html 25 Sep 2003 15:50:26 -0000 1.3 *************** *** 41,45 **** </tr> </table> - <br><br> <Include SRC="{{./}}comments/comments.html" /> --- 41,44 ---- |
From: Dashamir H. <das...@us...> - 2003-09-25 06:51:32
|
Update of /cvsroot/phpwebapp/top10 In directory sc8-pr-cvs1:/tmp/cvs-serv3883 Modified Files: global.php Log Message: Index: global.php =================================================================== RCS file: /cvsroot/phpwebapp/top10/global.php,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** global.php 23 Sep 2003 14:04:12 -0000 1.1.1.1 --- global.php 25 Sep 2003 06:51:27 -0000 1.2 *************** *** 9,12 **** /** E-mail of the admin of Top10. */ ! define("ADMIN", "dasho"); ?> --- 9,12 ---- /** E-mail of the admin of Top10. */ ! define("ADMIN", "das...@us..."); ?> |
From: Dashamir H. <das...@us...> - 2003-09-25 06:51:32
|
Update of /cvsroot/phpwebapp/top10/docs In directory sc8-pr-cvs1:/tmp/cvs-serv3883/docs Modified Files: ToDo.txt Log Message: Index: ToDo.txt =================================================================== RCS file: /cvsroot/phpwebapp/top10/docs/ToDo.txt,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** ToDo.txt 24 Sep 2003 14:01:37 -0000 1.2 --- ToDo.txt 25 Sep 2003 06:51:27 -0000 1.3 *************** *** 16,20 **** status of old pending requests to 'expired'. ! - Check for malicious requests. - If a user makes another request without confirming the first --- 16,22 ---- status of old pending requests to 'expired'. ! - Check for malicious requests. Username is given by the user ! and sometimes the project id as well; check their values so ! that it is not possible for them to have a malicious value. - If a user makes another request without confirming the first |