From f67d4768bb97a1e3f826ed49a8c4cb6a35fa918f Mon Sep 17 00:00:00 2001 From: alext Date: Sun, 11 Jun 2017 21:12:21 +0200 Subject: [PATCH] Do not use start_session directly as the required options from app config are not being used (#334). --- src/application/controllers/Google.php | 10 ++-------- src/application/libraries/Google_sync.php | 4 +--- 2 files changed, 3 insertions(+), 11 deletions(-) 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();