basic gettext integration
This commit is contained in:
parent
96a263f712
commit
aad54bfe88
|
@ -1,4 +1,8 @@
|
||||||
<?php
|
<?php
|
||||||
|
function admin_active_title() {
|
||||||
|
return _("Active angels");
|
||||||
|
}
|
||||||
|
|
||||||
function admin_active() {
|
function admin_active() {
|
||||||
global $tshirt_sizes, $shift_sum_formula;
|
global $tshirt_sizes, $shift_sum_formula;
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,8 @@
|
||||||
<?php
|
<?php
|
||||||
|
function admin_angel_types_title() {
|
||||||
|
return _("Angeltypes");
|
||||||
|
}
|
||||||
|
|
||||||
function admin_angel_types() {
|
function admin_angel_types() {
|
||||||
$angel_types_source = sql_select("SELECT * FROM `AngelTypes` ORDER BY `name`");
|
$angel_types_source = sql_select("SELECT * FROM `AngelTypes` ORDER BY `name`");
|
||||||
$angel_types = array ();
|
$angel_types = array ();
|
||||||
|
|
|
@ -1,4 +1,8 @@
|
||||||
<?php
|
<?php
|
||||||
|
function admin_arrive_title() {
|
||||||
|
return _("Arrived angels");
|
||||||
|
}
|
||||||
|
|
||||||
function admin_arrive() {
|
function admin_arrive() {
|
||||||
$msg = "";
|
$msg = "";
|
||||||
$search = "";
|
$search = "";
|
||||||
|
|
|
@ -1,88 +1,92 @@
|
||||||
<?php
|
<?php
|
||||||
|
function admin_faq_title() {
|
||||||
|
return _("Edit FAQs");
|
||||||
|
}
|
||||||
|
|
||||||
function admin_faq() {
|
function admin_faq() {
|
||||||
if (!isset ($_REQUEST['action'])) {
|
if (! isset($_REQUEST['action'])) {
|
||||||
$faqs_html = "";
|
$faqs_html = "";
|
||||||
$faqs = sql_select("SELECT * FROM `FAQ`");
|
$faqs = sql_select("SELECT * FROM `FAQ`");
|
||||||
foreach ($faqs as $faq) {
|
foreach ($faqs as $faq) {
|
||||||
$faqs_html .= sprintf('<tr><td> <dl><dt>%s</dt><dd>%s</dd></dl> </td>' . '<td> <dl><dt>%s</dt><dd>%s</dd></dl> </td>' . '<td><a href="%s&action=edit&id=%s">Edit</a></td></tr>', $faq['Frage_de'], $faq['Antwort_de'], $faq['Frage_en'], $faq['Antwort_en'], page_link_to('admin_faq'), $faq['FID']);
|
$faqs_html .= sprintf('<tr><td> <dl><dt>%s</dt><dd>%s</dd></dl> </td>' . '<td> <dl><dt>%s</dt><dd>%s</dd></dl> </td>' . '<td><a href="%s&action=edit&id=%s">Edit</a></td></tr>', $faq['Frage_de'], $faq['Antwort_de'], $faq['Frage_en'], $faq['Antwort_en'], page_link_to('admin_faq'), $faq['FID']);
|
||||||
}
|
}
|
||||||
return template_render('../templates/admin_faq.html', array (
|
return template_render('../templates/admin_faq.html', array(
|
||||||
'link' => page_link_to("admin_faq"),
|
'link' => page_link_to("admin_faq"),
|
||||||
'faqs' => $faqs_html
|
'faqs' => $faqs_html
|
||||||
));
|
));
|
||||||
} else {
|
} else {
|
||||||
switch ($_REQUEST['action']) {
|
switch ($_REQUEST['action']) {
|
||||||
case 'create' :
|
case 'create':
|
||||||
$frage = strip_request_item_nl('frage');
|
$frage = strip_request_item_nl('frage');
|
||||||
$antwort = strip_request_item_nl('antwort');
|
$antwort = strip_request_item_nl('antwort');
|
||||||
$question = strip_request_item_nl('question');
|
$question = strip_request_item_nl('question');
|
||||||
$answer = strip_request_item_nl('answer');
|
$answer = strip_request_item_nl('answer');
|
||||||
|
|
||||||
sql_query("INSERT INTO `FAQ` SET `Frage_de`='" . sql_escape($frage) . "', `Frage_en`='" . sql_escape($question) . "', `Antwort_de`='" . sql_escape($antwort) . "', `Antwort_en`='" . sql_escape($answer) . "'");
|
sql_query("INSERT INTO `FAQ` SET `Frage_de`='" . sql_escape($frage) . "', `Frage_en`='" . sql_escape($question) . "', `Antwort_de`='" . sql_escape($antwort) . "', `Antwort_en`='" . sql_escape($answer) . "'");
|
||||||
|
|
||||||
redirect(page_link_to("admin_faq"));
|
redirect(page_link_to("admin_faq"));
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 'save' :
|
case 'save':
|
||||||
if (isset ($_REQUEST['id']) && preg_match("/^[0-9]{1,11}$/", $_REQUEST['id']))
|
if (isset($_REQUEST['id']) && preg_match("/^[0-9]{1,11}$/", $_REQUEST['id']))
|
||||||
$id = $_REQUEST['id'];
|
$id = $_REQUEST['id'];
|
||||||
else
|
else
|
||||||
return error("Incomplete call, missing FAQ ID.", true);
|
return error("Incomplete call, missing FAQ ID.", true);
|
||||||
|
|
||||||
$faq = sql_select("SELECT * FROM `FAQ` WHERE `FID`=" . sql_escape($id) . " LIMIT 1");
|
$faq = sql_select("SELECT * FROM `FAQ` WHERE `FID`=" . sql_escape($id) . " LIMIT 1");
|
||||||
if (count($faq) > 0) {
|
if (count($faq) > 0) {
|
||||||
list ($faq) = $faq;
|
list($faq) = $faq;
|
||||||
|
|
||||||
$frage = strip_request_item_nl('frage');
|
$frage = strip_request_item_nl('frage');
|
||||||
$antwort = strip_request_item_nl('antwort');
|
$antwort = strip_request_item_nl('antwort');
|
||||||
$question = strip_request_item_nl('question');
|
$question = strip_request_item_nl('question');
|
||||||
$answer = strip_request_item_nl('answer');
|
$answer = strip_request_item_nl('answer');
|
||||||
|
|
||||||
sql_query("UPDATE `FAQ` SET `Frage_de`='" . sql_escape($frage) . "', `Frage_en`='" . sql_escape($question) . "', `Antwort_de`='" . sql_escape($antwort) . "', `Antwort_en`='" . sql_escape($answer) . "' WHERE `FID`=" . sql_escape($id) . " LIMIT 1");
|
sql_query("UPDATE `FAQ` SET `Frage_de`='" . sql_escape($frage) . "', `Frage_en`='" . sql_escape($question) . "', `Antwort_de`='" . sql_escape($antwort) . "', `Antwort_en`='" . sql_escape($answer) . "' WHERE `FID`=" . sql_escape($id) . " LIMIT 1");
|
||||||
|
|
||||||
redirect(page_link_to("admin_faq"));
|
redirect(page_link_to("admin_faq"));
|
||||||
} else
|
} else
|
||||||
return error("No FAQ found.", true);
|
return error("No FAQ found.", true);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 'edit' :
|
case 'edit':
|
||||||
if (isset ($_REQUEST['id']) && preg_match("/^[0-9]{1,11}$/", $_REQUEST['id']))
|
if (isset($_REQUEST['id']) && preg_match("/^[0-9]{1,11}$/", $_REQUEST['id']))
|
||||||
$id = $_REQUEST['id'];
|
$id = $_REQUEST['id'];
|
||||||
else
|
else
|
||||||
return error("Incomplete call, missing FAQ ID.", true);
|
return error("Incomplete call, missing FAQ ID.", true);
|
||||||
|
|
||||||
$faq = sql_select("SELECT * FROM `FAQ` WHERE `FID`=" . sql_escape($id) . " LIMIT 1");
|
$faq = sql_select("SELECT * FROM `FAQ` WHERE `FID`=" . sql_escape($id) . " LIMIT 1");
|
||||||
if (count($faq) > 0) {
|
if (count($faq) > 0) {
|
||||||
list ($faq) = $faq;
|
list($faq) = $faq;
|
||||||
|
|
||||||
return template_render('../templates/admin_faq_edit_form.html', array (
|
return template_render('../templates/admin_faq_edit_form.html', array(
|
||||||
'link' => page_link_to("admin_faq"),
|
'link' => page_link_to("admin_faq"),
|
||||||
'id' => $id,
|
'id' => $id,
|
||||||
'frage' => $faq['Frage_de'],
|
'frage' => $faq['Frage_de'],
|
||||||
'antwort' => $faq['Antwort_de'],
|
'antwort' => $faq['Antwort_de'],
|
||||||
'question' => $faq['Frage_en'],
|
'question' => $faq['Frage_en'],
|
||||||
'answer' => $faq['Antwort_en']
|
'answer' => $faq['Antwort_en']
|
||||||
));
|
));
|
||||||
} else
|
} else
|
||||||
return error("No FAQ found.", true);
|
return error("No FAQ found.", true);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 'delete' :
|
case 'delete':
|
||||||
if (isset ($_REQUEST['id']) && preg_match("/^[0-9]{1,11}$/", $_REQUEST['id']))
|
if (isset($_REQUEST['id']) && preg_match("/^[0-9]{1,11}$/", $_REQUEST['id']))
|
||||||
$id = $_REQUEST['id'];
|
$id = $_REQUEST['id'];
|
||||||
else
|
else
|
||||||
return error("Incomplete call, missing FAQ ID.", true);
|
return error("Incomplete call, missing FAQ ID.", true);
|
||||||
|
|
||||||
$faq = sql_select("SELECT * FROM `FAQ` WHERE `FID`=" . sql_escape($id) . " LIMIT 1");
|
$faq = sql_select("SELECT * FROM `FAQ` WHERE `FID`=" . sql_escape($id) . " LIMIT 1");
|
||||||
if (count($faq) > 0) {
|
if (count($faq) > 0) {
|
||||||
list ($faq) = $faq;
|
list($faq) = $faq;
|
||||||
|
|
||||||
sql_query("DELETE FROM `FAQ` WHERE `FID`=" . sql_escape($id) . " LIMIT 1");
|
sql_query("DELETE FROM `FAQ` WHERE `FID`=" . sql_escape($id) . " LIMIT 1");
|
||||||
redirect(page_link_to("admin_faq"));
|
redirect(page_link_to("admin_faq"));
|
||||||
} else
|
} else
|
||||||
return error("No FAQ found.", true);
|
return error("No FAQ found.", true);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
?>
|
?>
|
||||||
|
|
|
@ -1,4 +1,8 @@
|
||||||
<?php
|
<?php
|
||||||
|
function admin_free_title() {
|
||||||
|
return _("Free angels");
|
||||||
|
}
|
||||||
|
|
||||||
function admin_free() {
|
function admin_free() {
|
||||||
global $privileges;
|
global $privileges;
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,8 @@
|
||||||
<?php
|
<?php
|
||||||
|
function admin_groups_title() {
|
||||||
|
return _("Grouprights");
|
||||||
|
}
|
||||||
|
|
||||||
function admin_groups() {
|
function admin_groups() {
|
||||||
global $user;
|
global $user;
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,8 @@
|
||||||
<?php
|
<?php
|
||||||
|
function admin_import_title() {
|
||||||
|
return _("Pentabarf import");
|
||||||
|
}
|
||||||
|
|
||||||
function admin_import() {
|
function admin_import() {
|
||||||
global $PentabarfXMLhost, $PentabarfXMLpath;
|
global $PentabarfXMLhost, $PentabarfXMLpath;
|
||||||
global $rooms_import;
|
global $rooms_import;
|
||||||
|
|
|
@ -1,105 +0,0 @@
|
||||||
<?php
|
|
||||||
function admin_language() {
|
|
||||||
global $user;
|
|
||||||
global $languages;
|
|
||||||
|
|
||||||
$html = "";
|
|
||||||
if (!isset ($_POST["TextID"])) {
|
|
||||||
$html .= Get_Text("Hello") . User_Nick_render($user) . ", <br />\n";
|
|
||||||
$html .= Get_Text("pub_sprache_text1") . "<br /><br />\n";
|
|
||||||
|
|
||||||
$html .= "<a href=\"" . page_link_to("admin_language") . "&ShowEntry=y\">" . Get_Text("pub_sprache_ShowEntry") . "</a>";
|
|
||||||
// ausgabe Tabellenueberschift
|
|
||||||
$html .= "\t<table border=\"0\" class=\"border\" cellpadding=\"2\" cellspacing=\"1\">\n\t\t<tr>";
|
|
||||||
$html .= "\t\t<td class=\"contenttopic\"><b>" . Get_Text("pub_sprache_TextID") . "</b></td>";
|
|
||||||
foreach($languages as $language => $language_name) {
|
|
||||||
$html .= "<td class=\"contenttopic\"><b>" .
|
|
||||||
Get_Text("pub_sprache_Sprache") . " " . $language .
|
|
||||||
"</b></td>";
|
|
||||||
$Sprachen[$language] = $language_name;
|
|
||||||
}
|
|
||||||
$html .= "\t\t<td class=\"contenttopic\"><b>" . Get_Text("pub_sprache_Edit") . "</b></td>";
|
|
||||||
$html .= "\t\t</tr>";
|
|
||||||
|
|
||||||
if (isset ($_GET["ShowEntry"])) {
|
|
||||||
// ausgabe eintraege
|
|
||||||
$sprache_source = sql_select("SELECT * FROM `Sprache` ORDER BY `TextID`, `Sprache`");
|
|
||||||
|
|
||||||
$TextID_Old = $sprache_source[0]['TextID'];
|
|
||||||
foreach($sprache_source as $sprache_entry) {
|
|
||||||
$TextID_New = $sprache_entry['TextID'];
|
|
||||||
if ($TextID_Old != $TextID_New) {
|
|
||||||
$html .= "<form action=\"" . page_link_to("admin_language") . "\" method=\"post\">";
|
|
||||||
$html .= "<tr class=\"content\">\n";
|
|
||||||
$html .= "\t\t<td>$TextID_Old " .
|
|
||||||
"<input name=\"TextID\" type=\"hidden\" value=\"$TextID_Old\"> </td>\n";
|
|
||||||
|
|
||||||
foreach ($Sprachen as $Name => $Value) {
|
|
||||||
$Value = html_entity_decode($Value, ENT_QUOTES);
|
|
||||||
$html .= "\t\t<td><textarea name=\"$Name\" cols=\"22\" rows=\"8\">$Value</textarea></td>\n";
|
|
||||||
$Sprachen[$Name] = "";
|
|
||||||
}
|
|
||||||
|
|
||||||
$html .= "\t\t<td><input type=\"submit\" value=\"Save\"></td>\n";
|
|
||||||
$html .= "</tr>";
|
|
||||||
$html .= "</form>\n";
|
|
||||||
$TextID_Old = $TextID_New;
|
|
||||||
}
|
|
||||||
$Sprachen[$sprache_entry['Sprache']] = $sprache_entry['Text'];
|
|
||||||
} /*FOR*/
|
|
||||||
}
|
|
||||||
|
|
||||||
//fuer neu eintraege
|
|
||||||
$html .= "<form action=\"" . page_link_to("admin_language") . "\" method=\"post\">";
|
|
||||||
$html .= "<tr class=\"content\">\n";
|
|
||||||
$html .= "\t\t<td><input name=\"TextID\" type=\"text\" size=\"40\" value=\"new\"> </td>\n";
|
|
||||||
|
|
||||||
foreach ($Sprachen as $Name => $Value)
|
|
||||||
$html .= "\t\t<td><textarea name=\"$Name\" cols=\"22\" rows=\"8\">$Name Text</textarea></td>\n";
|
|
||||||
|
|
||||||
$html .= "\t\t<td><input type=\"submit\" value=\"Save\"></td>\n";
|
|
||||||
$html .= "</tr>";
|
|
||||||
$html .= "</form>\n";
|
|
||||||
|
|
||||||
$html .= "</table>\n";
|
|
||||||
} /*if( !isset( $TextID ) )*/
|
|
||||||
else {
|
|
||||||
$html .= "edit: " . $_POST["TextID"] . "<br /><br />";
|
|
||||||
foreach ($_POST as $k => $v) {
|
|
||||||
if ($k != "TextID") {
|
|
||||||
$sql_test = "SELECT * FROM `Sprache` " .
|
|
||||||
"WHERE `TextID`='" . sql_escape($_POST["TextID"])
|
|
||||||
. "' AND `Sprache`='"
|
|
||||||
. sql_escape($k) . "'";
|
|
||||||
|
|
||||||
$erg_test = sql_select("SELECT * FROM `Sprache` WHERE `TextID`='" . sql_escape($_POST["TextID"]) . "' AND `Sprache`='" . sql_escape($k) . "'");
|
|
||||||
if (count($erg_test) == 0) {
|
|
||||||
$sql_save = "INSERT INTO `Sprache` (`TextID`, `Sprache`, `Text`) " .
|
|
||||||
"VALUES ('" . sql_escape($_POST["TextID"]) . "', '"
|
|
||||||
. sql_escape($k) . "', '"
|
|
||||||
. sql_escape($v) . "')";
|
|
||||||
|
|
||||||
$html .= $sql_save . "<br />";
|
|
||||||
$Erg = sql_query($sql_save);
|
|
||||||
$html .= success("$k Save: OK<br />\n", true);
|
|
||||||
} else
|
|
||||||
if ($erg_test[0]['Text'] != $v) {
|
|
||||||
$sql_save = "UPDATE `Sprache` SET `Text`='"
|
|
||||||
. sql_escape($v) . "' " .
|
|
||||||
"WHERE `TextID`='"
|
|
||||||
. sql_escape($_POST["TextID"])
|
|
||||||
. "' AND `Sprache`='" . sql_escape($k) . "' ";
|
|
||||||
|
|
||||||
$html .= $sql_save . "<br />";
|
|
||||||
$Erg = sql_query($sql_save);
|
|
||||||
$html .= success(" $k Update: OK<br />\n", true);
|
|
||||||
} else
|
|
||||||
$html .= "\t $k no changes<br />\n";
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
return $html;
|
|
||||||
}
|
|
||||||
?>
|
|
||||||
|
|
|
@ -1,4 +1,8 @@
|
||||||
<?php
|
<?php
|
||||||
|
function admin_log_title() {
|
||||||
|
return _("Log");
|
||||||
|
}
|
||||||
|
|
||||||
function admin_log() {
|
function admin_log() {
|
||||||
$log_entries_source = LogEntries();
|
$log_entries_source = LogEntries();
|
||||||
$log_entries = array();
|
$log_entries = array();
|
||||||
|
|
|
@ -1,4 +1,8 @@
|
||||||
<?php
|
<?php
|
||||||
|
function admin_questions_title() {
|
||||||
|
return _("Answer questions");
|
||||||
|
}
|
||||||
|
|
||||||
function admin_new_questions() {
|
function admin_new_questions() {
|
||||||
global $user, $privileges;
|
global $user, $privileges;
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,8 @@
|
||||||
<?php
|
<?php
|
||||||
|
function admin_rooms_title() {
|
||||||
|
return _("Rooms");
|
||||||
|
}
|
||||||
|
|
||||||
function admin_rooms() {
|
function admin_rooms() {
|
||||||
global $user;
|
global $user;
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,7 @@
|
||||||
<?php
|
<?php
|
||||||
|
function admin_shifts_title() {
|
||||||
|
return _("Create shifts");
|
||||||
|
}
|
||||||
|
|
||||||
// Assistent zum Anlegen mehrerer neuer Schichten
|
// Assistent zum Anlegen mehrerer neuer Schichten
|
||||||
function admin_shifts() {
|
function admin_shifts() {
|
||||||
|
|
|
@ -1,4 +1,8 @@
|
||||||
<?php
|
<?php
|
||||||
|
function admin_user_title() {
|
||||||
|
return _("All Angels");
|
||||||
|
}
|
||||||
|
|
||||||
function admin_user() {
|
function admin_user() {
|
||||||
global $user, $privileges, $tshirt_sizes, $privileges;
|
global $user, $privileges, $tshirt_sizes, $privileges;
|
||||||
|
|
||||||
|
@ -145,7 +149,7 @@ function admin_user() {
|
||||||
$angel_types,
|
$angel_types,
|
||||||
array('selected_angel_types' => $selected_angel_types, 'accepted_angel_types' => array_merge($accepted_angel_types, $nonrestricted_angel_types)),
|
array('selected_angel_types' => $selected_angel_types, 'accepted_angel_types' => array_merge($accepted_angel_types, $nonrestricted_angel_types)),
|
||||||
array('accepted_angel_types' => $nonrestricted_angel_types)),
|
array('accepted_angel_types' => $nonrestricted_angel_types)),
|
||||||
form_submit('submit_user_angeltypes', Get_Text("Save"))
|
form_submit('submit_user_angeltypes', _("Save"))
|
||||||
));
|
));
|
||||||
|
|
||||||
$html .= "<hr />";
|
$html .= "<hr />";
|
||||||
|
@ -325,7 +329,7 @@ function admin_user() {
|
||||||
'Tshirt' => '<img src="pic/icons/' . ($angel['Tshirt'] == 1? 'tick' : 'cross') . '.png" alt="' . $angel['Tshirt'] . '">',
|
'Tshirt' => '<img src="pic/icons/' . ($angel['Tshirt'] == 1? 'tick' : 'cross') . '.png" alt="' . $angel['Tshirt'] . '">',
|
||||||
'Size' => $angel['Size'],
|
'Size' => $angel['Size'],
|
||||||
'lastLogIn' => date('d.m.&\n\b\s\p;H:i', $angel['lastLogIn']),
|
'lastLogIn' => date('d.m.&\n\b\s\p;H:i', $angel['lastLogIn']),
|
||||||
'edit' => img_button(page_link_to('admin_user') . '&id=' . $angel['UID'], 'pencil', 'edit'),
|
'edit' => img_button(page_link_to('admin_user') . '&id=' . $angel['UID'], 'pencil', _("edit")),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
$angels = array_map('prepare_angel_table', $angels);
|
$angels = array_map('prepare_angel_table', $angels);
|
||||||
|
|
|
@ -1,5 +1,7 @@
|
||||||
<?php
|
<?php
|
||||||
|
function admin_user_angeltypes_title() {
|
||||||
|
return _("Confirm angeltypes");
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Auf dieser Seite können Erzengel Engeltypen für bestimmte Nutzer freischalten, z.B. nachdem diese für die Aufgabe geschult wurden.
|
* Auf dieser Seite können Erzengel Engeltypen für bestimmte Nutzer freischalten, z.B. nachdem diese für die Aufgabe geschult wurden.
|
||||||
|
@ -77,12 +79,12 @@ function admin_user_angeltypes() {
|
||||||
$users = array ();
|
$users = array ();
|
||||||
foreach ($user_angel_types_source as $user) {
|
foreach ($user_angel_types_source as $user) {
|
||||||
$user['name'] = User_Nick_render($user);
|
$user['name'] = User_Nick_render($user);
|
||||||
$user['actions'] = img_button(page_link_to('admin_user_angeltypes') . '&confirm=' . $user['id'], 'tick', 'confirm');
|
$user['actions'] = img_button(page_link_to('admin_user_angeltypes') . '&confirm=' . $user['id'], 'tick', _("confirm"));
|
||||||
$user['actions'] .= ' ';
|
$user['actions'] .= ' ';
|
||||||
$user['actions'] .= img_button(page_link_to('admin_user_angeltypes') . '&deny=' . $user['id'], 'cross', 'deny');
|
$user['actions'] .= img_button(page_link_to('admin_user_angeltypes') . '&deny=' . $user['id'], 'cross', _("deny"));
|
||||||
$users[] = $user;
|
$users[] = $user;
|
||||||
}
|
}
|
||||||
$content[] = '<h2>' . $angel_type['name'] . ' <small>' . img_button(page_link_to('admin_user_angeltypes') . '&confirm_all=' . $angel_type['id'], 'tick', '', 'confirm all') . ' ' . img_button(page_link_to('admin_user_angeltypes') . '&deny_all=' . $angel_type['id'], 'cross', '', 'deny all') . '</small></h2>' . table(array (
|
$content[] = '<h2>' . $angel_type['name'] . ' <small>' . img_button(page_link_to('admin_user_angeltypes') . '&confirm_all=' . $angel_type['id'], 'tick', '', _("confirm all")) . ' ' . img_button(page_link_to('admin_user_angeltypes') . '&deny_all=' . $angel_type['id'], 'cross', '', _("deny all")) . '</small></h2>' . table(array (
|
||||||
'name' => "Nick",
|
'name' => "Nick",
|
||||||
'actions' => ""
|
'actions' => ""
|
||||||
), $users);
|
), $users);
|
||||||
|
|
|
@ -1,10 +1,14 @@
|
||||||
<?php
|
<?php
|
||||||
|
function faq_title() {
|
||||||
|
return _("FAQ");
|
||||||
|
}
|
||||||
|
|
||||||
function guest_faq() {
|
function guest_faq() {
|
||||||
$html = "";
|
$html = "";
|
||||||
$faqs = sql_select("SELECT * FROM `FAQ`");
|
$faqs = sql_select("SELECT * FROM `FAQ`");
|
||||||
foreach ($faqs as $faq) {
|
foreach ($faqs as $faq) {
|
||||||
$html .= "<dl>";
|
$html .= "<dl>";
|
||||||
if ($_SESSION['Sprache'] == "DE") {
|
if ($_SESSION['locale'] == "de_DE.UTF-8") {
|
||||||
$html .= sprintf(
|
$html .= sprintf(
|
||||||
'<dt>%s</dt> <dd>%s</dd>',
|
'<dt>%s</dt> <dd>%s</dd>',
|
||||||
$faq['Frage_de'],
|
$faq['Frage_de'],
|
||||||
|
|
|
@ -1,10 +1,9 @@
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
|
|
||||||
// Engel registrieren
|
// Engel registrieren
|
||||||
function guest_register() {
|
function guest_register() {
|
||||||
global $tshirt_sizes, $enable_tshirt_size;
|
global $tshirt_sizes, $enable_tshirt_size;
|
||||||
|
|
||||||
$msg = "";
|
$msg = "";
|
||||||
$nick = "";
|
$nick = "";
|
||||||
$lastname = "";
|
$lastname = "";
|
||||||
|
@ -20,101 +19,98 @@ function guest_register() {
|
||||||
$comment = "";
|
$comment = "";
|
||||||
$tshirt_size = '';
|
$tshirt_size = '';
|
||||||
$password_hash = "";
|
$password_hash = "";
|
||||||
$selected_angel_types = array ();
|
$selected_angel_types = array();
|
||||||
|
|
||||||
$angel_types_source = sql_select("SELECT * FROM `AngelTypes` ORDER BY `name`");
|
$angel_types_source = sql_select("SELECT * FROM `AngelTypes` ORDER BY `name`");
|
||||||
$angel_types = array ();
|
$angel_types = array();
|
||||||
foreach ($angel_types_source as $angel_type)
|
foreach ($angel_types_source as $angel_type)
|
||||||
$angel_types[$angel_type['id']] = $angel_type['name'] . ($angel_type['restricted'] ? " (restricted)" : "");
|
$angel_types[$angel_type['id']] = $angel_type['name'] . ($angel_type['restricted'] ? " (restricted)" : "");
|
||||||
|
|
||||||
if (isset ($_REQUEST['submit'])) {
|
if (isset($_REQUEST['submit'])) {
|
||||||
$ok = true;
|
$ok = true;
|
||||||
|
|
||||||
if (isset ($_REQUEST['nick']) && strlen(strip_request_item('nick')) > 1) {
|
if (isset($_REQUEST['nick']) && strlen(strip_request_item('nick')) > 1) {
|
||||||
$nick = strip_request_item('nick');
|
$nick = strip_request_item('nick');
|
||||||
if (sql_num_query("SELECT * FROM `User` WHERE `Nick`='" . sql_escape($nick) . "' LIMIT 1") > 0) {
|
if (sql_num_query("SELECT * FROM `User` WHERE `Nick`='" . sql_escape($nick) . "' LIMIT 1") > 0) {
|
||||||
$ok = false;
|
$ok = false;
|
||||||
$msg .= error(sprintf(Get_Text("makeuser_error_nick1") . "%s" . Get_Text("makeuser_error_nick3"), $nick), true);
|
$msg .= error(sprintf(_("Your nick "%s" already exists."), $nick), true);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
$ok = false;
|
$ok = false;
|
||||||
$msg .= error(sprintf(Get_Text("makeuser_error_nick1") . "%s" . Get_Text("makeuser_error_nick2"), strip_request_item('nick')), true);
|
$msg .= error(sprintf(_("Your nick "%s" is too short (min. 2 characters)."), strip_request_item('nick')), true);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (isset ($_REQUEST['mail']) && strlen(strip_request_item('mail')) > 0) {
|
if (isset($_REQUEST['mail']) && strlen(strip_request_item('mail')) > 0) {
|
||||||
$mail = strip_request_item('mail');
|
$mail = strip_request_item('mail');
|
||||||
if (!check_email($mail)) {
|
if (! check_email($mail)) {
|
||||||
$ok = false;
|
$ok = false;
|
||||||
$msg .= error(Get_Text("makeuser_error_mail"), true);
|
$msg .= error(_("E-mail address is not correct."), true);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
$ok = false;
|
$ok = false;
|
||||||
$msg .= error("Please enter your e-mail.", true);
|
$msg .= error(_("Please enter your e-mail."), true);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (isset ($_REQUEST['icq']))
|
if (isset($_REQUEST['icq']))
|
||||||
$icq = strip_request_item('icq');
|
$icq = strip_request_item('icq');
|
||||||
if (isset ($_REQUEST['jabber']) && strlen(strip_request_item('jabber')) > 0) {
|
if (isset($_REQUEST['jabber']) && strlen(strip_request_item('jabber')) > 0) {
|
||||||
$jabber = strip_request_item('jabber');
|
$jabber = strip_request_item('jabber');
|
||||||
if (!check_email($jabber)) {
|
if (! check_email($jabber)) {
|
||||||
$ok = false;
|
$ok = false;
|
||||||
$msg .= error("Please check your jabber.", true);
|
$msg .= error(_("Please check your jabber account information."), true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($enable_tshirt_size) {
|
if ($enable_tshirt_size) {
|
||||||
if (isset ($_REQUEST['tshirt_size']) && isset ($tshirt_sizes[$_REQUEST['tshirt_size']]) && $_REQUEST['tshirt_size'] != '')
|
if (isset($_REQUEST['tshirt_size']) && isset($tshirt_sizes[$_REQUEST['tshirt_size']]) && $_REQUEST['tshirt_size'] != '')
|
||||||
$tshirt_size = $_REQUEST['tshirt_size'];
|
$tshirt_size = $_REQUEST['tshirt_size'];
|
||||||
else {
|
else {
|
||||||
$ok = false;
|
$ok = false;
|
||||||
$msg .= error("Please select your shirt size.", true);
|
$msg .= error(_("Please select your shirt size."), true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (isset ($_REQUEST['password']) && strlen($_REQUEST['password']) >= MIN_PASSWORD_LENGTH) {
|
if (isset($_REQUEST['password']) && strlen($_REQUEST['password']) >= MIN_PASSWORD_LENGTH) {
|
||||||
if ($_REQUEST['password'] != $_REQUEST['password2']) {
|
if ($_REQUEST['password'] != $_REQUEST['password2']) {
|
||||||
$ok = false;
|
$ok = false;
|
||||||
$msg .= error(Get_Text("makeuser_error_password1"), true);
|
$msg .= error(_("Your passwords don't match."), true);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
$ok = false;
|
$ok = false;
|
||||||
$msg .= error(Get_Text("makeuser_error_password2"), true);
|
$msg .= error(_("Your password is to short (please use at least 6 characters)."), true);
|
||||||
}
|
}
|
||||||
|
|
||||||
$selected_angel_types = array ();
|
$selected_angel_types = array();
|
||||||
foreach ($angel_types as $angel_type_id => $angel_type_name)
|
foreach ($angel_types as $angel_type_id => $angel_type_name)
|
||||||
if (isset ($_REQUEST['angel_types_' . $angel_type_id]))
|
if (isset($_REQUEST['angel_types_' . $angel_type_id]))
|
||||||
$selected_angel_types[] = $angel_type_id;
|
$selected_angel_types[] = $angel_type_id;
|
||||||
|
|
||||||
// Trivia
|
// Trivia
|
||||||
if (isset ($_REQUEST['lastname']))
|
if (isset($_REQUEST['lastname']))
|
||||||
$lastname = strip_request_item('lastname');
|
$lastname = strip_request_item('lastname');
|
||||||
if (isset ($_REQUEST['prename']))
|
if (isset($_REQUEST['prename']))
|
||||||
$prename = strip_request_item('prename');
|
$prename = strip_request_item('prename');
|
||||||
if (isset ($_REQUEST['age']) && preg_match("/^[0-9]{0,4}$/", $_REQUEST['age']))
|
if (isset($_REQUEST['age']) && preg_match("/^[0-9]{0,4}$/", $_REQUEST['age']))
|
||||||
$age = strip_request_item('age');
|
$age = strip_request_item('age');
|
||||||
if (isset ($_REQUEST['tel']))
|
if (isset($_REQUEST['tel']))
|
||||||
$tel = strip_request_item('tel');
|
$tel = strip_request_item('tel');
|
||||||
if (isset ($_REQUEST['dect']))
|
if (isset($_REQUEST['dect']))
|
||||||
$dect = strip_request_item('dect');
|
$dect = strip_request_item('dect');
|
||||||
if (isset ($_REQUEST['mobile']))
|
if (isset($_REQUEST['mobile']))
|
||||||
$mobile = strip_request_item('mobile');
|
$mobile = strip_request_item('mobile');
|
||||||
if (isset ($_REQUEST['hometown']))
|
if (isset($_REQUEST['hometown']))
|
||||||
$hometown = strip_request_item('hometown');
|
$hometown = strip_request_item('hometown');
|
||||||
if (isset ($_REQUEST['comment']))
|
if (isset($_REQUEST['comment']))
|
||||||
$comment = strip_request_item_nl('comment');
|
$comment = strip_request_item_nl('comment');
|
||||||
|
|
||||||
if ($ok) {
|
if ($ok) {
|
||||||
sql_query("INSERT INTO `User` SET `Nick`='" . sql_escape($nick) . "', `Vorname`='" . sql_escape($prename) . "', `Name`='" . sql_escape($lastname) .
|
sql_query("INSERT INTO `User` SET `Nick`='" . sql_escape($nick) . "', `Vorname`='" . sql_escape($prename) . "', `Name`='" . sql_escape($lastname) . "', `Alter`='" . sql_escape($age) . "', `Telefon`='" . sql_escape($tel) . "', `DECT`='" . sql_escape($dect) . "', `Handy`='" . sql_escape($mobile) . "', `email`='" . sql_escape($mail) . "', `ICQ`='" . sql_escape($icq) . "', `jabber`='" . sql_escape($jabber) . "', `Size`='" . sql_escape($tshirt_size) . "', `Passwort`='" . sql_escape($password_hash) . "', `kommentar`='" . sql_escape($comment) . "', `Hometown`='" . sql_escape($hometown) . "', `CreateDate`=NOW(), `Sprache`='" . sql_escape($_SESSION["locale"]) . "'");
|
||||||
"', `Alter`='" . sql_escape($age) . "', `Telefon`='" . sql_escape($tel) . "', `DECT`='" . sql_escape($dect) . "', `Handy`='" . sql_escape($mobile) .
|
|
||||||
"', `email`='" . sql_escape($mail) . "', `ICQ`='" . sql_escape($icq) . "', `jabber`='" . sql_escape($jabber) . "', `Size`='" . sql_escape($tshirt_size) .
|
|
||||||
"', `Passwort`='" . sql_escape($password_hash) . "', `kommentar`='" . sql_escape($comment) . "', `Hometown`='" . sql_escape($hometown) . "', `CreateDate`=NOW(), `Sprache`='" . sql_escape($_SESSION["Sprache"]) . "'");
|
|
||||||
|
|
||||||
// Assign user-group and set password
|
// Assign user-group and set password
|
||||||
$user_id = sql_id();
|
$user_id = sql_id();
|
||||||
sql_query("INSERT INTO `UserGroups` SET `uid`=" . sql_escape($user_id) . ", `group_id`=-2");
|
sql_query("INSERT INTO `UserGroups` SET `uid`=" . sql_escape($user_id) . ", `group_id`=-2");
|
||||||
set_password($user_id, $_REQUEST['password']);
|
set_password($user_id, $_REQUEST['password']);
|
||||||
|
|
||||||
// Assign angel-types
|
// Assign angel-types
|
||||||
$user_angel_types_info = array();
|
$user_angel_types_info = array();
|
||||||
foreach ($selected_angel_types as $selected_angel_type_id) {
|
foreach ($selected_angel_types as $selected_angel_type_id) {
|
||||||
|
@ -122,37 +118,37 @@ function guest_register() {
|
||||||
$user_angel_types_info[] = $angel_types[$selected_angel_type_id];
|
$user_angel_types_info[] = $angel_types[$selected_angel_type_id];
|
||||||
}
|
}
|
||||||
engelsystem_log("User " . $nick . " signed up as: " . join(", ", $user_angel_types_info));
|
engelsystem_log("User " . $nick . " signed up as: " . join(", ", $user_angel_types_info));
|
||||||
success(Get_Text("makeuser_writeOK4"));
|
success(_("Angel registration successful!"));
|
||||||
//if (!isset ($_SESSION['uid']))
|
|
||||||
redirect(page_link_to('login'));
|
redirect(page_link_to('login'));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return page(array (
|
return page(array(
|
||||||
Get_Text("makeuser_text1"),
|
_("By completing this form you're registering as a Chaos-Angel. This script will create you an account in the angel task sheduler."),
|
||||||
$msg,
|
$msg,
|
||||||
msg(),
|
msg(),
|
||||||
form(array (
|
form(array(
|
||||||
form_text('nick', Get_Text("makeuser_Nickname") . "*", $nick),
|
form_text('nick', _("Nick") . "*", $nick),
|
||||||
form_text('lastname', Get_Text("makeuser_Nachname"), $lastname),
|
form_text('lastname', _("Last name"), $lastname),
|
||||||
form_text('prename', Get_Text("makeuser_Vorname"), $prename),
|
form_text('prename', _("First name"), $prename),
|
||||||
form_text('age', Get_Text("makeuser_Alter"), $age),
|
form_text('age', _("Age"), $age),
|
||||||
form_text('tel', Get_Text("makeuser_Telefon"), $tel),
|
form_text('tel', _("Phone"), $tel),
|
||||||
form_text('dect', Get_Text("makeuser_DECT"), $tel),
|
form_text('dect', _("DECT"), $tel),
|
||||||
form_text('mobile', Get_Text("makeuser_Handy"), $mobile),
|
form_text('mobile', _("Mobile"), $mobile),
|
||||||
form_text('mail', Get_Text("makeuser_E-Mail") . "*", $mail),
|
form_text('mail', _("E-Mail") . "*", $mail),
|
||||||
form_text('icq', "ICQ", $icq),
|
form_text('icq', _("ICQ"), $icq),
|
||||||
form_text('jabber', "Jabber", $jabber),
|
form_text('jabber', _("Jabber"), $jabber),
|
||||||
form_text('hometown', Get_Text("makeuser_Hometown"), $hometown),
|
form_text('hometown', _("Hometown"), $hometown),
|
||||||
$enable_tshirt_size ? form_select('tshirt_size', Get_Text("makeuser_T-Shirt"), $tshirt_sizes, $tshirt_size) : '',
|
$enable_tshirt_size ? form_select('tshirt_size', _("Shirt size"), $tshirt_sizes, $tshirt_size) : '',
|
||||||
form_textarea('comment', Get_Text("makeuser_text2"), $comment),
|
form_textarea('comment', _("Did you help at former CCC events and which tasks have you performed then?"), $comment),
|
||||||
form_checkboxes('angel_types', "What do you want to do?<br>(<a href=\"https://events.ccc.de/congress/2012/wiki/Volunteers#What_kind_of_volunteers_are_needed.3F\">Description of job types</a>)", $angel_types, $selected_angel_types),
|
form_checkboxes('angel_types', _("What do you want to do?") . sprintf("<br>(<a href=\"https://events.ccc.de/congress/2012/wiki/Volunteers#What_kind_of_volunteers_are_needed.3F\">%s</a>)", _("Description of job types")), $angel_types, $selected_angel_types),
|
||||||
form_info("", "Restricted angel types need will be confirmed later by an archangel. You can change your selection in the options section."),
|
form_info("", _("Restricted angel types need will be confirmed later by an archangel. You can change your selection in the options section.")),
|
||||||
form_password('password', Get_Text("makeuser_Passwort") . "*"),
|
form_password('password', _("Password") . "*"),
|
||||||
form_password('password2', Get_Text("makeuser_Passwort2") . "*"),
|
form_password('password2', _("Confirm password") . "*"),
|
||||||
info(Get_Text("makeuser_text3"), true),
|
info("*: " . _("Entry required!"), true),
|
||||||
form_submit('submit', Get_Text("makeuser_Anmelden"))
|
form_submit('submit', _("Register"))
|
||||||
))
|
))
|
||||||
));
|
));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -163,55 +159,55 @@ function guest_logout() {
|
||||||
|
|
||||||
function guest_login() {
|
function guest_login() {
|
||||||
global $user;
|
global $user;
|
||||||
|
|
||||||
$msg = "";
|
$msg = "";
|
||||||
$nick = "";
|
$nick = "";
|
||||||
|
|
||||||
unset ($_SESSION['uid']);
|
unset($_SESSION['uid']);
|
||||||
|
|
||||||
if (isset ($_REQUEST['submit'])) {
|
if (isset($_REQUEST['submit'])) {
|
||||||
$ok = true;
|
$ok = true;
|
||||||
|
|
||||||
if (isset ($_REQUEST['nick']) && strlen(strip_request_item('nick')) > 0) {
|
if (isset($_REQUEST['nick']) && strlen(strip_request_item('nick')) > 0) {
|
||||||
$nick = strip_request_item('nick');
|
$nick = strip_request_item('nick');
|
||||||
$login_user = sql_select("SELECT * FROM `User` WHERE `Nick`='" . sql_escape($nick) . "'");
|
$login_user = sql_select("SELECT * FROM `User` WHERE `Nick`='" . sql_escape($nick) . "'");
|
||||||
if (count($login_user) > 0) {
|
if (count($login_user) > 0) {
|
||||||
$login_user = $login_user[0];
|
$login_user = $login_user[0];
|
||||||
if (isset ($_REQUEST['password'])) {
|
if (isset($_REQUEST['password'])) {
|
||||||
if (!verify_password($_REQUEST['password'], $login_user['Passwort'], $login_user['UID'])) {
|
if (! verify_password($_REQUEST['password'], $login_user['Passwort'], $login_user['UID'])) {
|
||||||
$ok = false;
|
$ok = false;
|
||||||
$msg .= error(Get_Text("pub_index_pass_no_ok"), true);
|
$msg .= error(_("Your password is incorrect. Please try it again."), true);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
$ok = false;
|
$ok = false;
|
||||||
$msg .= error("Please enter a password.", true);
|
$msg .= error(_("Please enter a password."), true);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
$ok = false;
|
$ok = false;
|
||||||
$msg .= error(Get_Text("pub_index_User_unset"), true);
|
$msg .= error(_("No user was found with that Nickname. Please try again. If you are still having problems, ask an Dispatcher."), true);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
$ok = false;
|
$ok = false;
|
||||||
$msg .= error("Please enter a nickname.", true);
|
$msg .= error(_("Please enter a nickname."), true);
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($ok) {
|
if ($ok) {
|
||||||
$_SESSION['uid'] = $login_user['UID'];
|
$_SESSION['uid'] = $login_user['UID'];
|
||||||
$_SESSION['Sprache'] = $login_user['Sprache'];
|
$_SESSION['locale'] = $login_user['Sprache'];
|
||||||
redirect(page_link_to('news'));
|
redirect(page_link_to('news'));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return page(array (
|
return page(array(
|
||||||
$msg,
|
$msg,
|
||||||
msg(),
|
msg(),
|
||||||
Get_Text("index_text1") . " " . Get_Text("index_text2") . " " . Get_Text("index_text3"),
|
_("Resistance is futile! Your biological and physical parameters will be added to our collectiv! Assimilating angel:"),
|
||||||
form(array (
|
form(array(
|
||||||
form_text('nick', Get_Text("index_lang_nick"), $nick),
|
form_text('nick', _("Nick"), $nick),
|
||||||
form_password('password', Get_Text("index_lang_pass")),
|
form_password('password', _("Password")),
|
||||||
form_submit('submit', Get_Text("index_lang_send"))
|
form_submit('submit', _("Login"))
|
||||||
)),
|
)),
|
||||||
info(Get_Text("index_text4"), true)
|
info(_("Please note: You have to activate cookies!"), true)
|
||||||
));
|
));
|
||||||
}
|
}
|
||||||
?>
|
?>
|
||||||
|
|
|
@ -1,119 +1,115 @@
|
||||||
<?php
|
<?php
|
||||||
|
function messages_title() {
|
||||||
|
return _("Messages");
|
||||||
|
}
|
||||||
|
|
||||||
function user_unread_messages() {
|
function user_unread_messages() {
|
||||||
global $user, $privileges;
|
global $user, $privileges;
|
||||||
|
|
||||||
if (in_array("user_messages", $privileges)) {
|
if (in_array("user_messages", $privileges)) {
|
||||||
$new_messages = sql_num_query("SELECT * FROM `Messages` WHERE isRead='N' AND `RUID`=" . sql_escape($user['UID']));
|
$new_messages = sql_num_query("SELECT * FROM `Messages` WHERE isRead='N' AND `RUID`=" . sql_escape($user['UID']));
|
||||||
|
|
||||||
if ($new_messages > 0)
|
if ($new_messages > 0)
|
||||||
return sprintf('<p class="info"><a href="%s">%s %s %s</a></p><hr />', page_link_to("user_messages"), Get_Text("pub_messages_new1"), $new_messages, Get_Text("pub_messages_new2"));
|
return sprintf('<p class="info"><a href="%s">%s</a></p><hr />', page_link_to("user_messages"), sprintf(_("You have %s new messages.", $new_messages)));
|
||||||
}
|
}
|
||||||
|
|
||||||
return "";
|
return "";
|
||||||
}
|
}
|
||||||
|
|
||||||
function user_messages() {
|
function user_messages() {
|
||||||
global $user;
|
global $user;
|
||||||
|
|
||||||
if (!isset ($_REQUEST['action'])) {
|
if (! isset($_REQUEST['action'])) {
|
||||||
$users = sql_select("SELECT * FROM `User` WHERE NOT `UID`=" . sql_escape($user['UID']) . " ORDER BY `Nick`");
|
$users = sql_select("SELECT * FROM `User` WHERE NOT `UID`=" . sql_escape($user['UID']) . " ORDER BY `Nick`");
|
||||||
|
|
||||||
$to_select_data = array (
|
$to_select_data = array(
|
||||||
"" => "Select recipient..."
|
"" => "Select recipient..."
|
||||||
);
|
);
|
||||||
|
|
||||||
foreach ($users as $u)
|
foreach ($users as $u)
|
||||||
$to_select_data[$u['UID']] = $u['Nick'];
|
$to_select_data[$u['UID']] = $u['Nick'];
|
||||||
|
|
||||||
$to_select = html_select_key('to', 'to', $to_select_data, '');
|
$to_select = html_select_key('to', 'to', $to_select_data, '');
|
||||||
|
|
||||||
$messages_html = "";
|
$messages_html = "";
|
||||||
$messages = sql_select("SELECT * FROM `Messages` WHERE `SUID`=" . sql_escape($user['UID']) . " OR `RUID`=" . sql_escape($user['UID']) . " ORDER BY `isRead`,`Datum` DESC");
|
$messages = sql_select("SELECT * FROM `Messages` WHERE `SUID`=" . sql_escape($user['UID']) . " OR `RUID`=" . sql_escape($user['UID']) . " ORDER BY `isRead`,`Datum` DESC");
|
||||||
foreach ($messages as $message) {
|
foreach ($messages as $message) {
|
||||||
$sender_user_source = User($message['SUID']);
|
$sender_user_source = User($message['SUID']);
|
||||||
if($sender_user_source === false)
|
if ($sender_user_source === false)
|
||||||
engelsystem_error("Unable to load user.");
|
engelsystem_error("Unable to load user.");
|
||||||
$receiver_user_source = User($message['RUID']);
|
$receiver_user_source = User($message['RUID']);
|
||||||
if($receiver_user_source === false)
|
if ($receiver_user_source === false)
|
||||||
engelsystem_error("Unable to load user.");
|
engelsystem_error("Unable to load user.");
|
||||||
|
|
||||||
$messages_html .= sprintf(
|
$messages_html .= sprintf('<tr %s> <td>%s</td> <td>%s</td> <td>%s</td> <td>%s</td><td>%s</td>', ($message['isRead'] == 'N' ? ' class="new_message"' : ''), ($message['isRead'] == 'N' ? '•' : ''), date("Y-m-d H:i", $message['Datum']), User_Nick_render($sender_user_source), User_Nick_render($receiver_user_source), str_replace("\n", '<br />', $message['Text']));
|
||||||
'<tr %s> <td>%s</td> <td>%s</td> <td>%s</td> <td>%s</td><td>%s</td>',
|
|
||||||
($message['isRead'] == 'N' ? ' class="new_message"' : ''),
|
|
||||||
($message['isRead'] == 'N' ? '•' : ''),
|
|
||||||
date("Y-m-d H:i", $message['Datum']),
|
|
||||||
User_Nick_render($sender_user_source),
|
|
||||||
User_Nick_render($receiver_user_source),
|
|
||||||
str_replace("\n", '<br />', $message['Text'])
|
|
||||||
);
|
|
||||||
|
|
||||||
$messages_html .= '<td>';
|
$messages_html .= '<td>';
|
||||||
if ($message['RUID'] == $user['UID']) {
|
if ($message['RUID'] == $user['UID']) {
|
||||||
if ($message['isRead'] == 'N')
|
if ($message['isRead'] == 'N')
|
||||||
$messages_html .= '<a href="' . page_link_to("user_messages") . '&action=read&id=' . $message['id'] . '">' . Get_Text("pub_messages_MarkRead") . '</a>';
|
$messages_html .= '<a href="' . page_link_to("user_messages") . '&action=read&id=' . $message['id'] . '">' . _("mark as read") . '</a>';
|
||||||
} else {
|
} else {
|
||||||
$messages_html .= '<a href="' . page_link_to("user_messages") . '&action=delete&id=' . $message['id'] . '">' . Get_Text("pub_messages_DelMsg") . '</a>';
|
$messages_html .= '<a href="' . page_link_to("user_messages") . '&action=delete&id=' . $message['id'] . '">' . _("delete message") . '</a>';
|
||||||
}
|
}
|
||||||
$messages_html .= '</td></tr>';
|
$messages_html .= '</td></tr>';
|
||||||
}
|
}
|
||||||
|
|
||||||
return template_render('../templates/user_messages.html', array (
|
return template_render('../templates/user_messages.html', array(
|
||||||
'link' => page_link_to("user_messages"),
|
'link' => page_link_to("user_messages"),
|
||||||
'greeting' => Get_Text("Hello") . User_Nick_render($user) . ", <br />\n" . Get_Text("pub_messages_text1") . "<br /><br />\n",
|
'greeting' => _(sprintf("Hello %s, here can you leave messages for other angels", User_Nick_render($user))) . '<br /><br />',
|
||||||
'messages' => $messages_html,
|
'messages' => $messages_html,
|
||||||
'new_label' => Get_Text("pub_messages_Neu"),
|
'new_label' => _("New"),
|
||||||
'date_label' => Get_Text("pub_messages_Datum"),
|
'date_label' => _("Date"),
|
||||||
'from_label' => Get_Text("pub_messages_Von"),
|
'from_label' => _("Transmitted"),
|
||||||
'to_label' => Get_Text("pub_messages_An"),
|
'to_label' => _("Recipient"),
|
||||||
'text_label' => Get_Text("pub_messages_Text"),
|
'text_label' => _("Message"),
|
||||||
'date' => date("Y-m-d H:i"),
|
'date' => date("Y-m-d H:i"),
|
||||||
'from' => User_Nick_render($user),
|
'from' => User_Nick_render($user),
|
||||||
'to_select' => $to_select,
|
'to_select' => $to_select,
|
||||||
'submit_label' => Get_Text("save")
|
'submit_label' => _("Save")
|
||||||
));
|
));
|
||||||
} else {
|
} else {
|
||||||
switch ($_REQUEST['action']) {
|
switch ($_REQUEST['action']) {
|
||||||
case "read" :
|
case "read":
|
||||||
if (isset ($_REQUEST['id']) && preg_match("/^[0-9]{1,11}$/", $_REQUEST['id']))
|
if (isset($_REQUEST['id']) && preg_match("/^[0-9]{1,11}$/", $_REQUEST['id']))
|
||||||
$id = $_REQUEST['id'];
|
$id = $_REQUEST['id'];
|
||||||
else
|
else
|
||||||
return error("Incomplete call, missing Message ID.", true);
|
return error(_("Incomplete call, missing Message ID."), true);
|
||||||
|
|
||||||
$message = sql_select("SELECT * FROM `Messages` WHERE `id`=" . sql_escape($id) . " LIMIT 1");
|
$message = sql_select("SELECT * FROM `Messages` WHERE `id`=" . sql_escape($id) . " LIMIT 1");
|
||||||
if (count($message) > 0 && $message[0]['RUID'] == $user['UID']) {
|
if (count($message) > 0 && $message[0]['RUID'] == $user['UID']) {
|
||||||
sql_query("UPDATE `Messages` SET `isRead`='Y' WHERE `id`=" . sql_escape($id) . " LIMIT 1");
|
sql_query("UPDATE `Messages` SET `isRead`='Y' WHERE `id`=" . sql_escape($id) . " LIMIT 1");
|
||||||
redirect(page_link_to("user_messages"));
|
redirect(page_link_to("user_messages"));
|
||||||
} else
|
} else
|
||||||
return error("No Message found.", true);
|
return error(_("No Message found."), true);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case "delete" :
|
case "delete":
|
||||||
if (isset ($_REQUEST['id']) && preg_match("/^[0-9]{1,11}$/", $_REQUEST['id']))
|
if (isset($_REQUEST['id']) && preg_match("/^[0-9]{1,11}$/", $_REQUEST['id']))
|
||||||
$id = $_REQUEST['id'];
|
$id = $_REQUEST['id'];
|
||||||
else
|
else
|
||||||
return error("Incomplete call, missing Message ID.", true);
|
return error(_("Incomplete call, missing Message ID."), true);
|
||||||
|
|
||||||
$message = sql_select("SELECT * FROM `Messages` WHERE `id`=" . sql_escape($id) . " LIMIT 1");
|
$message = sql_select("SELECT * FROM `Messages` WHERE `id`=" . sql_escape($id) . " LIMIT 1");
|
||||||
if (count($message) > 0 && $message[0]['SUID'] == $user['UID']) {
|
if (count($message) > 0 && $message[0]['SUID'] == $user['UID']) {
|
||||||
sql_query("DELETE FROM `Messages` WHERE `id`=" . sql_escape($id) . " LIMIT 1");
|
sql_query("DELETE FROM `Messages` WHERE `id`=" . sql_escape($id) . " LIMIT 1");
|
||||||
redirect(page_link_to("user_messages"));
|
redirect(page_link_to("user_messages"));
|
||||||
} else
|
} else
|
||||||
return error("No Message found.", true);
|
return error(_("No Message found."), true);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case "send" :
|
case "send":
|
||||||
$text = preg_replace("/([^\p{L}\p{P}\p{Z}\p{N}\n]{1,})/ui", '', strip_tags($_REQUEST['text']));
|
$text = preg_replace("/([^\p{L}\p{P}\p{Z}\p{N}\n]{1,})/ui", '', strip_tags($_REQUEST['text']));
|
||||||
$to = preg_replace("/([^0-9]{1,})/ui", '', strip_tags($_REQUEST['to']));
|
$to = preg_replace("/([^0-9]{1,})/ui", '', strip_tags($_REQUEST['to']));
|
||||||
if ($text != "" && is_numeric($to) && sql_num_query("SELECT * FROM `User` WHERE `UID`=" . sql_escape($to) . " AND NOT `UID`=" . sql_escape($user['UID']) . " LIMIT 1") > 0) {
|
if ($text != "" && is_numeric($to) && sql_num_query("SELECT * FROM `User` WHERE `UID`=" . sql_escape($to) . " AND NOT `UID`=" . sql_escape($user['UID']) . " LIMIT 1") > 0) {
|
||||||
sql_query("INSERT INTO `Messages` SET `Datum`=" . sql_escape(time()) . ", `SUID`=" . sql_escape($user['UID']) . ", `RUID`=" . sql_escape($to) . ", `Text`='" . sql_escape($text) . "'");
|
sql_query("INSERT INTO `Messages` SET `Datum`=" . sql_escape(time()) . ", `SUID`=" . sql_escape($user['UID']) . ", `RUID`=" . sql_escape($to) . ", `Text`='" . sql_escape($text) . "'");
|
||||||
redirect(page_link_to("user_messages"));
|
redirect(page_link_to("user_messages"));
|
||||||
} else {
|
} else {
|
||||||
return error(Get_Text("pub_messages_Send_Error"), true);
|
return error(_("Transmitting was terminated with an Error."), true);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
default :
|
default:
|
||||||
return error("Wrong action.", true);
|
return error(_("Wrong action."), true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,5 +1,7 @@
|
||||||
<?php
|
<?php
|
||||||
|
function myshifts_title() {
|
||||||
|
return _("My shifts");
|
||||||
|
}
|
||||||
|
|
||||||
// Zeigt die Schichten an, die ein Benutzer belegt
|
// Zeigt die Schichten an, die ein Benutzer belegt
|
||||||
function user_myshifts() {
|
function user_myshifts() {
|
||||||
|
@ -56,9 +58,9 @@ function user_myshifts() {
|
||||||
$shift = $shift[0];
|
$shift = $shift[0];
|
||||||
if (($shift['start'] > time() + $LETZTES_AUSTRAGEN * 3600) || in_array('user_shifts_admin', $privileges)) {
|
if (($shift['start'] > time() + $LETZTES_AUSTRAGEN * 3600) || in_array('user_shifts_admin', $privileges)) {
|
||||||
sql_query("DELETE FROM `ShiftEntry` WHERE `id`=" . sql_escape($id) . " LIMIT 1");
|
sql_query("DELETE FROM `ShiftEntry` WHERE `id`=" . sql_escape($id) . " LIMIT 1");
|
||||||
$msg .= success(Get_Text("pub_myshifts_signed_off"), true);
|
$msg .= success(_("You have been signed off from the shift."), true);
|
||||||
} else
|
} else
|
||||||
$msg .= error(Get_Text("pub_myshifts_too_late"), true);
|
$msg .= error(_("It's too late to sign yourself off the shift. If neccessary, as the dispatcher to do so."), true);
|
||||||
} else
|
} else
|
||||||
redirect(page_link_to('user_myshifts'));
|
redirect(page_link_to('user_myshifts'));
|
||||||
}
|
}
|
||||||
|
@ -94,9 +96,9 @@ function user_myshifts() {
|
||||||
|
|
||||||
$myshift['actions'] = "";
|
$myshift['actions'] = "";
|
||||||
if ($id == $user['UID'])
|
if ($id == $user['UID'])
|
||||||
$myshift['actions'] .= img_button(page_link_to('user_myshifts') . '&edit=' . $shift['id'], 'pencil', 'edit');
|
$myshift['actions'] .= img_button(page_link_to('user_myshifts') . '&edit=' . $shift['id'], 'pencil', _("edit"));
|
||||||
if (($shift['start'] > time() + $LETZTES_AUSTRAGEN * 3600) || in_array('user_shifts_admin', $privileges))
|
if (($shift['start'] > time() + $LETZTES_AUSTRAGEN * 3600) || in_array('user_shifts_admin', $privileges))
|
||||||
$myshift['actions'] .= img_button(page_link_to('user_myshifts') . (($id != $user['UID'])? '&id=' . $id : '') . '&cancel=' . $shift['id'], 'cross', 'sign_off');
|
$myshift['actions'] .= img_button(page_link_to('user_myshifts') . (($id != $user['UID'])? '&id=' . $id : '') . '&cancel=' . $shift['id'], 'cross', _("sign off"));
|
||||||
|
|
||||||
$timesum += $shift['end'] - $shift['start'];
|
$timesum += $shift['end'] - $shift['start'];
|
||||||
$myshifts_table[] = $myshift;
|
$myshifts_table[] = $myshift;
|
||||||
|
@ -106,7 +108,7 @@ function user_myshifts() {
|
||||||
|
|
||||||
return page(array(
|
return page(array(
|
||||||
msg(),
|
msg(),
|
||||||
$id == $user['UID'] ? sprintf(Get_Text('pub_myshifts_intro'), $LETZTES_AUSTRAGEN) : '',
|
$id == $user['UID'] ? sprintf(_('These are your shifts.<br/>Please try to appear <b>15 minutes</b> before your shift begins!<br/>You can remove yourself from a shift up to %d hours before it starts.'), $LETZTES_AUSTRAGEN) : '',
|
||||||
$id != $user['UID'] ? info(sprintf("You are viewing %s's shifts.", $shifts_user['Nick']), true) : '',
|
$id != $user['UID'] ? info(sprintf("You are viewing %s's shifts.", $shifts_user['Nick']), true) : '',
|
||||||
$id != $user['UID'] ? buttons(array(button(page_link_to('admin_user') . '&id=' . $shifts_user['UID'], "Edit " . $shifts_user['Nick'], 'edit'))) : '',
|
$id != $user['UID'] ? buttons(array(button(page_link_to('admin_user') . '&id=' . $shifts_user['UID'], "Edit " . $shifts_user['Nick'], 'edit'))) : '',
|
||||||
table(array(
|
table(array(
|
||||||
|
@ -117,8 +119,8 @@ function user_myshifts() {
|
||||||
'comment' => "Kommentar",
|
'comment' => "Kommentar",
|
||||||
'actions' => "Aktion"
|
'actions' => "Aktion"
|
||||||
), $myshifts_table),
|
), $myshifts_table),
|
||||||
$id == $user['UID'] && count($shifts) == 0 ? error(sprintf(Get_Text('pub_myshifts_goto_shifts'), page_link_to('user_shifts')), true) : '',
|
$id == $user['UID'] && count($shifts) == 0 ? error(sprintf(_("Go to the <a href=\"%s\">shifts table</a> to sign yourself up for some shifts."), page_link_to('user_shifts')), true) : '',
|
||||||
"<h2>Exports</h2>" . sprintf(Get_Text('inc_schicht_ical_text'), page_link_to_absolute('ical') . '&key=' . $shifts_user['api_key'], page_link_to_absolute('shifts_json_export') . '&key=' . $shifts_user['api_key'], page_link_to('user_myshifts') . '&reset')
|
"<h2>Exports</h2>" . sprintf(_("Export of shown shifts. <a href=\"%s\">iCal format</a> or <a href=\"%s\">JSON format</a> available (please keep secret, otherwise <a href=\"%s\">reset the api key</a>)."), page_link_to_absolute('ical') . '&key=' . $shifts_user['api_key'], page_link_to_absolute('shifts_json_export') . '&key=' . $shifts_user['api_key'], page_link_to('user_myshifts') . '&reset')
|
||||||
));
|
));
|
||||||
}
|
}
|
||||||
?>
|
?>
|
||||||
|
|
|
@ -1,4 +1,12 @@
|
||||||
<?php
|
<?php
|
||||||
|
function news_title() {
|
||||||
|
return _("News");
|
||||||
|
}
|
||||||
|
|
||||||
|
function meetings_title() {
|
||||||
|
return _("Meetings");
|
||||||
|
}
|
||||||
|
|
||||||
function user_meetings() {
|
function user_meetings() {
|
||||||
global $DISPLAY_NEWS, $privileges, $user;
|
global $DISPLAY_NEWS, $privileges, $user;
|
||||||
|
|
||||||
|
@ -16,7 +24,7 @@ function user_meetings() {
|
||||||
$html .= "<div class=\"pagination\">\n\n";
|
$html .= "<div class=\"pagination\">\n\n";
|
||||||
$dis_rows = ceil(sql_num_query("SELECT * FROM `News` WHERE `Treffen`=1") / $DISPLAY_NEWS);
|
$dis_rows = ceil(sql_num_query("SELECT * FROM `News` WHERE `Treffen`=1") / $DISPLAY_NEWS);
|
||||||
|
|
||||||
$html .= Get_Text(5);
|
$html .= _("Page:");
|
||||||
|
|
||||||
for ($i = 0; $i < $dis_rows; $i++) {
|
for ($i = 0; $i < $dis_rows; $i++) {
|
||||||
if (isset($_REQUEST['page']) && $i == $_REQUEST['page'])
|
if (isset($_REQUEST['page']) && $i == $_REQUEST['page'])
|
||||||
|
@ -42,7 +50,7 @@ function display_news($news) {
|
||||||
|
|
||||||
$html .= User_Nick_render($user_source);
|
$html .= User_Nick_render($user_source);
|
||||||
if ($p != "news_comments")
|
if ($p != "news_comments")
|
||||||
$html .= ', <a href="' . page_link_to("news_comments") . '&nid=' . $news['ID'] . '">Kommentare (' . sql_num_query("SELECT * FROM `news_comments` WHERE `Refid`='" . sql_escape($news['ID']) . "'") . ') »</a>';
|
$html .= ', <a href="' . page_link_to("news_comments") . '&nid=' . $news['ID'] . '">' . _("Comments") . ' (' . sql_num_query("SELECT * FROM `news_comments` WHERE `Refid`='" . sql_escape($news['ID']) . "'") . ') »</a>';
|
||||||
$html .= '</details>';
|
$html .= '</details>';
|
||||||
$html .= '<h3>' . ($news['Treffen'] == 1 ? '[Meeting] ' : '') . ReplaceSmilies($news['Betreff']) . '</h3>';
|
$html .= '<h3>' . ($news['Treffen'] == 1 ? '[Meeting] ' : '') . ReplaceSmilies($news['Betreff']) . '</h3>';
|
||||||
$html .= '<p>' . ReplaceSmilies(nl2br($news['Text'])) . '</p>';
|
$html .= '<p>' . ReplaceSmilies(nl2br($news['Text'])) . '</p>';
|
||||||
|
@ -70,7 +78,7 @@ function user_news_comments() {
|
||||||
$html .= '<a href="' . page_link_to("news") . '">« Back</a>';
|
$html .= '<a href="' . page_link_to("news") . '">« Back</a>';
|
||||||
$html .= display_news($news);
|
$html .= display_news($news);
|
||||||
|
|
||||||
$html .= '<h2>Kommentare</h2>';
|
$html .= '<h2>' . _("Comments") . '</h2>';
|
||||||
|
|
||||||
$comments = sql_select("SELECT * FROM `news_comments` WHERE `Refid`='" . sql_escape($nid) . "' ORDER BY 'ID'");
|
$comments = sql_select("SELECT * FROM `news_comments` WHERE `Refid`='" . sql_escape($nid) . "' ORDER BY 'ID'");
|
||||||
foreach ($comments as $comment) {
|
foreach ($comments as $comment) {
|
||||||
|
@ -125,7 +133,7 @@ function user_news() {
|
||||||
"VALUES ('" . sql_escape(time()) . "', '" . sql_escape($_POST["betreff"]) . "', '" . sql_escape($_POST["text"]) . "', '" . sql_escape($user['UID']) .
|
"VALUES ('" . sql_escape(time()) . "', '" . sql_escape($_POST["betreff"]) . "', '" . sql_escape($_POST["text"]) . "', '" . sql_escape($user['UID']) .
|
||||||
"', '" . sql_escape($_POST["treffen"]) . "');");
|
"', '" . sql_escape($_POST["treffen"]) . "');");
|
||||||
engelsystem_log("Created news: " . $_POST["betreff"] . ", treffen: " . $_POST["treffen"]);
|
engelsystem_log("Created news: " . $_POST["betreff"] . ", treffen: " . $_POST["treffen"]);
|
||||||
success(Get_Text(4));
|
success(_("Entry saved."));
|
||||||
redirect(page_link_to('user_news'));
|
redirect(page_link_to('user_news'));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -141,7 +149,7 @@ function user_news() {
|
||||||
$html .= "<div class=\"pagination\">\n\n";
|
$html .= "<div class=\"pagination\">\n\n";
|
||||||
$dis_rows = ceil(sql_num_query("SELECT * FROM `News`") / $DISPLAY_NEWS);
|
$dis_rows = ceil(sql_num_query("SELECT * FROM `News`") / $DISPLAY_NEWS);
|
||||||
|
|
||||||
$html .= Get_Text(5);
|
$html .= _("Page:");
|
||||||
|
|
||||||
for ($i = 0; $i < $dis_rows; $i++) {
|
for ($i = 0; $i < $dis_rows; $i++) {
|
||||||
if (isset($_REQUEST['page']) && $i == $_REQUEST['page'])
|
if (isset($_REQUEST['page']) && $i == $_REQUEST['page'])
|
||||||
|
@ -152,29 +160,29 @@ function user_news() {
|
||||||
$html .= '</div>';
|
$html .= '</div>';
|
||||||
if (in_array("admin_news", $privileges)) {
|
if (in_array("admin_news", $privileges)) {
|
||||||
$html .= '<br /><hr />
|
$html .= '<br /><hr />
|
||||||
<h2>' . Get_Text(6) . '</h2>
|
<h2>' . _("Create news:") . '</h2>
|
||||||
<a name="Neu"> </a>
|
<a name="Neu"> </a>
|
||||||
|
|
||||||
<form action="" method="post">
|
<form action="" method="post">
|
||||||
<table>
|
<table>
|
||||||
<tr>
|
<tr>
|
||||||
<td align="right">' . Get_Text(7) . '</td>
|
<td align="right">' . _("Subject") . ':</td>
|
||||||
<td><input type="text" name="betreff" size="60"></td>
|
<td><input type="text" name="betreff" size="60"></td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td align="right">' . Get_Text(8) . '</td>
|
<td align="right">' . _("Message") . ':</td>
|
||||||
<td><textarea name="text" cols="50" rows="10"></textarea></td>
|
<td><textarea name="text" cols="50" rows="10"></textarea></td>
|
||||||
</tr>';
|
</tr>';
|
||||||
if (in_array('admin_news', $privileges)) {
|
if (in_array('admin_news', $privileges)) {
|
||||||
$html .= ' <tr>
|
$html .= ' <tr>
|
||||||
<td align="right">' . Get_Text(9) . '</td>
|
<td align="right">' . _("Meeting") . ':</td>
|
||||||
<td><input type="checkbox" name="treffen" size="1" value="1"></td>
|
<td><input type="checkbox" name="treffen" size="1" value="1"></td>
|
||||||
</tr>';
|
</tr>';
|
||||||
|
|
||||||
}
|
}
|
||||||
$html .= '</table>
|
$html .= '</table>
|
||||||
<br />
|
<br />
|
||||||
<input type="submit" value="' . Get_Text("save") . '">
|
<input type="submit" value="' . _("Save") . '">
|
||||||
</form>';
|
</form>';
|
||||||
}
|
}
|
||||||
return $html;
|
return $html;
|
||||||
|
|
|
@ -1,4 +1,8 @@
|
||||||
<?php
|
<?php
|
||||||
|
function questions_title() {
|
||||||
|
return _("Ask an archangel");
|
||||||
|
}
|
||||||
|
|
||||||
function user_questions() {
|
function user_questions() {
|
||||||
global $user;
|
global $user;
|
||||||
|
|
||||||
|
|
|
@ -1,8 +1,8 @@
|
||||||
<?php
|
<?php
|
||||||
function user_settings() {
|
function user_settings() {
|
||||||
global $enable_tshirt_size, $tshirt_sizes, $themes, $languages;
|
global $enable_tshirt_size, $tshirt_sizes, $themes, $locales;
|
||||||
global $user;
|
global $user;
|
||||||
|
|
||||||
$msg = "";
|
$msg = "";
|
||||||
$nick = $user['Nick'];
|
$nick = $user['Nick'];
|
||||||
$lastname = $user['Name'];
|
$lastname = $user['Name'];
|
||||||
|
@ -19,187 +19,181 @@ function user_settings() {
|
||||||
$password_hash = "";
|
$password_hash = "";
|
||||||
$selected_theme = $user['color'];
|
$selected_theme = $user['color'];
|
||||||
$selected_language = $user['Sprache'];
|
$selected_language = $user['Sprache'];
|
||||||
|
|
||||||
$selected_angel_types_source = sql_select("SELECT * FROM `UserAngelTypes` WHERE `user_id`=" . sql_escape($user['UID']));
|
$selected_angel_types_source = sql_select("SELECT * FROM `UserAngelTypes` WHERE `user_id`=" . sql_escape($user['UID']));
|
||||||
$selected_angel_types = array ();
|
$selected_angel_types = array();
|
||||||
foreach ($selected_angel_types_source as $selected_angel_type)
|
foreach ($selected_angel_types_source as $selected_angel_type)
|
||||||
$selected_angel_types[] = $selected_angel_type['angeltype_id'];
|
$selected_angel_types[] = $selected_angel_type['angeltype_id'];
|
||||||
|
|
||||||
$angel_types_source = sql_select("SELECT * FROM `AngelTypes` ORDER BY `name`");
|
$angel_types_source = sql_select("SELECT * FROM `AngelTypes` ORDER BY `name`");
|
||||||
$angel_types = array ();
|
$angel_types = array();
|
||||||
foreach ($angel_types_source as $angel_type)
|
foreach ($angel_types_source as $angel_type)
|
||||||
$angel_types[$angel_type['id']] = $angel_type['name'] . ($angel_type['restricted'] ? " (restricted)" : "");
|
$angel_types[$angel_type['id']] = $angel_type['name'] . ($angel_type['restricted'] ? " (restricted)" : "");
|
||||||
|
|
||||||
if (isset ($_REQUEST['submit'])) {
|
if (isset($_REQUEST['submit'])) {
|
||||||
$ok = true;
|
$ok = true;
|
||||||
|
|
||||||
if (isset ($_REQUEST['nick']) && strlen(strip_request_item('nick')) > 1) {
|
if (isset($_REQUEST['nick']) && strlen(strip_request_item('nick')) > 1) {
|
||||||
$nick = strip_request_item('nick');
|
$nick = strip_request_item('nick');
|
||||||
if (sql_num_query("SELECT * FROM `User` WHERE `Nick`='" . sql_escape($nick) . "' AND NOT `UID`=" . sql_escape($user['UID']) . " LIMIT 1") > 0) {
|
if (sql_num_query("SELECT * FROM `User` WHERE `Nick`='" . sql_escape($nick) . "' AND NOT `UID`=" . sql_escape($user['UID']) . " LIMIT 1") > 0) {
|
||||||
$ok = false;
|
$ok = false;
|
||||||
$msg .= error(sprintf(Get_Text("makeuser_error_nick1") . "%s" . Get_Text("makeuser_error_nick3"), $nick), true);
|
$msg .= error(sprintf(_("Your nick "%s" already exists."), $nick), true);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
$ok = false;
|
$ok = false;
|
||||||
$msg .= error(sprintf(Get_Text("makeuser_error_nick1") . "%s" . Get_Text("makeuser_error_nick2"), strip_request_item('nick')), true);
|
$msg .= error(sprintf(_("Your nick "%s" is too short (min. 2 characters)."), strip_request_item('nick')), true);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (isset ($_REQUEST['mail']) && strlen(strip_request_item('mail')) > 0) {
|
if (isset($_REQUEST['mail']) && strlen(strip_request_item('mail')) > 0) {
|
||||||
$mail = strip_request_item('mail');
|
$mail = strip_request_item('mail');
|
||||||
if (!check_email($mail)) {
|
if (! check_email($mail)) {
|
||||||
$ok = false;
|
$ok = false;
|
||||||
$msg .= error(Get_Text("makeuser_error_mail"), true);
|
$msg .= error(_("E-mail address is not correct."), true);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
$ok = false;
|
$ok = false;
|
||||||
$msg .= error("Please enter your e-mail.", true);
|
$msg .= error(_("Please enter your e-mail."), true);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (isset ($_REQUEST['icq']))
|
if (isset($_REQUEST['icq']))
|
||||||
$icq = strip_request_item('icq');
|
$icq = strip_request_item('icq');
|
||||||
if (isset ($_REQUEST['jabber']) && strlen(strip_request_item('jabber')) > 0) {
|
if (isset($_REQUEST['jabber']) && strlen(strip_request_item('jabber')) > 0) {
|
||||||
$jabber = strip_request_item('jabber');
|
$jabber = strip_request_item('jabber');
|
||||||
if (!check_email($jabber)) {
|
if (! check_email($jabber)) {
|
||||||
$ok = false;
|
$ok = false;
|
||||||
$msg .= error("Please check your jabber.", true);
|
$msg .= error(_("Please check your jabber account information."), true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (isset ($_REQUEST['tshirt_size']) && isset ($tshirt_sizes[$_REQUEST['tshirt_size']]))
|
if (isset($_REQUEST['tshirt_size']) && isset($tshirt_sizes[$_REQUEST['tshirt_size']]))
|
||||||
$tshirt_size = $_REQUEST['tshirt_size'];
|
$tshirt_size = $_REQUEST['tshirt_size'];
|
||||||
elseif($enable_tshirt_size) {
|
elseif ($enable_tshirt_size) {
|
||||||
$ok = false;
|
$ok = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
$selected_angel_types = array ();
|
$selected_angel_types = array();
|
||||||
foreach ($angel_types as $angel_type_id => $angel_type_name)
|
foreach ($angel_types as $angel_type_id => $angel_type_name)
|
||||||
if (isset ($_REQUEST['angel_types_' . $angel_type_id]))
|
if (isset($_REQUEST['angel_types_' . $angel_type_id]))
|
||||||
$selected_angel_types[] = $angel_type_id;
|
$selected_angel_types[] = $angel_type_id;
|
||||||
|
|
||||||
// Trivia
|
// Trivia
|
||||||
if (isset ($_REQUEST['lastname']))
|
if (isset($_REQUEST['lastname']))
|
||||||
$lastname = strip_request_item('lastname');
|
$lastname = strip_request_item('lastname');
|
||||||
if (isset ($_REQUEST['prename']))
|
if (isset($_REQUEST['prename']))
|
||||||
$prename = strip_request_item('prename');
|
$prename = strip_request_item('prename');
|
||||||
if (isset ($_REQUEST['age']) && preg_match("/^[0-9]{0,4}$/", $_REQUEST['age']))
|
if (isset($_REQUEST['age']) && preg_match("/^[0-9]{0,4}$/", $_REQUEST['age']))
|
||||||
$age = strip_request_item('age');
|
$age = strip_request_item('age');
|
||||||
if (isset ($_REQUEST['tel']))
|
if (isset($_REQUEST['tel']))
|
||||||
$tel = strip_request_item('tel');
|
$tel = strip_request_item('tel');
|
||||||
if (isset ($_REQUEST['dect']))
|
if (isset($_REQUEST['dect']))
|
||||||
$dect = strip_request_item('dect');
|
$dect = strip_request_item('dect');
|
||||||
if (isset ($_REQUEST['mobile']))
|
if (isset($_REQUEST['mobile']))
|
||||||
$mobile = strip_request_item('mobile');
|
$mobile = strip_request_item('mobile');
|
||||||
if (isset ($_REQUEST['hometown']))
|
if (isset($_REQUEST['hometown']))
|
||||||
$hometown = strip_request_item('hometown');
|
$hometown = strip_request_item('hometown');
|
||||||
|
|
||||||
if ($ok) {
|
if ($ok) {
|
||||||
sql_query("UPDATE `User` SET `Nick`='" . sql_escape($nick) . "', `Vorname`='" . sql_escape($prename) . "', `Name`='" . sql_escape($lastname) .
|
sql_query("UPDATE `User` SET `Nick`='" . sql_escape($nick) . "', `Vorname`='" . sql_escape($prename) . "', `Name`='" . sql_escape($lastname) . "', `Alter`='" . sql_escape($age) . "', `Telefon`='" . sql_escape($tel) . "', `DECT`='" . sql_escape($dect) . "', `Handy`='" . sql_escape($mobile) . "', `email`='" . sql_escape($mail) . "', `ICQ`='" . sql_escape($icq) . "', `jabber`='" . sql_escape($jabber) . "', `Size`='" . sql_escape($tshirt_size) . "', `Hometown`='" . sql_escape($hometown) . "' WHERE `UID`=" . sql_escape($user['UID']));
|
||||||
"', `Alter`='" . sql_escape($age) . "', `Telefon`='" . sql_escape($tel) . "', `DECT`='" . sql_escape($dect) . "', `Handy`='" . sql_escape($mobile) .
|
|
||||||
"', `email`='" . sql_escape($mail) . "', `ICQ`='" . sql_escape($icq) . "', `jabber`='" . sql_escape($jabber) . "', `Size`='" . sql_escape($tshirt_size) .
|
|
||||||
"', `Hometown`='" . sql_escape($hometown) . "' WHERE `UID`=" . sql_escape($user['UID']));
|
|
||||||
|
|
||||||
// Assign angel-types
|
// Assign angel-types
|
||||||
$user_angel_type_info = array();
|
$user_angel_type_info = array();
|
||||||
sql_query("DELETE FROM `UserAngelTypes` WHERE `user_id`='" . sql_escape($user['UID']) . "' AND `angeltype_id` IN (" . implode(",", array_diff(array_keys($angel_types), $selected_angel_types)) . ")");
|
sql_query("DELETE FROM `UserAngelTypes` WHERE `user_id`='" . sql_escape($user['UID']) . "' AND `angeltype_id` IN (" . implode(",", array_diff(array_keys($angel_types), $selected_angel_types)) . ")");
|
||||||
foreach ($angel_types_source as $angel_type)
|
foreach ($angel_types_source as $angel_type)
|
||||||
if (in_array($angel_type['id'], $selected_angel_types))
|
if (in_array($angel_type['id'], $selected_angel_types))
|
||||||
$user_angel_type_info[] = $angel_type['name'];
|
$user_angel_type_info[] = $angel_type['name'];
|
||||||
|
|
||||||
foreach ($selected_angel_types as $selected_angel_type_id) {
|
foreach ($selected_angel_types as $selected_angel_type_id) {
|
||||||
if (sql_num_query("SELECT * FROM `UserAngelTypes` WHERE `user_id`=" . sql_escape($user['UID']) . " AND `angeltype_id`=" . sql_escape($selected_angel_type_id) . " LIMIT 1") == 0)
|
if (sql_num_query("SELECT * FROM `UserAngelTypes` WHERE `user_id`=" . sql_escape($user['UID']) . " AND `angeltype_id`=" . sql_escape($selected_angel_type_id) . " LIMIT 1") == 0)
|
||||||
sql_query("INSERT INTO `UserAngelTypes` SET `user_id`=" . sql_escape($user['UID']) . ", `angeltype_id`=" . sql_escape($selected_angel_type_id));
|
sql_query("INSERT INTO `UserAngelTypes` SET `user_id`=" . sql_escape($user['UID']) . ", `angeltype_id`=" . sql_escape($selected_angel_type_id));
|
||||||
}
|
}
|
||||||
|
|
||||||
engelsystem_log("Own angel types set to: " . join(", ", $user_angel_type_info));
|
engelsystem_log("Own angel types set to: " . join(", ", $user_angel_type_info));
|
||||||
success("Settings saved.");
|
success("Settings saved.");
|
||||||
redirect(page_link_to('user_settings'));
|
redirect(page_link_to('user_settings'));
|
||||||
}
|
}
|
||||||
}
|
} elseif (isset($_REQUEST['submit_password'])) {
|
||||||
elseif (isset ($_REQUEST['submit_password'])) {
|
|
||||||
$ok = true;
|
$ok = true;
|
||||||
|
|
||||||
if (!isset ($_REQUEST['password']) || !verify_password($_REQUEST['password'], $user['Passwort'], $user['UID']))
|
if (! isset($_REQUEST['password']) || ! verify_password($_REQUEST['password'], $user['Passwort'], $user['UID']))
|
||||||
$msg .= error(Get_Text(30), true);
|
$msg .= error(_("-> not OK. Please try again."), true);
|
||||||
elseif (strlen($_REQUEST['new_password']) < MIN_PASSWORD_LENGTH)
|
elseif (strlen($_REQUEST['new_password']) < MIN_PASSWORD_LENGTH)
|
||||||
$msg .= error(Get_Text("makeuser_error_password2"));
|
$msg .= error(_("Your password is to short (please use at least 6 characters)."), true);
|
||||||
elseif ($_REQUEST['new_password'] != $_REQUEST['new_password2'])
|
elseif ($_REQUEST['new_password'] != $_REQUEST['new_password2'])
|
||||||
$msg .= error(Get_Text("makeuser_error_password1"), true);
|
$msg .= error(_("Your passwords don't match."), true);
|
||||||
elseif(set_password($user['UID'], $_REQUEST['new_password']))
|
elseif (set_password($user['UID'], $_REQUEST['new_password']))
|
||||||
success("Password saved.");
|
success(_("Password saved."));
|
||||||
else
|
else
|
||||||
error("Failed setting password.");
|
error(_("Failed setting password."));
|
||||||
redirect(page_link_to('user_settings'));
|
redirect(page_link_to('user_settings'));
|
||||||
}
|
} elseif (isset($_REQUEST['submit_theme'])) {
|
||||||
elseif (isset ($_REQUEST['submit_theme'])) {
|
|
||||||
$ok = true;
|
$ok = true;
|
||||||
|
|
||||||
if (isset ($_REQUEST['theme']) && isset ($themes[$_REQUEST['theme']]))
|
if (isset($_REQUEST['theme']) && isset($themes[$_REQUEST['theme']]))
|
||||||
$selected_theme = $_REQUEST['theme'];
|
$selected_theme = $_REQUEST['theme'];
|
||||||
else
|
else
|
||||||
$ok = false;
|
$ok = false;
|
||||||
|
|
||||||
if ($ok) {
|
if ($ok) {
|
||||||
sql_query("UPDATE `User` SET `color`='" . sql_escape($selected_theme) . "' WHERE `UID`=" . sql_escape($user['UID']));
|
sql_query("UPDATE `User` SET `color`='" . sql_escape($selected_theme) . "' WHERE `UID`=" . sql_escape($user['UID']));
|
||||||
|
|
||||||
success("Theme changed.");
|
success("Theme changed.");
|
||||||
redirect(page_link_to('user_settings'));
|
redirect(page_link_to('user_settings'));
|
||||||
}
|
}
|
||||||
}
|
} elseif (isset($_REQUEST['submit_language'])) {
|
||||||
elseif (isset ($_REQUEST['submit_language'])) {
|
|
||||||
$ok = true;
|
$ok = true;
|
||||||
|
|
||||||
if (isset ($_REQUEST['language']) && isset ($languages[$_REQUEST['language']]))
|
if (isset($_REQUEST['language']) && isset($locales[$_REQUEST['language']]))
|
||||||
$selected_language = $_REQUEST['language'];
|
$selected_language = $_REQUEST['language'];
|
||||||
else
|
else
|
||||||
$ok = false;
|
$ok = false;
|
||||||
|
|
||||||
if ($ok) {
|
if ($ok) {
|
||||||
sql_query("UPDATE `User` SET `Sprache`='" . sql_escape($selected_language) . "' WHERE `UID`=" . sql_escape($user['UID']));
|
sql_query("UPDATE `User` SET `Sprache`='" . sql_escape($selected_language) . "' WHERE `UID`=" . sql_escape($user['UID']));
|
||||||
$_SESSION['Sprache'] = $selected_language;
|
$_SESSION['locale'] = $selected_language;
|
||||||
|
|
||||||
success("Language changed.");
|
success("Language changed.");
|
||||||
redirect(page_link_to('user_settings'));
|
redirect(page_link_to('user_settings'));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return page(array (
|
return page(array(
|
||||||
sprintf(Get_Text("Hallo") . "%s,<br />" . Get_Text(13), User_Nick_render($user)),
|
sprintf(_("Hello %s, here you can change your personal settings i.e. password, color settings etc."), User_Nick_render($user)),
|
||||||
$msg,
|
$msg,
|
||||||
msg(),
|
msg(),
|
||||||
form(array (
|
form(array(
|
||||||
form_info("", Get_Text("pub_einstellungen_Text_UserData")),
|
form_info("", _("Here you can change your user details.")),
|
||||||
form_text('nick', Get_Text("makeuser_Nickname") . "*", $nick),
|
form_text('nick', _("Nick") . "*", $nick),
|
||||||
form_text('lastname', Get_Text("makeuser_Nachname"), $lastname),
|
form_text('lastname', _("Last name"), $lastname),
|
||||||
form_text('prename', Get_Text("makeuser_Vorname"), $prename),
|
form_text('prename', _("First name"), $prename),
|
||||||
form_text('age', Get_Text("makeuser_Alter"), $age),
|
form_text('age', _("Age"), $age),
|
||||||
form_text('tel', Get_Text("makeuser_Telefon"), $tel),
|
form_text('tel', _("Phone"), $tel),
|
||||||
form_text('dect', Get_Text("makeuser_DECT"), $dect),
|
form_text('dect', _("DECT"), $tel),
|
||||||
form_text('mobile', Get_Text("makeuser_Handy"), $mobile),
|
form_text('mobile', _("Mobile"), $mobile),
|
||||||
form_text('mail', Get_Text("makeuser_E-Mail") . "*", $mail),
|
form_text('mail', _("E-Mail") . "*", $mail),
|
||||||
form_text('icq', "ICQ", $icq),
|
form_text('icq', _("ICQ"), $icq),
|
||||||
form_text('jabber', "Jabber", $jabber),
|
form_text('jabber', _("Jabber"), $jabber),
|
||||||
form_text('hometown', Get_Text("makeuser_Hometown"), $hometown),
|
form_text('hometown', _("Hometown"), $hometown),
|
||||||
$enable_tshirt_size ? form_select('tshirt_size', Get_Text("makeuser_T-Shirt"), $tshirt_sizes, $tshirt_size) : '',
|
$enable_tshirt_size ? form_select('tshirt_size', _("Shirt size"), $tshirt_sizes, $tshirt_size) : '',
|
||||||
form_checkboxes('angel_types', "<span id=\"angel_types_anchor\">What do you want to do?</span><br>(<a href=\"https://events.ccc.de/congress/2012/wiki/Volunteers#What_kind_of_volunteers_are_needed.3F\">Description of job types</a>)", $angel_types, $selected_angel_types),
|
form_checkboxes('angel_types', _("What do you want to do?") . sprintf("<br>(<a href=\"https://events.ccc.de/congress/2012/wiki/Volunteers#What_kind_of_volunteers_are_needed.3F\">%s</a>)", _("Description of job types")), $angel_types, $selected_angel_types),
|
||||||
form_submit('submit', Get_Text("save"))
|
form_submit('submit', _("Save"))
|
||||||
)),
|
)),
|
||||||
form(array (
|
form(array(
|
||||||
form_info("", Get_Text(14)),
|
form_info("", _("Here you can change your password.")),
|
||||||
form_password('password', Get_Text(15)),
|
form_password('password', _("Old password:")),
|
||||||
form_password('new_password', Get_Text(16)),
|
form_password('new_password', _("New password:")),
|
||||||
form_password('new_password2', Get_Text(17)),
|
form_password('new_password2', _("Password confirmation:")),
|
||||||
form_submit('submit_password', Get_Text("save"))
|
form_submit('submit_password', _("Save"))
|
||||||
)),
|
)),
|
||||||
form(array (
|
form(array(
|
||||||
form_info("", Get_Text(18)),
|
form_info("", _("Here you can choose your color settings:")),
|
||||||
form_select('theme', Get_Text(19), $themes, $selected_theme),
|
form_select('theme', _("Color settings:"), $themes, $selected_theme),
|
||||||
form_submit('submit_theme', Get_Text("save"))
|
form_submit('submit_theme', _("Save"))
|
||||||
)),
|
)),
|
||||||
form(array (
|
form(array(
|
||||||
form_info("", Get_Text(20)),
|
form_info("", _("Here you can choose your language:")),
|
||||||
form_select('language', Get_Text(21), $languages, $selected_language),
|
form_select('language', _("Language:"), $locales, $selected_language),
|
||||||
form_submit('submit_language', Get_Text("save"))
|
form_submit('submit_language', _("Save"))
|
||||||
))
|
))
|
||||||
));
|
));
|
||||||
}
|
}
|
||||||
?>
|
?>
|
||||||
|
|
|
@ -1,4 +1,8 @@
|
||||||
<?php
|
<?php
|
||||||
|
function shifts_title() {
|
||||||
|
return _("All Shifts");
|
||||||
|
}
|
||||||
|
|
||||||
function user_shifts() {
|
function user_shifts() {
|
||||||
global $user, $privileges;
|
global $user, $privileges;
|
||||||
|
|
||||||
|
@ -296,11 +300,11 @@ function view_user_shifts() {
|
||||||
$filled = array (
|
$filled = array (
|
||||||
array (
|
array (
|
||||||
'id' => '1',
|
'id' => '1',
|
||||||
'name' => Get_Text('occupied')
|
'name' => _('occupied')
|
||||||
),
|
),
|
||||||
array (
|
array (
|
||||||
'id' => '0',
|
'id' => '0',
|
||||||
'name' => Get_Text('free')
|
'name' => _('free')
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
|
|
||||||
|
@ -479,7 +483,7 @@ function view_user_shifts() {
|
||||||
$is_free = false;
|
$is_free = false;
|
||||||
$shifts_row = $shift['name'];
|
$shifts_row = $shift['name'];
|
||||||
if (in_array('admin_shifts', $privileges))
|
if (in_array('admin_shifts', $privileges))
|
||||||
$shifts_row .= ' ' . img_button('?p=user_shifts&edit_shift=' . $shift['SID'], 'pencil', 'edit') . img_button('?p=user_shifts&delete_shift=' . $shift['SID'], 'bin', 'delete');
|
$shifts_row .= ' ' . img_button('?p=user_shifts&edit_shift=' . $shift['SID'], 'pencil', _("edit")) . img_button('?p=user_shifts&delete_shift=' . $shift['SID'], 'bin', _("delete"));
|
||||||
$shifts_row .= '<br />';
|
$shifts_row .= '<br />';
|
||||||
$query = "SELECT `NeededAngelTypes`.`count`, `AngelTypes`.`id`, `AngelTypes`.`restricted`, `UserAngelTypes`.`confirm_user_id`, `AngelTypes`.`name`, `UserAngelTypes`.`user_id`
|
$query = "SELECT `NeededAngelTypes`.`count`, `AngelTypes`.`id`, `AngelTypes`.`restricted`, `UserAngelTypes`.`confirm_user_id`, `AngelTypes`.`name`, `UserAngelTypes`.`user_id`
|
||||||
FROM `NeededAngelTypes`
|
FROM `NeededAngelTypes`
|
||||||
|
@ -507,12 +511,12 @@ function view_user_shifts() {
|
||||||
else
|
else
|
||||||
$style="font-weight:normal;";
|
$style="font-weight:normal;";
|
||||||
if (in_array('user_shifts_admin', $privileges))
|
if (in_array('user_shifts_admin', $privileges))
|
||||||
$entry_list[] = "<span style=\"$style\">" . User_Nick_render($entry) . ' ' . img_button(page_link_to('user_shifts') . '&entry_id=' . $entry['id'], 'bin', 'delete') . '</span>';
|
$entry_list[] = "<span style=\"$style\">" . User_Nick_render($entry) . ' ' . img_button(page_link_to('user_shifts') . '&entry_id=' . $entry['id'], 'bin', _("delete")) . '</span>';
|
||||||
else
|
else
|
||||||
$entry_list[] = "<span style=\"$style\">" . User_Nick_render($entry) ."</span>";
|
$entry_list[] = "<span style=\"$style\">" . User_Nick_render($entry) ."</span>";
|
||||||
}
|
}
|
||||||
if ($angeltype['count'] - count($entries) > 0) {
|
if ($angeltype['count'] - count($entries) > 0) {
|
||||||
$inner_text = ($angeltype['count'] - count($entries)) . ' ' . Get_Text($angeltype['count'] - count($entries) == 1 ? 'helper' : 'helpers') . ' ' . Get_Text('needed');
|
$inner_text = sprintf(ngettext("%d helper needed", "%d helpers needed", $angeltype['count'] - count($entries)), $angeltype['count'] - count($entries));
|
||||||
// is the shift still running or alternatively is the user shift admin?
|
// is the shift still running or alternatively is the user shift admin?
|
||||||
$user_may_join_shift = true;
|
$user_may_join_shift = true;
|
||||||
|
|
||||||
|
@ -605,7 +609,7 @@ function view_user_shifts() {
|
||||||
);
|
);
|
||||||
|
|
||||||
if (in_array('admin_shifts', $privileges))
|
if (in_array('admin_shifts', $privileges))
|
||||||
$shift_row['info'] .= ' ' . img_button('?p=user_shifts&edit_shift=' . $shift['SID'], 'pencil', 'edit') . img_button('?p=user_shifts&delete_shift=' . $shift['SID'], 'bin', 'delete');
|
$shift_row['info'] .= ' ' . img_button('?p=user_shifts&edit_shift=' . $shift['SID'], 'pencil', 'edit') . img_button('?p=user_shifts&delete_shift=' . $shift['SID'], 'bin', _("delete"));
|
||||||
$shift_row['entries'] .= '<br />';
|
$shift_row['entries'] .= '<br />';
|
||||||
$is_free = false;
|
$is_free = false;
|
||||||
$shift_has_special_needs = 0 < sql_num_query("SELECT `id` FROM `NeededAngelTypes` WHERE `shift_id` = " . $shift['SID']);
|
$shift_has_special_needs = 0 < sql_num_query("SELECT `id` FROM `NeededAngelTypes` WHERE `shift_id` = " . $shift['SID']);
|
||||||
|
@ -630,14 +634,14 @@ function view_user_shifts() {
|
||||||
$entry_list = array ();
|
$entry_list = array ();
|
||||||
foreach ($entries as $entry) {
|
foreach ($entries as $entry) {
|
||||||
if (in_array('user_shifts_admin', $privileges))
|
if (in_array('user_shifts_admin', $privileges))
|
||||||
$entry_list[] = User_Nick_render($entry) . ' ' . img_button(page_link_to('user_shifts') . '&entry_id=' . $entry['id'], 'bin', 'delete');
|
$entry_list[] = User_Nick_render($entry) . ' ' . img_button(page_link_to('user_shifts') . '&entry_id=' . $entry['id'], 'bin', _("delete"));
|
||||||
else
|
else
|
||||||
$entry_list[] = User_Nick_render($entry);
|
$entry_list[] = User_Nick_render($entry);
|
||||||
}
|
}
|
||||||
$angeltype['taken'] = count($entries);
|
$angeltype['taken'] = count($entries);
|
||||||
// do we need more angles of this type?
|
// do we need more angles of this type?
|
||||||
if ($angeltype['count'] - count($entries) > 0) {
|
if ($angeltype['count'] - count($entries) > 0) {
|
||||||
$inner_text = ($angeltype['count'] - count($entries)) . ' ' . Get_Text($angeltype['count'] - count($entries) == 1 ? 'helper' : 'helpers') . ' ' . Get_Text('needed');
|
$inner_text = sprintf(ngettext("%d helper needed", "%d helpers needed", $angeltype['count'] - count($entries)), $angeltype['count'] - count($entries));
|
||||||
// is the shift still running or alternatively is the user shift admin?
|
// is the shift still running or alternatively is the user shift admin?
|
||||||
$user_may_join_shift = true;
|
$user_may_join_shift = true;
|
||||||
|
|
||||||
|
@ -687,8 +691,8 @@ function view_user_shifts() {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
$shifts_table = table(array(
|
$shifts_table = table(array(
|
||||||
'info' => ucfirst(Get_Text("time")) . "/" . ucfirst(Get_Text("room")),
|
'info' => _("Time") . "/" . _("Room"),
|
||||||
'entries' => ucfirst(Get_Text("entries"))
|
'entries' => _("Entries")
|
||||||
), $shifts_table);
|
), $shifts_table);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -696,18 +700,18 @@ if ($user['api_key'] == "")
|
||||||
User_reset_api_key($user);
|
User_reset_api_key($user);
|
||||||
|
|
||||||
return msg() . template_render('../templates/user_shifts.html', array (
|
return msg() . template_render('../templates/user_shifts.html', array (
|
||||||
'room_select' => make_select($rooms, $_SESSION['user_shifts']['rooms'], "rooms", ucfirst(Get_Text("rooms"))),
|
'room_select' => make_select($rooms, $_SESSION['user_shifts']['rooms'], "rooms", _("Rooms")),
|
||||||
'start_select' => html_select_key("start_day", "start_day", array_combine($days, $days), $_SESSION['user_shifts']['start_day']),
|
'start_select' => html_select_key("start_day", "start_day", array_combine($days, $days), $_SESSION['user_shifts']['start_day']),
|
||||||
'start_time' => $_SESSION['user_shifts']['start_time'],
|
'start_time' => $_SESSION['user_shifts']['start_time'],
|
||||||
'end_select' => html_select_key("end_day", "end_day", array_combine($days, $days), $_SESSION['user_shifts']['end_day']),
|
'end_select' => html_select_key("end_day", "end_day", array_combine($days, $days), $_SESSION['user_shifts']['end_day']),
|
||||||
'end_time' => $_SESSION['user_shifts']['end_time'],
|
'end_time' => $_SESSION['user_shifts']['end_time'],
|
||||||
'type_select' => make_select($types, $_SESSION['user_shifts']['types'], "types", ucfirst(Get_Text("tasks")) . '<sup>1</sup>'),
|
'type_select' => make_select($types, $_SESSION['user_shifts']['types'], "types", _("Tasks") . '<sup>1</sup>'),
|
||||||
'filled_select' => make_select($filled, $_SESSION['user_shifts']['filled'], "filled", ucfirst(Get_Text("occupancy"))),
|
'filled_select' => make_select($filled, $_SESSION['user_shifts']['filled'], "filled", _("Occupancy")),
|
||||||
'task_notice' => '<sup>1</sup>' . Get_Text("pub_schichtplan_tasks_notice"),
|
'task_notice' => '<sup>1</sup>' . _("The tasks shown here are influenced by the preferences you defined in your settings! <a href=\"https://events.ccc.de/congress/2012/wiki/Volunteers#What_kind_of_volunteers_are_needed.3F\">Description of the jobs</a>."),
|
||||||
'new_style_checkbox' => '<label><input type="checkbox" name="new_style" value="1" ' . ($_SESSION['user_shifts']['new_style']? ' checked' : '') . '> Use new style if possible</label>',
|
'new_style_checkbox' => '<label><input type="checkbox" name="new_style" value="1" ' . ($_SESSION['user_shifts']['new_style']? ' checked' : '') . '> Use new style if possible</label>',
|
||||||
'shifts_table' => $shifts_table,
|
'shifts_table' => $shifts_table,
|
||||||
'ical_text' => sprintf(Get_Text('inc_schicht_ical_text'), htmlspecialchars(make_user_shifts_export_link('ical', $user['api_key'])), htmlspecialchars(make_user_shifts_export_link('shifts_json_export', $user['api_key'])), page_link_to('user_myshifts') . '&reset'),
|
'ical_text' => sprintf(_("Export of shown shifts. <a href=\"%s\">iCal format</a> or <a href=\"%s\">JSON format</a> available (please keep secret, otherwise <a href=\"%s\">reset the api key</a>)."), page_link_to_absolute('ical') . '&key=' . $user['api_key'], page_link_to_absolute('shifts_json_export') . '&key=' . $user['api_key'], page_link_to('user_myshifts') . '&reset'),
|
||||||
'filter' => ucfirst(Get_Text("to_filter")),
|
'filter' => _("Filter"),
|
||||||
));
|
));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -741,8 +745,8 @@ function make_select($items, $selected, $name, $title = null) {
|
||||||
$html .= implode("\n", $html_items);
|
$html .= implode("\n", $html_items);
|
||||||
$html .= '</ul>' . "\n";
|
$html .= '</ul>' . "\n";
|
||||||
$html .= buttons(array (
|
$html .= buttons(array (
|
||||||
button("javascript: check_all('selection_" . $name . "')", Get_Text("all"), ""),
|
button("javascript: check_all('selection_" . $name . "')", _("All"), ""),
|
||||||
button("javascript: uncheck_all('selection_" . $name . "')", Get_Text("none"), "")
|
button("javascript: uncheck_all('selection_" . $name . "')", _("None"), "")
|
||||||
));
|
));
|
||||||
$html .= '</div>' . "\n";
|
$html .= '</div>' . "\n";
|
||||||
return $html;
|
return $html;
|
||||||
|
|
|
@ -1,4 +1,8 @@
|
||||||
<?php
|
<?php
|
||||||
|
function wakeup_title() {
|
||||||
|
return _("Wakeup");
|
||||||
|
}
|
||||||
|
|
||||||
function user_wakeup() {
|
function user_wakeup() {
|
||||||
global $user;
|
global $user;
|
||||||
|
|
||||||
|
@ -17,37 +21,36 @@ function user_wakeup() {
|
||||||
. sql_escape($date) . "', '" . sql_escape($ort) . "', " . "'"
|
. sql_escape($date) . "', '" . sql_escape($ort) . "', " . "'"
|
||||||
. sql_escape($bemerkung) . "')";
|
. sql_escape($bemerkung) . "')";
|
||||||
sql_query($SQL);
|
sql_query($SQL);
|
||||||
$html .= success(Get_Text(4), true);
|
$html .= success(_("Entry saved."), true);
|
||||||
} else
|
} else
|
||||||
$html .= error("Broken date!", true);
|
$html .= error(_("Broken date!"), true);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 'delete' :
|
case 'delete' :
|
||||||
if (isset ($_REQUEST['id']) && preg_match("/^[0-9]{1,11}$/", $_REQUEST['id']))
|
if (isset ($_REQUEST['id']) && preg_match("/^[0-9]{1,11}$/", $_REQUEST['id']))
|
||||||
$id = $_REQUEST['id'];
|
$id = $_REQUEST['id'];
|
||||||
else
|
else
|
||||||
return error("Incomplete call, missing wake-up ID.", true);
|
return error(_("Incomplete call, missing wake-up ID."), true);
|
||||||
|
|
||||||
$wakeup = sql_select("SELECT * FROM `Wecken` WHERE `ID`=" . sql_escape($id) . " LIMIT 1");
|
$wakeup = sql_select("SELECT * FROM `Wecken` WHERE `ID`=" . sql_escape($id) . " LIMIT 1");
|
||||||
if (count($wakeup) > 0 && $wakeup[0]['UID'] == $user['UID']) {
|
if (count($wakeup) > 0 && $wakeup[0]['UID'] == $user['UID']) {
|
||||||
sql_query("DELETE FROM `Wecken` WHERE `ID`=" . sql_escape($id) . " LIMIT 1");
|
sql_query("DELETE FROM `Wecken` WHERE `ID`=" . sql_escape($id) . " LIMIT 1");
|
||||||
$html .= success("Wake-up call deleted.", true);
|
$html .= success(_("Wake-up call deleted."), true);
|
||||||
} else
|
} else
|
||||||
return error("No wake-up found.", true);
|
return error(_("No wake-up found."), true);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$html .= "<p>" . Get_Text("Hello") . User_Nick_render($user) . ",<br />"
|
$html .= '<p>' . sprintf(_("Hello %s, here you can register for a wake-up call. Simply say when and where the angel should come to wake you."), User_Nick_render($user)) . '</p>';
|
||||||
. Get_Text("pub_wake_beschreibung") . "</p>\n\n";
|
$html .= _("All ordered wake-up calls, next first.");
|
||||||
$html .= Get_Text("pub_wake_beschreibung2");
|
|
||||||
$html .= '
|
$html .= '
|
||||||
<table border="0" width="100%" class="border" cellpadding="2" cellspacing="1">
|
<table border="0" width="100%" class="border" cellpadding="2" cellspacing="1">
|
||||||
<tr class="contenttopic">
|
<tr class="contenttopic">
|
||||||
<th>' . Get_Text("pub_wake_Datum") . '</th>
|
<th>' . _("Date") . '</th>
|
||||||
<th>' . Get_Text("pub_waeckliste_Nick") . '</th>
|
<th>' . _("Nick") . '</th>
|
||||||
<th>' . Get_Text("pub_wake_Ort") . '</th>
|
<th>' . _("Place") . '</th>
|
||||||
<th>' . Get_Text("pub_wake_Bemerkung") . '</th>
|
<th>' . _("Notes") . '</th>
|
||||||
<th></th>
|
<th></th>
|
||||||
</tr>
|
</tr>
|
||||||
';
|
';
|
||||||
|
@ -65,22 +68,22 @@ function user_wakeup() {
|
||||||
$html .= '<td>' . $wecken['Ort'] . ' </td>';
|
$html .= '<td>' . $wecken['Ort'] . ' </td>';
|
||||||
$html .= '<td>' . $wecken['Bemerkung'] . ' </td>';
|
$html .= '<td>' . $wecken['Bemerkung'] . ' </td>';
|
||||||
if ($wecken['UID'] == $user['UID'])
|
if ($wecken['UID'] == $user['UID'])
|
||||||
$html .= '<td><a href="' . page_link_to("user_wakeup") . '&action=delete&id=' . $wecken['ID'] . "\">" . Get_Text("pub_wake_del") . '</a></td>';
|
$html .= '<td><a href="' . page_link_to("user_wakeup") . '&action=delete&id=' . $wecken['ID'] . "\">" . _("delete") . '</a></td>';
|
||||||
else
|
else
|
||||||
$html .= '<td></td>';
|
$html .= '<td></td>';
|
||||||
$html .= '</tr>';
|
$html .= '</tr>';
|
||||||
}
|
}
|
||||||
|
|
||||||
$html .= '</table><hr />' . Get_Text("pub_wake_Text2");
|
$html .= '</table><hr />' . _("Schedule a new wake-up here:");
|
||||||
|
|
||||||
$html .= template_render('../templates/user_wakeup.html', array (
|
$html .= template_render('../templates/user_wakeup.html', array (
|
||||||
'wakeup_link' => page_link_to("user_wakeup"),
|
'wakeup_link' => page_link_to("user_wakeup"),
|
||||||
'date_text' => Get_Text("pub_wake_Datum"),
|
'date_text' => _("Date"),
|
||||||
'date_value' => date("Y-m-d H:i"),
|
'date_value' => date("Y-m-d H:i"),
|
||||||
'place_text' => Get_Text("pub_wake_Ort"),
|
'place_text' => _("Place"),
|
||||||
'comment_text' => Get_Text("pub_wake_Bemerkung"),
|
'comment_text' => _("Notes"),
|
||||||
'comment_value' => "Knock knock Leo, follow the white rabbit to the blue tent",
|
'comment_value' => "Knock knock Leo, follow the white rabbit to the blue tent",
|
||||||
'submit_text' => Get_Text("pub_wake_bouton")
|
'submit_text' => _("Save")
|
||||||
));
|
));
|
||||||
return $html;
|
return $html;
|
||||||
}
|
}
|
||||||
|
|
|
@ -40,37 +40,35 @@ function make_navigation() {
|
||||||
$menu = "";
|
$menu = "";
|
||||||
|
|
||||||
$specials = array(
|
$specials = array(
|
||||||
"faq"
|
"faq"
|
||||||
);
|
);
|
||||||
|
|
||||||
$pages = array(
|
$pages = array(
|
||||||
"news",
|
"news" => news_title(),
|
||||||
"user_meetings",
|
"user_meetings" => meetings_title(),
|
||||||
"user_myshifts",
|
"user_myshifts" => myshifts_title(),
|
||||||
"user_shifts",
|
"user_shifts" => shifts_title(),
|
||||||
"user_messages",
|
"user_messages" => messages_title(),
|
||||||
"user_questions",
|
"user_questions" => questions_title(),
|
||||||
"user_wakeup",
|
"user_wakeup" => wakeup_title(),
|
||||||
"admin_arrive",
|
"admin_arrive" => admin_arrive_title(),
|
||||||
"admin_active",
|
"admin_active" => admin_active_title(),
|
||||||
"admin_user",
|
"admin_user" => admin_user_title(),
|
||||||
"admin_free",
|
"admin_free" => admin_free_title(),
|
||||||
"admin_usershifts",
|
"admin_questions" => admin_questions_title(),
|
||||||
"admin_questions",
|
"admin_angel_types" => admin_angel_types_title(),
|
||||||
"admin_angel_types",
|
"admin_user_angeltypes" => admin_user_angeltypes_title(),
|
||||||
"admin_user_angeltypes",
|
"admin_shifts" => admin_shifts_title(),
|
||||||
"admin_shifts",
|
"admin_rooms" => admin_rooms_title(),
|
||||||
"admin_rooms",
|
"admin_groups" => admin_groups_title(),
|
||||||
"admin_groups",
|
"admin_faq" => admin_faq_title(),
|
||||||
"admin_faq",
|
"admin_import" => admin_import_title(),
|
||||||
"admin_language",
|
"admin_log" => admin_log_title()
|
||||||
"admin_import",
|
|
||||||
"admin_log"
|
|
||||||
);
|
);
|
||||||
|
|
||||||
foreach ($pages as $page)
|
foreach ($pages as $page => $title)
|
||||||
if (in_array($page, $privileges) || in_array($page, $specials))
|
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>';
|
$menu .= '<li' . ($page == $p ? ' class="selected"' : '') . '><a href="' . page_link_to($page) . '">' . $title . '</a></li>';
|
||||||
|
|
||||||
return '<nav><ul>' . $menu . '</ul></nav>';
|
return '<nav><ul>' . $menu . '</ul></nav>';
|
||||||
}
|
}
|
||||||
|
|
|
@ -259,8 +259,7 @@ 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);
|
return '<a href="' . htmlspecialchars($link) . '"><img src="pic/icons/' . htmlspecialchars($icon) . '.png" alt="' . $text . '" ' . (empty($text) ? '' : 'title="' . $text . '"') . '>' . (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) {
|
||||||
|
|
Binary file not shown.
|
@ -1,8 +1,8 @@
|
||||||
msgid ""
|
msgid ""
|
||||||
msgstr ""
|
msgstr ""
|
||||||
"Project-Id-Version: Engelsystem 2.0\n"
|
"Project-Id-Version: Engelsystem 2.0\n"
|
||||||
"POT-Creation-Date: 2013-11-25 19:11+0100\n"
|
"POT-Creation-Date: 2013-11-25 19:30+0100\n"
|
||||||
"PO-Revision-Date: 2013-11-25 19:11+0100\n"
|
"PO-Revision-Date: 2013-11-25 19:32+0100\n"
|
||||||
"Last-Translator: msquare <msquare@notrademark.de>\n"
|
"Last-Translator: msquare <msquare@notrademark.de>\n"
|
||||||
"Language-Team: \n"
|
"Language-Team: \n"
|
||||||
"Language: de_DE\n"
|
"Language: de_DE\n"
|
||||||
|
@ -21,5 +21,141 @@ msgstr ""
|
||||||
msgid "Language"
|
msgid "Language"
|
||||||
msgstr "Sprache"
|
msgstr "Sprache"
|
||||||
|
|
||||||
|
#: /Users/msquare/workspace/projects/engelsystem/includes/pages/admin_user.php:148
|
||||||
|
msgid "Save"
|
||||||
|
msgstr "Speichern"
|
||||||
|
|
||||||
|
#: /Users/msquare/workspace/projects/engelsystem/includes/pages/guest_login.php:36
|
||||||
|
#, php-format
|
||||||
|
msgid "Your nick "%s" already exists."
|
||||||
|
msgstr "Der Nick "%s" existiert schon."
|
||||||
|
|
||||||
|
#: /Users/msquare/workspace/projects/engelsystem/includes/pages/guest_login.php:40
|
||||||
|
#, php-format
|
||||||
|
msgid "Your nick "%s" is too short (min. 2 characters)."
|
||||||
|
msgstr "Der Nick "%s" ist zu kurz (Mindestens 2 Zeichen)."
|
||||||
|
|
||||||
|
#: /Users/msquare/workspace/projects/engelsystem/includes/pages/guest_login.php:47
|
||||||
|
msgid "E-mail address is not correct."
|
||||||
|
msgstr "Die E-Mail Adresse ist nicht in Ordnung."
|
||||||
|
|
||||||
|
#: /Users/msquare/workspace/projects/engelsystem/includes/pages/guest_login.php:51
|
||||||
|
msgid "Please enter your e-mail."
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: /Users/msquare/workspace/projects/engelsystem/includes/pages/guest_login.php:60
|
||||||
|
msgid "Please check your jabber account information."
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: /Users/msquare/workspace/projects/engelsystem/includes/pages/guest_login.php:69
|
||||||
|
msgid "Please select your shirt size."
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: /Users/msquare/workspace/projects/engelsystem/includes/pages/guest_login.php:76
|
||||||
|
msgid "Your passwords don't match."
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: /Users/msquare/workspace/projects/engelsystem/includes/pages/guest_login.php:80
|
||||||
|
msgid "Your password is to short (please use at least 6 characters)."
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: /Users/msquare/workspace/projects/engelsystem/includes/pages/guest_login.php:121
|
||||||
|
msgid "Angel registration successful!"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: /Users/msquare/workspace/projects/engelsystem/includes/pages/guest_login.php:128
|
||||||
|
msgid ""
|
||||||
|
"By completing this form you're registering as a Chaos-Angel. This script "
|
||||||
|
"will create you an account in the angel task sheduler."
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: /Users/msquare/workspace/projects/engelsystem/includes/pages/guest_login.php:132
|
||||||
|
msgid "Nick"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: /Users/msquare/workspace/projects/engelsystem/includes/pages/guest_login.php:133
|
||||||
|
msgid "Last name"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: /Users/msquare/workspace/projects/engelsystem/includes/pages/guest_login.php:134
|
||||||
|
msgid "First name"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: /Users/msquare/workspace/projects/engelsystem/includes/pages/guest_login.php:135
|
||||||
|
msgid "Age"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: /Users/msquare/workspace/projects/engelsystem/includes/pages/guest_login.php:136
|
||||||
|
msgid "Phone"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: /Users/msquare/workspace/projects/engelsystem/includes/pages/guest_login.php:137
|
||||||
|
msgid "DECT"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: /Users/msquare/workspace/projects/engelsystem/includes/pages/guest_login.php:138
|
||||||
|
msgid "Mobile"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: /Users/msquare/workspace/projects/engelsystem/includes/pages/guest_login.php:139
|
||||||
|
msgid "E-Mail"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: /Users/msquare/workspace/projects/engelsystem/includes/pages/guest_login.php:140
|
||||||
|
msgid "ICQ"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: /Users/msquare/workspace/projects/engelsystem/includes/pages/guest_login.php:141
|
||||||
|
msgid "Jabber"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: /Users/msquare/workspace/projects/engelsystem/includes/pages/guest_login.php:142
|
||||||
|
msgid "Hometown"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: /Users/msquare/workspace/projects/engelsystem/includes/pages/guest_login.php:143
|
||||||
|
msgid "Shirt size"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: /Users/msquare/workspace/projects/engelsystem/includes/pages/guest_login.php:144
|
||||||
|
msgid ""
|
||||||
|
"Did you help at former CCC events and which tasks have you performed then?"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: /Users/msquare/workspace/projects/engelsystem/includes/pages/guest_login.php:145
|
||||||
|
msgid "What do you want to do?"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: /Users/msquare/workspace/projects/engelsystem/includes/pages/guest_login.php:145
|
||||||
|
msgid "Description of job types"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: /Users/msquare/workspace/projects/engelsystem/includes/pages/guest_login.php:146
|
||||||
|
msgid ""
|
||||||
|
"Restricted angel types need will be confirmed later by an archangel. You can "
|
||||||
|
"change your selection in the options section."
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: /Users/msquare/workspace/projects/engelsystem/includes/pages/guest_login.php:147
|
||||||
|
msgid "Password"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: /Users/msquare/workspace/projects/engelsystem/includes/pages/guest_login.php:148
|
||||||
|
msgid "Confirm password"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: /Users/msquare/workspace/projects/engelsystem/includes/pages/guest_login.php:149
|
||||||
|
msgid "Entry required!"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: /Users/msquare/workspace/projects/engelsystem/includes/pages/guest_login.php:150
|
||||||
|
msgid "Register"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: /Users/msquare/workspace/projects/engelsystem/includes/pages/user_messages.php:9
|
||||||
|
#, php-format
|
||||||
|
msgid "You have %s new messages."
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
#~ msgid "asdf"
|
#~ msgid "asdf"
|
||||||
#~ msgstr "fdsa"
|
#~ msgstr "fdsa"
|
||||||
|
|
|
@ -25,9 +25,26 @@ require_once ('includes/helper/error_helper.php');
|
||||||
require_once ('config/config.php');
|
require_once ('config/config.php');
|
||||||
require_once ('config/config_db.php');
|
require_once ('config/config_db.php');
|
||||||
|
|
||||||
|
require_once ('includes/pages/admin_active.php');
|
||||||
|
require_once ('includes/pages/admin_angel_types.php');
|
||||||
|
require_once ('includes/pages/admin_arrive.php');
|
||||||
|
require_once ('includes/pages/admin_faq.php');
|
||||||
|
require_once ('includes/pages/admin_free.php');
|
||||||
|
require_once ('includes/pages/admin_groups.php');
|
||||||
|
require_once ('includes/pages/admin_import.php');
|
||||||
|
require_once ('includes/pages/admin_log.php');
|
||||||
require_once ('includes/pages/admin_questions.php');
|
require_once ('includes/pages/admin_questions.php');
|
||||||
|
require_once ('includes/pages/admin_rooms.php');
|
||||||
|
require_once ('includes/pages/admin_shifts.php');
|
||||||
|
require_once ('includes/pages/admin_user.php');
|
||||||
require_once ('includes/pages/admin_user_angeltypes.php');
|
require_once ('includes/pages/admin_user_angeltypes.php');
|
||||||
|
require_once ('includes/pages/guest_faq.php');
|
||||||
require_once ('includes/pages/user_messages.php');
|
require_once ('includes/pages/user_messages.php');
|
||||||
|
require_once ('includes/pages/user_myshifts.php');
|
||||||
|
require_once ('includes/pages/user_news.php');
|
||||||
|
require_once ('includes/pages/user_questions.php');
|
||||||
|
require_once ('includes/pages/user_shifts.php');
|
||||||
|
require_once ('includes/pages/user_wakeup.php');
|
||||||
|
|
||||||
session_start();
|
session_start();
|
||||||
|
|
||||||
|
@ -46,7 +63,7 @@ $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 = $p;
|
||||||
$content = "";
|
$content = "";
|
||||||
|
|
||||||
if ($p == "ical") {
|
if ($p == "ical") {
|
||||||
|
@ -64,27 +81,28 @@ if ($p == "ical") {
|
||||||
} // 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');
|
$title = news_title();
|
||||||
$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');
|
$title = meetings_title();
|
||||||
$content = user_meetings();
|
$content = user_meetings();
|
||||||
} elseif ($p == "user_myshifts") {
|
} elseif ($p == "user_myshifts") {
|
||||||
require_once ('includes/pages/user_myshifts.php');
|
$title = myshifts_title();
|
||||||
$content = user_myshifts();
|
$content = user_myshifts();
|
||||||
} elseif ($p == "user_shifts") {
|
} elseif ($p == "user_shifts") {
|
||||||
require_once ('includes/pages/user_shifts.php');
|
$title = shifts_title();
|
||||||
$content = user_shifts();
|
$content = user_shifts();
|
||||||
} elseif ($p == "user_messages") {
|
} elseif ($p == "user_messages") {
|
||||||
|
$title = messages_title();
|
||||||
$content = user_messages();
|
$content = user_messages();
|
||||||
} elseif ($p == "user_questions") {
|
} elseif ($p == "user_questions") {
|
||||||
require_once ('includes/pages/user_questions.php');
|
$title = questions_title();
|
||||||
$content = user_questions();
|
$content = user_questions();
|
||||||
} elseif ($p == "user_wakeup") {
|
} elseif ($p == "user_wakeup") {
|
||||||
require_once ('includes/pages/user_wakeup.php');
|
$title = wakeup_title();
|
||||||
$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');
|
||||||
|
@ -99,48 +117,49 @@ elseif (in_array($p, $privileges)) {
|
||||||
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") {
|
||||||
|
$title = admin_questions_title();
|
||||||
$content = admin_questions();
|
$content = admin_questions();
|
||||||
} elseif ($p == "admin_user") {
|
} elseif ($p == "admin_user") {
|
||||||
require_once ('includes/pages/admin_user.php');
|
$title = admin_user_title();
|
||||||
$content = admin_user();
|
$content = admin_user();
|
||||||
} elseif ($p == "admin_user_angeltypes") {
|
} elseif ($p == "admin_user_angeltypes") {
|
||||||
require_once ('includes/pages/admin_user_angeltypes.php');
|
$title = admin_user_angeltypes_title();
|
||||||
$content = admin_user_angeltypes();
|
$content = admin_user_angeltypes();
|
||||||
} elseif ($p == "admin_arrive") {
|
} elseif ($p == "admin_arrive") {
|
||||||
require_once ('includes/pages/admin_arrive.php');
|
$title = admin_arrive_title();
|
||||||
$content = admin_arrive();
|
$content = admin_arrive();
|
||||||
} elseif ($p == "admin_active") {
|
} elseif ($p == "admin_active") {
|
||||||
require_once ('includes/pages/admin_active.php');
|
$title = admin_active_title();
|
||||||
$content = admin_active();
|
$content = admin_active();
|
||||||
} elseif ($p == "admin_free") {
|
} elseif ($p == "admin_free") {
|
||||||
require_once ('includes/pages/admin_free.php');
|
$title = admin_free_title();
|
||||||
$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');
|
$title = admin_angel_types_title();
|
||||||
$content = admin_angel_types();
|
$content = admin_angel_types();
|
||||||
} elseif ($p == "admin_rooms") {
|
} elseif ($p == "admin_rooms") {
|
||||||
require_once ('includes/pages/admin_rooms.php');
|
$title = admin_rooms_title();
|
||||||
$content = admin_rooms();
|
$content = admin_rooms();
|
||||||
} elseif ($p == "admin_groups") {
|
} elseif ($p == "admin_groups") {
|
||||||
require_once ('includes/pages/admin_groups.php');
|
$title = admin_groups_title();
|
||||||
$content = admin_groups();
|
$content = admin_groups();
|
||||||
} elseif ($p == "admin_faq") {
|
} elseif ($p == "admin_faq") {
|
||||||
require_once ('includes/pages/admin_faq.php');
|
$title = admin_faq_title();
|
||||||
$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');
|
$title = admin_import_title();
|
||||||
$content = admin_import();
|
$content = admin_import();
|
||||||
} elseif ($p == "admin_shifts") {
|
} elseif ($p == "admin_shifts") {
|
||||||
require_once ('includes/pages/admin_shifts.php');
|
$title = admin_shifts_title();
|
||||||
$content = admin_shifts();
|
$content = admin_shifts();
|
||||||
} elseif ($p == "admin_log") {
|
} elseif ($p == "admin_log") {
|
||||||
require_once ('includes/pages/admin_log.php');
|
$title = admin_log_title();
|
||||||
$content = admin_log();
|
$content = admin_log();
|
||||||
} else {
|
} else {
|
||||||
require_once ('includes/pages/guest_start.php');
|
require_once ('includes/pages/guest_start.php');
|
||||||
|
@ -150,13 +169,13 @@ elseif (in_array($p, $privileges)) {
|
||||||
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');
|
$title = faq_title();
|
||||||
$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 = _("No Access");
|
||||||
$content = Get_Text("no_access_text");
|
$content = _("You don't have permission to view this page. You probably have to sign in or register in order to gain access!");
|
||||||
} else {
|
} else {
|
||||||
// Sonst zur Loginseite leiten
|
// Sonst zur Loginseite leiten
|
||||||
redirect(page_link_to("login"));
|
redirect(page_link_to("login"));
|
||||||
|
@ -169,7 +188,7 @@ if (isset($user) && $p != "user_messages")
|
||||||
|
|
||||||
// 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")
|
||||||
|
|
Loading…
Reference in New Issue