Users using the Tequila login are invited to migrate to gitlab.epfl.ch. This instance will close for Tequila users by May 2020.

Commit f6841700 authored by Florian Vessaz's avatar Florian Vessaz

Show account expiration date when updating subscription

parent c53e9fa6
......@@ -310,6 +310,7 @@ post '/subscriptions' => sub {
my $message;
foreach my $username (keys %$members) {
my $member = $members->{$username};
my $pay_now = params->{$username . '-now'};
my $date = params->{$username . '-date'};
my $ts;
......@@ -326,14 +327,13 @@ post '/subscriptions' => sub {
}
if (defined $ts) {
my $old_date = POSIX::strftime("%Y-%m-%d",
localtime $members->{$username}->subscription);
my $new_date = POSIX::strftime("%Y-%m-%d",
localtime $ts);
my $old_date = POSIX::strftime("%Y-%m-%d", localtime $member->subscription);
my $new_date = POSIX::strftime("%Y-%m-%d", localtime $ts);
unless ($old_date eq $new_date) {
$members->{$username}->subscription($ts);
$members->{$username}->shadow_expire_update;
$message .= "Updated subscription date for $username.<br/>";
$member->subscription($ts);
$member->shadow_expire_update;
my $expire = $member->subscription_expire_as_string;
$message .= "Updated subscription date for $username, expiration date is now $expire.<br/>";
}
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment