Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 5945807
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T16:44:00+00:00 2026-05-22T16:44:00+00:00

I’m developing a login system for the backend. There will be a number of

  • 0

I’m developing a login system for the backend.

There will be a number of user levels / permissions to do certain task.

A member can have 1 or more levels.

What are the best architecture to do this?

I came with these solution:

Tables:

Group
 - group_id (P)
 - group_name

Group_User
- group_id (F)
- user_id

And how link with OOP approach?

OOP Design I have come up with:

class User {

private $privateSalt = "Don't Tell Anyone! Q£$£$^$";

public function newAccount($email, $password, $firstName, $lastName) { }

public function login($email = 0, $password = 0) { }

private function _setSession($data) {
    $_SESSION['logged_in'] = true;
    $_SESSION['member_id'] = $data['member_id'];
    $_SESSION['email'] = $data['email'];
    $_SESSION['first_name'] = $data['first_name'];
}

public function logout() { }

public function isLoggedIn() { }

}

It is not necessary to declare User details in the OOP properties because I Have stored in the session?
Also if user refresh the page, it is recommended to check user $_SESSION[‘member_id’] against to the database again?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-22T16:44:01+00:00Added an answer on May 22, 2026 at 4:44 pm

    A login system is actually pretty easy to do, but very difficult to do well. Implementing password recovery mecanisms, user account administration for both users and admin, mutliple roles that can be added and edited, all that of course needs to be done in a secure fashion.
    Add to that OAuth and OpenID , login systems are one of the most complicated parts of many moderns applications.

    I would consider looking at how others have tackled the problem, there are libraries and components such as Zend_Acl that can help ease the task a lot and make you avoid some basic issues you will encounter. That being said, DO explore the ideas you have, I mean it’s great what you are doing and I am not at all saying this to discourage you. I started on the same exact path you are on, many years ago.

    That being said, I have a few questions to ask on your new design. The newAccount function, are those the only parameters needed for that function? You can consider passing objects to functions that require many parameters, that way you can benefit from type hinting. The function login(), why the parameters set to default 0? Are those really default values for that function? At first glance maybe better would be $email=null and $password=null, but can one login with no email/password? If your application logic relies on having those values set, it’s ok to have a function signature that enforces the logic. I think it’s great, though keep up the initiative and be curious.

    Happy coding, friend

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

link Im having trouble converting the html entites into html characters, (&# 8217;) i
I want to count how many characters a certain string has in PHP, but
I have a jquery bug and I've been looking for hours now, I can't
I'm new to using the Perl treebuilder module for HTML parsing and can't figure
I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this
I need to clean up various Word 'smart' characters in user input, including but
Does anyone know how can I replace this 2 symbol below from the string
I need a function that will clean a strings' special characters. I do NOT
I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
I'm working with an upstream system that sometimes sends me text destined for HTML/XML

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.