Update printgcp.modules.php
This commit is contained in:
parent
73041b0be5
commit
51da5ea1f0
@ -75,7 +75,7 @@ class printing_printgcp extends PrintingDriver
|
||||
$credentials = new Credentials(
|
||||
$this->google_id,
|
||||
$this->google_secret,
|
||||
$urlwithroot.'/core/modules/oauth/getgoogleoauthcallback.php'
|
||||
$urlwithroot.'/core/modules/oauth/google_oauthcallback.php'
|
||||
);
|
||||
$access = ($storage->hasAccessToken('Google')?'HasAccessToken':'NoAccessToken');
|
||||
$serviceFactory = new \OAuth\ServiceFactory();
|
||||
@ -113,7 +113,7 @@ class printing_printgcp extends PrintingDriver
|
||||
|
||||
if ($this->google_id != '' && $this->google_secret != '') {
|
||||
$this->conf[] = array('varname'=>'PRINTGCP_INFO', 'info'=>'GoogleAuthConfigured', 'type'=>'info');
|
||||
$this->conf[] = array('varname'=>'PRINTGCP_TOKEN_ACCESS', 'info'=>$access, 'type'=>'info', 'renew'=>$urlwithroot.'/core/modules/oauth/getgoogleoauthcallback.php?state=userinfo_email,userinfo_profile,cloud_print&backtourl='.urlencode(DOL_URL_ROOT.'/printing/admin/printing.php?mode=setup&driver=printgcp'), 'delete'=>($storage->hasAccessToken('Google')?$urlwithroot.'/core/modules/oauth/getgoogleoauthcallback.php?action=delete&backtourl='.urlencode(DOL_URL_ROOT.'/printing/admin/printing.php?mode=setup&driver=printgcp'):''));
|
||||
$this->conf[] = array('varname'=>'PRINTGCP_TOKEN_ACCESS', 'info'=>$access, 'type'=>'info', 'renew'=>$urlwithroot.'/core/modules/oauth/google_oauthcallback.php?state=userinfo_email,userinfo_profile,cloud_print&backtourl='.urlencode(DOL_URL_ROOT.'/printing/admin/printing.php?mode=setup&driver=printgcp'), 'delete'=>($storage->hasAccessToken('Google')?$urlwithroot.'/core/modules/oauth/getgoogleoauthcallback.php?action=delete&backtourl='.urlencode(DOL_URL_ROOT.'/printing/admin/printing.php?mode=setup&driver=printgcp'):''));
|
||||
if ($token_ok) {
|
||||
$refreshtoken = $token->getRefreshToken();
|
||||
$this->conf[] = array('varname'=>'PRINTGCP_TOKEN_REFRESH', 'info'=>((! empty($refreshtoken))?'Yes':'No'), 'type'=>'info');
|
||||
@ -122,10 +122,10 @@ class printing_printgcp extends PrintingDriver
|
||||
}
|
||||
/*
|
||||
if ($storage->hasAccessToken('Google')) {
|
||||
$this->conf[] = array('varname'=>'PRINTGCP_AUTHLINK', 'link'=>$urlwithroot.'/core/modules/oauth/getgoogleoauthcallback.php?backtourl='.urlencode(DOL_URL_ROOT.'/printing/admin/printing.php?mode=setup&driver=printgcp'), 'type'=>'authlink');
|
||||
$this->conf[] = array('varname'=>'PRINTGCP_DELETE_TOKEN', 'link'=>$urlwithroot.'/core/modules/oauth/getgoogleoauthcallback.php?action=delete&backtourl='.urlencode(DOL_URL_ROOT.'/printing/admin/printing.php?mode=setup&driver=printgcp'), 'type'=>'delete');
|
||||
$this->conf[] = array('varname'=>'PRINTGCP_AUTHLINK', 'link'=>$urlwithroot.'/core/modules/oauth/google_oauthcallback.php?backtourl='.urlencode(DOL_URL_ROOT.'/printing/admin/printing.php?mode=setup&driver=printgcp'), 'type'=>'authlink');
|
||||
$this->conf[] = array('varname'=>'PRINTGCP_DELETE_TOKEN', 'link'=>$urlwithroot.'/core/modules/oauth/google_oauthcallback.php?action=delete&backtourl='.urlencode(DOL_URL_ROOT.'/printing/admin/printing.php?mode=setup&driver=printgcp'), 'type'=>'delete');
|
||||
} else {
|
||||
$this->conf[] = array('varname'=>'PRINTGCP_AUTHLINK', 'link'=>$urlwithroot.'/core/modules/oauth/getgoogleoauthcallback.php?backtourl='.urlencode(DOL_URL_ROOT.'/printing/admin/printing.php?mode=setup&driver=printgcp'), 'type'=>'authlink');
|
||||
$this->conf[] = array('varname'=>'PRINTGCP_AUTHLINK', 'link'=>$urlwithroot.'/core/modules/oauth/google_oauthcallback.php?backtourl='.urlencode(DOL_URL_ROOT.'/printing/admin/printing.php?mode=setup&driver=printgcp'), 'type'=>'authlink');
|
||||
}*/
|
||||
} else {
|
||||
$this->conf[] = array('varname'=>'PRINTGCP_INFO', 'info'=>'GoogleAuthNotConfigured', 'type'=>'info');
|
||||
@ -200,7 +200,7 @@ class printing_printgcp extends PrintingDriver
|
||||
$credentials = new Credentials(
|
||||
$this->google_id,
|
||||
$this->google_secret,
|
||||
DOL_MAIN_URL_ROOT.'/core/modules/oauth/getgoogleoauthcallback.php'
|
||||
DOL_MAIN_URL_ROOT.'/core/modules/oauth/google_oauthcallback.php'
|
||||
);
|
||||
$serviceFactory = new \OAuth\ServiceFactory();
|
||||
$apiService = $serviceFactory->createService('Google', $credentials, $storage, array());
|
||||
@ -387,7 +387,7 @@ class printing_printgcp extends PrintingDriver
|
||||
$credentials = new Credentials(
|
||||
$this->google_id,
|
||||
$this->google_secret,
|
||||
DOL_MAIN_URL_ROOT.'/core/modules/oauth/getgoogleoauthcallback.php'
|
||||
DOL_MAIN_URL_ROOT.'/core/modules/oauth/google_oauthcallback.php'
|
||||
);
|
||||
$serviceFactory = new \OAuth\ServiceFactory();
|
||||
$apiService = $serviceFactory->createService('Google', $credentials, $storage, array());
|
||||
|
||||
Loading…
Reference in New Issue
Block a user