joomla : authentication -
i have made folder in joomla directory. in folder have file.
i want authenticate these files direct access using url name?
how can achieved?
i'm not sure if best way, can create php script (let's call joomla-auth.php
) containing this:
<?php define( '_jexec', 1 ); define('jpath_base', dirname(__file__)); define( 'ds', directory_separator ); require_once ( jpath_base .ds.'includes'.ds.'defines.php' ); require_once ( jpath_base .ds.'includes'.ds.'framework.php' ); $mainframe =& jfactory::getapplication('site'); if (jfactory::getuser()->id == 0) die("access denied: login required."); ?>
then, @ top of php scripts need joomla authentication, do:
<?php include 'joomla-auth.php'; ?>
if have php script, , need information authenticated user, use jfactory::getuser()
. if have .html
file, can change extension .php
, add 3 lines above top.
chances are, creating component or module "right way" you're trying do. however, can't advise on because lesson still need learn myself. should jumi, lets embed php, html, javascript, etc. files directly articles using syntax this:
{jumi myfile.html}{/jumi}
Comments
Post a Comment