if (isset($_REQUEST['shift_id']) && preg_match("/^[0-9]*$/", $_REQUEST['shift_id'])) {
$shift_id = $_REQUEST['shift_id'];
} else {
redirect(page_link_to('user_shifts'));
}
// Locations laden
$rooms = sql_select("SELECT * FROM `Room` WHERE `show`='Y' ORDER BY `Name`");
// Locations laden
$rooms = sql_select("SELECT * FROM `Room` WHERE `show`='Y' ORDER BY `Name`");
$room_array = [];
foreach ($rooms as $room) {
$room_array[$room['RID']] = $room['Name'];
}
$shift = Shift($shift_id);
$shift['Name'] = $room_array[$shift['RID']];
if ($shift == null) {
redirect(page_link_to('user_shifts'));
}
if (isset($_REQUEST['type_id']) && preg_match("/^[0-9]*$/", $_REQUEST['type_id'])) {
$type_id = $_REQUEST['type_id'];
} else {
redirect(page_link_to('user_shifts'));
}
if (in_array('user_shifts_admin', $privileges) || in_array('shiftentry_edit_angeltype_supporter', $privileges)) {
$type = AngelType($type_id);
} else {
$type = sql_select("SELECT * FROM `UserAngelTypes` JOIN `AngelTypes` ON (`UserAngelTypes`.`angeltype_id` = `AngelTypes`.`id`) WHERE `AngelTypes`.`id` = '" . sql_escape($type_id) . "' AND (`AngelTypes`.`restricted` = 0 OR (`UserAngelTypes`.`user_id` = '" . sql_escape($user['UID']) . "' AND NOT `UserAngelTypes`.`confirm_user_id` IS NULL))");
$type = sql_select("
SELECT * FROM `UserAngelTypes`
JOIN `AngelTypes` ON (`UserAngelTypes`.`angeltype_id` = `AngelTypes`.`id`)
WHERE `AngelTypes`.`id` = '" . sql_escape($type_id) . "'
$users = sql_select("SELECT *, (SELECT count(*) FROM `ShiftEntry` WHERE `freeloaded`=1 AND `ShiftEntry`.`UID`=`User`.`UID`) AS `freeloaded` FROM `User` ORDER BY `Nick`");
$users = sql_select("
SELECT *, (SELECT count(*) FROM `ShiftEntry` WHERE `freeloaded`=1 AND `ShiftEntry`.`UID`=`User`.`UID`) AS `freeloaded`
error(sprintf(_("Do you want to delete the shift %s from %s to %s?"), $shift['name'], date("Y-m-d H:i", $shift['start']), date("H:i", $shift['end'])), true),
$success_message = sprintf($supporter ? _("Added supporter rights for %s to %s.") : _("Removed supporter rights for %s from %s."), AngelType_name_render($angeltype), User_Nick_render($user_source));
$success_message = sprintf(
$supporter ? _("Added supporter rights for %s to %s.") : _("Removed supporter rights for %s from %s."),
return sprintf(_("You joined an angeltype which requires a driving license. Please edit your driving license information here: %s."), '<ahref="' . user_driver_license_edit_link() . '">' . _("driving license information") . '</a>');
return sprintf(
_("You joined an angeltype which requires a driving license. Please edit your driving license information here: %s."),
$shift['needed_angeltypes'] = sql_select("SELECT DISTINCT `AngelTypes`.* FROM `ShiftEntry` JOIN `AngelTypes` ON `ShiftEntry`.`TID`=`AngelTypes`.`id` WHERE `ShiftEntry`.`SID`='" . sql_escape($shift['SID']) . "' ORDER BY `AngelTypes`.`name`");
$shift['needed_angeltypes'] = sql_select("SELECT DISTINCT `AngelTypes`.* FROM `ShiftEntry` JOIN `AngelTypes` ON `ShiftEntry`.`TID`=`AngelTypes`.`id` WHERE `ShiftEntry`.`SID`='" . sql_escape($shift['SID']) . "' ORDER BY `AngelTypes`.`name`");
foreach ($shift['needed_angeltypes'] as &$needed_angeltype) {
$needed_angeltype['users'] = sql_select("
SELECT `ShiftEntry`.`freeloaded`, `User`.*
@ -174,15 +177,23 @@ function user_controller()
AND `ShiftEntry`.`TID`='" . sql_escape($needed_angeltype['id']) . "'");
function engelsystem_email_to_user($recipient_user, $title, $message, $not_if_its_me = false)
{
global $user;
if ($not_if_its_me && $user['UID'] == $recipient_user['UID']) {
return true;
}
gettext_locale($recipient_user['Sprache']);
$message = sprintf(_("Hi %s,"), $recipient_user['Nick']) . "\n\n" . _("here is a message for you from the engelsystem:") . "\n\n" . $message . "\n\n" . _("This email is autogenerated and has not to be signed. You got this email because you are registered in the engelsystem.");
engelsystem_email_to_user($user, '[engelsystem] ' . _("Your account has been deleted"), _("Your angelsystem account has been deleted. If you have any questions regarding your account deletion, please contact heaven."));
engelsystem_email_to_user(
$user,
'[engelsystem] ' . _("Your account has been deleted"),
_("Your angelsystem account has been deleted. If you have any questions regarding your account deletion, please contact heaven.")
if (isset($_REQUEST['id']) && preg_match("/^-[0-9]{1,11}$/", $_REQUEST['id'])) {
$group_id = $_REQUEST['id'];
} else {
return error("Incomplete call, missing Groups ID.", true);
}
$group = sql_select("SELECT * FROM `Groups` WHERE `UID`='" . sql_escape($group_id) . "' LIMIT 1");
if (count($group) > 0) {
list($group) = $group;
$privileges = sql_select("SELECT `Privileges`.*, `GroupPrivileges`.`group_id` FROM `Privileges` LEFT OUTER JOIN `GroupPrivileges` ON (`Privileges`.`id` = `GroupPrivileges`.`privilege_id` AND `GroupPrivileges`.`group_id`='" . sql_escape($group_id) . "') ORDER BY `Privileges`.`name`");
global $user, $privileges, $tshirt_sizes, $privileges;
$html = '';
if (!isset($_REQUEST['id'])) {
if (!isset($_REQUEST['id'])) {
redirect(users_link());
}
$user_id = $_REQUEST['id'];
if (!isset($_REQUEST['action'])) {
if (!isset($_REQUEST['action'])) {
$user_source = User($user_id);
if ($user_source == null) {
error(_('This user does not exist.'));
redirect(users_link());
}
$html .= "Hallo,<br/>" . "hier kannst du den Eintrag ändern. Unter dem Punkt 'Gekommen' " . "wird der Engel als anwesend markiert, ein Ja bei Aktiv bedeutet, " . "dass der Engel aktiv war und damit ein Anspruch auf ein T-Shirt hat. " . "Wenn T-Shirt ein 'Ja' enthält, bedeutet dies, dass der Engel " . "bereits sein T-Shirt erhalten hat.<br/><br/>\n";
$html .= form_info('', _('Please visit the angeltypes page or the users profile to manage users angeltypes.'));
$html .= "Hier kannst Du das Passwort dieses Engels neu setzen:<formaction=\"".page_link_to("admin_user")."&action=change_pw&id=$user_id\"method=\"post\">\n";
if ($user_id != $user['UID'] && $my_highest_group <= $his_highest_group) {
$html .= "Hier kannst Du die Benutzergruppen des Engels festlegen:<formaction=\"".page_link_to("admin_user")."&action=save_groups&id=".$user_id."\"method=\"post\">\n";
$html .= '<table>';
$groups = sql_select("SELECT * FROM `Groups` LEFT OUTER JOIN `UserGroups` ON (`UserGroups`.`group_id` = `Groups`.`UID` AND `UserGroups`.`uid` = '" . sql_escape($user_id) . "') WHERE `Groups`.`UID` >= '" . sql_escape($my_highest_group) . "' ORDER BY `Groups`.`Name`");
$groups_source = sql_select("SELECT * FROM `Groups` LEFT OUTER JOIN `UserGroups` ON (`UserGroups`.`group_id` = `Groups`.`UID` AND `UserGroups`.`uid` = '" . sql_escape($user_id) . "') WHERE `Groups`.`UID` >= '" . sql_escape($my_highest_group[0]['group_id']) . "' ORDER BY `Groups`.`Name`");
$groups = [];
$grouplist = [];
foreach ($groups_source as $group) {
$groups[$group['UID']] = $group;
$grouplist[] = $group['UID'];
}
if (! is_array($_REQUEST['groups'])) {
$_REQUEST['groups'] = [];
}
sql_query("DELETE FROM `UserGroups` WHERE `uid`='" . sql_escape($user_id) . "'");
$user_groups_info = [];
foreach ($_REQUEST['groups'] as $group) {
if (in_array($group, $grouplist)) {
sql_query("INSERT INTO `UserGroups` SET `uid`='" . sql_escape($user_id) . "', `group_id`='" . sql_escape($group) . "'");
$user_groups_info[] = $groups[$group]['Name'];
case 'save_groups':
if ($user_id != $user['UID']) {
$my_highest_group = sql_select("SELECT * FROM `UserGroups` WHERE `uid`='" . sql_escape($user['UID']) . "' ORDER BY `group_id`");
$his_highest_group = sql_select("SELECT * FROM `UserGroups` WHERE `uid`='" . sql_escape($user_id) . "' ORDER BY `group_id`");
$groups_source = sql_select("SELECT * FROM `Groups` LEFT OUTER JOIN `UserGroups` ON (`UserGroups`.`group_id` = `Groups`.`UID` AND `UserGroups`.`uid` = '" . sql_escape($user_id) . "') WHERE `Groups`.`UID` >= '" . sql_escape($my_highest_group[0]['group_id']) . "' ORDER BY `Groups`.`Name`");
$groups = [];
$grouplist = [];
foreach ($groups_source as $group) {
$groups[$group['UID']] = $group;
$grouplist[] = $group['UID'];
}
if (!is_array($_REQUEST['groups'])) {
$_REQUEST['groups'] = [];
}
sql_query("DELETE FROM `UserGroups` WHERE `uid`='" . sql_escape($user_id) . "'");
$user_groups_info = [];
foreach ($_REQUEST['groups'] as $group) {
if (in_array($group, $grouplist)) {
sql_query("INSERT INTO `UserGroups` SET `uid`='" . sql_escape($user_id) . "', `group_id`='" . sql_escape($group) . "'");
$user_groups_info[] = $groups[$group]['Name'];
}
}
$user_source = User($user_id);
engelsystem_log("Set groups of " . User_Nick_render($user_source) . " to: " . join(", ",
form_checkboxes('angel_types', _("What do you want to do?") . sprintf(" (<ahref=\"%s\">%s</a>)", page_link_to('angeltypes') . '&action=about', _("Description of job types")), $angel_types, $selected_angel_types),
form_info("", _("Restricted angel types need will be confirmed later by a supporter. You can change your selection in the options section."))
$done_shifts_seconds = sql_select_single_cell("SELECT SUM(`Shifts`.`end` - `Shifts`.`start`) FROM `ShiftEntry` JOIN `Shifts` USING (`SID`) WHERE `Shifts`.`end` <UNIX_TIMESTAMP()");
$users_in_action = sql_select("SELECT `Shifts`.`start`, `Shifts`.`end` FROM `ShiftEntry` JOIN `Shifts` ON `Shifts`.`SID`=`ShiftEntry`.`SID` WHERE UNIX_TIMESTAMP() BETWEEN `Shifts`.`start` AND `Shifts`.`end`");
$messages = sql_select("SELECT * FROM `Messages` WHERE `SUID`='" . sql_escape($user['UID']) . "' OR `RUID`='" . sql_escape($user['UID']) . "' ORDER BY `isRead`,`Datum` DESC");
error(_("If you reset the key, the url to your iCal- and JSON-export and your atom feed changes! You have to update it in every application using one of these exports."), true),
_("If you reset the key, the url to your iCal- and JSON-export and your atom feed changes! You have to update it in every application using one of these exports."),
error(_("Please enter your planned date of departure. It should be after your planned arrival date and after buildup start date and before teardown end date."));
@ -66,9 +66,9 @@ function update_ShiftsFilter_timerange(ShiftsFilter $shiftsFilter, $days)
*
* @param ShiftsFilter $shiftsFilter
* The shifts filter to update from request data
* @param boolean $user_shifts_admin
* @param boolean $user_shifts_admin
* Has the user user_shift_admin privilege?
* @param string[] $days
* @param string[] $days
* An array of available filter days
*/
function update_ShiftsFilter(ShiftsFilter $shiftsFilter, $user_shifts_admin, $days)
@ -106,12 +106,30 @@ function load_days()
function load_types()
{
global $user;
if (sql_num_query("SELECT `id`, `name` FROM `AngelTypes` WHERE `restricted` = 0") == 0) {
error(_("The administration has not configured any angeltypes yet - or you are not subscribed to any angeltype."));
redirect('?');
}
$types = sql_select("SELECT `AngelTypes`.`id`, `AngelTypes`.`name`, (`AngelTypes`.`restricted`=0 OR (NOT `UserAngelTypes`.`confirm_user_id` IS NULL OR `UserAngelTypes`.`id` IS NULL)) as `enabled` FROM `AngelTypes` LEFT JOIN `UserAngelTypes` ON (`UserAngelTypes`.`angeltype_id`=`AngelTypes`.`id` AND `UserAngelTypes`.`user_id`='" . sql_escape($user['UID']) . "') ORDER BY `AngelTypes`.`name`");
$types = sql_select("
SELECT
`AngelTypes`.`id`,
`AngelTypes`.`name`,
(
`AngelTypes`.`restricted`=0
OR (
NOT `UserAngelTypes`.`confirm_user_id` IS NULL
OR `UserAngelTypes`.`id` IS NULL
)
) AS `enabled`
FROM `AngelTypes`
LEFT JOIN `UserAngelTypes`
ON (
`UserAngelTypes`.`angeltype_id`=`AngelTypes`.`id`
AND `UserAngelTypes`.`user_id`='" . sql_escape($user['UID']) . "'
)
ORDER BY `AngelTypes`.`name`
");
if (empty($types)) {
return sql_select("SELECT `id`, `name` FROM `AngelTypes` WHERE `restricted` = 0");
'task_notice' => '<sup>1</sup>' . _("The tasks shown here are influenced by the angeltypes you joined already!") . " <ahref=\"".page_link_to('angeltypes').'&action=about'."\">" . _("Description of the jobs.") . "</a>",
_("Export of shown shifts. <ahref=\"%s\">iCal format</a> or <ahref=\"%s\">JSON format</a> available (please keep secret, otherwise <ahref=\"%s\">reset the api key</a>)."),
info(sprintf($supporter ? _("Do you really want to add supporter rights for %s to %s?") : _("Do you really want to remove supporter rights for %s from %s?"), $angeltype['name'], User_Nick_render($user)), true),
button(user_link($user_source), _("Back to profile"), 'back')
]),
msg(),
form([
form_info(_("Privacy"), _("Your driving license information is only visible for supporters and admins.")),
form_checkbox('wants_to_drive', _("I am willing to operate cars for the PL"), $wants_to_drive),
div('panel panel-default', [
div('panel-body', [
form_checkbox('has_car', _("I have my own car with me and am willing to use it for the PL (You'll get reimbursed for fuel)"), $user_driver_license['has_car']),
form_checkbox('email_shiftinfo', _("The engelsystem is allowed to send me an email (e.g. when my shifts change)"), $user_source['email_shiftinfo']),
form_checkbox('email_by_human_allowed', _("Humans are allowed to send me an email (e.g. for ticket vouchers)"), $user_source['email_by_human_allowed']),
$its_me ? info(glyph('info-sign') . _("Your night shifts between 2 and 8 am count twice."), true) : '',
$its_me && count($shifts) == 0 ? error(sprintf(_("Go to the <ahref=\"%s\">shifts table</a> to sign yourself up for some shifts."), page_link_to('user_shifts')), true) : ''
@ -459,22 +565,25 @@ function User_Nick_render($user_source)
function render_user_departure_date_hint()
{
global $user;
if (!isset($user['planned_departure_date']) || $user['planned_departure_date'] == null) {
if (!isset($user['planned_departure_date']) || $user['planned_departure_date'] == null) {
return _("Please enter your planned date of departure on your settings page to give us a feeling for teardown capacities.");
}
return null;
}
function render_user_freeloader_hint()
{
global $user, $max_freeloadable_shifts;
if (User_is_freeloader($user)) {
return sprintf(_("You freeloaded at least %s shifts. Shift signup is locked. Please go to heavens desk to be unlocked again."), $max_freeloadable_shifts);
return sprintf(
_("You freeloaded at least %s shifts. Shift signup is locked. Please go to heavens desk to be unlocked again."),
$max_freeloadable_shifts
);
}
return null;
}
@ -482,32 +591,32 @@ function render_user_freeloader_hint()
function render_user_arrived_hint()
{
global $user;
if ($user['Gekommen'] == 0) {
return _("You are not marked as arrived. Please go to heaven's desk, get your angel badge and/or tell them that you arrived already.");
}
return null;
}
function render_user_tshirt_hint()
{
global $enable_tshirt_size, $user;
if ($enable_tshirt_size && $user['Size'] == "") {
return _("You need to specify a tshirt size in your settings!");
}
return null;
}
function render_user_dect_hint()
{
global $user;
if ($user['DECT'] == "") {
return _("You need to specify a DECT phone number in your settings! If you don't have a DECT phone, just enter \"-\".");
The <spanclass="icon-icon_angel"></span><strong>ENGELSYSTEM</strong> is in maintenance mode.
</h2>
<p>This may be due to...</p>
<p>
...archangels closing the gates of heaven. <br>...somebody's stolen the power chord and now the battery is empty. <br>...DHCP decided to give me another ip address.
<p>The great interest in becoming an angel and participating at 33C3 is is something we are grateful for every time. There is a record number of angels and helping volunteers this year.</p>
<p>We did anticipate a great number but we are overwhelmed by this endless wave of support. We do want to enable each and every one of you to be an angel at the congress, but sadly our resources and capacities at Heaven are limited. The amount of angels at this point is beyond our
planing and to ensure we can support the angels already checked in. We did make a choice never thought possible on a chaos event:</p>
<p>We closed the registration in the Engelsystem and at Heaven Desk at 19:00 27. Dec. 2016.</p>
<p>Everyone of us works for you to support you in being an angel, but the Heaven Desk and the Kitchen among others are limited and so we decided to focus our effort to support those of you already arrived to the best of our abilities.</p>
<p>
For the Heaven Team<br/> Agnes, Jen, LLF and Knuth
</p>
</div>
<divclass="jumbotron">
<divclass="container text-center">
<divclass="col-md-6 col-md-offset-3">
<h2>Dear Angels,</h2>
<p>
The great interest in becoming an angel and participating at 33C3 is is something we are
grateful for every time. There is a record number of angels and helping volunteers this year.
</p>
<p>
We did anticipate a great number but we are overwhelmed by this endless wave of support. We do
want to enable each and every one of you to be an angel at the congress, but sadly our resources
and capacities at Heaven are limited. The amount of angels at this point is beyond our
planing and to ensure we can support the angels already checked in. We did make a choice never
thought possible on a chaos event:
</p>
<p>
We closed the registration in the Engelsystem and at Heaven Desk at 19:00 27. Dec. 2016.
</p>
<p>
Everyone of us works for you to support you in being an angel, but the Heaven Desk and the
Kitchen among others are limited and so we decided to focus our effort to support those of you
The original system was written by <ahref="https://github.com/cookieBerlin/engelsystem">cookie</a>. It was then completely rewritten and greatly enhanced by <ahref="http://notrademark.de/">msquare</a> and <ahref="http://mortzu.de/">mortzu</a> of <ahref="http://planetcyborg.de">planet
cyborg</a>, <ahref="http://jplitza.de/">jplitza</a> and gnomus.
</p>
<p>
Please look at the <ahref="https://github.com/engelsystem/engelsystem/graphs/contributors">contributor list on github</a> for a more complete version.
</p>
<h1>Credits</h1>
<divclass="row">
<divclass="col-md-4">
<h2>Source code</h2>
<p>
The original system was written by <ahref="https://github.com/cookieBerlin/engelsystem">cookie</a>.
It was then completely rewritten and greatly enhanced by <ahref="http://notrademark.de/">msquare</a>
and <ahref="http://myigel.name/">MyIgel</a>,
<ahref="http://mortzu.de/">mortzu</a> of <ahref="http://planetcyborg.de">planet cyborg</a>,
<ahref="http://jplitza.de/">jplitza</a> and gnomus.
</p>
<p>
Please look at the <ahref="https://github.com/engelsystem/engelsystem/graphs/contributors">contributor
list on github</a> for a more complete version.
</p>
</div>
<divclass="col-md-4">
<h2>Hosting</h2>
<p>
Webspace, development platform and domain is currently provided by
<ahref="https://www.wybt.net/">would you buy this?</a> (ichdasich)<br/>
and adminstrated by <ahref="http://mortzu.de/">mortzu</a>,
<ahref="http://derf.homelinux.org/">derf</a>
and ichdasich.
</p>
</div>
<divclass="col-md-4">
<h2>Translation</h2>
<p>
Many thanks for the german translation: <ahref="http://e7p.de">e7p</a>
</p>
</div>
</div>
<divclass="col-md-4">
<h2>Hosting</h2>
<p>
Webspace, development platform and domain is currently provided by <ahref="https://www.wybt.net/">would you buy this?</a> (ichdasich)<br/> and adminstrated by <ahref="http://mortzu.de/">mortzu</a>, <ahref="http://derf.homelinux.org/">derf</a> and ichdasich.
</p>
</div>
<divclass="col-md-4">
<h2>Translation</h2>
<p>
Many thanks for the german translation: <ahref="http://e7p.de">e7p</a>