more security stuff
parent
0db1f88b7f
commit
ab0082c735
@ -0,0 +1,9 @@
|
||||
<?php
|
||||
|
||||
function get_header($key) {
|
||||
$headers = getallheaders();
|
||||
|
||||
return isset($headers[$key])
|
||||
? $headers[$key]
|
||||
: NULL;
|
||||
}
|
@ -0,0 +1,11 @@
|
||||
<?php
|
||||
class AccessException extends Exception {
|
||||
public function __construct($code)
|
||||
{
|
||||
$message = '';
|
||||
if ($code == 422) {
|
||||
$message = 'The X-Auth-Token is invalid';
|
||||
}
|
||||
parent::__construct($message, $code);
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue