minor fixes
This commit is contained in:
@@ -3,6 +3,7 @@ setlocale (LC_ALL, 'de_DE@euro', 'de_DE', 'de', 'ge');
|
|||||||
set_include_path(get_include_path() . PATH_SEPARATOR . "./lib/");
|
set_include_path(get_include_path() . PATH_SEPARATOR . "./lib/");
|
||||||
|
|
||||||
// configs and local data
|
// configs and local data
|
||||||
|
require_once 'config/participo.php';
|
||||||
require_once './local/cwsvJudo.php';
|
require_once './local/cwsvJudo.php';
|
||||||
|
|
||||||
// libraries
|
// libraries
|
||||||
|
|||||||
@@ -21,14 +21,12 @@ function init($config)
|
|||||||
|
|
||||||
function authorize()
|
function authorize()
|
||||||
{
|
{
|
||||||
if (array_key_exists("HTTP_AUTHORIZATION", $_SERVER)) {
|
if (array_key_exists("HTTP_AUTHORIZATION", $_SERVER) && (!empty($_SERVER["HTTP_AUTHORIZATION"])) ) {
|
||||||
if (!empty($_SERVER["HTTP_AUTHORIZATION"])) {
|
|
||||||
$auth = explode(" ", $_SERVER["HTTP_AUTHORIZATION"]);
|
$auth = explode(" ", $_SERVER["HTTP_AUTHORIZATION"]);
|
||||||
if ($auth[0] = "Basic") {
|
if ($auth[0] = "Basic") {
|
||||||
$allowKey = ApiKey::loadFromDb($auth[1]);
|
$allowKey = ApiKey::loadFromDb($auth[1]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
if (!$allowKey || !$allowKey->isValidFor("api")) {
|
if (!$allowKey || !$allowKey->isValidFor("api")) {
|
||||||
die(
|
die(
|
||||||
|
|||||||
@@ -3,10 +3,10 @@
|
|||||||
function processPostData($db, $post, $redirectLocation = '.')
|
function processPostData($db, $post, $redirectLocation = '.')
|
||||||
{
|
{
|
||||||
sleep(1);
|
sleep(1);
|
||||||
if ($post['action']) {
|
if (array_key_exists("action", $post)) {
|
||||||
// if there is a redirectlocation, set it
|
// if there is a redirectLocation, set it
|
||||||
if ($post['redirectLocation']) {
|
if (array_key_exists("redirectLocation", $post)) {
|
||||||
$redirectLocation = $post['redirectLocation'];
|
$redirectLocation = filter_var($post['redirectLocation'], FILTER_SANITIZE_URL);
|
||||||
}
|
}
|
||||||
|
|
||||||
// change a users password
|
// change a users password
|
||||||
|
|||||||
@@ -641,7 +641,7 @@ function logLoginsToJsonFile($userName, $fileName = 'lastLogins.json')
|
|||||||
function getCurPagesUrl()
|
function getCurPagesUrl()
|
||||||
{
|
{
|
||||||
$pageURL = 'http';
|
$pageURL = 'http';
|
||||||
if ($_SERVER['HTTPS'] == 'on') {
|
if ( array_key_exists("HTTPS", $_SERVER) && ($_SERVER['HTTPS'] == 'on')) {
|
||||||
$pageURL .= 's';
|
$pageURL .= 's';
|
||||||
}
|
}
|
||||||
$pageURL .= '://';
|
$pageURL .= '://';
|
||||||
|
|||||||
Reference in New Issue
Block a user