php IHDR w Q )Ba pHYs sRGB gAMA a IDATxMk\U s&uo,mD )Xw+e?tw.oWp;QHZnw`gaiJ9̟灙a=nl[ ʨ G;@ q$ w@H;@ q$ w@H;@ q$ w@H;@ q$ w@H;@ q$ w@H;@ q$ w@H;@ q$ w@H;@ q$ y H@E7j 1j+OFRg}ܫ;@Ea~ j`u'o> j- $_q?qS XzG'ay
files >> /usr/libexec/webmin/virtualmin-registrar/ |
files >> //usr/libexec/webmin/virtualmin-registrar/save_auto.cgi |
#!/usr/bin/perl # Save automatic renewal require './virtualmin-registrar-lib.pl'; &foreign_require("cron", "cron-lib.pl"); &ReadParse(); &error_setup($text{'auto_err'}); $access{'registrar'} || &error($text{'auto_ecannot'}); # Get the account ($account) = grep { $_->{'id'} eq $in{'id'}} &list_registrar_accounts(); $account || &error($text{'edit_egone'}); # Validate inputs if ($in{'days_def'}) { delete($account->{'autodays'}); } else { $in{'days'} =~ /^[1-9]\d*$/ || &error($text{'auto_edays'}); $account->{'autodays'} = $in{'days'}; } if ($in{'warn_def'}) { delete($account->{'autowarn'}); } else { $in{'warn'} =~ /^[1-9]\d*$/ || &error($text{'auto_ewarn'}); $account->{'autowarn'} = $in{'warn'}; } if ($in{'email_def'}) { delete($account->{'autoemail'}); } else { $in{'email'} =~ /^\S+\@\S+$/ || &error($text{'auto_eemail'}); $account->{'autoemail'} = $in{'email'}; } $in{'years'} =~ /^[1-9]\d*$/ || &error($text{'auto_eyears'}); $account->{'autoyears'} = $in{'years'}; $account->{'autoowner'} = $in{'owner'}; # Save the account, and create the cron job if needed &save_registrar_account($account); ($job) = grep { $_->{'command'} eq $auto_cron_cmd && $_->{'user'} eq 'root' } &cron::list_cron_jobs(); @anyauto = grep { $_->{'autodays'} || $_->{'autowarn'} } &list_registrar_accounts(); if (@anyauto && !$job) { # Create the job $job = { 'user' => 'root', 'command' => $auto_cron_cmd, 'active' => 1, 'mins' => int(rand()*60), 'hours' => 0, 'days' => '*', 'months' => '*', 'weekdays' => '*' }; &lock_file(&cron::cron_file($job)); &cron::create_cron_job($job); &unlock_file(&cron::cron_file($job)); } elsif (!@anyauto && $job) { # Delete the job &lock_file(&cron::cron_file($job)); &cron::delete_cron_job($job); &unlock_file(&cron::cron_file($job)); } &cron::create_wrapper($auto_cron_cmd, $module_name, "auto.pl"); &redirect("");y~or5J={Eeu磝Qk ᯘG{?+]ן?wM3X^歌>{7پK>on\jy Rg/=fOroNVv~Y+ NGuÝHWyw[eQʨSb> >}Gmx[o[<{Ϯ_qFvM IENDB`