I have made a folder in joomla directory. In this folder I have some file.
I want to authenticate these files from direct access using URL by name?
How can it be achieved?
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.
I’m not sure if this is the best way, but you can create a PHP script (let’s call it
joomla-auth.php) containing this:Then, at the top of PHP scripts that need Joomla authentication, do:
If you have a PHP script, and you need to get information about the authenticated user, use
JFactory::getUser(). If you have an.htmlfile, you can change the extension to.phpand add the 3 lines above to the top.Chances are, creating a component or module is the “right way” to do what you’re trying to do. However, I can’t advise you on that because this is a lesson I still need to learn myself. You should also look into Jumi, which lets you embed PHP, HTML, JavaScript, etc. files directly into articles using a syntax like this: