mirror of
https://github.com/alchemy-fr/Phraseanet.git
synced 2025-10-10 03:23:19 +00:00
update API
revert bad merge fix cs
This commit is contained in:
@@ -168,19 +168,6 @@ class API_OAuth2_Adapter extends OAuth2
|
||||
return $this->usr_id;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @param string $secret
|
||||
* @param string $nonce
|
||||
* @return string
|
||||
*/
|
||||
protected static function crypt_secret($secret, $nonce)
|
||||
{
|
||||
$registry = registry::get_instance();
|
||||
|
||||
return hash_hmac('sha512', $secret . $nonce, $registry->get('GV_sit'));
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* Implements OAuth2::checkClientCredentials().
|
||||
@@ -198,9 +185,7 @@ class API_OAuth2_Adapter extends OAuth2
|
||||
return true;
|
||||
}
|
||||
|
||||
$crypted = $this->crypt_secret($client_secret, $application->get_nonce());
|
||||
|
||||
return ($result["client_secret"] === $crypted);
|
||||
return ($application->get_client_secret() === $client_secret);
|
||||
} catch (Exception $e) {
|
||||
|
||||
}
|
||||
|
@@ -1063,7 +1063,7 @@ class API_V1_adapter extends API_V1_Abstract
|
||||
}
|
||||
|
||||
$record->set_metadatas($metadatas);
|
||||
$result->set_datas(array("metadatas" => $this->list_record_caption($record->get_caption())));
|
||||
$result->set_datas(array("record_metadatas" => $this->list_record_caption($record->get_caption())));
|
||||
} catch (Exception $e) {
|
||||
$result->set_error_message(API_V1_result::ERROR_BAD_REQUEST, _('An error occured'));
|
||||
}
|
||||
@@ -1817,7 +1817,7 @@ class API_V1_adapter extends API_V1_Abstract
|
||||
'mime_type' => $record->get_mime(),
|
||||
'title' => $record->get_title(),
|
||||
'original_name' => $record->get_original_name(),
|
||||
'updated-on' => $record->get_modification_date()->format(DATE_ATOM),
|
||||
'updated_on' => $record->get_modification_date()->format(DATE_ATOM),
|
||||
'created_on' => $record->get_creation_date()->format(DATE_ATOM),
|
||||
'collection_id' => phrasea::collFromBas($record->get_base_id()),
|
||||
'sha256' => $record->get_sha256(),
|
||||
|
Reference in New Issue
Block a user