From 951330c9f83c8c8ee98f65fdccb5797e2e59d1f3 Mon Sep 17 00:00:00 2001 From: BlueRaja Date: Sat, 1 Jun 2013 20:10:36 -0500 Subject: A partial commit of the auth stuff, in case my upcoming changes break anything --- includes/OAuth/LinkedIn.php | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 includes/OAuth/LinkedIn.php (limited to 'includes/OAuth/LinkedIn.php') diff --git a/includes/OAuth/LinkedIn.php b/includes/OAuth/LinkedIn.php new file mode 100644 index 0000000..b72e20a --- /dev/null +++ b/includes/OAuth/LinkedIn.php @@ -0,0 +1,36 @@ +makeRequest($this->_access_token_url, 'POST', array(), $returnType, false, true); + + if($returnType != 'json'){ + $r = explode('&', $response); + $params = array(); + foreach($r as $v){ + $param = explode('=', $v); + $params[$param[0]] = $param[1]; + } + } else { + $params = $response; + } + + if(isset($params[$values[0]]) && isset($params[$values[1]])){ + $_SESSION[$this->_prefix]['access_token'] = $params[$values[0]]; + $_SESSION[$this->_prefix]['access_token_secret'] = $params[$values[1]]; + } else { + $s = ''; + foreach($params as $k => $v){ + $s = $k . '=' . $v; + } + throw new Exception('incorrect access token parameters returned: ' . implode('&', $s)); + } + } + +} \ No newline at end of file -- cgit v1.2.3