I have setup a CRUD area on my frontendAPI.php file (testing my models)… and I even managed to secure it. I would like to do this the proper way… I would like to establish a separate directory/ Page for the Admins. Please advise on this.
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
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.
Still new at this but I’m trying to do the same for a news page, think i’ve got the login part working but having problems with the CRUD (will post a question on it shortly) – i have a table to populate with data from an rss feed (but will be manually populated with a CRUD to start with) and then have a page on the front end to pull out the details using views to format each news story.
Create a new file here based on the function e.g. news.php containing
In Frontend.php, you need to enable the login – for an admin only access, the BasicAuth may be sufficient but there are also classes to use a database to obtain username and password infromation e.g. for a membership site – heres the basic one.
// If you wish to restrict access to your pages, use BasicAuth class
$auth=$this->add(‘BasicAuth’)
->allow(‘demo’,’demo’)
;
You need to modify Frontend.php to enable pages that can be viewed
without being logged in
And also in Frontend.php, you need to create a different menu if logged in. Note the login and logout pages dont actually exist.
When you login, it goes to page/index.php by default so if you want it to redirect to a particular page when you log in so you can add this to page/index.php
Hope that helps.
Trev