Skip to content

Commit

Permalink
Removed the commented codes and also added a handler to handle the c…
Browse files Browse the repository at this point in the history
…linet secret for the first time
  • Loading branch information
Amanskywalker committed Aug 18, 2017
1 parent 4599871 commit d275725
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 4 deletions.
15 changes: 11 additions & 4 deletions web/setups/clientsyncscript.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,6 @@

$curl = curl_init($service_url);

//var_dump($client_sceret);
//var_dump($server_auth_token);
//var_dump($fqdn);

$curl_post_data = array ('client_sceret' => $client_sceret,
'server_auth_token' => $server_auth_token,
'fqdn' => $fqdn );
Expand Down Expand Up @@ -53,6 +49,17 @@
// var_dump($decoded);

// instructions to update the client secrets
if (!isset($client_sceret) && empty($client_sceret)) {
$curl_post_data = array ('client_sceret' => $client_sceret);
$service_url = $server_url."/pecan/setups/add.php";
$curl = curl_init($service_url);
// set the curl to do POST request to add client secret to the config page
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
curl_setopt($curl, CURLOPT_POST, true);
curl_setopt($curl, CURLOPT_POSTFIELDS, $curl_post_data);
// execute the curl request
$curl_response = curl_exec($curl);
}

// script to handle wait id part
//echo $decoded->wantid;
Expand Down
1 change: 1 addition & 0 deletions web/setups/core.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
case 'browndog': $pattern = '/\$browndog*/i'; break;
case 'database': $pattern = '/\$db_bety_*/i'; break;
case 'fiadb': $pattern = '/\$db_fia_*/i'; break;
case 'client_sceret': $pattern = '/\$client_sceret*/i'; break;
default: $pattern = '/^\$'.$key.'/i';
}

Expand Down

0 comments on commit d275725

Please sign in to comment.