Welcome to Dream.In.Code
Become a PHP Expert!

Join 136,909 PHP Programmers for FREE! Get instant access to thousands of PHP experts, tutorials, code snippets, and more! There are 1,739 people online right now. Registration is fast and FREE... Join Now!




feature creep is killing me... user db .. need help thinking

 
Reply to this topicStart new topic

feature creep is killing me... user db .. need help thinking

capty99
15 Mar, 2008 - 08:32 PM
Post #1

the real kya
Group Icon

Joined: 26 Apr, 2001
Posts: 9,169



Thanked: 16 times
Dream Kudos: 550
My Contributions
so my boss has a serious case of feature creep.

this store system went from a simple display of name, and info

to a multi-section map displayin, interactive, whatever beast i really didn't need to add to my plate right now.

anyways, the system isn't very complex.
its three db tables, simple admin pages that add/edit/delete all of the relevant content.

but one of the tables is stores, with all of their info in it. each row is a different store obviously.

soo....

what he wants to do is allow each store to have the ability to edit their own pages. so i need to give them access to only their administration page.
i'm not really sure how to do that.

never done a user system before, so how would i set something like that up, or if you have a quick dirty way to get this done i would be happy to hear that.
User is offlineProfile CardPM
+Quote Post

PsychoCoder
RE: Feature Creep Is Killing Me... User Db .. Need Help Thinking
15 Mar, 2008 - 09:22 PM
Post #2

using DIC.Core;
Group Icon

Joined: 26 Jul, 2007
Posts: 8,998



Thanked: 126 times
Dream Kudos: 8625
Expert In: VB, VB.Net, C#, SQL, ASP, ASP.Net, Web Development, HTML, CSS, Win32 API, Javascript, mySQL, J#, Boo.Net

My Contributions
I don't know how quick & dirty it is, but I'd have a login page for the clients, once they validate send them to an admin page (you only need 1) passing their store ID. Once they hit the admin page with their ID, load the admin page with their specific store information.
User is online!Profile CardPM
+Quote Post

capty99
RE: Feature Creep Is Killing Me... User Db .. Need Help Thinking
15 Mar, 2008 - 09:26 PM
Post #3

the real kya
Group Icon

Joined: 26 Apr, 2001
Posts: 9,169



Thanked: 16 times
Dream Kudos: 550
My Contributions
okay, i can do that ... lemme break it down
a table 3 columns,
user, pass and id

and then do i just do simple if statements for where if pass matches with user then go to la ti da...?


anything i need for security reasons... password encryption or anything. its not a big deal, but just to be safe.
User is offlineProfile CardPM
+Quote Post

PsychoCoder
RE: Feature Creep Is Killing Me... User Db .. Need Help Thinking
15 Mar, 2008 - 09:35 PM
Post #4

using DIC.Core;
Group Icon

Joined: 26 Jul, 2007
Posts: 8,998



Thanked: 126 times
Dream Kudos: 8625
Expert In: VB, VB.Net, C#, SQL, ASP, ASP.Net, Web Development, HTML, CSS, Win32 API, Javascript, mySQL, J#, Boo.Net

My Contributions
A simple login form, when they click "Login" check the username/password combination, make sure it matches what's in the database. I would do a simple encryption of the password, especially if the login isn't at https (which is a bad thing in or itself).

If the login succeeds, then pass them off to the admin page, carrying their store ID with them. When they hit the admin page, hit your database with the store ID you passed to retrieve the stores information. Once they make their changes, just update your table with the new information for that store id.

And yes, I would just have a simple 3 column table with username, password and store id.
User is online!Profile CardPM
+Quote Post

capty99
RE: Feature Creep Is Killing Me... User Db .. Need Help Thinking
15 Mar, 2008 - 09:41 PM
Post #5

the real kya
Group Icon

Joined: 26 Apr, 2001
Posts: 9,169



Thanked: 16 times
Dream Kudos: 550
My Contributions
o-tay.

playing with crypt() now.

gracias.
User is offlineProfile CardPM
+Quote Post

PsychoCoder
RE: Feature Creep Is Killing Me... User Db .. Need Help Thinking
15 Mar, 2008 - 09:43 PM
Post #6

using DIC.Core;
Group Icon

Joined: 26 Jul, 2007
Posts: 8,998



Thanked: 126 times
Dream Kudos: 8625
Expert In: VB, VB.Net, C#, SQL, ASP, ASP.Net, Web Development, HTML, CSS, Win32 API, Javascript, mySQL, J#, Boo.Net

My Contributions
No problem, remember thats why you allow me to stay around lol tongue.gif
User is online!Profile CardPM
+Quote Post

capty99
RE: Feature Creep Is Killing Me... User Db .. Need Help Thinking
15 Mar, 2008 - 10:26 PM
Post #7

the real kya
Group Icon

Joined: 26 Apr, 2001
Posts: 9,169



Thanked: 16 times
Dream Kudos: 550
My Contributions
my host is completely down.
right in the middle of me working on this.
been 45 minutes now.
son of a .
User is offlineProfile CardPM
+Quote Post

capty99
RE: Feature Creep Is Killing Me... User Db .. Need Help Thinking
17 Mar, 2008 - 08:32 AM
Post #8

the real kya
Group Icon

Joined: 26 Apr, 2001
Posts: 9,169



Thanked: 16 times
Dream Kudos: 550
My Contributions
psycho... pratically this is just a forwarder based on their user and pass, but really offers no protection correct?

if they just change the id in their url they would be able to access the other admin pages.

i don't foresee that being a problem, its local companies and not a big deal, plus i will just disguise the id in there... but to complete the project theoretically i would have to deal with sessions or some such thing i have never used before right?
User is offlineProfile CardPM
+Quote Post

thehat
RE: Feature Creep Is Killing Me... User Db .. Need Help Thinking
17 Mar, 2008 - 09:09 AM
Post #9

D.I.C Head
Group Icon

Joined: 28 Feb, 2008
Posts: 217


Dream Kudos: 100
My Contributions
I used vAuthenticate to protect the CMS area for the last project I did. It uses session, supports multiple users and groups and is really easy to set up.

I think it was actually recommended to someone on DIC before, and my google search brought me to this site for the first time. smile.gif

This post has been edited by thehat: 17 Mar, 2008 - 09:10 AM
User is offlineProfile CardPM
+Quote Post

Jargonaut
RE: Feature Creep Is Killing Me... User Db .. Need Help Thinking
20 Mar, 2008 - 02:53 PM
Post #10

New D.I.C Head
*

Joined: 20 Mar, 2008
Posts: 1

Have a memberid column in your store table. When a store is created place the members id in there. Then when they log in the memberid from the user table is used to pull the relevant store from the store table. No user input to decide which store is loaded.
User is offlineProfile CardPM
+Quote Post

PsychoCoder
RE: Feature Creep Is Killing Me... User Db .. Need Help Thinking
20 Mar, 2008 - 03:54 PM
Post #11

using DIC.Core;
Group Icon

Joined: 26 Jul, 2007
Posts: 8,998



Thanked: 126 times
Dream Kudos: 8625
Expert In: VB, VB.Net, C#, SQL, ASP, ASP.Net, Web Development, HTML, CSS, Win32 API, Javascript, mySQL, J#, Boo.Net

My Contributions
Tyler,

Have a look at this snippet I wrote on using sessions with PHP. It validates the users name & password, then implements sessions to only allow those that are authenticated for that page to access it


Login using sessions

Hope that helps smile.gif
User is online!Profile CardPM
+Quote Post

Fast ReplyReply to this topicStart new topic
Time is now: 12/3/08 09:54PM

Live PHP Help!

PHP Tutorials

Reference Sheets

PHP Snippets

DIC Chatroom

Bye Bye Ads

Monthly Drawing

Thumb Drive

Top Contributors

Top 10 Kudos This Month