How to get the current user connected ID in a report issue

Post about your customizations to share with others.

Moderators: Developer, Contributor

Post Reply
kevin_kino
Posts: 8
Joined: 13 Feb 2013, 08:17

How to get the current user connected ID in a report issue

Post by kevin_kino »

Good morning all !

I'd to know how can I get the id of the current user connected to mantis in a report issue. I know that the variable name is $f_handler_id.
I need this to create a custom function in my mantis when I'm in the report issue.

Huge thanks ! :)

Kevin
atrol
Site Admin
Posts: 8366
Joined: 26 Mar 2008, 21:37
Location: Germany

Re: How to get the current user connected ID in a report iss

Post by atrol »

Use function auth_get_current_user_id()
Please use Search before posting and read the Manual
kevin_kino
Posts: 8
Joined: 13 Feb 2013, 08:17

Re: How to get the current user connected ID in a report iss

Post by kevin_kino »

Massive thanks Atrol !

It works fine! :)
Yuhd
Posts: 27
Joined: 20 Nov 2012, 22:01

Re: How to get the current user connected ID in a report iss

Post by Yuhd »

Hello all,
I'd like to know how can I get the Group ID of one user? (Is he Reporter, viewer,...)
Which function ?

Thanks
atrol
Site Admin
Posts: 8366
Joined: 26 Mar 2008, 21:37
Location: Germany

Re: How to get the current user connected ID in a report iss

Post by atrol »

Code: Select all

$t_access_level = user_get_field( $t_user_id, 'access_level' );
if ( $t_access_level == REPORTER ) ...
Please use Search before posting and read the Manual
Yuhd
Posts: 27
Joined: 20 Nov 2012, 22:01

Re: How to get the current user connected ID in a report iss

Post by Yuhd »

Thank you for your reply.
however, I've got the following error

Code: Select all

Notice: Undefined index: user_get_field() for NO_USER in ...\core\error_api.php on line 375
APPLICATION WARNING #user_get_field() for NO_USER:
For your information my code already included

Code: Select all

require_once( 'current_user_api.php' );
atrol
Site Admin
Posts: 8366
Joined: 26 Mar 2008, 21:37
Location: Germany

Re: How to get the current user connected ID in a report iss

Post by atrol »

To which value did you set $t_user_id ?
Please use Search before posting and read the Manual
Post Reply