make add/remove starter buttons date sensitive
This commit is contained in:
@@ -23,6 +23,15 @@ class participo
|
||||
return (isset($_SESSION) && array_key_exists('login', $_SESSION) && $_SESSION['login'] == true);
|
||||
}
|
||||
|
||||
public static function getSessionUserId()
|
||||
{
|
||||
$userId = null;
|
||||
if (isset($_SESSION) && array_key_exists('user', $_SESSION) && array_key_exists('userId', $_SESSION['user'])) {
|
||||
$userId = $_SESSION['user']['userId'];
|
||||
}
|
||||
return $userId;
|
||||
}
|
||||
|
||||
/** Remove all login data from the session data
|
||||
*
|
||||
* @return void
|
||||
@@ -541,3 +550,17 @@ function getHtmlSquareDate($date = null)
|
||||
. '<div style="font-size: small">' . $year . '</div>'
|
||||
. '</div>';
|
||||
}
|
||||
|
||||
/**
|
||||
* filter_var for a (db)id
|
||||
*
|
||||
* check for valid id; null is default; only values > 0 are excepted
|
||||
*
|
||||
* @param [type] $id
|
||||
* @retval int>0 filtered id
|
||||
* @retval null sth. went wrong
|
||||
*/
|
||||
function filterId($id)
|
||||
{
|
||||
return filter_var($id, FILTER_VALIDATE_INT, ['options' => ['default' => null, 'min_range' => 1]]);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user