RegisterRegister    SearchSearch   ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

AJAX upload progress bar

File sharing script

File mirror script

Newsletter script
[RESOLVED] Get the uid to insert it into a script

 
Post new topic   Reply to topic    SibSoft Ltd Forum Index -> XFileSharing Pro
View previous topic :: View next topic  
Author Message
applewar



Joined: 08 Feb 2011
Posts: 71

PostPosted: Jun 25, 2011 4:02 pm    Post subject: [RESOLVED] Get the uid to insert it into a script Reply with quote

Hello,

I have a small problem with the current configuration of Xfilesharing Pro.

I wish I could get the uid of the user from their username in order to then insert it into a script for a survey, but I can not do it properly, or even not at all.

I managed to create a page that retrieves by adding the name of the user in the ajoutenant in the url and using the header in php, but I wish I could do otherwise.

I have thought about changing the file index.cgi but I do not know Perl and do not venture to touch it.

Could someone give me a working solution please?

Sincerely


Last edited by applewar on Jun 27, 2011 3:59 pm; edited 1 time in total
Back to top
View user's profile Send private message
nyan



Joined: 28 Oct 2010
Posts: 121

PostPosted: Jun 26, 2011 4:08 pm    Post subject: Reply with quote

Try TMPL_VAR usr_id
if it's not defined, define it yourself at the print template parts of the script (download0/1/2)
'usr_id' = $ses->getUser->{usr_id},
Back to top
View user's profile Send private message
applewar



Joined: 08 Feb 2011
Posts: 71

PostPosted: Jun 26, 2011 10:55 pm    Post subject: Reply with quote

Thanks nyan, I've define it manually, it's works with:

'usr_id' => $ses->getUser->{usr_id},

but I've got an error when a non-registered member try to download, because he hasn't got usr_id.

Error is:

Can't use an undefined value as a HASH reference at index_dl.pm on line 376

Any solution for that ? (Yes, I'm a newbies in Perl)
Back to top
View user's profile Send private message
admin
Site Admin


Joined: 22 Mar 2006
Posts: 1283

PostPosted: Jun 27, 2011 7:41 am    Post subject: Reply with quote

You need to check if it's defined first.
Back to top
View user's profile Send private message Send e-mail
applewar



Joined: 08 Feb 2011
Posts: 71

PostPosted: Jun 27, 2011 3:58 pm    Post subject: Reply with quote

I've modified the line, it's work great with:

'usr_id' => $ses->getUserId,

When user is registered, display usr_id and when is non registered, display nothing.

And for my banner, I apply filter for non-registered with TMPL_IF my_login.

Thanks for your help nyan and admin Wink
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    SibSoft Ltd Forum Index -> XFileSharing Pro All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum

Powered by phpBB © 2001, 2005 phpBB Group