Want more? Explore the library at https://www.codecourse.com/lessons Official site https://www.codecourse.com Twitter https://twitter.com/teamcodecourse.
Original source
PHP Tutorials: Register & Login (Part 21): More Account Permissions
Tags
account, admin, administrator, codecourse, login, moderator, mysql tutorial, php, phpacademy, privileges, register, registration, tutorial, type, types
Share :
- tweet
-
About the : d4mer
sistema biblioteca php Mysql(CODIGO FUENTE GRATIS)
April 12th, 2019Apache, PHP & MySql on Docker
April 11th, 2019Python Flask and Vue Tutorial – Video 1
April 11th, 2019Importing MySQL Database
April 11th, 2019sistema escolar php y mysql Codigo Fuente Gratis
April 10th, 2019Connecting to MySQL database on Wampserver from any host (Computer)
April 10th, 201917 Comments
Leave A Comment
You must be logged in to post a comment.
TheRoxas13th
Notice: Undefined variable: session_user_id in index.php is happening because the user is not logged in. In order to solve this, we only need to wrap Alex code with this if (logged_in()) { //alex code } where logged_in is a function that we (or Alex) created to check if the user has logged in or not.
Ramesh Fernandez
Notice: Undefined variable: session_user_id in index.php
Please someone let me know how to solve this
Ousama Esbel
You already have $user_data['type'] to return the value of type without having to create a function for it!
Atahan Kiltan
A better way to have access protection is in the "has_access" function to return the value of the user's type like this"mysql_result(mysql_query("SELECT `user_type` FROM `users` WHERE `user_id` = $user_id"), 0);"
And then checking for the access level like this: "if(has_access($user_data['user_id']) < 4)" this will check against everyone with a lower access key then 4, i.e. 1,2&3
My usertype setup:
1 – normal
2- vip
3 – op
4 – admin
eg. anyone lower than 4 isn't admin…
Charlie Sheen
its what the pause is for on the video 🙂
ArnoldsK
What about 'user created in…'
ky luc
Lập trình web là một môn học rất hay và cũng rất cần thiết đối với các doanh nghiệp cũng như cá nhân trong thời kỳ công nghệ thông tin đang phát triển như ngày nay.
Để trở thành một lập trình web chuyên nghiệp. Hãy đến với Athena.
Để hiểu rõ hơn về môn học này bạn hãy truy cập vào athena.edu.vn
Hoặc liên hệ: 92 nguyễn đình chiểu, p.đakao, q.1, tp.hcm
Tel: (08) 2210 3801 – 0943 23 00 99
whitepawwa12
Hey man, just want to thank you. You have helped me A LOT in the past two days. I have a uni assignment due in 15 hours and if it werent for your easy to understand and in depth tutorials I would have done fuck all and had a higher chance of failing this web application class. (lets hope i dont fail now lol)
I dont have any money but when I do i will surely send you a fair amount. Thank you so much! I love you (no homo)
latlov
If you log out here, at the end of this video tutorial, a warning shows up:
Notice: Undefined variable: session_user_id in index.php
David Fodor
and its a little bit longer 😀 and that was just the basic idea and not the currect solution
but its easy to add a new group, or delete, or modify
after that, if you want to know more send a pm
David Fodor
table users has an a_gtype column
table groups has all the premissions with an id
then simple get the acess type with a query for currect user
groups looks like this:
ID, NAME, CADD, CDEL, CMOD etc..and CSEE with tinyint or bool
if i have request the type for a post news then i call it:
if(canAccess($_SESSION['userid'],'CADD')){
// show the form or something
}
can acess gets the user from an array ( all user details is stored )
and query to he is able to do that
thats the basic
BaconDrinker
pizza + php = Morpheus
Dorin Nistor
Hey Alex, grate work, i have learned so much from yout tutorials THANK YOU SO VERRY VERRY MUCH. I have only one question … what's next? 🙂
Isak Boström
Make an profile upload thing:)))
BaconDrinker
3:18 Morpheus has arrived Alex. It's time to choose, the red pill, or the blue pill.
David Fodor
keep goin, but there is a more flexible premission system 🙂
but i solved this problem with an another table which can be modified by a default admin, and set premissions for different groups. ( or add a new group ) but this is great 😉
Eduardo Sanchez
Man am buying a shirt !!