Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Autolog #5

Open
wergh opened this issue May 1, 2017 · 1 comment
Open

Autolog #5

wergh opened this issue May 1, 2017 · 1 comment

Comments

@wergh
Copy link

wergh commented May 1, 2017

When you go to the webbinar list for example, in this method:

function auth_citrixonline($redirect_url = '') 
    {
		if($redirect_url == '')
		{
			$redirect_url = $this->get_current_url();
		}
		if($this->citrix_api_key == '')
		{
			throw new Exception('Please set citrix_api_key.');
		}
		return 'https://api.citrixonline.com/oauth/authorize?client_id=' . $this->citrix_api_key . '&redirect_uri='. urlencode($redirect_url);
	}

You must log with your account. But if i want to show to the visitors of my web mi list of webbinars, i can't make him log. I need the API autolog with my account to take the webbinar list.

Ty

@wergh
Copy link
Author

wergh commented May 1, 2017

Fixed!

If soomeone need it you only must change this:

in login.php:


if(!$organizer_key)
{
        $url = $citrix->auth_citrixonline();
         ?><script>
        location.reload();
        </script>
        
        <?php
}

And in the citrix.php replace this:

function auth_citrixonline($redirect_url = '') 
    {
		if($redirect_url == '')
		{
			$redirect_url = $this->get_current_url();
		}
		if($this->citrix_api_key == '')
		{
			throw new Exception('Please set citrix_api_key.');
		}
		$reponse = json_decode($this->make_request('https://api.citrixonline.com/oauth/access_token?grant_type=password&user_id=YOUR_ACCOUNT_ID&password=YOUR_PASSWORD&client_id=' . $this->citrix_api_key),true);
               
                $_SESSION['citrix_access_token']=$reponse['access_token'];
                $_SESSION['citrix_expires_in']=$reponse['expires_in'];
                $_SESSION['citrix_refresh_token']=$reponse['refresh_token'];
                $_SESSION['citrix_organizer_key']=$reponse['organizer_key'];
                $_SESSION['citrix_account_key']=$reponse['account_key'];
                $_SESSION['citrix_account_type']=$reponse['account_type'];
                $_SESSION['citrix_firstName']=$reponse['firstName'];
                $_SESSION['citrix_lastName']=$reponse['lastName'];
                $_SESSION['citrix_email']=$reponse['email'];
                $_SESSION['citrix_platform']=$reponse['platform'];
                $_SESSION['citrix_version']=$reponse['version'];
        }

This will make run the API without must manual loggin into the web

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant