I have created one application in YiiFramework which has two functionalities.
1. Login to google
For login to google, I have followed the tutorial on below website.
Tutorial : https://github.com/Nodge/yii-eauth
Tutorial Demo : http://nodge.ru/yii-eauth/demo/login
2 Get calendar using Zend_Gdata Library
Tutorial : http://www.bcits.co.in/googlecalendar/index.php/site/install
Tutorial Demo : http://www.bcits.co.in/googlecalendar/index.php/site/page?view=about
[1st Step] I get successfully login to my application using yii-eauth.
[2nd Step] when I need to use calendar, I am giving hard coded gmail Id and password.
I am accessing calendar in this way.
<?php
$user = 'your gmail username';
$pass ='your gmail password';
Yii::app()->CALENDAR->login($user, $pass);
?>
login() in googlecalendar.php file.
public function login($user, $pass) {
$service = Zend_Gdata_Calendar::AUTH_SERVICE_NAME;
$client = Zend_Gdata_ClientLogin::getHttpClient($user, $pass, $service);// It uses hard-coded gmail/password to get login again
$calenderlist = $this->outputCalendarList($client);
$events = $this->outputCalendar($client);
$calendardate = $this->outputCalendarByDateRange($client, $startDate = '2011-05-01', $endDate = '2011-06-01');
.........
}
Does Zend_Gdata library contain any function which automatically gets calendar of current user without again logging in(hard-coded here).
Stuck with this. Appreciate helps. Thanks