src/Session.php
public function login($username, $accessKey)
    {
        // Do the challenge before loggin in
        if ($this->passChallenge($username) === false) {
            return false;
        }

        $postdata = [
            'operation' => 'login',
            'username'  => $username,
            'accessKey' => md5($this->serviceToken.$accessKey)
        ];

        $result = $this->sendHttpRequest($postdata);
        if (!is_array($result) || empty($result)) {
            return false;
        }

        // Backuping logged in user credentials
        $this->userName = $username;
        $this->accessKey = $accessKey;

        // Session data
        $this->sessionName = $result[ 'sessionName' ];
        $this->userID = $result[ 'userId' ];

        // Vtiger CRM and WebServices API version
        $this->vtigerApiVersion = $result[ 'version' ];
        $this->vtigerVersion = $result[ 'vtigerVersion' ];

        return true;
    }
public function login($username, $accessKey)
    {
        // Do the challenge before loggin in
        if ($this->passChallenge($username) === false) {
            return false;
        }

        $postdata = [
            'operation' => 'login',
            'username'  => $username,
            'accessKey' => md5($this->serviceToken.$accessKey)
        ];

        $result = $this->sendHttpRequest($postdata);
        if (!is_array($result) || empty($result)) {
            return false;
        }

        // Backuping logged in user credentials
        $this->userName = $username;
        $this->accessKey = $accessKey;

        // Session data
        $this->sessionName = $result[ 'sessionName' ];
        $this->userID = $result[ 'userId' ];

        // Vtiger CRM and WebServices API version
        $this->vtigerApiVersion = $result[ 'version' ];
        $this->vtigerVersion = $result[ 'vtigerVersion' ];

        return true;
    }
public function login ( $ username , $ accessKey ) { // Do the challenge before loggin in if ( $ this -> passChallenge ( $ username ) === false ) { return false ; } $ postdata = [ 'operation' => 'login' , 'username' => $ username , 'accessKey' => md5 ( $ this -> serviceToken . $ accessKey ) ] ; $ result = $ this -> sendHttpRequest ( $ postdata ) ; if ( ! is_array ( $ result ) || empty ( $ result ) ) { return false ; } // Backuping logged in user credentials $ this -> userName = $ username ; $ this -> accessKey = $ accessKey ; // Session data $ this -> sessionName = $ result [ 'sessionName' ] ; $ this -> userID = $ result [ 'userId' ] ; // Vtiger CRM and WebServices API version $ this -> vtigerApiVersion = $ result [ 'version' ] ; $ this -> vtigerVersion = $ result [ 'vtigerVersion' ] ; return true ; }
Login to the server using username and VTiger access key token
@access public
@param  string $username VTiger user name
@param  string $accessKey VTiger access key token (visible on user profile/settings page)
@return boolean Returns true if login operation has been successful
Login to the server using username and VTiger access key token