|
|
|
|
|
|
|
|
* @param OC_OCS_Result $result |
|
|
* @param OC_OCS_Result $result |
|
|
* @param string $format the format xml|json |
|
|
* @param string $format the format xml|json |
|
|
*/ |
|
|
*/ |
|
|
private static function respond($result, $format='xml') { |
|
|
|
|
|
|
|
|
public static function respond($result, $format='xml') { |
|
|
// Send 401 headers if unauthorised |
|
|
// Send 401 headers if unauthorised |
|
|
if($result->getStatusCode() === self::RESPOND_UNAUTHORISED) { |
|
|
if($result->getStatusCode() === self::RESPOND_UNAUTHORISED) { |
|
|
header('WWW-Authenticate: Basic realm="Authorisation Required"'); |
|
|
header('WWW-Authenticate: Basic realm="Authorisation Required"'); |