Crankshaft Coalition Crankshaft Coalition  

Go Back   Crankshaft Coalition > Automotive Knowledge > Coalition Knowledge Projects > GPL Automotive Photojournal
User Name
Password
Register FAQ Members List Search Today's Posts Mark Forums Read


Reply
 
Thread Tools Search this Thread Display Modes
  #101  
Old 08-17-2006, 08:43 PM
Jon Jon is offline
Hotrodders.com
 
Join Date: Apr 2005
Location: Colorado
Age: 33
Posts: 146
I've studied up, and I know how to do the sessions and the authentication now. A decision has to be made as to "how secure" we need it to be in regard to sessions. Up to a certain point, there's a trade-off between security and convenience.

However, the next big move is to start taking apart the procedural code, and moving it into an object-oriented framework.

I finally finished moving all of the old Hotrodders "Hot Rod Search Engine" links into our new Knowledge Base (nearly 2,000 links), so that's a big monkey off my back.

Getting there, but slowly.
Reply With Quote
  #102  
Old 02-19-2007, 06:45 AM
grouch grouch is offline
Member
 
Join Date: Jun 2005
Posts: 79
Quote:
Originally Posted by Jon
I've studied up, and I know how to do the sessions and the authentication now. A decision has to be made as to "how secure" we need it to be in regard to sessions. Up to a certain point, there's a trade-off between security and convenience.


Wish I could say I know how, because I really need to know.

The biggest need I see for security is when a journal is altered. That's really the only time the server needs to confirm the identity of the client, to make sure that only the owner of a journal can alter it. It should not be too inconvenient to require username and password before beginning an editing session. This could be a place to require https, even.

Quote:
Originally Posted by Jon
However, the next big move is to start taking apart the procedural code, and moving it into an object-oriented framework.


I really can't help with that.

Quote:
Originally Posted by Jon
I finally finished moving all of the old Hotrodders "Hot Rod Search Engine" links into our new Knowledge Base (nearly 2,000 links), so that's a big monkey off my back.

Getting there, but slowly.


I'm studying sessions and user authentication again. Can't promise any results.

1. Verify user.
Login, set cookies, start session.

2. Re-verify user credentials for subsequent pages.
Test cookies, test sessionid.

3. End session.
Clear session variables.

Does that look right?

[Edited to add:]

Quote:
Originally Posted by Jon
To authenticate, you'll need to read the vBulletin cookie.


I see bbpassword, bbuserid, bblastvisit, sessionhash cookies. Which one(s) do I need to read? What do I compare it to?

Last edited by grouch : 02-19-2007 at 01:52 PM. Reason: add questions
Reply With Quote
  #103  
Old 02-23-2007, 03:16 PM
grouch grouch is offline
Member
 
Join Date: Jun 2005
Posts: 79
Progress on version 0.43 so far:

-- Changed variable names everywhere in order to have some more consistency: all of the global variables named in _vars.php now begin with an underscore. (That was a mess). Rationale: PHP's globals begin with an underscore, like _SESSION, _COOKIE, _GET, _POST. Establishing a convention like this could be helpful with maintaining or extending the code later.

-- Created a journal_users table as Jon suggested ages ago. For PostgreSQL, this also involved creating a view and several rules so that everything works the same when MySQL's "mediumint(8) unsigned zerofill" stuff is used. In PostgreSQL, the table is:
Code:
CREATE TABLE jrnl_users ( userid serial NOT NULL PRIMARY KEY, name text, passhash text )

Passwords are not stored on the server, only a salted hash of the password that the user submits.

-- Renamed some columns in tables to avoid confusion:
In journal_entries, "date" => "entry_date", "text" => "entry_text". In journal_photos, "type" => "i_type".

-- Added some database variables to _vars.php because the above changes in the database tables created a really aggravating, tedious search and replace. Variables added:
Code:
/* * database variables * So you only have one file to change if you change database names. * Watch out for conflicts in variable names if you change any of the * default database table column names. */ // journal users table $_journal_users = "journal_users"; $_userid = "userid"; // doesn't conflict with userid in other tables $_name = "name"; $_password = "passhash"; // journals table $_journals = "journal"; $_journalid = "journalid"; $_userid = "userid"; // doesn't conflict with journal_users.userid $_entries = "entries"; $_views = "views"; // journal entries table $_journal_entries = "journal_entries"; $_entryid = "entryid"; $_journalid = "journalid"; $_entry_date = "entry_date"; $_entry_title = "entry_title"; $_entry_text = "entry_text"; $_threadid = "threadid"; // journal photos table $_journal_photos = "journal_photos"; $_photoid = "photoid"; $_entryid = "entryid"; $_i_type = "i_type";


-- Cleaned up some ugly messes in _common.php, show_all.php, show_journal.php, show_toc.php and their associated display files.

-- Created a session_destroy.php and a session_test.php to begin trying to understand sessions.

It's still not ready to tar up and post.
Reply With Quote
  #104  
Old 03-07-2007, 01:52 AM
grouch grouch is offline
Member
 
Join Date: Jun 2005
Posts: 79
sql injection

Reply With Quote
  #105  
Old 03-12-2007, 08:14 AM
grouch grouch is offline
Member
 
Join Date: Jun 2005
Posts: 79
I'm really stuck. For some reason, this thing is mixing session data from different sessions and different users, even after going through session_destroy() and individually unsetting all session variables and cookies. Just what in the world is session_destroy() good for if it doesn't, in fact, do what the manual says, "destroys all of the data associated with the current session."?

The attached tar.gz and zip show the condition of the mess so far.

WARNING: This is BROKEN and should NOT be used on any computer with a network connection! IT IS NOT SAFE AT ALL!
Attached Files
File Type: zip journals_test-0.43.zip (63.7 KB, 0 views)
File Type: gz journals_test-0.43.tar.gz (34.0 KB, 1 views)
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump



All times are GMT -7. The time now is 08:37 PM.



Home  •  About  •  Join  •  Forum  •  Wiki  •  180+ Hotrodding Forums  •  Resources  •  RSS  •  Contact

Powered by: vBulletin Version 3.0.7
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.