Forums de discussion

passing the userid to a php portlet?

thumbnail
William Shackelford, modifié il y a 15 années.

passing the userid to a php portlet?

New Member Publications: 18 Date d'inscription: 26/02/09 Publications récentes
I am developing a php portlet to extend the content on profile page for members of my liferay site. How do I pass the userid or screenname of the profile page users are on to php portlet from liferay?
thumbnail
Eric Devlin, modifié il y a 15 années.

RE: passing the userid to a php portlet?

Regular Member Publications: 154 Date d'inscription: 19/02/08 Publications récentes
Hey,
Add a self posting page which which gets the userid from javascript. Here is a link that might help. Ignore the third step as that is for portletbridge, but the first two should do the trick.
Eric
thumbnail
William Shackelford, modifié il y a 15 années.

RE: passing the userid to a php portlet?

New Member Publications: 18 Date d'inscription: 26/02/09 Publications récentes
Thanks.. I didn't think about doing it via Javascript.. works great!
thumbnail
Billy Jones, modifié il y a 13 années.

RE: passing the userid to a php portlet?

New Member Publications: 10 Date d'inscription: 20/08/10 Publications récentes
Hi William,

I'm having the same problem trying to figure out how to obtain user id's is there any chance you can tell me more about how you did it?

thanks a lot!

Billy
thumbnail
Gabriel Leon Leyva, modifié il y a 13 années.

RE: passing the userid to a php portlet?

Regular Member Publications: 243 Date d'inscription: 20/06/09 Publications récentes
import com.liferay.portal.util.PortalUtil;
import com.liferay.portal.model.User;
$util = new PortalUtil();
$user = $util->getUser($request->getRequest());
$UserID = $user->getuserId();
thumbnail
Michael Charles, modifié il y a 13 années.

RE: passing the userid to a php portlet?

New Member Publications: 15 Date d'inscription: 20/01/11 Publications récentes
Gabriel Leon Leyva:
import com.liferay.portal.util.PortalUtil;
import com.liferay.portal.model.User;
$util = new PortalUtil();
$user = $util->getUser($request->getRequest());
$UserID = $user->getuserId();



Some have been asking about the "$request" variable. If you are struggling try.
$request = quercus_servlet_request();
thumbnail
Gabriel Leon Leyva, modifié il y a 12 années.

RE: passing the userid to a php portlet?

Regular Member Publications: 243 Date d'inscription: 20/06/09 Publications récentes
thanks Michael

import com.liferay.portal.util.PortalUtil;
import com.liferay.portal.model.User;
$util = new PortalUtil();
$request = quercus_servlet_request();
$user = $util->getUser($request->getRequest());
$UserID = $user->getuserId();
brian schneider, modifié il y a 10 années.

RE: passing the userid to a php portlet?

New Member Publications: 4 Date d'inscription: 29/07/13 Publications récentes
where can one find more information on quercus_servlet_request() or specifics about the request object it returns?
brian schneider, modifié il y a 10 années.

RE: passing the userid to a php portlet?

New Member Publications: 4 Date d'inscription: 29/07/13 Publications récentes
more specifically, how do you access the browser get and post variables in your php portet?