1
koog75
Get current user and group
  • 2005/3/8 15:38

  • koog75

  • Just popping in

  • Posts: 5

  • Since: 2005/3/8 1


Hi, i'm writing external php scripts to include in a website running XOOPS for a client of my own company.
I started as a n00b with xoops, so i first began studying how XOOPS works with MySQL databases and use my scripts to interact with XOOPS data in MySQL db.
Well now i'm writing a bunch of scripts to allow users to post their curriculum online and a picture to ask for an employment . I'm also building a search engine for the company to search curriculums data for the requirements they are looking for, such as experiences and skills.
My problem is to interact with XOOPS permissions, like only users that are logged in XOOPS ( user.php ) and are part of a certain group can post their curriculum and the picture.
The second issue is that i need to let only users in the group agents ( that i've previously created ) to search the curriculum databases and get the results they need.
What i've to include in my php scripts to be sure that a not logged in user can post and search for data ?
Which are the variables that XOOPS use to decide that a user is logged in or not and in which group the user is ?

Help would be really appreciated.

Thanks

Francesco Fazio

2
Mithrandir
Re: Get current user and group

Whether a user is logged in or not:
if ($xoopsUser) {
    
//user is logged in
}
else{
    
//user is not logged in
}


Get the user's groups
$groups $xoopsUser $xoopsUser->getGroups() : array(XOOPS_GROUP_ANONYMOUS);

3
koog75
Re: Get current user and group
  • 2005/3/9 10:07

  • koog75

  • Just popping in

  • Posts: 5

  • Since: 2005/3/8 1


Thank u so much it solves all my problems :)

4
beach_defend
Re: Get current user and group

Hi,
I hope that I'm not off topic too much, but I'm working on a very similar issue.

We have been working on a number of appplications (based mostly on PEAR DB,DBO,Auth,Quickform and QFC and Smarty) and would love to be able to add a range of XOOPS based functionality. The application framework has a core UserAdmin (needing to be replaced) and a number of very specific applications/modules. The UserAdmin module manages session vairables/cookies to ensure that only certified users are able to connect to the applications.

I have ported all of the existing users and group information into the relevant XOOPS tables. Plan A was to use build a specialised module that would set the appropriate $_SESSION variables (essentially $_SESSION['valid_user_id']) and then send them off to the appropriate scripts.

I'm running into a really interesting problem in that having logged into XOOPS and setting the appropriate session vars, once I get to my scripts, the session disappears as do all of the XOOPS Global vars.

I'm still trying to work out why and what I am doing wrong, but in the meantime if anyone has clues I'd appreciate it heaps.

Thanks, BTW we love XOOPS as hpfm.

Barry (aka Beach_defender)

Login

Who's Online

449 user(s) are online (327 user(s) are browsing Support Forums)


Members: 0


Guests: 449


more...

Donat-O-Meter

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

Latest GitHub Commits