{"action":"created","issue":{"url":"https://api.github.com/repos/thedigicraft/Atom.CMS/issues/105","labels_url":"https://api.github.com/repos/thedigicraft/Atom.CMS/issues/105/labels{/name}","comments_url":"https://api.github.com/repos/thedigicraft/Atom.CMS/issues/105/comments","events_url":"https://api.github.com/repos/thedigicraft/Atom.CMS/issues/105/events","html_url":"https://github.com/thedigicraft/Atom.CMS/issues/105","id":62174027,"number":105,"title":"Admin users and regular users?","user":{"login":"ninasmurffh","id":9914418,"avatar_url":"https://avatars.githubusercontent.com/u/9914418?v=3","gravatar_id":"","url":"https://api.github.com/users/ninasmurffh","html_url":"https://github.com/ninasmurffh","followers_url":"https://api.github.com/users/ninasmurffh/followers","following_url":"https://api.github.com/users/ninasmurffh/following{/other_user}","gists_url":"https://api.github.com/users/ninasmurffh/gists{/gist_id}","starred_url":"https://api.github.com/users/ninasmurffh/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ninasmurffh/subscriptions","organizations_url":"https://api.github.com/users/ninasmurffh/orgs","repos_url":"https://api.github.com/users/ninasmurffh/repos","events_url":"https://api.github.com/users/ninasmurffh/events{/privacy}","received_events_url":"https://api.github.com/users/ninasmurffh/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":8,"created_at":"2015-03-16T18:47:04Z","updated_at":"2015-03-19T22:08:29Z","closed_at":null,"body":"Hello all you smart people on here!\r\nI have a login form on the front end similar to the one on the back end, and i'm wondering if there's a way to \"separate\" the admins from the \"regular\" users so that the \"regular\" users wouldn't be able to log in to the back end of the website, but still using the same \"users\" table in the database?\r\nI'm figuring there should be a way to do this with if-statements and adding a column to the \"users\" table (like type \"1\" would be an admin user and \"2\" would be a normal user), but i suck at coding and google couldn't help me with my problem either...\r\nSo this is what i've got:\r\n\r\nif($_POST) {\r\n\t\r\n\t$q = \"SELECT * FROM users WHERE email = '$_POST[email]' AND password = SHA1('$_POST[password]')\";\r\n\t$r = mysqli_query($dbc, $q);\r\n\t\r\n\tif(mysqli_num_rows($r) == 1) {\r\n\t\t\r\n\t\t$_SESSION['username'] = $_POST['email'];\r\n\t\theader('Location: index.php');\r\n\t\t\r\n\t}\r\n\t\r\n\t\r\n}"},"comment":{"url":"https://api.github.com/repos/thedigicraft/Atom.CMS/issues/comments/83778380","html_url":"https://github.com/thedigicraft/Atom.CMS/issues/105#issuecomment-83778380","issue_url":"https://api.github.com/repos/thedigicraft/Atom.CMS/issues/105","id":83778380,"user":{"login":"creptor","id":3092157,"avatar_url":"https://avatars.githubusercontent.com/u/3092157?v=3","gravatar_id":"","url":"https://api.github.com/users/creptor","html_url":"https://github.com/creptor","followers_url":"https://api.github.com/users/creptor/followers","following_url":"https://api.github.com/users/creptor/following{/other_user}","gists_url":"https://api.github.com/users/creptor/gists{/gist_id}","starred_url":"https://api.github.com/users/creptor/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/creptor/subscriptions","organizations_url":"https://api.github.com/users/creptor/orgs","repos_url":"https://api.github.com/users/creptor/repos","events_url":"https://api.github.com/users/creptor/events{/privacy}","received_events_url":"https://api.github.com/users/creptor/received_events","type":"User","site_admin":false},"created_at":"2015-03-19T22:08:29Z","updated_at":"2015-03-19T22:08:29Z","body":"Ok, got it...\r\nMy code basically get's all the data from the table and adds it to the $_SESSION, and that includes the colums names, like: email, id, first, etc. so they will show like `$_SESSION['email']`, `$_SESSION['id']`, etc.\r\n\r\nSo if you have any other interfiring code, just chacnge the session variable to something that it's displayed on the table, hope it works."}}