Skip to content

fix power actions#1599

Open
nbosb wants to merge 1 commit into
PhotoboothProject:devfrom
nbosb:fix-power-actions
Open

fix power actions#1599
nbosb wants to merge 1 commit into
PhotoboothProject:devfrom
nbosb:fix-power-actions

Conversation

@nbosb

@nbosb nbosb commented Jul 12, 2026

Copy link
Copy Markdown
Contributor

always allow power options if login is disabled

Prerequisites checklist

What is the purpose of this pull request? (put an "x" next to an item)

  • Documentation update
  • Bug fix
  • New feature
  • Other, please explain:

What changes did you make? (Give an overview)

When login was disabled, the photobooth could not be shut down/rebooted anymore (if isAdmin and isRental are both false).
I removed the check inside the shutdown and reboot actions because the correct check (that also checks if login is enabled) is already there before the switch/case block:

// Allow pre/post without admin auth; protect dangerous actions.
// If login is enabled, require auth for administrative modes (e.g., reboot/shutdown).
if (
($config['login']['enabled'] ?? false)
&& !$isAdmin
&& !($isRental && in_array($mode, ['reboot', 'shutdown'], true))
&& !in_array($mode, ['pre-command', 'post-command'], true)
) {
$data = [
'success' => 'false',
'mode' => 'Unauthorized',
];
$logger->debug('message', $data);
echo json_encode($data);
die();
}

Is there anything you'd like reviewers to focus on?

No

AI used to create this Pull Request?

No

always allow power options if login is disabled.

Signed-off-by: Nils Bosbach <n.bosbach@gmx.de>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant