bradtraversy / php_stripe_paypage

Payment app with PHP, MySQL, PDO & Stripe API
113 stars 98 forks source link

I don't know how to contact you but for your Udemy course can you add... #2

Open jackttcoms opened 6 years ago

jackttcoms commented 6 years ago

Hi, i purchased your course and its really good but i was wondering whether you could do an update where you add permissions/roles and also an encryption class!

This would be really helpful in seeing how you do it but right now I have done it this way and it kinda works kinda doesn't so would you be able to make a proper tutorial?

Thanks

https://www.sitepoint.com/role-based-access-control-in-php/

jackttcoms commented 6 years ago

For example how can i load a model or a function always because im trying to do a user role system and i dont want to use sessions so for the session_helper.php that controls the isloggedin how do i get it to do something where it gets data from the DB always but only if logged in?

`function isLoggedIn(){ if ( isset($_SESSION['user_id']) && isset($_SESSION['user_name']) && isset($_SESSION['user_email'])) {

      //$userDetails = $this->userModel->getUserById($_SESSION['uid']);

      return true;
  } else {
      return false;
  }`

And then in the views/inc/navbar.php the ability to do something basic like this... Role: <?php echo $userDetails['role'];?>

This would be really helpful if you could clear this up in a quick video or something because then i and lots of others will be able to maximise this brilliant MVC and use it for more serious things so please respond as this is the only way I know where you will see this!

Thanks