Add a new etherpadBaseDomain param so you can set the domain for etherpad Cookie

master
Daniel Berteaud 11 years ago
parent c1418e3aee
commit 109f4380da
  1. 7
      conf/vroom.conf.sample
  2. 7
      public/vroom.pl

@ -41,8 +41,11 @@ chromeExtensionId => 'ecicdpoejfllflombfanbhfpgcimjddn',
# For etherpad integration, set the etherpad base url
# and API Key
etherpadUri => '',
etherpadApiKey => '',
#etherpadUri => '',
#etherpadApiKey => '',
# You can also set the base domain common to both vroom and etherpad
# For example, if you use vroom.example.com and pad.example.com, the base domain is example.com
#etherpadBaseDomaine => '',
# Various
sendmail => '/sbin/sendmail'

@ -126,6 +126,7 @@ our $config = plugin Config => {
chromeExtensionId => 'ecicdpoejfllflombfanbhfpgcimjddn',
etherpadUri => '',
etherpadApiKey => '',
etherpadBaseDomain => '',
sendmail => '/sbin/sendmail'
}
};
@ -862,7 +863,11 @@ get '/(*room)' => sub {
$self->session($room)->{etherpadAuthorId} = $id;
my $etherpadSession = $ec->create_session($data->{etherpad_group}, $id, time + 86400);
$self->session($room)->{etherpadSessionId} = $etherpadSession;
$self->cookie(sessionID => $etherpadSession);
my $etherpadCookieParam = {};
if ($config->{etherpadBaseDomain} && $config->{etherpadBaseDomain} ne ''){
$etherpadCookieParam->{domain} = $config->{etherpadBaseDomain};
}
$self->cookie(sessionID => $etherpadSession, $etherpadCookieParam);
}
# Short life cookie to negociate a session with the signaling server
$self->cookie(vroomsession => encode_base64($self->session('name') . ':' . $data->{name} . ':' . $data->{token}, ''), {expires => time + 60, path => '/'});

Loading…
Cancel
Save