Changeset View
Changeset View
Standalone View
Standalone View
scripts/user/add_user.php
| Show All 13 Lines | |||||
| $realname = $argv[3]; | $realname = $argv[3]; | ||||
| $admin = $argv[4]; | $admin = $argv[4]; | ||||
| $admin = id(new PhabricatorUser())->loadOneWhere( | $admin = id(new PhabricatorUser())->loadOneWhere( | ||||
| 'username = %s', | 'username = %s', | ||||
| $argv[4]); | $argv[4]); | ||||
| if (!$admin) { | if (!$admin) { | ||||
| throw new Exception( | throw new Exception( | ||||
| "Admin user must be the username of a valid Phabricator account, used ". | 'Admin user must be the username of a valid Phabricator account, used '. | ||||
| "to send the new user a welcome email."); | 'to send the new user a welcome email.'); | ||||
| } | } | ||||
| $existing_user = id(new PhabricatorUser())->loadOneWhere( | $existing_user = id(new PhabricatorUser())->loadOneWhere( | ||||
| 'username = %s', | 'username = %s', | ||||
| $username); | $username); | ||||
| if ($existing_user) { | if ($existing_user) { | ||||
| throw new Exception( | throw new Exception( | ||||
| "There is already a user with the username '{$username}'!"); | "There is already a user with the username '{$username}'!"); | ||||
| Show All 26 Lines | |||||