You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
if (!$this->bootstrapManager->doBootstrap(DrupalBootLevels::FULL)) {
72
-
thrownew \Exception('Unable to bootstrap Drupal.');
73
-
}
74
-
75
-
$account = null;
76
-
if ($input->getOption('name') && !$account = user_load_by_name($input->getOption('name'))) {
77
-
thrownew \Exception(sprintf('Unable to load user by name: %s', $input->getOption('name')));
78
-
}
79
-
80
-
if ($input->getOption('uid') && !$account = User::load($input->getOption('uid'))) {
81
-
thrownew \Exception(sprintf('Unable to load user by uid: %s', $input->getOption('uid')));
82
-
}
55
+
$account = null;
56
+
if ($input->getOption('name') && !$account = user_load_by_name($input->getOption('name'))) {
57
+
thrownew \Exception(sprintf('Unable to load user by name: %s', $input->getOption('name')));
58
+
}
83
59
84
-
if ($input->getOption('mail') && !$account = user_load_by_mail($input->getOption('mail'))) {
85
-
thrownew \Exception(sprintf('Unable to load user by mail: %s', $input->getOption('mail')));
86
-
}
60
+
if ($input->getOption('uid') && !$account = User::load($input->getOption('uid'))) {
61
+
thrownew \Exception(sprintf('Unable to load user by uid: %s', $input->getOption('uid')));
62
+
}
87
63
88
-
if (empty($account)) {
89
-
$account = User::load(1);
90
-
}
64
+
if ($input->getOption('mail') && !$account = user_load_by_mail($input->getOption('mail'))) {
65
+
thrownew \Exception(sprintf('Unable to load user by mail: %s', $input->getOption('mail')));
66
+
}
91
67
92
-
if ($account->isBlocked()) {
93
-
thrownew \InvalidArgumentException('Account %s is blocked and thus cannot login. The user:unblock command may be helpful.', $account->getAccountName());
94
-
}
68
+
if (empty($account)) {
69
+
$account = User::load(1);
70
+
}
95
71
96
-
// Can't inject dependency because this command instantiates without a bootstrap.
97
-
$timestamp = \Drupal::time()->getRequestTime();
98
-
$link = Url::fromRoute(
99
-
'user.reset.login',
100
-
[
101
-
'uid' => $account->id(),
102
-
'timestamp' => $timestamp,
103
-
'hash' => user_pass_rehash($account, $timestamp),
104
-
],
105
-
[
106
-
'absolute' => true,
107
-
'query' => $path ? ['destination' => $path] : [],
108
-
// Can't inject dependency because this command instantiates without a bootstrap.
thrownew \InvalidArgumentException('Account %s is blocked and thus cannot login. The user:unblock command may be helpful.', $account->getAccountName());
112
74
}
113
-
$port = $input->getOption('redirect-port');
114
-
// $browser = $input->getOption('browser');
115
-
// if (is_null($browser) && !str_contains(strval($input), '--browser')) {
116
-
// // WHen user doesn't specify, we have always represented that with true.
0 commit comments