Forbid setting an owner password for rooms which uses a common name

This list can be set in the config
master
Daniel Berteaud 11 years ago
parent 6cfec8335b
commit f53a16b86d
  1. 7
      conf/vroom.conf.sample
  2. 1
      lib/Vroom/I18N/en.pm
  3. 1
      lib/Vroom/I18N/fr.pm
  4. 7
      public/vroom.pl

@ -27,6 +27,13 @@ inactivityTimeout => 3600,
# 0 means they are not deleted. You can use a high number
# so that persistent rooms are kept long enough, but deleted when not used
persistentInactivityTimeout => 0,
# A list of room names which are valid but too common to allow reservation
# with an owner password
commonRoomNames => [
'test', 'test1', 'test123', '0', '1', '2', '3', '4', '5', '6', '7', '8', '9',
'123', '1234', '12345', 'a', 'aa', 'abc', 'azerty', 'qwerty', 'vroom',
'foo', 'bar', 'baz'
],
logLevel => 'info',
# ID of the Chrome extension for screen sharing

@ -81,6 +81,7 @@ our %Lexicon = (
"REMOVE_PASSWORD" => "Remove the password",
"PASSWORD_SET" => "Password updated",
"PASSWORD_REMOVED" => "Password removed",
"ERROR_COMMON_ROOM_NAME" => "Sorry, this room name is too comon to be reserved",
"AUTHENTICATE" => "Authentication",
"AUTH_TO_MANAGE_THE_ROOM" => "Authenticate to manage the room",
"OWNER_PASSWORD_MAKES_PERSISTENT" => "You can set a manager password. It will make this room persistent",

@ -88,6 +88,7 @@ our %Lexicon = (
"REMOVE_PASSWORD" => "Supprimer le mot de passe",
"PASSWORD_SET" => "Le mot de passe a été mis à jour",
"PASSWORD_REMOVED" => "Le mot de passe a été supprimé",
"ERROR_COMMON_ROOM_NAME" => "Désolé, le nom de ce salon est trop commun pour être réservé",
"AUTHENTICATE" => "Authentification",
"AUTH_TO_MANAGE_THE_ROOM" => "Authentifiez-vous pour gérer le salon",
"OWNER_PASSWORD_MAKES_PERSISTENT" => "Ajouter un mot de passe de gestionnaire. Ceci rendra le salon persistant",

@ -113,6 +113,7 @@ our $config = plugin Config => {
template => 'default',
inactivityTimeout => 3600,
persistentInactivityTimeout => 0,
commonRoomNames => [ qw() ],
logLevel => 'info',
chromeExtensionId => 'ecicdpoejfllflombfanbhfpgcimjddn',
sendmail => '/sbin/sendmail'
@ -783,8 +784,14 @@ post '/action' => sub {
# Once again, only the owner can do this
if ($self->session($room)->{role} eq 'owner'){
if ($type eq 'owner'){
# Forbid a few common room names to be reserved
if (grep { $room eq $_ } @{$config->{commonRoomNames}}){
$msg = 'ERROR_COMMON_ROOM_NAME';
}
else{
$res = $self->set_owner_pass($room,$pass);
}
}
else{
$res = $self->set_join_pass($room,$pass);
}

Loading…
Cancel
Save