sreview-user is a simple script to manage SReview users. It allows you
to create, destroy, and set passwords for users. Optionally, it also
allows to mark newly-created users as administrators.
More detailed user management should be done through the SReview
webinterface, however.
=cut
if($actioneq "create") {
openPASSWORD, "pwgen -s 10 -n 1|";
my$password=<PASSWORD>;
close(PASSWORD);
chomp$password;
$dbh->prepare("INSERT INTO users(email,password,isadmin) VALUES(?,crypt(?, gen_salt('bf', 8)),?)")->execute($user,$password,$admin? "true": "false") or die$!;
print"New password is $password\n";
} elsif($actioneq "delete") {
$dbh->prepare("DELETE FROM users WHERE email = ?")->execute($user) or die$!;
} elsif($actioneq "pwreset") {
openPASSWORD, "pwgen -s 10 -n 1|";
my$password=<PASSWORD>;
close(PASSWORD);
chomp$password;
$dbh->prepare("UPDATE users SET password=crypt(?,gen_salt('bf',8)) WHERE email=?")->execute($password, $user) or die$!;
print"New password is $password\n";
} else{
die"unknown action";
}
Keyboard Shortcuts
Global
s
Focus search bar
?
Bring up this help dialog
GitHub
gp
Go to pull requests
gi
go to github issues (only if github is preferred repository)