Loading...
 
Features / Usability

Features / Usability


Re: User and Registration tracker Help

posts: 214

Sorry that didn't work. I guess I assumed it was being used in a plugin, the global should have worked in a plugin.

If the php program is not a tiki plugin, then I think the problem accessing the $user variable is because the called program is not inheriting the Tiki session variables.

I have a solution, if you have Admin -> General -> General Settings -> "Session cookie name" empty (not set to anything).

If you have Admin -> General -> General Settings -> "Session cookie name" set to something, then this will not work. But if Admin -> General -> General Settings -> "Session cookie name" is empty (which I think uses the default "PHPSESSID"), then you can add this to the top of your php program:

Copy to clipboard
session_start(); $userinfo=$_SESSION['u_info']; $user=$userinfo['login'];


Then $user will be set to the login.

If you want to see which session variables are available, you can add:

Copy to clipboard
print_r($_SESSION);


Note that changing Admin -> General -> General Settings -> "Session cookie name" durring a session will cause you to be logged out of that session.

There should be a way to do it if Admin -> General -> General Settings -> "Session cookie name" is set to something, but I don't know how to do it.

Does anyone else have a process to access the Tiki $user from a called php program?


For the user tracker, I will run through the steps that I think you need:

Admin -> Features -> Global features -> check Trackers and Apply.

Trackers -> List Trackers

Create Tracker

Enter Name, example: Users
Any Description text entered will display on the Register page.
click "OK" to finish creation

Click on the Fields icon for the tracker.
Add Field
Enter Name, example: User
From Type Dropdown, select "User Selector".
Checking "Restrict visibility to administrators" is probably a good idea.
Click on "ADD FIELD & EDIT ADVANCED OPTIONS".
Under Validation, "Type" dropdown, select "User Name".
Under Permissions, Visibility, select "Visible by administrators only".

You should add at least one more field:
Add Field
Enter Name, example: robot
From Type Dropdown, select "Drop Down".
Checking "Restrict visibility to administrators" is probably a good idea.
Click on "ADD FIELD & EDIT ADVANCED OPTIONS".
Under "Options for Drop Down", Option, enter: yes,no
And save.

In "Tracker fields" list check the "Mandatory" boxes for the fields they must use at registration and then with "Save All" selected, click on "Go".

Note the ID numbers of the fields you have in the tracker, you will need those latter.

Next:
Admin -> Login
Check "Users can register".
Check "Use tracker to collect more user information".
Click on "CHANGE PREFERENCES".

Now you have to add the tracker to the Registered group:
Click on "Admin Groups" (or Admin -> Groups).
Click on the Edit icon for Registered group.
In the "Users Information Tracker" drop down, select the tracker you created and then "SAVE".
Now under "Users Information Tracker", for "choose a field", select the name of your "User Selector" field.
Next, for "Users Information Tracker Fields Asked at Registration Time" put the field IDs of the fields you want asked at registration (you do not have to put the User Selector field ID number in there).

Now log out and go to Register and see if the tracker field has been added to the registration requests.

I hope this helped.

Tom

There are no comments at this time.

Upcoming Events

1)  18 Apr 2024 14:00 GMT-0000
Tiki Roundtable Meeting
2)  16 May 2024 14:00 GMT-0000
Tiki Roundtable Meeting
3)  20 Jun 2024 14:00 GMT-0000
Tiki Roundtable Meeting
4)  18 Jul 2024 14:00 GMT-0000
Tiki Roundtable Meeting
5)  15 Aug 2024 14:00 GMT-0000
Tiki Roundtable Meeting
6)  19 Sep 2024 14:00 GMT-0000
Tiki Roundtable Meeting
7) 
Tiki birthday
8)  17 Oct 2024 14:00 GMT-0000
Tiki Roundtable Meeting
9)  21 Nov 2024 14:00 GMT-0000
Tiki Roundtable Meeting
10)  19 Dec 2024 14:00 GMT-0000
Tiki Roundtable Meeting