Changeset 2086483
- Timestamp:
- 05/13/2019 04:40:54 AM (7 years ago)
- Location:
- narnoo-distributor/trunk
- Files:
-
- 9 edited
-
class-narnoo-distributor-helper.php (modified) (1 diff)
-
libs/narnoo-php-sdk/Narnoo/Access/Access.php (modified) (1 diff)
-
libs/narnoo-php-sdk/Narnoo/Authenticate/Authenticate.php (modified) (2 diffs)
-
libs/narnoo-php-sdk/Narnoo/Booking/Booking.php (modified) (1 diff)
-
libs/narnoo-php-sdk/Narnoo/Business/Business.php (modified) (1 diff)
-
libs/narnoo-php-sdk/Narnoo/Connect/Connect.php (modified) (1 diff)
-
libs/narnoo-php-sdk/Narnoo/Media/Media.php (modified) (1 diff)
-
libs/narnoo-php-sdk/Narnoo/Product/Product.php (modified) (1 diff)
-
libs/narnooauthn.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
narnoo-distributor/trunk/class-narnoo-distributor-helper.php
r2016600 r2086483 132 132 $_apiToken = get_option( 'narnoo_api_token' ); 133 133 } 134 135 /** 136 * 137 * Check to see if the current token is expired or not 138 * 139 **/ 140 $narnooToken = new NarnooToken(); 141 $tokenValid = $narnooToken->validCheck( $_apiToken ); 142 if(empty($tokenValid)){ 143 $apiToken = $narnooToken->authenticate($options['access_key'], $options['secret_key']); 144 if(!empty($apiToken)){ 145 update_option( 'narnoo_api_token', $apiToken, 'yes' ); 146 $_apiToken = $apiToken; 147 }else{ 148 return null; 149 } 150 } 151 //End 134 152 135 153 //var_dump($_apiToken); -
narnoo-distributor/trunk/libs/narnoo-php-sdk/Narnoo/Access/Access.php
r1927097 r2086483 1 <? 1 <?php 2 2 3 3 namespace Narnoo\Access; -
narnoo-distributor/trunk/libs/narnoo-php-sdk/Narnoo/Authenticate/Authenticate.php
r1927097 r2086483 1 <? 1 <?php 2 2 3 3 namespace Narnoo\Authenticate; … … 45 45 **************************************************/ 46 46 47 /************************************************** 48 * 49 * --- Valid Check --- 50 * 51 **************************************************/ 52 53 /** 54 * @title: Get Products 55 * @date: 25.06.2018 56 * @param: int business ID [optional] 57 * @result: JSON 58 */ 59 public function valid() 60 { 61 62 try{ 63 $url = "/token/validate"; 64 $response = $this->callNarnooAPI("get",$url); 65 return $response; 66 } catch (Exception $e) { 67 $response = array("error" => $e->getMessage()); 68 return $response; 69 } 70 } 71 72 73 /************************************************** 74 * 75 * --- .Valid Check --- 76 * 77 **************************************************/ 78 47 79 48 80 -
narnoo-distributor/trunk/libs/narnoo-php-sdk/Narnoo/Booking/Booking.php
r1927097 r2086483 1 <? 1 <?php 2 2 3 3 namespace Narnoo\Booking; -
narnoo-distributor/trunk/libs/narnoo-php-sdk/Narnoo/Business/Business.php
r1927097 r2086483 1 <? 1 <?php 2 2 3 3 namespace Narnoo\Business; -
narnoo-distributor/trunk/libs/narnoo-php-sdk/Narnoo/Connect/Connect.php
r1927097 r2086483 1 <? 1 <?php 2 2 3 3 namespace Narnoo\Connect; -
narnoo-distributor/trunk/libs/narnoo-php-sdk/Narnoo/Media/Media.php
r1927097 r2086483 1 <? 1 <?php 2 2 3 3 namespace Narnoo\Media; -
narnoo-distributor/trunk/libs/narnoo-php-sdk/Narnoo/Product/Product.php
r1927097 r2086483 1 <? 1 <?php 2 2 3 3 namespace Narnoo\Product; -
narnoo-distributor/trunk/libs/narnooauthn.php
r1927097 r2086483 19 19 } 20 20 21 public function validCheck($token){ 22 23 $authn = new Authenticate(); 24 $authn->setToken($token); 25 $token = $authn->valid(); 26 if( !empty($token->data) ){ 27 return TRUE; 28 }else{ 29 return FALSE; 30 } 31 } 32 21 33 22 34 }
Note: See TracChangeset
for help on using the changeset viewer.