Add version to page header
This commit is contained in:
@@ -5,26 +5,6 @@ require __DIR__ . '/../cli-start.php';
|
||||
|
||||
cli_title('USER MAINTENANCE');
|
||||
|
||||
/**
|
||||
* Display the options for this utility and exit
|
||||
*/
|
||||
#[NoReturn]
|
||||
function display_help(): void {
|
||||
printfn('Options:');
|
||||
printfn(' - add-user [e-mail] [password]');
|
||||
printfn(' Adds a new user to this instance');
|
||||
printfn(' - set-password [e-mail] [password]');
|
||||
printfn(' Sets the password for the given user');
|
||||
printfn(' - delete-user [e-mail]');
|
||||
printfn(' Deletes a user and all their data' . PHP_EOL);
|
||||
printfn('To assist with migrating from single-user to multi-user mode:');
|
||||
printfn(' - migrate-single-user [e-mail] [password]');
|
||||
printfn(' Changes the e-mail address and password for the single-user mode user');
|
||||
printfn(' - remove-single-user');
|
||||
printfn(' Removes the single-user mode user and its data');
|
||||
exit(0);
|
||||
}
|
||||
|
||||
if ($argc < 2) display_help();
|
||||
|
||||
switch ($argv[1]) {
|
||||
@@ -65,11 +45,32 @@ switch ($argv[1]) {
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Display the options for this utility and exit
|
||||
*/
|
||||
#[NoReturn]
|
||||
function display_help(): void {
|
||||
printfn('Options:');
|
||||
printfn(' - add-user [e-mail] [password]');
|
||||
printfn(' Adds a new user to this instance');
|
||||
printfn(' - set-password [e-mail] [password]');
|
||||
printfn(' Sets the password for the given user');
|
||||
printfn(' - delete-user [e-mail]');
|
||||
printfn(' Deletes a user and all their data' . PHP_EOL);
|
||||
printfn('To assist with migrating from single-user to multi-user mode:');
|
||||
printfn(' - migrate-single-user [e-mail] [password]');
|
||||
printfn(' Changes the e-mail address and password for the single-user mode user');
|
||||
printfn(' - remove-single-user');
|
||||
printfn(' Removes the single-user mode user and its data');
|
||||
exit(0);
|
||||
}
|
||||
|
||||
/**
|
||||
* Add a new user
|
||||
*/
|
||||
function add_user(): void {
|
||||
global $argv;
|
||||
|
||||
$db = Data::getConnection();
|
||||
|
||||
try {
|
||||
|
||||
Reference in New Issue
Block a user