Check cookie authentication without using Joomla libraries

Moderators: mandville, General Support Moderators

Forum rules
Forum Rules
Absolute Beginner's Guide to Joomla! <-- please read before posting, this means YOU.
Forum Post Assistant - If you are serious about wanting help, you will use this tool to help you post.
Windows Defender SmartScreen Issues <-- please read this if using Windows 10.
Locked
conanthedestroya
Joomla! Apprentice
Joomla! Apprentice
Posts: 25
Joined: Wed May 16, 2007 8:01 pm

Check cookie authentication without using Joomla libraries

Post by conanthedestroya » Wed Feb 14, 2018 8:14 pm

Hi,

I was hoping to get some help with the following please.

I’m redesigning some things in an already made Joomla website. The first thing I did was to update it to Joomla! 3.8.5 and all works good except the following.

The site has individual folders on the hosting that contain presentations and each of these folders has it's own index.php

At the top of this index.php file is the following code that checks to make sure the person is assigned to the joomla group 10 and if not gets redirected to the registration page. If they are registered then they get to see the presentation.

Code: Select all

<?php
require "../joomla_auth.php";
$auth = new JoomAuth('../../configuration.php');

/*
* param redirect_on_fail
* param group_id - The Joolmla Group ID with access to this page can be integer or array
*/
$auth->checkauth( '/registration', 10 );
 ?>
The redirection works fine but unfortunately it’s still works even when I’m registered to group 10 and don’t fully understand what’s happening with the access / permissions script (joomla_auth.php) and am unable to get it to work correctly. I'm thinking that perhaps some code has changed in the Joomla update which has in turn effected what's being calculated in the script?

I've attached the code for for joomla_auth.php in a text file as am unable to upload the .php or paste it.


Really appreciate any help on this if you have the time.

Many thanks,

Andrew
You do not have the required permissions to view the files attached to this post.

User avatar
Per Yngve Berg
Joomla! Master
Joomla! Master
Posts: 30892
Joined: Mon Oct 27, 2008 9:27 pm
Location: Romerike, Norway

Re: Check cookie authentication without using Joomla libraries

Post by Per Yngve Berg » Wed Feb 14, 2018 10:36 pm

What version of Joomla did you upgrade from?

There was a change in locations of library files in 3.8.0.

conanthedestroya
Joomla! Apprentice
Joomla! Apprentice
Posts: 25
Joined: Wed May 16, 2007 8:01 pm

Re: Check cookie authentication without using Joomla libraries

Post by conanthedestroya » Wed Feb 14, 2018 10:49 pm

Thanks for your quick reply Per.

Previous version was Joomla 3.7.2 so that probably explains it.

Is there anything on the joomla_auth.txt that refers to the libraries as I noticed in the comments at the top that is says 'without using Joomla libraries'
Checks Joomla user and privelage against authentication stored in a cookie, without using Joomla libraries

Andrew


Locked

Return to “Access Control List (ACL) in Joomla! 3.x”