diff --git a/src/application/controllers/Google.php b/src/application/controllers/Google.php index e5a0fe4e..7a463e03 100644 --- a/src/application/controllers/Google.php +++ b/src/application/controllers/Google.php @@ -24,7 +24,8 @@ class Google extends CI_Controller { */ public function __construct() { parent::__construct(); - } + $this->load->library('session'); + } /** * Authorize Google Calendar API usage for a specific provider. @@ -37,9 +38,6 @@ class Google extends CI_Controller { */ public function oauth($provider_id) { // Store the provider id for use on the callback function. - if (!isset($_SESSION)) { - @session_start(); - } $_SESSION['oauth_provider_id'] = $provider_id; // Redirect browser to google user content page. @@ -67,10 +65,6 @@ class Google extends CI_Controller { $token = $this->google_sync->authenticate($_GET['code']); // Store the token into the database for future reference. - if (!isset($_SESSION)) { - @session_start(); - } - if (isset($_SESSION['oauth_provider_id'])) { $this->load->model('providers_model'); $this->providers_model->set_setting('google_sync', TRUE, diff --git a/src/application/libraries/Google_sync.php b/src/application/libraries/Google_sync.php index a65dbdb1..04bb8152 100644 --- a/src/application/libraries/Google_sync.php +++ b/src/application/libraries/Google_sync.php @@ -55,9 +55,7 @@ class Google_Sync { public function __construct() { $this->CI =& get_instance(); - if (!isset($_SESSION)) { - @session_start(); - } + $this->CI->load->library('session'); // Initialize google client and calendar service. $this->client = new Google_Client();