Finished up password grant

This commit is contained in:
Josh Sherman 2014-10-13 22:50:43 -04:00
parent ec14621e7c
commit 49a713eb35
3 changed files with 17 additions and 23 deletions

View file

@ -26,15 +26,6 @@ namespace Pickles;
*/
class Resource extends Object
{
/**
* HTTPS
*
* Whether or not the page should be loaded via HTTP Secure.
*
* @var boolean defaults to false
*/
public $https = false;
/**
* Filter
*
@ -83,14 +74,6 @@ class Resource extends Object
try
{
// Determines if we need to serve over HTTP or HTTPS
if (($this->https === true
|| (isset($this->https[$method]) && $this->https[$method]))
&& (!isset($_SERVER['HTTPS']) || $_SERVER['HTTPS'] == false))
{
throw new \Exception('HTTPS is required.', 400);
}
// Check auth if flag is explicitly true or is true for the method
if ($this->auth === true
|| (isset($this->auth[$method]) && $this->auth[$method]))
@ -101,7 +84,7 @@ class Resource extends Object
}
}
// Hack together some new globals
// Hacks together some new globals
if (in_array($method, ['PUT', 'DELETE']))
{
$GLOBALS['_' . $method] = [];
@ -337,7 +320,7 @@ class Resource extends Object
{
http_response_code($this->status);
header('Content-Type: application/json');
header('X-Powered-By: Pickles v2 - https://picklesphp.com');
header('X-Powered-By: Pickles (http://picklesphp.com)');
$meta = [
'status' => $this->status,