| View previous topic :: View next topic |
| Author |
Message |
talz13 Tux's lil' helper


Joined: 08 Oct 2004 Posts: 77
|
Posted: Sat Nov 27, 2004 6:35 am Post subject: come critique my class project |
|
|
I just set up my gentoo server at home for use with apache, mod_python and postgresql to pretty much mirror the functionality of the server at school that we've been using. I just want to get a little test going of multi-user performance at this fairly early stage of development.
Anyway, it's a web based help-desk application, and while the back end is fairly developed, the front end (web page parts) are still pretty early in development.
Please check it out and (if it's working) let me know what you think. I'd like to know if there's any glaring security problems that you might find, and what would make the general page layout look good (anything that you'd change or add to any sections).
The create user functionality will be added soon in our class version of it (this is just my self-pirated modified copy that I'm running now ), so just use these couple default usernames and passwords:
username: FMuser1
password: madonion
username: FMuser2
password: madonion2
and one thing to note, there isn't really much error checking yet in the text entry fields (like the problem description in submit request). there's possibly enough to stop people from dropping my tables and the like, but not to check for other things that might cause errors when you submit. So if you get some errors, check and make sure you weren't entering funny characters like : ; / kinda stuff.
So anyway, without further ado, here's the link:
http://www.talz13.com/proj/UIhandler.psp
please note that this is hosted on a cable modem w/ 256k upload, so it might get slow if people actually visit _________________ Gentoo 2004.2 2.4.26-gentoo-r9 kernel
AXP 2100+
epox 8k5a3+
1024mb pc2100
120gb WD SE
GF4 TI4400
SBLive! x-gamer |
|
| Back to top |
|
 |
dvc5 Guru


Joined: 06 Dec 2003 Posts: 433 Location: Sunnyvale, California
|
Posted: Sat Nov 27, 2004 6:44 am Post subject: |
|
|
Site times out for me, is your DNS updated? _________________ #define NULL rand() /*heh heh heh */
Green Is Good |
|
| Back to top |
|
 |
talz13 Tux's lil' helper


Joined: 08 Oct 2004 Posts: 77
|
Posted: Sat Nov 27, 2004 6:45 am Post subject: |
|
|
it should be, my friends in northern ohio haven't had trouble with timeouts afaik _________________ Gentoo 2004.2 2.4.26-gentoo-r9 kernel
AXP 2100+
epox 8k5a3+
1024mb pc2100
120gb WD SE
GF4 TI4400
SBLive! x-gamer |
|
| Back to top |
|
 |
dvc5 Guru


Joined: 06 Dec 2003 Posts: 433 Location: Sunnyvale, California
|
Posted: Sat Nov 27, 2004 6:49 am Post subject: |
|
|
Working now, although you should probably handle the case where the user presses "search" w/out any entry:
| Code: | Mod_python error: "PythonHandler mod_python.psp"
Traceback (most recent call last):
File "/usr/lib/python2.3/site-packages/mod_python/apache.py", line 299, in HandlerDispatch
result = object(req)
File "/usr/lib/python2.3/site-packages/mod_python/psp.py", line 297, in handler
p.run()
File "/usr/lib/python2.3/site-packages/mod_python/psp.py", line 208, in run
exec code in global_scope
File "/var/www/localhost/htdocs/proj/UIhandler.psp", line 28, in ?
mover.getCmd(pageid)(req, form)
File "/var/www/localhost/htdocs/proj/lib/controller.py", line 175, in searchRequest
self.requestList = self.help.selectRequest(self.searchDict)
File "/var/www/localhost/htdocs/proj/lib/helpDesk.py", line 33, in selectRequest
return self.request.selectRequest(searchDict)
File "/var/www/localhost/htdocs/proj/lib/requestContainer.py", line 103, in selectRequest
self.requestDataList = self.handler.queryDB(self.queryString)
File "/var/www/localhost/htdocs/proj/lib/dbWork.py", line 21, in queryDB
self.cur.execute(query)
File "/usr/lib/python2.3/site-packages/pgdb.py", line 189, in execute
self.executemany(operation, (params,))
File "/usr/lib/python2.3/site-packages/pgdb.py", line 208, in executemany
raise DatabaseError, "error '%s' in '%s'" % ( msg, sql )
DatabaseError: error 'ERROR: syntax error at or near "ORDER" at character 30
' in 'SELECT * FROM request WHERE ORDER BY idNumber ASC ;' |
_________________ #define NULL rand() /*heh heh heh */
Green Is Good |
|
| Back to top |
|
 |
talz13 Tux's lil' helper


Joined: 08 Oct 2004 Posts: 77
|
Posted: Sat Nov 27, 2004 6:53 am Post subject: |
|
|
there we go, i think i fixed that one. That was the result of a debugging section that was in there, where the if was:
| Code: |
if self.counter > -10:
self.queryString = ('').join(self.selectStringList)
#print( self.queryString )
self.requestDataList = self.handler.queryDB(self.queryString)
return self.generateRequestList(self.requestDataList)
|
where self.counter started off at 0, and only incremented. It was just a silly way to bypass the conditional _________________ Gentoo 2004.2 2.4.26-gentoo-r9 kernel
AXP 2100+
epox 8k5a3+
1024mb pc2100
120gb WD SE
GF4 TI4400
SBLive! x-gamer |
|
| Back to top |
|
 |
RedDawn Guru


Joined: 22 Sep 2003 Posts: 368 Location: Los Angeles, California
|
Posted: Sat Nov 27, 2004 7:03 am Post subject: |
|
|
Mod_python error: "PythonHandler mod_python.psp"
Traceback (most recent call last):
File "/usr/lib/python2.3/site-packages/mod_python/apache.py", line 299, in HandlerDispatch
result = object(req)
File "/usr/lib/python2.3/site-packages/mod_python/psp.py", line 297, in handler
p.run()
File "/usr/lib/python2.3/site-packages/mod_python/psp.py", line 208, in run
exec code in global_scope
File "/var/www/localhost/htdocs/proj/UIhandler.psp", line 28, in ?
mover.getCmd(pageid)(req, form)
File "/var/www/localhost/htdocs/proj/lib/controller.py", line 176, in searchRequest
self.requestList = self.help.selectRequest(self.searchDict)
File "/var/www/localhost/htdocs/proj/lib/helpDesk.py", line 33, in selectRequest
return self.request.selectRequest(searchDict)
File "/var/www/localhost/htdocs/proj/lib/requestContainer.py", line 103, in selectRequest
self.requestDataList = self.handler.queryDB(self.queryString)
File "/var/www/localhost/htdocs/proj/lib/dbWork.py", line 21, in queryDB
self.cur.execute(query)
File "/usr/lib/python2.3/site-packages/pgdb.py", line 189, in execute
self.executemany(operation, (params,))
File "/usr/lib/python2.3/site-packages/pgdb.py", line 208, in executemany
raise DatabaseError, "error '%s' in '%s'" % ( msg, sql )
DatabaseError: error 'ERROR: syntax error at or near "idNumber" at character 96
' in 'SELECT * FROM request WHERE originator = 'FMuser1' AND priority = 'High' AND queue = '1' idNumber = 1123 AND closeStatus = '0' AND owner = 'FMuser2' AND doneStatus = '0' AND dueDate = '2004/11/' ORDER BY idNumber ASC ;'
i typed all this stuff and when i press search.. BOOM!!! |
|
| Back to top |
|
 |
talz13 Tux's lil' helper


Joined: 08 Oct 2004 Posts: 77
|
Posted: Sat Nov 27, 2004 7:24 am Post subject: |
|
|
| RedDawn wrote: |
DatabaseError: error 'ERROR: syntax error at or near "idNumber" at character 96
' in 'SELECT * FROM request WHERE originator = 'FMuser1' AND priority = 'High' AND queue = '1' idNumber = 1123 AND closeStatus = '0' AND owner = 'FMuser2' AND doneStatus = '0' AND dueDate = '2004/11/' ORDER BY idNumber ASC ;'
i typed all this stuff and when i press search.. BOOM!!! |
woo, more stuff hopefully fixed. This is the kind of stuff that I'm looking for. You get many more eyes looking at the project, and every little fault starts coming to the surface!
thanks for the notes so far, and keep checking it everybody! I wanna break this thing! (cuz then i can fix it, and it'll make it better ) _________________ Gentoo 2004.2 2.4.26-gentoo-r9 kernel
AXP 2100+
epox 8k5a3+
1024mb pc2100
120gb WD SE
GF4 TI4400
SBLive! x-gamer |
|
| Back to top |
|
 |
talz13 Tux's lil' helper


Joined: 08 Oct 2004 Posts: 77
|
Posted: Sat Nov 27, 2004 5:26 pm Post subject: |
|
|
just a little bump.
Still looking for testing, go do whatever you want on it and let me know if it breaks on anything. It seems to be doing better since I fixed those few areas that were brought up in this thread, but I'm sure there is still much left to do _________________ Gentoo 2004.2 2.4.26-gentoo-r9 kernel
AXP 2100+
epox 8k5a3+
1024mb pc2100
120gb WD SE
GF4 TI4400
SBLive! x-gamer |
|
| Back to top |
|
 |
brenden l33t


Joined: 09 Mar 2004 Posts: 710 Location: Calgary, AB
|
Posted: Sat Nov 27, 2004 5:31 pm Post subject: |
|
|
Entered junk in search fields and voila:
| Code: | Mod_python error: "PythonHandler mod_python.psp"
Traceback (most recent call last):
File "/usr/lib/python2.3/site-packages/mod_python/apache.py", line 299, in HandlerDispatch
result = object(req)
File "/usr/lib/python2.3/site-packages/mod_python/psp.py", line 297, in handler
p.run()
File "/usr/lib/python2.3/site-packages/mod_python/psp.py", line 208, in run
exec code in global_scope
File "/var/www/localhost/htdocs/proj/UIhandler.psp", line 28, in ?
mover.getCmd(pageid)(req, form)
File "/var/www/localhost/htdocs/proj/lib/controller.py", line 176, in searchRequest
self.requestList = self.help.selectRequest(self.searchDict)
File "/var/www/localhost/htdocs/proj/lib/helpDesk.py", line 33, in selectRequest
return self.request.selectRequest(searchDict)
File "/var/www/localhost/htdocs/proj/lib/requestContainer.py", line 63, in selectRequest
self.selectStringList.append( self.strings.SELECTID % (int(selectionData[each])) )
ValueError: invalid literal for int(): kjh |
|
|
| Back to top |
|
 |
maxima Apprentice

Joined: 01 Oct 2004 Posts: 150
|
Posted: Sat Nov 27, 2004 5:32 pm Post subject: |
|
|
change priority to medium
and originator to FMuser1
and search
| Code: | Mod_python error: "PythonHandler mod_python.psp"
Traceback (most recent call last):
File "/usr/lib/python2.3/site-packages/mod_python/apache.py", line 299, in HandlerDispatch
result = object(req)
File "/usr/lib/python2.3/site-packages/mod_python/psp.py", line 297, in handler
p.run()
File "/usr/lib/python2.3/site-packages/mod_python/psp.py", line 208, in run
exec code in global_scope
File "/var/www/localhost/htdocs/proj/UIhandler.psp", line 28, in ?
mover.getCmd(pageid)(req, form)
File "/var/www/localhost/htdocs/proj/lib/controller.py", line 176, in searchRequest
self.requestList = self.help.selectRequest(self.searchDict)
File "/var/www/localhost/htdocs/proj/lib/helpDesk.py", line 33, in selectRequest
return self.request.selectRequest(searchDict)
File "/var/www/localhost/htdocs/proj/lib/requestContainer.py", line 113, in selectRequest
self.requestDataList = self.handler.queryDB(self.queryString)
File "/var/www/localhost/htdocs/proj/lib/dbWork.py", line 21, in queryDB
self.cur.execute(query)
File "/usr/lib/python2.3/site-packages/pgdb.py", line 189, in execute
self.executemany(operation, (params,))
File "/usr/lib/python2.3/site-packages/pgdb.py", line 208, in executemany
raise DatabaseError, "error '%s' in '%s'" % ( msg, sql )
DatabaseError: error 'ERROR: syntax error at or near "originator" at character 51
' in 'SELECT * FROM request WHERE priority = 'Medium' originator = 'FMuser1' ORDER BY idNumber ASC ;' |
|
|
| Back to top |
|
 |
brenden l33t


Joined: 09 Mar 2004 Posts: 710 Location: Calgary, AB
|
Posted: Sat Nov 27, 2004 5:34 pm Post subject: |
|
|
Did some more messing around with closing/opening and marking finished/unfinished and voila:
| Code: | Mod_python error: "PythonHandler mod_python.psp"
Traceback (most recent call last):
File "/usr/lib/python2.3/site-packages/mod_python/apache.py", line 299, in HandlerDispatch
result = object(req)
File "/usr/lib/python2.3/site-packages/mod_python/psp.py", line 297, in handler
p.run()
File "/usr/lib/python2.3/site-packages/mod_python/psp.py", line 208, in run
exec code in global_scope
File "/var/www/localhost/htdocs/proj/UIhandler.psp", line 28, in ?
mover.getCmd(pageid)(req, form)
File "/var/www/localhost/htdocs/proj/lib/controller.py", line 261, in viewRequest
self.queues = self.help.makeQueueList()
File "/var/www/localhost/htdocs/proj/lib/helpDesk.py", line 57, in makeQueueList
return self.drop.makeQueueList()
File "/var/www/localhost/htdocs/proj/lib/dropDown.py", line 25, in makeQueueList
self.queueList = self.container.selectQueue()
File "/var/www/localhost/htdocs/proj/lib/queueContainer.py", line 23, in selectQueue
self.handler = dbWork.dbWork()
File "/var/www/localhost/htdocs/proj/lib/dbWork.py", line 7, in __init__
self.db = connectDB.connectDB()
File "/var/www/localhost/htdocs/proj/lib/connectDB.py", line 12, in __init__
self.connectDB = pgdb.connect(user="byromj", password="****", host="server", database="byromj")
File "/usr/lib/python2.3/site-packages/pgdb.py", line 389, in connect
dbtty, dbuser, dbpasswd)
_pg.error: FATAL: connection limit exceeded for non-superusers |
EDIT: fixed password...
Last edited by brenden on Sat Nov 27, 2004 5:36 pm; edited 1 time in total |
|
| Back to top |
|
 |
wescott Apprentice


Joined: 18 Feb 2004 Posts: 183 Location: A giant shoe
|
Posted: Sat Nov 27, 2004 5:35 pm Post subject: |
|
|
You may want to use encrypted authentication. The page prompts me asking me whether I am willing to send the password as text. This is a definite security hole. I could boot with a HAL 91 boot floppy (verry old) and listen on a computer in your LAN and fetch a password easily. _________________ Sometimes you feel like a nut, sometimes you don't
Gentoo Forum Member #43303
Yoda of Borg are we: Futile is resistance. Assimilate you, we will. |
|
| Back to top |
|
 |
talz13 Tux's lil' helper


Joined: 08 Oct 2004 Posts: 77
|
Posted: Sat Nov 27, 2004 5:45 pm Post subject: |
|
|
| maxima wrote: | change priority to medium
and originator to FMuser1
and search
| Code: | Mod_python error: "PythonHandler mod_python.psp"
Traceback (most recent call last):
File "/usr/lib/python2.3/site-packages/mod_python/apache.py", line 299, in HandlerDispatch
result = object(req)
File "/usr/lib/python2.3/site-packages/mod_python/psp.py", line 297, in handler
p.run()
File "/usr/lib/python2.3/site-packages/mod_python/psp.py", line 208, in run
exec code in global_scope
File "/var/www/localhost/htdocs/proj/UIhandler.psp", line 28, in ?
mover.getCmd(pageid)(req, form)
File "/var/www/localhost/htdocs/proj/lib/controller.py", line 176, in searchRequest
self.requestList = self.help.selectRequest(self.searchDict)
File "/var/www/localhost/htdocs/proj/lib/helpDesk.py", line 33, in selectRequest
return self.request.selectRequest(searchDict)
File "/var/www/localhost/htdocs/proj/lib/requestContainer.py", line 113, in selectRequest
self.requestDataList = self.handler.queryDB(self.queryString)
File "/var/www/localhost/htdocs/proj/lib/dbWork.py", line 21, in queryDB
self.cur.execute(query)
File "/usr/lib/python2.3/site-packages/pgdb.py", line 189, in execute
self.executemany(operation, (params,))
File "/usr/lib/python2.3/site-packages/pgdb.py", line 208, in executemany
raise DatabaseError, "error '%s' in '%s'" % ( msg, sql )
DatabaseError: error 'ERROR: syntax error at or near "originator" at character 51
' in 'SELECT * FROM request WHERE priority = 'Medium' originator = 'FMuser1' ORDER BY idNumber ASC ;' |
|
this error seems to be troublesome. I have my AND being appended a number of times less 1 than the number of items being searched by. I changed it to = number of items being searched by, and that search works, but when I add more fields I get an additional AND before my ORDER BY statement. If I change it back to -1, it drops the last AND like it should, but then doesn't add it to other searches (like the medium, FMuser1). Some more work for me to do...
edit: looks like I fixed it, hopefully. This is really helpful of you guys! _________________ Gentoo 2004.2 2.4.26-gentoo-r9 kernel
AXP 2100+
epox 8k5a3+
1024mb pc2100
120gb WD SE
GF4 TI4400
SBLive! x-gamer
Last edited by talz13 on Sat Nov 27, 2004 5:52 pm; edited 1 time in total |
|
| Back to top |
|
 |
talz13 Tux's lil' helper


Joined: 08 Oct 2004 Posts: 77
|
Posted: Sat Nov 27, 2004 5:47 pm Post subject: |
|
|
| wescott wrote: | | You may want to use encrypted authentication. The page prompts me asking me whether I am willing to send the password as text. This is a definite security hole. I could boot with a HAL 91 boot floppy (verry old) and listen on a computer in your LAN and fetch a password easily. |
Yeah, I was just having trouble getting the md5 authentication working with postgres and psp. This is just a temporary testing ground, it's all going back to school to be refactored into the code there (which may or may not use a hashed password, since it's behind their firewall) _________________ Gentoo 2004.2 2.4.26-gentoo-r9 kernel
AXP 2100+
epox 8k5a3+
1024mb pc2100
120gb WD SE
GF4 TI4400
SBLive! x-gamer |
|
| Back to top |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|