Skip to content

Commit

Permalink
-- 7.x-3.2 --
Browse files Browse the repository at this point in the history
 1. Capitalised HTTP method names
  • Loading branch information
SUDHANSHU authored and SUDHANSHU committed Aug 17, 2018
1 parent 754051a commit bdd607a
Show file tree
Hide file tree
Showing 21 changed files with 99 additions and 97 deletions.
Binary file modified drupal-7/package/ciam_loginradius.zip
Binary file not shown.
3 changes: 3 additions & 0 deletions drupal-7/src/ciam_loginradius/README.txt
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,9 @@ Please share your comments and feedback at [email protected]

-- Changelog --

-- 7.x-3.2 --
1. Capitalised HTTP method names

-- 7.x-3.1 --
1. Implemented Cloud API Functionality
2. Removed Advanced options from Drupal admin as they can be configured from User Dashboard
Expand Down
2 changes: 1 addition & 1 deletion drupal-7/src/ciam_loginradius/ciam_loginradius.info
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name = CIAM LoginRadius
version = "7.x-3.0.0"
version = "7.x-3.2"
core = "7.x"
project = "ciam_loginradius"

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ public function getConfigurationList()
{
$options = array('authentication' => 'key');
$url = LR_CLOUD_ENDPOINT . "/ciam/appInfo";
return Functions::apiClient($url, '', $options);
}
return Functions::apiClient($url, '', $options);
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ public function webHooksSettings()
*/
public function subscribeWebHooks($target_url, $event = 'Login')
{
return $this->apiClientHandler('webhook', array('apikey' => Functions::getApiKey(), 'apisecret' => Functions::getApiSecret()), array('method' => 'post', 'post_data' => json_encode(array('TargetUrl' => $target_url, 'Event' => $event)), 'content_type' => 'json'));
return $this->apiClientHandler('webhook', array('apikey' => Functions::getApiKey(), 'apisecret' => Functions::getApiSecret()), array('method' => 'POST', 'post_data' => json_encode(array('TargetUrl' => $target_url, 'Event' => $event)), 'content_type' => 'json'));
}


Expand All @@ -73,7 +73,7 @@ public function getWebHooksSubscribedUrls($event = 'Login')
*/
public function unsubscribeWebHooks($target_url, $event = 'Login')
{
return $this->apiClientHandler('webhook', array('apikey' => Functions::getApiKey(), 'apisecret' => Functions::getApiSecret()), array('method' => 'delete', 'post_data' => json_encode(array('TargetUrl' => $target_url, 'Event' => $event)), 'content_type' => 'json'));
return $this->apiClientHandler('webhook', array('apikey' => Functions::getApiKey(), 'apisecret' => Functions::getApiSecret()), array('method' => 'DELETE', 'post_data' => json_encode(array('TargetUrl' => $target_url, 'Event' => $event)), 'content_type' => 'json'));
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
* @category : Clients
* @package : DefaultHttpClient
* @author : LoginRadius Team
* @version : 4.5.1
* @version : 4.5.3
* @license : https://opensource.org/licenses/MIT
*/

Expand Down Expand Up @@ -54,7 +54,6 @@ public function request($path, $query_array = array(), $options = array()) {
}
$request_url .= Functions::queryBuild($query_array);
}

if (in_array('curl', get_loaded_extensions())) {
$response = $this->curlApiMethod($request_url, $options);
}
Expand Down Expand Up @@ -83,7 +82,7 @@ public function request($path, $query_array = array(), $options = array()) {
*/
private function curlApiMethod($request_url, $options = array()) {
$ssl_verify = isset($options['ssl_verify']) ? $options['ssl_verify'] : false;
$method = isset($options['method']) ? strtolower($options['method']) : 'get';
$method = isset($options['method']) ? strtoupper($options['method']) : 'GET';
$data = isset($options['post_data']) ? $options['post_data'] : array();
$content_type = isset($options['content_type']) ? trim($options['content_type']) : 'x-www-form-urlencoded';
$sott_header_content = isset($options['X-LoginRadius-Sott']) ? trim($options['X-LoginRadius-Sott']) : '';
Expand All @@ -107,13 +106,13 @@ private function curlApiMethod($request_url, $options = array()) {

curl_setopt($curl_handle, CURLOPT_POSTFIELDS, (($content_type == 'json') ? $data : Functions::queryBuild($data)));

if ($method == 'post') {
if ($method == 'POST') {
curl_setopt($curl_handle, CURLOPT_POST, 1);
}
elseif ($method == 'delete') {
curl_setopt($curl_handle, CURLOPT_CUSTOMREQUEST, "delete");
elseif ($method == 'DELETE') {
curl_setopt($curl_handle, CURLOPT_CUSTOMREQUEST, "DELETE");
}
elseif ($method == 'put') {
elseif ($method == 'PUT') {
curl_setopt($curl_handle, CURLOPT_CUSTOMREQUEST, "PUT");
}
}
Expand All @@ -138,7 +137,7 @@ private function curlApiMethod($request_url, $options = array()) {
*/
private function fsockopenApiMethod($request_url, $options = array()) {
$ssl_verify = isset($options['ssl_verify']) ? $options['ssl_verify'] : false;
$method = isset($options['method']) ? strtolower($options['method']) : 'get';
$method = isset($options['method']) ? strtoupper($options['method']) : 'GET';
$data = isset($options['post_data']) ? $options['post_data'] : array();
$content_type = isset($options['content_type']) ? $options['content_type'] : 'form_params';
$sott_header_content = isset($options['X-LoginRadius-Sott']) ? trim($options['X-LoginRadius-Sott']) : '';
Expand All @@ -147,7 +146,7 @@ private function fsockopenApiMethod($request_url, $options = array()) {

$optionsArray = array('http' =>
array(
'method' => strtoupper($method),
'method' => $method,
'timeout' => 50,
'ignore_errors' => true,
'header' => 'Content-Type: application/' . $content_type
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
* @category : Clients
* @package : IHttpClient
* @author : LoginRadius Team
* @version : 4.5.1
* @version : 4.5.3
* @license : https://opensource.org/licenses/MIT
*/

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ public function __construct($apikey = '', $apisecret = '', $customize_options =
*/
public function createCustomObject($access_token, $objectname, $data, $fields = '*')
{
return $this->apiClientHandler("CustomObject", array('access_token' => $access_token,'ObjectName' => $objectname, 'fields' => $fields), array('method' => 'post', 'post_data' => $data, 'content_type' => 'json'));
return $this->apiClientHandler("CustomObject", array('access_token' => $access_token,'ObjectName' => $objectname, 'fields' => $fields), array('method' => 'POST', 'post_data' => $data, 'content_type' => 'json'));
}

/**
Expand All @@ -55,7 +55,7 @@ public function createCustomObject($access_token, $objectname, $data, $fields =
*/
public function updateCustomObjectData($access_token, $object_name, $object_record_id, $update_type, $data, $fields = '*')
{
return $this->apiClientHandler("CustomObject/" . $object_record_id, array('access_token' => $access_token,'ObjectName' => $object_name,'updatetype' => $update_type, 'fields' => $fields), array('method' => 'put', 'post_data' => $data, 'content_type' => 'json'));
return $this->apiClientHandler("CustomObject/" . $object_record_id, array('access_token' => $access_token,'ObjectName' => $object_name,'updatetype' => $update_type, 'fields' => $fields), array('method' => 'PUT', 'post_data' => $data, 'content_type' => 'json'));
}

/**
Expand Down Expand Up @@ -91,7 +91,7 @@ public function getCustomObjectSetByID($access_token, $object_name, $object_reco
*/
public function deleteCustomObjectSet($access_token, $object_name, $object_record_id, $fields = '*')
{
return $this->apiClientHandler("CustomObject/" . $object_record_id, array('access_token' => $access_token, 'ObjectName' => $object_name, 'fields' => $fields), array('method' => 'delete', 'post_data' => true));
return $this->apiClientHandler("CustomObject/" . $object_record_id, array('access_token' => $access_token, 'ObjectName' => $object_name, 'fields' => $fields), array('method' => 'DELETE', 'post_data' => true));
}

/**
Expand Down
Loading

0 comments on commit bdd607a

Please sign in to comment.