User log in rules only from Services

We encourage users to post events happening in the community to the community events group on https://www.drupal.org.
Anonymous's picture

Hi, i'm trying to execute an action related to user login only if the user log in from api provided by Services module. Is there a way to do that? I checked the $account variable and token but there is no information about that.

Thanks,
Igor

Comments

Did you find a way to do

marcus178's picture

Did you find a way to do this, I'm looking for the same thing too and not having much luck

I would recommend to check

ygerasimov's picture

I would recommend to check path when user is logged in. arg(0) should be endpoint path.

Otherwise, you could create

waldmanm's picture

Otherwise, you could create your own version of the user_service_login() method (this is for services v2 in Drupal 6) and take any appropriate action. It basically calls user_authenticate().

Always act on login

manObject's picture

My suggestion would be to have your action always fire on login. This would cause a script to run that checks where the login originated and then conditionally does your main action.

Services

Group organizers

Group categories

Group notifications

This group offers an RSS feed. Or subscribe to these personalized, sitewide feeds: