1
jorge
Controlling members out of XOOPS
  • 2008/1/16 10:11

  • jorge

  • Just popping in

  • Posts: 23

  • Since: 2004/5/17


I have a XOOPS based site (2.0.13 version) and I would like to continue controlling the members in another part of the site.

The new code is written in PHP as well. I've been trying thinks like that:

include "XXX/mainfile.php";
include "XXX/include/common.php";
$uid = $xoopsUser->getVar('uid');


What collection of functions do I have to call to take control of the user session in XOOPS?

Kind regards, thanks in advance,

Jorge

2
nachenko
Re: Controlling members out of XOOPS
  • 2008/1/16 10:26

  • nachenko

  • Quite a regular

  • Posts: 356

  • Since: 2005/1/18


You need mainfile to get XOOPS config, and header.php to get the $xoopsUser object and session control

3
jorge
Re: Controlling members out of XOOPS
  • 2008/1/16 11:03

  • jorge

  • Just popping in

  • Posts: 23

  • Since: 2004/5/17


Thanks for your help nachenko,


I've write:

include "XXX/mainfile.php";
include "XXX/header.php";

if ($xoopsUser) {echo "Sí";} else {echo "No";};


The response is always "No".

What can I prove?

4
nachenko
Re: Controlling members out of XOOPS
  • 2008/1/16 11:31

  • nachenko

  • Quite a regular

  • Posts: 356

  • Since: 2005/1/18


try evaluating user this way:

if (is_object($xoopsUser))

This is taken form a real website:

Quote:
if (!is_object($xoopsUser)) {
redirect_header('javascript: history.back(1);', 3, _NOPERM);
}


You can see it in action clicking on this link:

http://www.sinestesia2007.info/forms/congress_form.php

then try login as test / test and try again.

5
jorge
Re: Controlling members out of XOOPS
  • 2008/1/16 15:59

  • jorge

  • Just popping in

  • Posts: 23

  • Since: 2004/5/17


Congratulations for your work nachenko,

I've test your web and it's Ok, but I can't access to the xoopsUser object.

Are you sure you only include mainfile and header? Do you make something else?

Best regards!
Jorge

Login

Who's Online

61 user(s) are online (33 user(s) are browsing Support Forums)


Members: 0


Guests: 61


more...

Donat-O-Meter

Stats
Goal: $100.00
Due Date: Jul 31
Gross Amount: $0.00
Net Balance: $0.00
Left to go: $100.00
Make donations with PayPal!

Latest GitHub Commits