30c3 theme

main
Philip Häusler 11 years ago
parent bfb0cacd54
commit 3c4321ff76

@ -1230,7 +1230,7 @@ CREATE TABLE IF NOT EXISTS `User` (
-- --
INSERT INTO `User` (`UID`, `Nick`, `Name`, `Vorname`, `Alter`, `Telefon`, `DECT`, `Handy`, `email`, `ICQ`, `jabber`, `Size`, `Passwort`, `Gekommen`, `Aktiv`, `Tshirt`, `color`, `Sprache`, `Avatar`, `Menu`, `lastLogIn`, `CreateDate`, `Art`, `kommentar`, `Hometown`, `api_key`) VALUES INSERT INTO `User` (`UID`, `Nick`, `Name`, `Vorname`, `Alter`, `Telefon`, `DECT`, `Handy`, `email`, `ICQ`, `jabber`, `Size`, `Passwort`, `Gekommen`, `Aktiv`, `Tshirt`, `color`, `Sprache`, `Avatar`, `Menu`, `lastLogIn`, `CreateDate`, `Art`, `kommentar`, `Hometown`, `api_key`) VALUES
(1, 'admin', 'Gates', 'Bill', 42, '', '', '', '', '', '', '', '$23PstrXfk7Nw', 1, 1, 0, 10, 'DE', 115, 'L', 1371899094, '0000-00-00 00:00:00', '', '', '', ''); (1, 'admin', 'Gates', 'Bill', 42, '', '', '', '', '', '', '', '$23PstrXfk7Nw', 1, 1, 0, 1, 'DE', 115, 'L', 1371899094, '0000-00-00 00:00:00', '', '', '', '');
-- -------------------------------------------------------- -- --------------------------------------------------------

@ -1,25 +1,26 @@
<?php <?php
/** /**
* Export filtered shifts via JSON. (Like iCal Export or shifts view) * Export filtered shifts via JSON.
* (Like iCal Export or shifts view)
*/ */
function shifts_json_export_controller() { function shifts_json_export_controller() {
global $ical_shifts, $user; global $ical_shifts, $user;
if (isset ($_REQUEST['key']) && preg_match("/^[0-9a-f]{32}$/", $_REQUEST['key'])) if (isset($_REQUEST['key']) && preg_match("/^[0-9a-f]{32}$/", $_REQUEST['key']))
$key = $_REQUEST['key']; $key = $_REQUEST['key'];
else else
die("Missing key."); die("Missing key.");
$user = User_by_api_key($key); $user = User_by_api_key($key);
if($user === false) if ($user === false)
die("Unable to find user."); die("Unable to find user.");
if($user == null) if ($user == null)
die("Key invalid."); die("Key invalid.");
if(!in_array('shifts_json_export', privileges_for_user($user['UID']))) if (! in_array('shifts_json_export', privileges_for_user($user['UID'])))
die("No privilege for shifts_json_export."); die("No privilege for shifts_json_export.");
if (isset ($_REQUEST['export']) && $_REQUEST['export'] == 'user_shifts') { if (isset($_REQUEST['export']) && $_REQUEST['export'] == 'user_shifts') {
require_once ('includes/pages/user_shifts.php'); require_once ('includes/pages/user_shifts.php');
view_user_shifts(); view_user_shifts();
} else { } else {

@ -2,6 +2,7 @@
/** /**
* Displays a fatal message and stops execution. * Displays a fatal message and stops execution.
*
* @param string $message * @param string $message
*/ */
function engelsystem_error($message) { function engelsystem_error($message) {

@ -4,7 +4,7 @@
* Gibt zwischengespeicherte Fehlermeldungen zurück und löscht den Zwischenspeicher * Gibt zwischengespeicherte Fehlermeldungen zurück und löscht den Zwischenspeicher
*/ */
function msg() { function msg() {
if (!isset ($_SESSION['msg'])) if (! isset($_SESSION['msg']))
return ""; return "";
$msg = $_SESSION['msg']; $msg = $_SESSION['msg'];
$_SESSION['msg'] = ""; $_SESSION['msg'] = "";
@ -20,7 +20,7 @@ function info($msg, $immediatly = false) {
return ""; return "";
return '<p class="info">' . $msg . '</p>'; return '<p class="info">' . $msg . '</p>';
} else { } else {
if (!isset ($_SESSION['msg'])) if (! isset($_SESSION['msg']))
$_SESSION['msg'] = ""; $_SESSION['msg'] = "";
$_SESSION['msg'] .= info($msg, true); $_SESSION['msg'] .= info($msg, true);
} }
@ -35,7 +35,7 @@ function error($msg, $immediatly = false) {
return ""; return "";
return '<p class="error">' . $msg . '</p>'; return '<p class="error">' . $msg . '</p>';
} else { } else {
if (!isset ($_SESSION['msg'])) if (! isset($_SESSION['msg']))
$_SESSION['msg'] = ""; $_SESSION['msg'] = "";
$_SESSION['msg'] .= error($msg, true); $_SESSION['msg'] .= error($msg, true);
} }
@ -50,7 +50,7 @@ function success($msg, $immediatly = false) {
return ""; return "";
return '<p class="success">' . $msg . '</p>'; return '<p class="success">' . $msg . '</p>';
} else { } else {
if (!isset ($_SESSION['msg'])) if (! isset($_SESSION['msg']))
$_SESSION['msg'] = ""; $_SESSION['msg'] = "";
$_SESSION['msg'] .= success($msg, true); $_SESSION['msg'] .= success($msg, true);
} }

@ -2,8 +2,10 @@
/** /**
* Creates a log entry. * Creates a log entry.
*
* @param $nick Username * @param $nick Username
* @param $message Log Message * @param $message Log
* Message
*/ */
function LogEntry_create($nick, $message) { function LogEntry_create($nick, $message) {
return sql_query("INSERT INTO `LogEntries` SET `timestamp`=" . sql_escape(time()) . ", `nick`='" . sql_escape($nick) . "', `message`='" . sql_escape($message) . "'"); return sql_query("INSERT INTO `LogEntries` SET `timestamp`=" . sql_escape(time()) . ", `nick`='" . sql_escape($nick) . "', `message`='" . sql_escape($message) . "'");
@ -13,8 +15,7 @@ function LogEntry_create($nick, $message) {
* Returns log entries of the last 24 hours with maximum count of 1000. * Returns log entries of the last 24 hours with maximum count of 1000.
*/ */
function LogEntries() { function LogEntries() {
return sql_select("SELECT * FROM `LogEntries` WHERE `timestamp` > " . (time() - 24*60*60) . " ORDER BY `timestamp` DESC LIMIT 1000"); return sql_select("SELECT * FROM `LogEntries` WHERE `timestamp` > " . (time() - 24 * 60 * 60) . " ORDER BY `timestamp` DESC LIMIT 1000");
} }
?> ?>

@ -2,17 +2,23 @@
/** /**
* Load a string by key. * Load a string by key.
*
* @param string $textid * @param string $textid
* @param string $sprache * @param string $sprache
*/ */
function Sprache($textid, $sprache) { function Sprache($textid, $sprache) {
$sprache_source = sql_select("SELECT * FROM `Sprache` WHERE `TextID`='" . sql_escape($textid) . "' AND `Sprache`='" . sql_escape($sprache) . "' LIMIT 1"); $sprache_source = sql_select("
if($sprache_source === false) SELECT *
FROM `Sprache`
WHERE `TextID`='" . sql_escape($textid) . "'
AND `Sprache`='" . sql_escape($sprache) . "'
LIMIT 1
");
if ($sprache_source === false)
return false; return false;
if(count($sprache_source) == 1) if (count($sprache_source) == 1)
return $sprache_source[0]; return $sprache_source[0];
return null; return null;
} }
?> ?>

@ -1,25 +1,29 @@
<?php <?php
/** /**
* Returns user by id. * Returns user by id.
*
* @param $id UID * @param $id UID
*/ */
function User($id) { function User($id) {
$user_source = sql_select("SELECT * FROM `User` WHERE `UID`=" . sql_escape($id) . " LIMIT 1"); $user_source = sql_select("SELECT * FROM `User` WHERE `UID`=" . sql_escape($id) . " LIMIT 1");
if($user_source === false) if ($user_source === false)
return false; return false;
if(count($user_source) > 0) if (count($user_source) > 0)
return $user_source[0]; return $user_source[0];
return null; return null;
} }
/** /**
* Returns User by api_key. * Returns User by api_key.
* @param string $api_key User api key *
* @param string $api_key
* User api key
* @return Matching user, null or false on error * @return Matching user, null or false on error
*/ */
function User_by_api_key($api_key) { function User_by_api_key($api_key) {
$user = sql_select("SELECT * FROM `User` WHERE `api_key`='" . sql_escape($api_key) . "' LIMIT 1"); $user = sql_select("SELECT * FROM `User` WHERE `api_key`='" . sql_escape($api_key) . "' LIMIT 1");
if($user === false) if ($user === false)
return false; return false;
if (count($user) == 0) if (count($user) == 0)
return null; return null;
@ -28,12 +32,13 @@ function User_by_api_key($api_key) {
/** /**
* Generates a new api key for given user. * Generates a new api key for given user.
*
* @param User $user * @param User $user
*/ */
function User_reset_api_key(&$user) { function User_reset_api_key(&$user) {
$user['api_key'] = md5($user['Nick'] . time() . rand()); $user['api_key'] = md5($user['Nick'] . time() . rand());
$result = sql_query("UPDATE `User` SET `api_key`='" . sql_escape($user['api_key']) . "' WHERE `UID`='" . sql_escape($user['UID']) . "' LIMIT 1"); $result = sql_query("UPDATE `User` SET `api_key`='" . sql_escape($user['api_key']) . "' WHERE `UID`='" . sql_escape($user['UID']) . "' LIMIT 1");
if($result === false) if ($result === false)
return false; return false;
engelsystem_log("API key resetted."); engelsystem_log("API key resetted.");
} }

@ -15,7 +15,7 @@ function sql_close() {
function sql_transaction_start() { function sql_transaction_start() {
global $sql_nested_transaction_level; global $sql_nested_transaction_level;
if($sql_nested_transaction_level++ == 0) if ($sql_nested_transaction_level ++ == 0)
return sql_query("BEGIN"); return sql_query("BEGIN");
else else
return true; return true;
@ -27,7 +27,7 @@ function sql_transaction_start() {
function sql_transaction_commit() { function sql_transaction_commit() {
global $sql_nested_transaction_level; global $sql_nested_transaction_level;
if(--$sql_nested_transaction_level == 0) if (-- $sql_nested_transaction_level == 0)
return sql_query("COMMIT"); return sql_query("COMMIT");
else else
return true; return true;
@ -39,7 +39,7 @@ function sql_transaction_commit() {
function sql_transaction_rollback() { function sql_transaction_rollback() {
global $sql_nested_transaction_level; global $sql_nested_transaction_level;
if(--$sql_nested_transaction_level == 0) if (-- $sql_nested_transaction_level == 0)
return sql_query("ROLLBACK"); return sql_query("ROLLBACK");
else else
return true; return true;
@ -47,6 +47,7 @@ function sql_transaction_rollback() {
/** /**
* Logs an sql error. * Logs an sql error.
*
* @param string $message * @param string $message
* @return false * @return false
*/ */
@ -63,10 +64,15 @@ function sql_error($message) {
/** /**
* Connect to mysql server. * Connect to mysql server.
* @param string $host Host *
* @param string $user Username * @param string $host
* @param string $pass Password * Host
* @param string $db DB to select * @param string $user
* Username
* @param string $pass
* Password
* @param string $db
* DB to select
* @return mysqli The connection handler * @return mysqli The connection handler
*/ */
function sql_connect($host, $user, $pass, $db) { function sql_connect($host, $user, $pass, $db) {
@ -89,18 +95,21 @@ function sql_connect($host, $user, $pass, $db) {
/** /**
* Change the selected db in current mysql-connection. * Change the selected db in current mysql-connection.
* @param $db_name *
* @param
* $db_name
* @return bool true on success, false on error * @return bool true on success, false on error
*/ */
function sql_select_db($db_name) { function sql_select_db($db_name) {
global $sql_connection; global $sql_connection;
if (!$sql_connection->select_db($db_name)) if (! $sql_connection->select_db($db_name))
return sql_error("No database selected."); return sql_error("No database selected.");
return true; return true;
} }
/** /**
* MySQL SELECT query * MySQL SELECT query
*
* @param string $query * @param string $query
* @return Result array or false on error * @return Result array or false on error
*/ */
@ -119,8 +128,9 @@ function sql_select($query) {
/** /**
* MySQL execute a query * MySQL execute a query
*
* @param string $query * @param string $query
* @return mysqli_result|boolean Result resource or false on error * @return mysqli_result boolean resource or false on error
*/ */
function sql_query($query) { function sql_query($query) {
global $sql_connection; global $sql_connection;
@ -129,7 +139,7 @@ function sql_query($query) {
if ($result) { if ($result) {
return $result; return $result;
} else } else
usr_error("MySQL-query error: " . $query . " (" . $sql_connection->errno . ") " . $sql_connection->error); return sql_error("MySQL-query error: " . $query . " (" . $sql_connection->errno . ") " . $sql_connection->error);
} }
/** /**

@ -1,30 +1,29 @@
<?php <?php
// Testet ob ein User eingeloggt ist und lädt die entsprechenden Privilegien // Testet ob ein User eingeloggt ist und lädt die entsprechenden Privilegien
function load_auth() { function load_auth() {
global $user, $privileges; global $user, $privileges;
$user = null; $user = null;
if (isset ($_SESSION['uid'])) { if (isset($_SESSION['uid'])) {
$user = sql_select("SELECT * FROM `User` WHERE `UID`=" . sql_escape($_SESSION['uid']) . " LIMIT 1"); $user = sql_select("SELECT * FROM `User` WHERE `UID`=" . sql_escape($_SESSION['uid']) . " LIMIT 1");
if (count($user) > 0) { if (count($user) > 0) {
// User ist eingeloggt, Datensatz zur Verfügung stellen und Timestamp updaten // User ist eingeloggt, Datensatz zur Verfügung stellen und Timestamp updaten
list ($user) = $user; list ($user) = $user;
sql_query("UPDATE `User` SET " . "`lastLogIn` = '" . time() . "'" . " WHERE `UID` = '" . sql_escape($_SESSION['uid']) . "' LIMIT 1;"); sql_query("UPDATE `User` SET " . "`lastLogIn` = '" . time() . "'" . " WHERE `UID` = '" . sql_escape($_SESSION['uid']) . "' LIMIT 1;");
} else } else
unset ($_SESSION['uid']); unset($_SESSION['uid']);
} }
$privileges = isset ($user) ? privileges_for_user($user['UID']) : privileges_for_group(-1); $privileges = isset($user) ? privileges_for_user($user['UID']) : privileges_for_group(- 1);
} }
// generate a salt (random string) of arbitrary length suitable for the use with crypt() // generate a salt (random string) of arbitrary length suitable for the use with crypt()
function generate_salt($length = 16) { function generate_salt($length = 16) {
$alphabet = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"; $alphabet = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
$salt = ""; $salt = "";
for ($i = 0; $i < $length; $i++) { for($i = 0; $i < $length; $i ++) {
$salt .= $alphabet[rand(0, strlen($alphabet)-1)]; $salt .= $alphabet[rand(0, strlen($alphabet) - 1)];
} }
return $salt; return $salt;
} }
@ -45,7 +44,7 @@ function verify_password($password, $salt, $uid = false) {
elseif (strlen($salt) == 32) // old-style md5 without salt - not used anymore elseif (strlen($salt) == 32) // old-style md5 without salt - not used anymore
$correct = md5($password) == $salt; $correct = md5($password) == $salt;
if($correct && substr($salt, 0, strlen(CRYPT_ALG)) != CRYPT_ALG && $uid) { if ($correct && substr($salt, 0, strlen(CRYPT_ALG)) != CRYPT_ALG && $uid) {
// this password is stored in another format than we want it to be. // this password is stored in another format than we want it to be.
// let's update it! // let's update it!
// we duplicate the query from the above set_password() function to have the extra safety of checking the old hash // we duplicate the query from the above set_password() function to have the extra safety of checking the old hash
@ -64,7 +63,7 @@ function json_auth_service() {
$Pass = $_REQUEST['pw']; $Pass = $_REQUEST['pw'];
$SourceOuth = $_REQUEST['so']; $SourceOuth = $_REQUEST['so'];
if (isset ($CurrentExternAuthPass) && $SourceOuth == $CurrentExternAuthPass) { if (isset($CurrentExternAuthPass) && $SourceOuth == $CurrentExternAuthPass) {
$sql = "SELECT `UID`, `Passwort` FROM `User` WHERE `Nick`='" . sql_escape($User) . "'"; $sql = "SELECT `UID`, `Passwort` FROM `User` WHERE `Nick`='" . sql_escape($User) . "'";
$Erg = sql_select($sql); $Erg = sql_select($sql);

@ -1,4 +1,5 @@
<?php <?php
function counter() { function counter() {
global $p; global $p;

@ -1,13 +1,16 @@
<?php <?php
/** /**
* Write a log entry. This should be used to log user's activity. * Write a log entry.
* @param $message * This should be used to log user's activity.
*
* @param
* $message
*/ */
function engelsystem_log($message) { function engelsystem_log($message) {
global $user; global $user;
if(isset($user)) { if (isset($user)) {
$nick = $user['Nick']; $nick = $user['Nick'];
} else { } else {
$nick = "Guest"; $nick = "Guest";
@ -16,4 +19,23 @@ function engelsystem_log($message) {
LogEntry_create($nick, $message); LogEntry_create($nick, $message);
} }
/**
* Generates a PHP Stacktrace.
*/
function debug_string_backtrace() {
ob_start();
debug_print_backtrace();
$trace = ob_get_contents();
ob_end_clean();
// Remove first item from backtrace as it's this function which
// is redundant.
$trace = preg_replace('/^#0\s+' . __FUNCTION__ . "[^\n]*\n/", '', $trace, 1);
// Renumber backtrace items.
$trace = preg_replace('/^#(\d+)/me', '\'#\' . ($1 - 1)', $trace);
return $trace;
}
?> ?>

@ -1,29 +1,49 @@
<?php <?php
function page_link_to($page) { function page_link_to($page) {
return '?p=' . $page; return '?p=' . $page;
} }
function page_link_to_absolute($page) { function page_link_to_absolute($page) {
return (isset ($_SERVER['HTTPS']) ? 'https' : 'http') . '://' . $_SERVER['HTTP_HOST'] . preg_replace("/\?.*$/", '', $_SERVER['REQUEST_URI']) . page_link_to($page); return (isset($_SERVER['HTTPS']) ? 'https' : 'http') . '://' . $_SERVER['HTTP_HOST'] . preg_replace("/\?.*$/", '', $_SERVER['REQUEST_URI']) . page_link_to($page);
}
/**
* Renders the header toolbar containing search, login/logout, user and settings links.
*/
function header_toolbar() {
global $p, $privileges, $user;
$toolbar_items = array();
if(in_array('register', $privileges))
$toolbar_items[] = toolbar_item_link(page_link_to('register'), 'register', "Register", $p == 'register');
if(in_array('user_myshifts', $privileges))
$toolbar_items[] = toolbar_item_link(page_link_to('user_myshifts'), 'engel', $user['Nick'], $p == 'user_myshifts');
if(in_array('user_settings', $privileges))
$toolbar_items[] = toolbar_item_link(page_link_to('user_settings'), 'settings', "Settings", $p == 'user_settings');
if(in_array('login', $privileges))
$toolbar_items[] = toolbar_item_link(page_link_to('login'), 'login', "Login", $p == 'login');
if(in_array('logout', $privileges))
$toolbar_items[] = toolbar_item_link(page_link_to('logout'), 'logout', "Logout", $p == 'logout');
return toolbar($toolbar_items);
} }
function make_navigation() { function make_navigation() {
global $p; global $p;
global $privileges; global $privileges;
$menu_items = $privileges;
$menu_items[] = "faq";
$menu = ""; $menu = "";
// Standard Navigation $specials = array(
$menu .= make_navigation_for(Get_Text('/'), array (
"login",
"logout",
"register",
"faq" "faq"
)); );
// Engel Navigation $pages = array(
$menu .= make_navigation_for(Get_Text('inc_schicht_engel'), array (
"news", "news",
"user_meetings", "user_meetings",
"user_myshifts", "user_myshifts",
@ -31,11 +51,6 @@ function make_navigation() {
"user_messages", "user_messages",
"user_questions", "user_questions",
"user_wakeup", "user_wakeup",
"user_settings"
));
// Admin Navigation
$menu .= make_navigation_for(Get_Text('admin/'), array (
"admin_arrive", "admin_arrive",
"admin_active", "admin_active",
"admin_user", "admin_user",
@ -51,14 +66,19 @@ function make_navigation() {
"admin_language", "admin_language",
"admin_import", "admin_import",
"admin_log" "admin_log"
)); );
return $menu;
foreach ($pages as $page)
if (in_array($page, $privileges) || in_array($page, $specials))
$menu .= '<li' . ($page == $p ? ' class="selected"' : '') . '><a href="' . page_link_to($page) . '">' . Get_Text($page) . '</a></li>';
return '<nav><ul>' . $menu . '</ul></nav>';
} }
function make_navigation_for($name, $pages) { function make_navigation_for($name, $pages) {
global $privileges, $p; global $privileges, $p;
$specials = array ( $specials = array(
"faq" "faq"
); );

@ -1,6 +1,5 @@
<?php <?php
/** /**
* Leitet den Browser an die übergebene URL weiter und hält das Script an. * Leitet den Browser an die übergebene URL weiter und hält das Script an.
*/ */
@ -17,10 +16,11 @@ function strip_request_item($name) {
} }
/** /**
* Testet, ob der angegebene REQUEST Wert ein Integer ist, bzw. eine ID sein könnte. * Testet, ob der angegebene REQUEST Wert ein Integer ist, bzw.
* eine ID sein könnte.
*/ */
function test_request_int($name) { function test_request_int($name) {
if (isset ($_REQUEST[$name])) if (isset($_REQUEST[$name]))
return preg_match("/^[0-9]*$/", $_REQUEST[$name]); return preg_match("/^[0-9]*$/", $_REQUEST[$name]);
return false; return false;
} }

@ -1,29 +1,46 @@
<?php <?php
/** /**
* Liste der verfügbaren Themes * Liste der verfügbaren Themes
*/ */
$themes = array ( $themes = array(
"1" => "Standard-Style", "1" => "30C3 light",
"2" => "ot/Gelber Style", "2" => "30C3 dark"
"3" => "Club-Mate Style",
"5" => "Debian Style",
"6" => "c-base Style",
"7" => "Blau/Gelber Style",
"8" => "Pastel Style",
"4" => "Test Style",
"9" => "Test Style 21c3",
"10" => "Engelsystem 2.0",
"11" => "msquare (29c3)"
); );
/**
* Render a toolbar.
*
* @param array $items
* @return string
*/
function toolbar($items = array()) {
return '<div class="toolbar">' . join("\n", $items) . '</div>';
}
/**
* Render a link for a toolbar.
* @param string $href
* @param string $class
* @param string $label
* @param bool $selected
* @return string
*/
function toolbar_item_link($href, $class, $label, $selected = false) {
return '<a href="' . $href . '" class="' . ($selected ? 'selected ' : '') . '' . $class . '">' . $label . '</a>';
}
/** /**
* Rendert eine Liste von Checkboxen für ein Formular * Rendert eine Liste von Checkboxen für ein Formular
* @param name Die Namen der Checkboxen werden aus name_key gebildet *
* @param label Die Beschriftung der Liste * @param
* @param items Array mit den einzelnen Checkboxen * name Die Namen der Checkboxen werden aus name_key gebildet
* @param selected Array mit den Keys, die ausgewählt sind * @param
* label Die Beschriftung der Liste
* @param
* items Array mit den einzelnen Checkboxen
* @param
* selected Array mit den Keys, die ausgewählt sind
*/ */
function form_checkboxes($name, $label, $items, $selected) { function form_checkboxes($name, $label, $items, $selected) {
$html = "<ul>"; $html = "<ul>";
@ -38,11 +55,17 @@ function form_checkboxes($name, $label, $items, $selected) {
/** /**
* Rendert eine Tabelle von Checkboxen für ein Formular * Rendert eine Tabelle von Checkboxen für ein Formular
* @param names Assoziatives Array mit Namen der Checkboxen als Keys und Überschriften als Values *
* @param label Die Beschriftung der gesamten Tabelle * @param
* @param items Array mit den Beschriftungen der Zeilen * names Assoziatives Array mit Namen der Checkboxen als Keys und Überschriften als Values
* @param selected Mehrdimensionales Array, wobei $selected[foo] ein Array der in der Datenreihe foo markierten Checkboxen ist * @param
* @param disabled Wie selected, nur dass die entsprechenden Checkboxen deaktiviert statt markiert sind * label Die Beschriftung der gesamten Tabelle
* @param
* items Array mit den Beschriftungen der Zeilen
* @param
* selected Mehrdimensionales Array, wobei $selected[foo] ein Array der in der Datenreihe foo markierten Checkboxen ist
* @param
* disabled Wie selected, nur dass die entsprechenden Checkboxen deaktiviert statt markiert sind
*/ */
function form_multi_checkboxes($names, $label, $items, $selected, $disabled = array()) { function form_multi_checkboxes($names, $label, $items, $selected, $disabled = array()) {
$html = "<table><thead><tr>"; $html = "<table><thead><tr>";
@ -54,7 +77,7 @@ function form_multi_checkboxes($names, $label, $items, $selected, $disabled = ar
foreach ($names as $name => $title) { foreach ($names as $name => $title) {
$id = $name . '_' . $key; $id = $name . '_' . $key;
$sel = array_search($key, $selected[$name]) !== false ? ' checked="checked"' : ""; $sel = array_search($key, $selected[$name]) !== false ? ' checked="checked"' : "";
if (!empty($disabled) && !empty($disabled[$name]) && array_search($key, $disabled[$name]) !== false) if (! empty($disabled) && ! empty($disabled[$name]) && array_search($key, $disabled[$name]) !== false)
$sel .= ' disabled="disabled"'; $sel .= ' disabled="disabled"';
$html .= '<td style="text-align: center;"><input type="checkbox" id="' . $id . '" name="' . $name . '[]" value="' . $key . '"' . $sel . ' /></td>'; $html .= '<td style="text-align: center;"><input type="checkbox" id="' . $id . '" name="' . $name . '[]" value="' . $key . '"' . $sel . ' /></td>';
} }
@ -131,7 +154,8 @@ function form($elements, $action = "") {
} }
/** /**
* Generiert HTML Code für eine "Seite". Fügt dazu die übergebenen Elemente zusammen. * Generiert HTML Code für eine "Seite".
* Fügt dazu die übergebenen Elemente zusammen.
*/ */
function page($elements) { function page($elements) {
return join($elements); return join($elements);
@ -153,7 +177,7 @@ function table($columns, $rows, $data = true) {
foreach ($rows as $row) { foreach ($rows as $row) {
$html .= '<tr>'; $html .= '<tr>';
foreach ($columns as $key => $column) foreach ($columns as $key => $column)
if (isset ($row[$key])) if (isset($row[$key]))
$html .= '<td class="' . $key . '">' . $row[$key] . '</td>'; $html .= '<td class="' . $key . '">' . $row[$key] . '</td>';
else else
$html .= '<td class="' . $key . '">&nbsp;</td>'; $html .= '<td class="' . $key . '">&nbsp;</td>';
@ -235,11 +259,10 @@ function html_select_key($id, $name, $rows, $selected) {
} }
function img_button($link, $icon, $text, $extra_text = '') { function img_button($link, $icon, $text, $extra_text = '') {
$translation = empty($text)? '' : Get_Text($text); $translation = empty($text) ? '' : Get_Text($text);
return '<a href="' . htmlspecialchars($link) . '"><img src="pic/icons/' . htmlspecialchars($icon) . '.png" alt="' . $translation . '" ' . (empty($translation)? '' : 'title="' . $translation . '"') . '>' . (empty($extra_text)? '' : ' ' . $extra_text) . '</a>'; return '<a href="' . htmlspecialchars($link) . '"><img src="pic/icons/' . htmlspecialchars($icon) . '.png" alt="' . $translation . '" ' . (empty($translation) ? '' : 'title="' . $translation . '"') . '>' . (empty($extra_text) ? '' : ' ' . $extra_text) . '</a>';
} }
function ReplaceSmilies($neueckig) { function ReplaceSmilies($neueckig) {
$neueckig = str_replace(";o))", "<img src=\"pic/smiles/icon_redface.gif\">", $neueckig); $neueckig = str_replace(";o))", "<img src=\"pic/smiles/icon_redface.gif\">", $neueckig);
$neueckig = str_replace(":-))", "<img src=\"pic/smiles/icon_redface.gif\">", $neueckig); $neueckig = str_replace(":-))", "<img src=\"pic/smiles/icon_redface.gif\">", $neueckig);

@ -4,16 +4,29 @@
} }
body { body {
background: #fff;
font-family: Arial, sans-serif; font-family: Arial, sans-serif;
font-size: 14px; font-size: 14px;
} }
header { header {
background: #f0f0f0;
border-bottom: 1px solid #000;
display: block; display: block;
width: 100%; padding: 5px;
}
header .toolbar {
position: absolute;
right: 17px;
top: 17px;
}
.toolbar a {
padding: 0 10px 0 0;
} }
article, details { article,details {
clear: none; clear: none;
display: block; display: block;
float: none; float: none;
@ -24,31 +37,60 @@ article, details {
} }
#logo { #logo {
background: url('../pic/himmel.png') top left no-repeat; background: url('../pic/engelsystem_logo_30c3.png') top left no-repeat;
display: block; display: block;
height: 32px; float: left;
margin: 10px auto; height: 42px;
width: 380px; margin: 0;
} width: 202px;
#body {
margin: 0 20px 20px 20px;
} }
#menu { #menu {
float: left; float: left;
width: 200px; padding: 10px;
width: 180px;
}
#menu p {
padding: 4px;
}
#menu h4 {
font-size: 14px;
padding: 3px;
text-transform: capitalize;
}
#menu ul {
list-style: none;
margin: 0;
padding: 0;
}
#menu li a {
display: block;
padding: 3px;
}
#menu li a:hover, .toolbar a:hover {
color: #900;
}
#menu li.selected a, .toolbar a.selected {
color: #900;
font-weight: bold;
} }
#content { #content {
margin-left: 200px; margin-left: 200px;
padding: 10px;
} }
a { a {
color: #000; color: #000;
} }
th, td, dt, dd { th,td,dt,dd {
padding: 4px; padding: 4px;
vertical-align: top; vertical-align: top;
} }
@ -61,12 +103,14 @@ dd {
margin-left: 20px; margin-left: 20px;
} }
h1, h2, h3, h4 { h1,h2,h3,h4 {
font-size: 16px; font-size: 16px;
padding: 3px;
} }
h1, h4 { h1 {
padding: 0 4px; font-size: 18px;
margin-bottom: 10px;
} }
hr { hr {
@ -78,11 +122,11 @@ ul {
} }
nav { nav {
margin: 0 10px 10px 0; margin: 0 0 20px 0;
} }
#content > article { #content>article {
padding: 10px; padding: 3px;
} }
#content h2 { #content h2 {
@ -97,10 +141,6 @@ p {
padding: 0 0 10px 0; padding: 0 0 10px 0;
} }
#menu p {
padding: 4px;
}
a.sprache img { a.sprache img {
margin-right: 5px; margin-right: 5px;
} }
@ -111,6 +151,10 @@ table {
display: block; display: block;
} }
tr:hover > td {
background-color: #f0f0f0;
}
#shifts { #shifts {
background-color: #fff; background-color: #fff;
} }
@ -177,11 +221,12 @@ fieldset p label input {
th { th {
background: #f0f0f0; background: #f0f0f0;
} }
thead th { thead th {
vertical-align: bottom; vertical-align: bottom;
} }
td, th { td,th {
border: 1px solid #888; border: 1px solid #888;
} }
@ -231,19 +276,7 @@ tr:hover .hidden {
text-align: center; text-align: center;
} }
.background { .error,.info,.success {
background: #f0f0f0;
}
.container {
border: 1px solid #888;
}
.content {
background: #fff;
}
.error, .info, .success {
background: #f0f0f0; background: #f0f0f0;
border: 1px solid #888; border: 1px solid #888;
border-radius: 2px; border-radius: 2px;
@ -253,34 +286,38 @@ tr:hover .hidden {
} }
.error { .error {
background: #f99; background: #fff;
border-color: #900; border-color: #ed1a3b;
color: #ed1a3b;
font-weight: bold;
} }
.success { .success {
background: #9f9; background: #fff;
border-color: #090; border-color: rgb(0, 178, 107);
color: rgb(0, 178, 107);
font-weight: bold;
} }
.new_message { .new_message {
font-weight: bold; font-weight: bold;
} }
.news_comment, .news { .news_comment,.news {
border: 1px solid #888; border: 1px solid #888;
margin: 10px 0; margin: 10px 0;
} }
.news_comment details, .news details { .news_comment details,.news details {
background: #f0f0f0; background: #f0f0f0;
padding: 4px; padding: 4px;
} }
.news_comment p, .news p, h3 { .news_comment p,.news p,h3 {
padding: 4px; padding: 4px;
} }
.news_comment p, .news_comment details { .news_comment p,.news_comment details {
margin-left: 72px; margin-left: 72px;
} }
@ -320,7 +357,7 @@ tr:hover .hidden {
margin: 0 0 10px 0; margin: 0 0 10px 0;
} }
.button { a.button {
background: #f0f0f0; background: #f0f0f0;
border: 1px solid #888; border: 1px solid #888;
border-radius: 4px; border-radius: 4px;
@ -340,6 +377,11 @@ tr:hover .hidden {
background: #fff; background: #fff;
} }
.button.add {
background: url('../pic/icons/add.png') 2px 2px no-repeat;
padding-left: 20px;
}
.button.edit { .button.edit {
background: url('../pic/icons/pencil.png') 2px 2px no-repeat; background: url('../pic/icons/pencil.png') 2px 2px no-repeat;
padding-left: 20px; padding-left: 20px;
@ -355,6 +397,21 @@ tr:hover .hidden {
padding-left: 20px; padding-left: 20px;
} }
a.engel {
background: url('../pic/icons/engel.png') no-repeat;
padding-left: 20px;
}
a.logout {
background: url('../pic/icons/door_in.png') no-repeat;
padding-left: 20px;
}
a.settings {
background: url('../pic/icons/application_form_edit.png') no-repeat;
padding-left: 20px;
}
.form { .form {
border: 1px solid #888; border: 1px solid #888;
border-radius: 2px; border-radius: 2px;
@ -378,7 +435,7 @@ tr:hover .hidden {
margin-left: 250px; margin-left: 250px;
} }
.form input[type="text"], .form input[type="password"], .form textarea { .form input[type="text"],.form input[type="password"],.form textarea {
background: #fff; background: #fff;
border: 1px solid #888; border: 1px solid #888;
color: inherit; color: inherit;
@ -412,15 +469,21 @@ tr:hover .hidden {
padding: 0; padding: 0;
} }
.selection.rooms, .selection.rooms,.selection.days,.selection.types,.selection.filled {
.selection.days,
.selection.types,
.selection.filled {
display: inline-block; display: inline-block;
vertical-align: top; vertical-align: top;
margin-right: 15px; margin-right: 15px;
} }
.selection ul li.heading {
text-align: center;
font-weight: bold;
}
.selection ul li:nth-child(even) {
background: #f0f0f0;
}
#filter { #filter {
padding: 10px; padding: 10px;
} }

@ -1,62 +0,0 @@
function isClass(object, className) {
return (object.className.search('(^|\\s)' + className + '(\\s|$)') != -1);
}
var grossbild_an = 0
function grossbild_over(e) {
if(grossbild_an) return
grossbild_an = 1
if(!e) e = window.event;
body = document.getElementsByTagName("body")[0]
i = document.createElement("img")
i.src = e.target.src;
i.style.position = "absolute"
/*a = ""
for(b in e) a += b + " "
alert(a)*/
i.style.top = e.clientY + window.scrollY
i.style.left = e.clientX + window.scrollX
i.id = "mouseoverphoto"
i.onmouseover = grossbild_over
i.onmouseout = grossbild_out
//i.onmousemove = grossbild_move
body.appendChild(i);
}
function grossbild_out(e) {
if(!grossbild_an) return
grossbild_an = 0
if(!e) e = window.event;
body = document.getElementsByTagName("body")[0]
i = document.getElementById("mouseoverphoto")
body.removeChild(i)
}
function grossbild_move(e) {
if(!e) e = window.event;
i = document.getElementById("mouseoverphoto")
i.style.top = e.clientY + window.scrollY
i.style.left = e.clientX + window.scrollX
}
function grossbild_register(objekt) {
objekt.onmouseover = grossbild_over
objekt.onmouseout = grossbild_out
objekt.onmousemove = grossbild_move
}
function grossbild_registrieren() {
if(grossbild_altonload)
grossbild_altonload()
objekte = document.getElementsByTagName("img");
for(var i = 0; i < objekte.length; i++) {
if(isClass(objekte[i], "photo")) {
grossbild_register(objekte[i])
}
}
}
var grossbild_altonload = window.onload
window.onload = grossbild_registrieren

@ -1,83 +1,3 @@
#logo {
body, .background { background-image: url('../pic/engelsystem_logo_30c3.png');
background-color: #131313;
color: #424242;
line-height: 150%;
font-family: Trebuchet MS, Lucida Grande, Arial, sans-serif;
}
a {
text-decoration: none;
color: #424242
}
td {
font-size: small
}
a:active, a:hover {
font-weight: bold
}
li {
font-size: small
}
.content {
background-color: #131313;
color: #424242;
}
.contenttopic, h1 {
font-weight: bold;
font-size: small;
color: #000000;
background-color: #333333
}
.border, .container {
background-color: #333333;
border: 1px solid #424242;
}
.menu {
background-color: #131313;
color: #424242;
font-size: small
}
h4 {
background-color: #333333;
font-weight: bold;
font-size: small;
color: #000000
}
.linkbox {
background-color: #ffffff
}
.linkboxtitle {
font-weight: bold;
background-color: #000000;
color: #ffffff
}
.question {
font-weight: bold;
font-size: 9pt
}
.engeltreffen {
font-weight: bold;
font-size: 9pt;
color: #ff0000;
}
.answer {
font-size: 9pt;
}
.comment {
font-size: 6pt;
} }

@ -1,11 +0,0 @@
#logo {
background: url('../pic/engelsystem_logo_cccamp2011.png') top left no-repeat;
display: block;
height: 69px;
margin: 10px auto;
width: 523px;
}
tr:hover > td {
background: #f0f0f0;
}

@ -1,53 +0,0 @@
body.background {
background: #000532;
}
footer, footer a {
color: #fff;
}
#body {
background: #fff;
border: 1px solid #fff;
border-radius: 2px;
padding: 20px;
}
.content {
background: transparent;
}
#logo {
background: url('../pic/engelsystem_logo_29c3.png') top left no-repeat #fff;
display: block;
height: 100px;
margin: 10px;
width: 900px;
}
tr:hover > td {
background-color: #f0f0f0;
}
.selection ul li.heading {
text-align: center;
font-weight: bold;
}
.selection ul li:nth-child(even) {
background: #f0f0f0;
}
.error {
background: #fff;
border-color: #ed1a3b;
color: #ed1a3b;
font-weight: bold;
}
.success {
background: #fff;
border-color: rgb(0, 178, 107);
color: rgb(0, 178, 107);
font-weight: bold;
}

@ -1,117 +1,65 @@
body { body {
font-size : small; background-color: #222;
font-family : Arial; color: #bbb;
background-color : #f3b115;
color : navy;
}
a {
font-family : Arial;
font-size : small;
text-decoration : none;
color : #0000a0;
}
td {
font-size : small;
} }
A:Visited { header, details,.news_comment details, .news details {
font-family : Arial; background-color: #333;
font-size : small;
color : #0000a0;
text-decoration : none;
} }
A:Active { #logo {
text-decoration : none; background-image: url('../pic/engelsystem_logo_30c3.png');
font-family : Arial;
font-size : small;
} }
A:Hover { a {
font-family : Arial; color: #fff;
font-size : small;
color : #0000a0;
text-decoration : underline;
font-weight : bold;
}
li {
font-size: small
}
H4 {
font-family : Arial,Verdana;
} }
#menu li.selected a,.toolbar a.selected,#menu li a:hover,.toolbar a:hover
B { {
font-weight : bold; color: #090;
font-family : Arial;
font-size : small;
} }
.content { .form input[type="text"],.form input[type="password"],.form textarea {
background-color: #aa8822; background-color: #333;
<!-- #ffeba2 -->
color: #000000
} }
.contenttopic { .error,.success,.info {
font-weight: bold; background-color: #333;
font-size: small;
color: #ffffff;
background-color: #ff1111
} }
<!-- #157cc1 -->
a.title { th,.hidden {
color:#ffa000; background-color: #333;
} }
.border {
background-color: #050509
}
.menu { tr:hover>td {
background-color: #bdd9ef; background-color: #333;
color: #000022;
font-size: small
} }
h4.menu { .selection ul li:nth-child(2n) {
font-weight: bold; background-color: #333;
font-size: small;
color: #3e9fef
} }
.linkbox { #shifts {
background-color: #ffffff background-color: #222;
} }
.linkboxtitle { #shifts td.free {
font-weight: bold; background-color: #322;
background-color: #000000;
color: #bdd9ef
} }
.question { #shifts td.occupied {
font-weight: bold; background-color: #232;
font-size: 9pt
} }
.engeltreffen { #shifts td.own {
font-weight: bold; background-color: #223;
font-size: 9pt;
color: #ff0000;
} }
.answer { #shifts td.collides {
font-size: 9pt; background-color: #333;
} }
.comment { a.button {
font-size : 6pt; background-color: #000;
} }

@ -1,105 +0,0 @@
body {
font-size : small;
font-family : Arial;
background-color : #f3b115;
color : navy;
}
a {
font-family : Arial;
font-size : small;
text-decoration : none;
color : #0000a0;
}
td {
font-size : small;
}
A:Visited {
font-family : Arial;
font-size : small;
color : #0000a0;
text-decoration : none;
}
A:Active {
text-decoration : none;
font-family : Arial;
font-size : small;
}
A:Hover {
font-family : Arial;
font-size : small;
color : #0000a0;
text-decoration : underline;
font-weight : bold;
}
li {
font-size: small
}
H4 {
font-family : Arial,Verdana;
}
B {
font-weight : bold;
font-family : Arial;
font-size : small;
}
.content {
background-color: #ffeba2;
color: #000000
}
.contenttopic {
font-weight: bold;
font-size: small;
color: #ffa000;
background-color: navy
}
a.title {
color:#ffa000;
}
.border {
background-color: #050509
}
.menu {
background-color: #ffeba2;
color: navy;
font-size: small
}
h4.menu {
font-weight: bold;
font-size: small;
}
.question {
font-weight: bold;
font-size: 9pt
}
.engeltreffen {
font-weight: bold;
font-size: 9pt;
color: #ff0000;
}
.answer {
font-size: 9pt;
}
.comment {
font-size : 6pt;
}

@ -1,70 +0,0 @@
body {
font-family: Arial;
background-color: #00009f;
color: #e0a09f;
font-size: small
}
a {
text-decoration: none;
color: #e0ffff
}
td {
font-size: small;
color: #e0a09f
}
a:active, a:hover {
font-weight: bold
}
li {
font-size: small
}
.content {
background-color: #90009f;
color: #e0a09f
}
.contenttopic {
font-weight: bold;
font-size: small;
color: #e0e09f;
background-color: #740057
}
.border {
background-color: #0000FF
}
.menu {
background-color: #5f0043;
color: #e0ff9f;
font-size: small
}
h4.menu {
font-weight: bold;
font-size: small;
color: #e0ff9f
}
.question {
font-weight: bold;
font-size: 9pt
}
.engeltreffen {
font-weight: bold;
font-size: 9pt;
color: #ff0000;
}
.answer {
font-size: 9pt;
}
.comment {
font-size : 6pt;
}

@ -1,79 +0,0 @@
body {
font-family: Verdana,Helvetica,Arial;
background-color: #e1d6d6;
color: #8a0000;
font-size: small
}
a {
text-decoration: none;
color: #583a3a
}
td {
font-size: small
}
a:active, a:hover {
font-weight: bold
}
li {
font-size: small
}
.content {
background-color: #e7e2e2;
color: #8a0000
}
.contenttopic {
font-weight: bold;
font-size: small;
color: #ffeded;
background-color: #8a0000
}
.border {
background-color: #8a0000
}
.menu {
background-color: #e7e2e2;
color: #8a0000;
font-size: small
}
h4.menu {
font-weight: bold;
font-size: small;
color: #8a0000
}
.linkbox {
background-color: #e7e2e2
}
.linkboxtitle {
font-weight: bold;
background-color: #e7e2e2;
color: #8a0000
}
.question {
font-weight: bold;
font-size: 9pt
}
.engeltreffen {
font-weight: bold;
font-size: 9pt;
color: #ff0000;
}
.answer {
font-size: 9pt;
}
.comment {
font-size : 6pt;
}

@ -1,76 +0,0 @@
body, .background {
font-family: Arial, Helvetica, sans-serif;
background-color: #121327;
color: #FFFFFF;
font-size: small
}
#logo {
background-image: url('../pic/himmel_w.png');
}
a {
text-decoration: none;
color: #ff9900
}
td {
font-size: small
}
a:active, a:hover {
font-weight: bold
}
li {
font-size: small
}
.content {
background-color: #636e77;
color: #FFFFFF
}
.contenttopic {
font-weight: bold;
font-size: small;
color: #FF9900;
background-color: #333e47
}
.border, .container {
background-color: #000000
}
.menu {
background-color: #1f203f;
color: #fff3bf;
font-size: small
}
h4.menu {
font-weight: bold;
font-size: small;
color: #fff3bf
}
.question {
font-weight: bold;
font-size: 9pt
}
.engeltreffen {
font-weight: bold;
font-size: 9pt;
color: #FF0000;
}
.answer {
font-size: 9pt;
}
.comment {
font-size : 6pt;
}
h4, h1, th {
background: #333E47;
}

@ -1,70 +0,0 @@
body {
font-family: Arial;
background-color: #353d87;
color: #FFFFFF;
font-size: small
}
a {
text-decoration: none;
color: #832fb8
}
td {
font-size: small;
color: #353d87
}
a:active, a:hover {
font-weight: bold
}
li {
font-size: small
}
.content {
background-color: #fff3bf;
color: #353d87
}
.contenttopic {
font-weight: bold;
font-size: small;
color: #fff3bf;
background-color: #353daa
}
.border {
background-color: #0000FF
}
.menu {
background-color: #c5bfff;
color: #973cff;
font-size: small
}
h4.menu {
font-weight: bold;
font-size: small;
color: #973cff
}
.question {
font-weight: bold;
font-size: 9pt
}
.engeltreffen {
font-weight: bold;
font-size: 9pt;
color: #ff0000;
}
.answer {
font-size: 9pt;
}
.comment {
font-size : 6pt;
}

@ -1,70 +0,0 @@
body {
font-family: Arial;
background-color: #a4ffff;
color: #f7ff00;
font-size: small
}
a {
text-decoration: none;
color: #a45f9f
}
td {
font-size: small;
color: #f7ff00
}
a:active, a:hover {
font-weight: bold
}
li {
font-size: small
}
.content {
background-color: #bd9bff;
color: #f7ff00
}
.contenttopic {
font-weight: bold;
font-size: small;
color: #f7ff00;
background-color: #ffb2ff
}
.border {
background-color: #0000FF
}
.menu {
background-color: #ffb2ff;
color: #f7ff00;
font-size: small
}
h4.menu {
font-weight: bold;
font-size: small;
color: #f7ff00
}
.question {
font-weight: bold;
font-size: 9pt
}
.engeltreffen {
font-weight: bold;
font-size: 9pt;
color: #ff0000;
}
.answer {
font-size: 9pt;
}
.comment {
font-size : 6pt;
}

@ -1,84 +0,0 @@
body {
background-color: #ffffff;
color: black;
line-height: 150%;
font-family: Trebuchet MS, Lucida Grande, Arial, sans-serif;
margin-bottom: 20px;
}
a {
text-decoration: none;
color: #304930
}
td {
font-size: small
}
a:active, a:hover {
font-weight: bold
}
li {
font-size: small
}
.content {
background-color: #ffffff;
color: #000000
}
.contenttopic {
font-weight: bold;
font-size: small;
color: #000000;
background-color: #A4C93C
}
.border {
background-color: #A4C93C
}
.menu {
background-color: #ffffff;
color: #000000;
font-size: small
}
h4.menu {
background-color: #A4C93C;
font-weight: bold;
font-size: small;
color: #000000
}
.linkbox {
background-color: #ffffff
}
.linkboxtitle {
font-weight: bold;
background-color: #000000;
color: #ffffff
}
.question {
font-weight: bold;
font-size: 9pt
}
.engeltreffen {
font-weight: bold;
font-size: 9pt;
color: #ff0000;
}
.answer {
font-size: 9pt;
}
.comment {
font-size : 6pt;
}

@ -35,12 +35,12 @@ sql_connect($config['host'], $config['user'], $config['pw'], $config['db']);
load_auth(); load_auth();
// JSON Authorisierung gewünscht? // JSON Authorisierung gewünscht?
if (isset ($_REQUEST['auth'])) if (isset($_REQUEST['auth']))
json_auth_service(); json_auth_service();
// Gewünschte Seite/Funktion // Gewünschte Seite/Funktion
$p = isset ($user) ? "news" : "login"; $p = isset($user) ? "news" : "login";
if (isset ($_REQUEST['p']) && preg_match("/^[a-z0-9_]*$/i", $_REQUEST['p']) && ($_REQUEST['p'] == 'stats' || (sql_num_query("SELECT * FROM `Privileges` WHERE `name`='" . sql_escape($_REQUEST['p']) . "' LIMIT 1") > 0))) if (isset($_REQUEST['p']) && preg_match("/^[a-z0-9_]*$/i", $_REQUEST['p']) && ($_REQUEST['p'] == 'stats' || (sql_num_query("SELECT * FROM `Privileges` WHERE `name`='" . sql_escape($_REQUEST['p']) . "' LIMIT 1") > 0)))
$p = $_REQUEST['p']; $p = $_REQUEST['p'];
$title = Get_Text($p); $title = Get_Text($p);
@ -49,141 +49,109 @@ $content = "";
if ($p == "ical") { if ($p == "ical") {
require_once ('includes/pages/user_ical.php'); require_once ('includes/pages/user_ical.php');
user_ical(); user_ical();
} } elseif ($p == "atom") {
elseif ($p == "atom") {
require_once ('includes/pages/user_atom.php'); require_once ('includes/pages/user_atom.php');
user_atom(); user_atom();
} } elseif ($p == "shifts_json_export") {
elseif ($p == "shifts_json_export") {
require_once ('includes/controller/shifts_controller.php'); require_once ('includes/controller/shifts_controller.php');
shifts_json_export_controller(); shifts_json_export_controller();
} } elseif ($p == "stats") {
elseif ($p == "stats") {
require_once ('includes/pages/guest_stats.php'); require_once ('includes/pages/guest_stats.php');
guest_stats(); guest_stats();
} } // Recht dafür vorhanden?
// Recht dafür vorhanden?
elseif (in_array($p, $privileges)) { elseif (in_array($p, $privileges)) {
if ($p == "news") { if ($p == "news") {
require_once ('includes/pages/user_news.php'); require_once ('includes/pages/user_news.php');
$content = user_news(); $content = user_news();
} } elseif ($p == "news_comments") {
elseif ($p == "news_comments") {
require_once ('includes/pages/user_news.php'); require_once ('includes/pages/user_news.php');
$content = user_news_comments(); $content = user_news_comments();
} } elseif ($p == "user_meetings") {
elseif ($p == "user_meetings") {
require_once ('includes/pages/user_news.php'); require_once ('includes/pages/user_news.php');
$content = user_meetings(); $content = user_meetings();
} } elseif ($p == "user_myshifts") {
elseif ($p == "user_myshifts") {
require_once ('includes/pages/user_myshifts.php'); require_once ('includes/pages/user_myshifts.php');
$content = user_myshifts(); $content = user_myshifts();
} } elseif ($p == "user_shifts") {
elseif ($p == "user_shifts") {
require_once ('includes/pages/user_shifts.php'); require_once ('includes/pages/user_shifts.php');
$content = user_shifts(); $content = user_shifts();
} } elseif ($p == "user_messages") {
elseif ($p == "user_messages") {
$content = user_messages(); $content = user_messages();
} } elseif ($p == "user_questions") {
elseif ($p == "user_questions") {
require_once ('includes/pages/user_questions.php'); require_once ('includes/pages/user_questions.php');
$content = user_questions(); $content = user_questions();
} } elseif ($p == "user_wakeup") {
elseif ($p == "user_wakeup") {
require_once ('includes/pages/user_wakeup.php'); require_once ('includes/pages/user_wakeup.php');
$content = user_wakeup(); $content = user_wakeup();
} } elseif ($p == "user_settings") {
elseif ($p == "user_settings") {
require_once ('includes/pages/user_settings.php'); require_once ('includes/pages/user_settings.php');
$content = user_settings(); $content = user_settings();
} } elseif ($p == "login") {
elseif ($p == "login") {
require_once ('includes/pages/guest_login.php'); require_once ('includes/pages/guest_login.php');
$content = guest_login(); $content = guest_login();
} } elseif ($p == "register") {
elseif ($p == "register") {
require_once ('includes/pages/guest_login.php'); require_once ('includes/pages/guest_login.php');
$content = guest_register(); $content = guest_register();
} } elseif ($p == "logout") {
elseif ($p == "logout") {
require_once ('includes/pages/guest_login.php'); require_once ('includes/pages/guest_login.php');
$content = guest_logout(); $content = guest_logout();
} } elseif ($p == "admin_questions") {
elseif ($p == "admin_questions") {
$content = admin_questions(); $content = admin_questions();
} } elseif ($p == "admin_user") {
elseif ($p == "admin_user") {
require_once ('includes/pages/admin_user.php'); require_once ('includes/pages/admin_user.php');
$content = admin_user(); $content = admin_user();
} } elseif ($p == "admin_user_angeltypes") {
elseif ($p == "admin_user_angeltypes") {
require_once ('includes/pages/admin_user_angeltypes.php'); require_once ('includes/pages/admin_user_angeltypes.php');
$content = admin_user_angeltypes(); $content = admin_user_angeltypes();
} } elseif ($p == "admin_arrive") {
elseif ($p == "admin_arrive") {
require_once ('includes/pages/admin_arrive.php'); require_once ('includes/pages/admin_arrive.php');
$content = admin_arrive(); $content = admin_arrive();
} } elseif ($p == "admin_active") {
elseif ($p == "admin_active") {
require_once ('includes/pages/admin_active.php'); require_once ('includes/pages/admin_active.php');
$content = admin_active(); $content = admin_active();
} } elseif ($p == "admin_free") {
elseif ($p == "admin_free") {
require_once ('includes/pages/admin_free.php'); require_once ('includes/pages/admin_free.php');
$content = admin_free(); $content = admin_free();
} } elseif ($p == "admin_news") {
elseif ($p == "admin_news") {
require_once ('includes/pages/admin_news.php'); require_once ('includes/pages/admin_news.php');
$content = admin_news(); $content = admin_news();
} } elseif ($p == "admin_angel_types") {
elseif ($p == "admin_angel_types") {
require_once ('includes/pages/admin_angel_types.php'); require_once ('includes/pages/admin_angel_types.php');
$content = admin_angel_types(); $content = admin_angel_types();
} } elseif ($p == "admin_rooms") {
elseif ($p == "admin_rooms") {
require_once ('includes/pages/admin_rooms.php'); require_once ('includes/pages/admin_rooms.php');
$content = admin_rooms(); $content = admin_rooms();
} } elseif ($p == "admin_groups") {
elseif ($p == "admin_groups") {
require_once ('includes/pages/admin_groups.php'); require_once ('includes/pages/admin_groups.php');
$content = admin_groups(); $content = admin_groups();
} } elseif ($p == "admin_faq") {
elseif ($p == "admin_faq") {
require_once ('includes/pages/admin_faq.php'); require_once ('includes/pages/admin_faq.php');
$content = admin_faq(); $content = admin_faq();
} } elseif ($p == "admin_language") {
elseif ($p == "admin_language") {
require_once ('includes/pages/admin_language.php'); require_once ('includes/pages/admin_language.php');
$content = admin_language(); $content = admin_language();
} } elseif ($p == "admin_import") {
elseif ($p == "admin_import") {
require_once ('includes/pages/admin_import.php'); require_once ('includes/pages/admin_import.php');
$content = admin_import(); $content = admin_import();
} } elseif ($p == "admin_shifts") {
elseif ($p == "admin_shifts") {
require_once ('includes/pages/admin_shifts.php'); require_once ('includes/pages/admin_shifts.php');
$content = admin_shifts(); $content = admin_shifts();
} } elseif ($p == "admin_log") {
elseif ($p == "admin_log") {
require_once ('includes/pages/admin_log.php'); require_once ('includes/pages/admin_log.php');
$content = admin_log(); $content = admin_log();
} else { } else {
require_once ('includes/pages/guest_start.php'); require_once ('includes/pages/guest_start.php');
$content = guest_start(); $content = guest_start();
} }
} } elseif ($p == "credits") {
elseif ($p == "credits") {
require_once ('includes/pages/guest_credits.php'); require_once ('includes/pages/guest_credits.php');
$content = guest_credits(); $content = guest_credits();
} } elseif ($p == "faq") {
elseif ($p == "faq") {
require_once ('includes/pages/guest_faq.php'); require_once ('includes/pages/guest_faq.php');
$content = guest_faq(); $content = guest_faq();
} else { } else {
// Wenn schon eingeloggt, keine-Berechtigung-Seite anzeigen // Wenn schon eingeloggt, keine-Berechtigung-Seite anzeigen
if (isset ($user)) { if (isset($user)) {
$title = Get_Text("no_access_title"); $title = Get_Text("no_access_title");
$content = Get_Text("no_access_text"); $content = Get_Text("no_access_text");
} else { } else {
@ -193,27 +161,28 @@ elseif ($p == "faq") {
} }
// Hinweis für ungelesene Nachrichten // Hinweis für ungelesene Nachrichten
if (isset ($user) && $p != "user_messages") if (isset($user) && $p != "user_messages")
$content = user_unread_messages() . $content; $content = user_unread_messages() . $content;
// Hinweis für Engel, die noch nicht angekommen sind // Hinweis für Engel, die noch nicht angekommen sind
if(isset($user) && $user['Gekommen'] == 0) if (isset($user) && $user['Gekommen'] == 0)
$content = error("You are not marked as arrived. Please go to heaven's desk, get your angel badge and/or tell them that you arrived already.", true) . $content; $content = error("You are not marked as arrived. Please go to heaven's desk, get your angel badge and/or tell them that you arrived already.", true) . $content;
// Erzengel Hinweis für unbeantwortete Fragen // Erzengel Hinweis für unbeantwortete Fragen
if (isset ($user) && $p != "admin_questions") if (isset($user) && $p != "admin_questions")
$content = admin_new_questions() . $content; $content = admin_new_questions() . $content;
// Erzengel Hinweis für freizuschaltende Engeltypen // Erzengel Hinweis für freizuschaltende Engeltypen
if (isset ($user) && $p != "admin_user_angeltypes") if (isset($user) && $p != "admin_user_angeltypes")
$content = admin_new_user_angeltypes() . $content; $content = admin_new_user_angeltypes() . $content;
echo template_render('../templates/layout.html', array ( echo template_render('../templates/layout.html', array (
'theme' => isset ($user) ? $user['color'] : $default_theme, 'theme' => isset($user) ? $user['color'] : $default_theme,
'title' => $title, 'title' => $title,
'atom_link' => ($p == 'news' || $p == 'user_meetings')? '<link href="' . page_link_to('atom') . (($p == 'user_meetings')? '&amp;meetings=1' : '') . '&amp;key=' . $user['api_key'] . '" type="application/atom+xml" rel="alternate" title="Atom Feed">' : '', 'atom_link' => ($p == 'news' || $p == 'user_meetings') ? '<link href="' . page_link_to('atom') . (($p == 'user_meetings') ? '&amp;meetings=1' : '') . '&amp;key=' . $user['api_key'] . '" type="application/atom+xml" rel="alternate" title="Atom Feed">' : '',
'menu' => make_menu(), 'menu' => make_menu(),
'content' => $content 'content' => $content,
'header_toolbar' => header_toolbar()
)); ));
counter(); counter();

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 733 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 714 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 693 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

@ -10,7 +10,6 @@
<meta http-equiv="expires" content="0" /> <meta http-equiv="expires" content="0" />
<meta name="robots" content="index" /> <meta name="robots" content="index" />
<meta name="revisit-after" content="1 days" /> <meta name="revisit-after" content="1 days" />
<script type="text/javascript" src="css/grossbild.js"></script>
<script type="text/javascript" src="css/forms.js"></script> <script type="text/javascript" src="css/forms.js"></script>
<link rel="stylesheet" type="text/css" href="css/base.css" /> <link rel="stylesheet" type="text/css" href="css/base.css" />
<link rel="stylesheet" type="text/css" href="css/style%theme%.css" /> <link rel="stylesheet" type="text/css" href="css/style%theme%.css" />
@ -19,12 +18,15 @@
<body class="background"> <body class="background">
<header> <header>
<a href="?" id="logo"></a> <a href="?" id="logo"></a>
%header_toolbar%
<div class="clear"></div>
</header> </header>
<div id="body"> <div id="body">
<div id="menu"> <div id="menu">
%menu% %menu%
<nav class="container small"> <nav class="container small">
<ul> <ul>
<li><a href="?p=faq">FAQ</a></li>
<li><a href="mailto:erzengel@lists.ccc.de">Contact <img src="pic/icons/email.png" alt="E-Mail"></a></li> <li><a href="mailto:erzengel@lists.ccc.de">Contact <img src="pic/icons/email.png" alt="E-Mail"></a></li>
<li><a href="mailto:bugs@engelsystem.de">Bugs / Features <img src="pic/icons/email.png" alt="E-Mail"></a></li> <li><a href="mailto:bugs@engelsystem.de">Bugs / Features <img src="pic/icons/email.png" alt="E-Mail"></a></li>
<li><a href="https://vcs.wybt.net/engelsystem/trac/">Development Platform</a></li> <li><a href="https://vcs.wybt.net/engelsystem/trac/">Development Platform</a></li>

Loading…
Cancel
Save