Skip to content

Commit

Permalink
Add files via upload
Browse files Browse the repository at this point in the history
  • Loading branch information
Kris-B authored Feb 27, 2017
1 parent 0e7be8f commit 4598ca3
Showing 1 changed file with 15 additions and 3 deletions.
18 changes: 15 additions & 3 deletions dist/authorize.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* http://nanogallery2.nanostudio.org
*
* PHP 5.2+
* @version 1.2.2
* @version 1.2.3
* @author Christophe Brisbois - http://www.brisbois.fr/
* @copyright Copyright 2017
* @license GPLv3
Expand All @@ -28,11 +28,18 @@
include('admin/config.php');
include('admin/tools.php');

// check CURL installation
if( !function_exists('curl_version') ) {
echo 'Please install/enable CURL to execute this application.';
response_json( array('nano_status' => 'error', 'nano_message' => 'Please install/enable CURL to execute this application.' ) );
exit;
}


// check write permissions
if( !is_writable('admin/users') ) {
response_json( array('nano_status' => 'error', 'nano_message' => 'Error: no write permissions to folder admin/users.' ) );
exit;
}

$prot='http://';
if (isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] != 'off'){
$prot='https://';
Expand Down Expand Up @@ -127,6 +134,11 @@
// we got the user ID
$user_id = $objProfile -> id;

if( $user_id = '' ) {
response_json( array('nano_status' => 'error', 'nano_message' => 'Retrieved user ID is empty.' ) );
exit;
}

if( property_exists( $authObj, 'refresh_token' ) ) {
// refresh token present -> ok, it's the first authorization grant
// store tokens
Expand Down

0 comments on commit 4598ca3

Please sign in to comment.