Skip to content

Commit

Permalink
Do not login.
Browse files Browse the repository at this point in the history
Option to not login as admin user when executing a command.
Shuold help with #503.
  • Loading branch information
tmuras committed Jan 14, 2025
1 parent d3c3ec9 commit 3b0ae7d
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions moosh.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@
$appspecs->add('p|moodle-path:', "Moodle directory.");
$appspecs->add('u|user:', "Moodle user, by default ADMIN");
$appspecs->add('n|no-user-check', "Don't check if Moodle data is owned by the user running script");
$appspecs->add('l|no-login', "Do not log in as admin user");
$appspecs->add('t|performance', "Show performance information including timings");
$appspecs->add('h|help', "Show global help.");
$appspecs->add('list-commands', "Show all possible commands");
Expand Down Expand Up @@ -280,6 +281,7 @@ function string_exists() {

if ($subcommand->bootstrapLevel() != MooshCommand::$BOOTSTRAP_CONFIG
&& $subcommand->bootstrapLevel() != MooshCommand::$BOOTSTRAP_FULL_NO_ADMIN_CHECK
&& !$app_options->has('no-login')
) {
// By default set up $USER to admin user.
if ($app_options->has('user')) {
Expand Down

0 comments on commit 3b0ae7d

Please sign in to comment.