summaryrefslogtreecommitdiff
path: root/includes/pages
diff options
context:
space:
mode:
authormsquare <msquare@notrademark.de>2016-09-29 12:08:12 +0200
committermsquare <msquare@notrademark.de>2016-09-29 12:08:12 +0200
commitf05f1a3cd4cc3a9fa6021d2c5feedd7e734973ba (patch)
treed1c2404dc56f6d1d0a3ed402d0a3880e77b70a17 /includes/pages
parent81e5a6482c340d3013c9fce54c10ef1a72a5a930 (diff)
rename to
Diffstat (limited to 'includes/pages')
-rw-r--r--includes/pages/admin_active.php6
-rw-r--r--includes/pages/admin_import.php18
-rw-r--r--includes/pages/admin_rooms.php12
-rw-r--r--includes/pages/admin_shifts.php32
-rw-r--r--includes/pages/guest_login.php34
-rw-r--r--includes/pages/user_myshifts.php6
-rw-r--r--includes/pages/user_settings.php30
-rw-r--r--includes/pages/user_shifts.php16
8 files changed, 77 insertions, 77 deletions
diff --git a/includes/pages/admin_active.php b/includes/pages/admin_active.php
index b672fddb..83f99d5a 100644
--- a/includes/pages/admin_active.php
+++ b/includes/pages/admin_active.php
@@ -21,7 +21,7 @@ function admin_active() {
$show_all_shifts = isset($_REQUEST['show_all_shifts']);
if (isset($_REQUEST['set_active'])) {
- $ok = true;
+ $valid = true;
if (isset($_REQUEST['count']) && preg_match("/^[0-9]+$/", $_REQUEST['count'])) {
$count = strip_request_item('count');
@@ -30,11 +30,11 @@ function admin_active() {
redirect(page_link_to('admin_active'));
}
} else {
- $ok = false;
+ $valid = false;
$msg .= error(_("Please enter a number of angels to be marked as active."), true);
}
- if ($ok) {
+ if ($valid) {
$limit = " LIMIT " . $count;
}
if (isset($_REQUEST['ack'])) {
diff --git a/includes/pages/admin_import.php b/includes/pages/admin_import.php
index e533819f..8643dc55 100644
--- a/includes/pages/admin_import.php
+++ b/includes/pages/admin_import.php
@@ -41,29 +41,29 @@ function admin_import() {
switch ($step) {
case 'input':
- $ok = false;
+ $valid = false;
if (isset($_REQUEST['submit'])) {
- $ok = true;
+ $valid = true;
if (isset($_REQUEST['shifttype_id']) && isset($shifttypes[$_REQUEST['shifttype_id']])) {
$shifttype_id = $_REQUEST['shifttype_id'];
} else {
- $ok = false;
+ $valid = false;
error(_('Please select a shift type.'));
}
if (isset($_REQUEST['add_minutes_start']) && is_numeric(trim($_REQUEST['add_minutes_start']))) {
$add_minutes_start = trim($_REQUEST['add_minutes_start']);
} else {
- $ok = false;
+ $valid = false;
error(_("Please enter an amount of minutes to add to a talk's begin."));
}
if (isset($_REQUEST['add_minutes_end']) && is_numeric(trim($_REQUEST['add_minutes_end']))) {
$add_minutes_end = trim($_REQUEST['add_minutes_end']);
} else {
- $ok = false;
+ $valid = false;
error(_("Please enter an amount of minutes to add to a talk's end."));
}
@@ -71,21 +71,21 @@ function admin_import() {
if (move_uploaded_file($_FILES['xcal_file']['tmp_name'], $import_file)) {
libxml_use_internal_errors(true);
if (simplexml_load_file($import_file) === false) {
- $ok = false;
+ $valid = false;
error(_('No valid xml/xcal file provided.'));
unlink($import_file);
}
} else {
- $ok = false;
+ $valid = false;
error(_('File upload went wrong.'));
}
} else {
- $ok = false;
+ $valid = false;
error(_('Please provide some data.'));
}
}
- if ($ok) {
+ if ($valid) {
redirect(page_link_to('admin_import') . "&step=check&shifttype_id=" . $shifttype_id . "&add_minutes_end=" . $add_minutes_end . "&add_minutes_start=" . $add_minutes_start);
} else {
$html .= div('well well-sm text-center', [
diff --git a/includes/pages/admin_rooms.php b/includes/pages/admin_rooms.php
index 631a7e0b..3c26048a 100644
--- a/includes/pages/admin_rooms.php
+++ b/includes/pages/admin_rooms.php
@@ -54,16 +54,16 @@ function admin_rooms() {
if ($_REQUEST['show'] == 'edit') {
if (isset($_REQUEST['submit'])) {
- $ok = true;
+ $valid = true;
if (isset($_REQUEST['name']) && strlen(strip_request_item('name')) > 0) {
$name = strip_request_item('name');
if (isset($room) && sql_num_query("SELECT * FROM `Room` WHERE `Name`='" . sql_escape($name) . "' AND NOT `RID`=" . sql_escape($id)) > 0) {
- $ok = false;
+ $valid = false;
$msg .= error(_("This name is already in use."), true);
}
} else {
- $ok = false;
+ $valid = false;
$msg .= error(_("Please enter a name."), true);
}
@@ -82,19 +82,19 @@ function admin_rooms() {
if (isset($_REQUEST['number'])) {
$number = strip_request_item('number');
} else {
- $ok = false;
+ $valid = false;
}
foreach ($angeltypes as $angeltype_id => $angeltype) {
if (isset($_REQUEST['angeltype_count_' . $angeltype_id]) && preg_match("/^[0-9]{1,4}$/", $_REQUEST['angeltype_count_' . $angeltype_id])) {
$angeltypes_count[$angeltype_id] = $_REQUEST['angeltype_count_' . $angeltype_id];
} else {
- $ok = false;
+ $valid = false;
$msg .= error(sprintf(_("Please enter needed angels for type %s.", $angeltype)), true);
}
}
- if ($ok) {
+ if ($valid) {
if (isset($id)) {
sql_query("UPDATE `Room` SET `Name`='" . sql_escape($name) . "', `FromPentabarf`='" . sql_escape($from_pentabarf) . "', `show`='" . sql_escape($public) . "', `Number`='" . sql_escape($number) . "' WHERE `RID`='" . sql_escape($id) . "' LIMIT 1");
engelsystem_log("Room updated: " . $name . ", pentabarf import: " . $from_pentabarf . ", public: " . $public . ", number: " . $number);
diff --git a/includes/pages/admin_shifts.php b/includes/pages/admin_shifts.php
index 3682b38c..3dd22f3a 100644
--- a/includes/pages/admin_shifts.php
+++ b/includes/pages/admin_shifts.php
@@ -6,7 +6,7 @@ function admin_shifts_title() {
// Assistent zum Anlegen mehrerer neuer Schichten
function admin_shifts() {
- $ok = true;
+ $valid = true;
$rid = 0;
$start = DateTime::createFromFormat("Y-m-d H:i", date("Y-m-d") . " 00:00")->getTimestamp();
@@ -49,13 +49,13 @@ function admin_shifts() {
engelsystem_error('Unable to load shift type.');
}
if ($shifttype == null) {
- $ok = false;
+ $valid = false;
error(_('Please select a shift type.'));
} else {
$shifttype_id = $_REQUEST['shifttype_id'];
}
} else {
- $ok = false;
+ $valid = false;
error(_('Please select a shift type.'));
}
@@ -66,7 +66,7 @@ function admin_shifts() {
if (isset($_REQUEST['rid']) && preg_match("/^[0-9]+$/", $_REQUEST['rid']) && isset($room_array[$_REQUEST['rid']])) {
$rid = $_REQUEST['rid'];
} else {
- $ok = false;
+ $valid = false;
$rid = $rooms[0]['RID'];
error(_('Please select a location.'));
}
@@ -74,19 +74,19 @@ function admin_shifts() {
if (isset($_REQUEST['start']) && $tmp = DateTime::createFromFormat("Y-m-d H:i", trim($_REQUEST['start']))) {
$start = $tmp->getTimestamp();
} else {
- $ok = false;
+ $valid = false;
error(_('Please select a start time.'));
}
if (isset($_REQUEST['end']) && $tmp = DateTime::createFromFormat("Y-m-d H:i", trim($_REQUEST['end']))) {
$end = $tmp->getTimestamp();
} else {
- $ok = false;
+ $valid = false;
error(_('Please select an end time.'));
}
if ($start >= $end) {
- $ok = false;
+ $valid = false;
error(_('The shifts end has to be after its start.'));
}
@@ -98,7 +98,7 @@ function admin_shifts() {
$mode = 'multi';
$length = trim($_REQUEST['length']);
} else {
- $ok = false;
+ $valid = false;
error(_('Please enter a shift duration in minutes.'));
}
} elseif ($_REQUEST['mode'] == 'variable') {
@@ -106,12 +106,12 @@ function admin_shifts() {
$mode = 'variable';
$change_hours = array_map('trim', explode(",", $_REQUEST['change_hours']));
} else {
- $ok = false;
+ $valid = false;
error(_('Please split the shift-change hours by colons.'));
}
}
} else {
- $ok = false;
+ $valid = false;
error(_('Please select a mode.'));
}
@@ -124,30 +124,30 @@ function admin_shifts() {
if (isset($_REQUEST['type_' . $type['id']]) && preg_match("/^[0-9]+$/", trim($_REQUEST['type_' . $type['id']]))) {
$needed_angel_types[$type['id']] = trim($_REQUEST['type_' . $type['id']]);
} else {
- $ok = false;
+ $valid = false;
error(sprintf(_('Please check the needed angels for team %s.'), $type['name']));
}
}
if (array_sum($needed_angel_types) == 0) {
- $ok = false;
+ $valid = false;
error(_('There are 0 angels needed. Please enter the amounts of needed angels.'));
}
} else {
- $ok = false;
+ $valid = false;
error(_('Please select a mode for needed angels.'));
}
} else {
- $ok = false;
+ $valid = false;
error(_('Please select needed angels.'));
}
// Beim Zurück-Knopf das Formular zeigen
if (isset($_REQUEST['back'])) {
- $ok = false;
+ $valid = false;
}
// Alle Eingaben in Ordnung
- if ($ok) {
+ if ($valid) {
if ($angelmode == 'location') {
$needed_angel_types = [];
$needed_angel_types_location = sql_select("SELECT * FROM `NeededAngelTypes` WHERE `room_id`='" . sql_escape($rid) . "'");
diff --git a/includes/pages/guest_login.php b/includes/pages/guest_login.php
index aeaed182..1f1b7ab2 100644
--- a/includes/pages/guest_login.php
+++ b/includes/pages/guest_login.php
@@ -49,27 +49,27 @@ function guest_register() {
}
if (isset($_REQUEST['submit'])) {
- $ok = true;
+ $valid = true;
if (isset($_REQUEST['nick']) && strlen(User_validate_Nick($_REQUEST['nick'])) > 1) {
$nick = User_validate_Nick($_REQUEST['nick']);
if (sql_num_query("SELECT * FROM `User` WHERE `Nick`='" . sql_escape($nick) . "' LIMIT 1") > 0) {
- $ok = false;
+ $valid = false;
$msg .= error(sprintf(_("Your nick &quot;%s&quot; already exists."), $nick), true);
}
} else {
- $ok = false;
+ $valid = false;
$msg .= error(sprintf(_("Your nick &quot;%s&quot; is too short (min. 2 characters)."), User_validate_Nick($_REQUEST['nick'])), true);
}
if (isset($_REQUEST['mail']) && strlen(strip_request_item('mail')) > 0) {
$mail = strip_request_item('mail');
if (! check_email($mail)) {
- $ok = false;
+ $valid = false;
$msg .= error(_("E-mail address is not correct."), true);
}
} else {
- $ok = false;
+ $valid = false;
$msg .= error(_("Please enter your e-mail."), true);
}
@@ -80,7 +80,7 @@ function guest_register() {
if (isset($_REQUEST['jabber']) && strlen(strip_request_item('jabber')) > 0) {
$jabber = strip_request_item('jabber');
if (! check_email($jabber)) {
- $ok = false;
+ $valid = false;
$msg .= error(_("Please check your jabber account information."), true);
}
}
@@ -89,25 +89,25 @@ function guest_register() {
if (isset($_REQUEST['tshirt_size']) && isset($tshirt_sizes[$_REQUEST['tshirt_size']]) && $_REQUEST['tshirt_size'] != '') {
$tshirt_size = $_REQUEST['tshirt_size'];
} else {
- $ok = false;
+ $valid = false;
$msg .= error(_("Please select your shirt size."), true);
}
}
if (isset($_REQUEST['password']) && strlen($_REQUEST['password']) >= MIN_PASSWORD_LENGTH) {
if ($_REQUEST['password'] != $_REQUEST['password2']) {
- $ok = false;
+ $valid = false;
$msg .= error(_("Your passwords don't match."), true);
}
} else {
- $ok = false;
+ $valid = false;
$msg .= error(sprintf(_("Your password is too short (please use at least %s characters)."), MIN_PASSWORD_LENGTH), true);
}
if (isset($_REQUEST['planned_arrival_date']) && DateTime::createFromFormat("Y-m-d", trim($_REQUEST['planned_arrival_date']))) {
$planned_arrival_date = DateTime::createFromFormat("Y-m-d", trim($_REQUEST['planned_arrival_date']))->getTimestamp();
} else {
- $ok = false;
+ $valid = false;
$msg .= error(_("Please enter your planned date of arrival."), true);
}
@@ -144,7 +144,7 @@ function guest_register() {
$comment = strip_request_item_nl('comment');
}
- if ($ok) {
+ if ($valid) {
sql_query("
INSERT INTO `User` SET
`color`='" . sql_escape($default_theme) . "',
@@ -284,7 +284,7 @@ function guest_login() {
unset($_SESSION['uid']);
if (isset($_REQUEST['submit'])) {
- $ok = true;
+ $valid = true;
if (isset($_REQUEST['nick']) && strlen(User_validate_Nick($_REQUEST['nick'])) > 0) {
$nick = User_validate_Nick($_REQUEST['nick']);
@@ -293,23 +293,23 @@ function guest_login() {
$login_user = $login_user[0];
if (isset($_REQUEST['password'])) {
if (! verify_password($_REQUEST['password'], $login_user['Passwort'], $login_user['UID'])) {
- $ok = false;
+ $valid = false;
error(_("Your password is incorrect. Please try it again."));
}
} else {
- $ok = false;
+ $valid = false;
error(_("Please enter a password."));
}
} else {
- $ok = false;
+ $valid = false;
error(_("No user was found with that Nickname. Please try again. If you are still having problems, ask an Dispatcher."));
}
} else {
- $ok = false;
+ $valid = false;
error(_("Please enter a nickname."));
}
- if ($ok) {
+ if ($valid) {
$_SESSION['uid'] = $login_user['UID'];
$_SESSION['locale'] = $login_user['Sprache'];
diff --git a/includes/pages/user_myshifts.php b/includes/pages/user_myshifts.php
index 3040c8c3..f50711a7 100644
--- a/includes/pages/user_myshifts.php
+++ b/includes/pages/user_myshifts.php
@@ -51,12 +51,12 @@ function user_myshifts() {
$freeload_comment = $shift['freeload_comment'];
if (isset($_REQUEST['submit'])) {
- $ok = true;
+ $valid = true;
if (in_array("user_shifts_admin", $privileges)) {
$freeloaded = isset($_REQUEST['freeloaded']);
$freeload_comment = strip_request_item_nl('freeload_comment');
if ($freeloaded && $freeload_comment == '') {
- $ok = false;
+ $valid = false;
error(_("Please enter a freeload comment!"));
}
}
@@ -64,7 +64,7 @@ function user_myshifts() {
$comment = strip_request_item_nl('comment');
$user_source = User($shift['UID']);
- if ($ok) {
+ if ($valid) {
$result = ShiftEntry_update([
'id' => $id,
'Comment' => $comment,
diff --git a/includes/pages/user_settings.php b/includes/pages/user_settings.php
index 779349a5..b2ea5752 100644
--- a/includes/pages/user_settings.php
+++ b/includes/pages/user_settings.php
@@ -27,16 +27,16 @@ function user_settings() {
$planned_departure_date = $user['planned_departure_date'];
if (isset($_REQUEST['submit'])) {
- $ok = true;
+ $valid = true;
if (isset($_REQUEST['mail']) && strlen(strip_request_item('mail')) > 0) {
$mail = strip_request_item('mail');
if (! check_email($mail)) {
- $ok = false;
+ $valid = false;
$msg .= error(_("E-mail address is not correct."), true);
}
} else {
- $ok = false;
+ $valid = false;
$msg .= error(_("Please enter your e-mail."), true);
}
@@ -45,7 +45,7 @@ function user_settings() {
if (isset($_REQUEST['jabber']) && strlen(strip_request_item('jabber')) > 0) {
$jabber = strip_request_item('jabber');
if (! check_email($jabber)) {
- $ok = false;
+ $valid = false;
$msg .= error(_("Please check your jabber account information."), true);
}
}
@@ -53,13 +53,13 @@ function user_settings() {
if (isset($_REQUEST['tshirt_size']) && isset($tshirt_sizes[$_REQUEST['tshirt_size']])) {
$tshirt_size = $_REQUEST['tshirt_size'];
} elseif ($enable_tshirt_size) {
- $ok = false;
+ $valid = false;
}
if (isset($_REQUEST['planned_arrival_date']) && DateTime::createFromFormat("Y-m-d", trim($_REQUEST['planned_arrival_date']))) {
$planned_arrival_date = DateTime::createFromFormat("Y-m-d", trim($_REQUEST['planned_arrival_date']))->getTimestamp();
} else {
- $ok = false;
+ $valid = false;
$msg .= error(_("Please enter your planned date of arrival."), true);
}
@@ -67,7 +67,7 @@ function user_settings() {
if (DateTime::createFromFormat("Y-m-d", trim($_REQUEST['planned_departure_date']))) {
$planned_departure_date = DateTime::createFromFormat("Y-m-d", trim($_REQUEST['planned_departure_date']))->getTimestamp();
} else {
- $ok = false;
+ $valid = false;
$msg .= error(_("Please enter your planned date of departure."), true);
}
} else {
@@ -97,7 +97,7 @@ function user_settings() {
$hometown = strip_request_item('hometown');
}
- if ($ok) {
+ if ($valid) {
sql_query("
UPDATE `User` SET
`Nick`='" . sql_escape($nick) . "',
@@ -120,7 +120,7 @@ function user_settings() {
redirect(page_link_to('user_settings'));
}
} elseif (isset($_REQUEST['submit_password'])) {
- $ok = true;
+ $valid = true;
if (! isset($_REQUEST['password']) || ! verify_password($_REQUEST['password'], $user['Passwort'], $user['UID'])) {
$msg .= error(_("-> not OK. Please try again."), true);
@@ -135,30 +135,30 @@ function user_settings() {
}
redirect(page_link_to('user_settings'));
} elseif (isset($_REQUEST['submit_theme'])) {
- $ok = true;
+ $valid = true;
if (isset($_REQUEST['theme']) && isset($themes[$_REQUEST['theme']])) {
$selected_theme = $_REQUEST['theme'];
} else {
- $ok = false;
+ $valid = false;
}
- if ($ok) {
+ if ($valid) {
sql_query("UPDATE `User` SET `color`='" . sql_escape($selected_theme) . "' WHERE `UID`='" . sql_escape($user['UID']) . "'");
success(_("Theme changed."));
redirect(page_link_to('user_settings'));
}
} elseif (isset($_REQUEST['submit_language'])) {
- $ok = true;
+ $valid = true;
if (isset($_REQUEST['language']) && isset($locales[$_REQUEST['language']])) {
$selected_language = $_REQUEST['language'];
} else {
- $ok = false;
+ $valid = false;
}
- if ($ok) {
+ if ($valid) {
sql_query("UPDATE `User` SET `Sprache`='" . sql_escape($selected_language) . "' WHERE `UID`='" . sql_escape($user['UID']) . "'");
$_SESSION['locale'] = $selected_language;
diff --git a/includes/pages/user_shifts.php b/includes/pages/user_shifts.php
index 90be0c6c..b6a3c9f5 100644
--- a/includes/pages/user_shifts.php
+++ b/includes/pages/user_shifts.php
@@ -52,7 +52,7 @@ function user_shifts() {
} elseif (isset($_REQUEST['edit_shift']) && in_array('admin_shifts', $privileges)) {
// Schicht bearbeiten
$msg = "";
- $ok = true;
+ $valid = true;
if (isset($_REQUEST['edit_shift']) && test_request_int('edit_shift')) {
$shift_id = $_REQUEST['edit_shift'];
@@ -115,7 +115,7 @@ function user_shifts() {
if (isset($_REQUEST['rid']) && preg_match("/^[0-9]+$/", $_REQUEST['rid']) && isset($room_array[$_REQUEST['rid']])) {
$rid = $_REQUEST['rid'];
} else {
- $ok = false;
+ $valid = false;
$rid = $rooms[0]['RID'];
$msg .= error(_("Please select a room."), true);
}
@@ -123,26 +123,26 @@ function user_shifts() {
if (isset($_REQUEST['shifttype_id']) && isset($shifttypes[$_REQUEST['shifttype_id']])) {
$shifttype_id = $_REQUEST['shifttype_id'];
} else {
- $ok = false;
+ $valid = false;
$msg .= error(_('Please select a shifttype.'), true);
}
if (isset($_REQUEST['start']) && $tmp = DateTime::createFromFormat("Y-m-d H:i", trim($_REQUEST['start']))) {
$start = $tmp->getTimestamp();
} else {
- $ok = false;
+ $valid = false;
$msg .= error(_("Please enter a valid starting time for the shifts."), true);
}
if (isset($_REQUEST['end']) && $tmp = DateTime::createFromFormat("Y-m-d H:i", trim($_REQUEST['end']))) {
$end = $tmp->getTimestamp();
} else {
- $ok = false;
+ $valid = false;
$msg .= error(_("Please enter a valid ending time for the shifts."), true);
}
if ($start >= $end) {
- $ok = false;
+ $valid = false;
$msg .= error(_("The ending time has to be after the starting time."), true);
}
@@ -150,12 +150,12 @@ function user_shifts() {
if (isset($_REQUEST['type_' . $type['id']]) && preg_match("/^[0-9]+$/", trim($_REQUEST['type_' . $type['id']]))) {
$needed_angel_types[$type['id']] = trim($_REQUEST['type_' . $type['id']]);
} else {
- $ok = false;
+ $valid = false;
$msg .= error(sprintf(_("Please check your input for needed angels of type %s."), $type['name']), true);
}
}
- if ($ok) {
+ if ($valid) {
$shift['shifttype_id'] = $shifttype_id;
$shift['title'] = $title;
$shift['RID'] = $rid;