Login or Register

RSS IconRecent posts in this topic

avatar
chagam on May 11. 2007. 8:57 am
Hi,

I installed activeCollab and I'd like to use the authentication system to disable access to some php pages I added.

Is there an easy way to know if a user is logged on without loading all the activeCollab files ? I spent 5 hours yesterday trying to paste code sections from activeCollab to a 'authentication.php' file wich I could include in my php pages.

All I want is if the user has logged on, he can read the page. If he didn't, he is redirected to the login page.

thanks

Chag
avatar Staff
Ilija Studen on May 11. 2007. 9:34 am
Easies way to do this is to open CompanyWebsite class (in /application/models/CompanyWebsite.class.php) and analyze initLoggedUser() method and methods called by it. There you'll see how activeCollab handles user login so you'll be able to reproduce it in your own scripts.

Btw, if you are extending activeCollab it's far easier to do that from inside than with outside scripts.
activeCollab Team Member
avatar
chagam on May 11. 2007. 11:45 am
Hi,

In fact, I installed mediawiki and I just want that people who are logged on collab can read the wiki. I added a include in the mediawiki index.php. This include will just check if the user is logged on. If not, then he's redirected to the login page.

I looked at the CompanyWebsite.class.php. From what I understand, I need to :

$foo = new CompanyWebsite;
$foo->init();


then, I should be able to use logged_user().

Am I right ?
avatar Staff
Ilija Studen on May 11. 2007. 12:14 pm
You don't need an instance. Simple CompanyWebsite::init() should work. Still, I would suggest that you replicate login instead of loading all the files...
activeCollab Team Member
avatar
chagam on May 11. 2007. 2:09 pm
Thanks Ilija,

Y almost have something working. I included all the fils for testing purposes. My final goal is to have just a small set of instructions to check if the user is logged on. But to achieve this, I have to understand php-object better :)

Thanks for your help

Chag
Topic is locked. If you have something important to say about issues discussed on this page please write at hi@a51dev.com.

RSS IconRecent posts in this topic