<?php
import("com.laurus.core.actions.CoreActionHttp");
import("com.laurus.main.auth.exceptions.*");
import("com.laurus.main.auth.ent.*");
/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/**
 * Description of ActGetUserFromSession
 *
 * @author Shripad
 */
class ActGetUserFromSession extends CoreActionHttp{
    public function executeInvoke(\HttpRequest $wr) {
        try {
             /* @var $user User */
            $user=$wr->getUserFromSessionOrRequest();
            
        } catch (Exception $exc) {
            throw new ValidationException("Please Login First",  IAuthExceptionType::USER_NOT_IN_SESSION_OR_REQUEST);
        }
        $wr->setParameter("userId",$user->getId());
        return $user;
    }    //put your code here
}

?>
