7

I am trying to use the Gcal API in PHP.

I am using the ZEND framework

function getAuthSubUrl($company) 
{
  $next = "http://$company.mysite.com";
  $scope = 'http://www.google.com/calendar/feeds/';
  $secure = false;
  $session = true;
  return (Zend_Gdata_AuthSub::getAuthSubTokenUri($next, $scope, $secure, $session));
}
$authSubUrl = getAuthSubUrl();
echo "<a href=\"$authSubUrl\">login to your Google account"</a> 

I am not sure what I am doing wrong here. I am following the google example almost exactly.

They do have $next = getCurrentUrl(); in their expample but I am getting undefined errors when I try that.

shaneburgess
  • 15,702
  • 15
  • 47
  • 66
  • 4
    I figured it out, I was using a subdomain that was forwarding to pages based on the subdomain. I guess Google tries to make sure that your $next page is real and mine were just forwards. Once I made $next the main domain it worked fine. I then just added some GET vars to the url to forward it back to the right place. – shaneburgess Mar 15 '10 at 16:10
  • I would alao like to add that you should look at the ZEND documentation as it is much better than Google's. http://framework.zend.com/manual/en/zend.gdata.html – shaneburgess Mar 17 '10 at 18:46
  • Yeah, this i what I just ran into too! – thenengah Apr 01 '11 at 05:38
  • 3
    Could you post the answer if it's solved? – yarson Jun 02 '11 at 11:29
  • @shaneburgess: Please post your solution as an answer (yes you can) and then accept it two days later? That will help to mark the question as answered. Thank you for your help. – hakre Jul 15 '11 at 22:27

1 Answers1

1

I figured it out, I was using a subdomain that was forwarding to pages based on the subdomain. I guess Google tries to make sure that your $next page is real and mine were just forwards. Once I made $next the main domain it worked fine. I then just added some GET vars to the url to forward it back to the right place.

//$next = "http://$company.mysite.com";
  $next = "http://mysite.com?company=$company";
shaneburgess
  • 15,702
  • 15
  • 47
  • 66