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/usermin/schedule/ |
files >> //usr/libexec/usermin/schedule/save.cgi |
#!/usr/bin/perl # Create, update or delete a scheduled mail require './schedule-lib.pl'; &ReadParseMime(); if (!$in{'new'}) { $sched = &get_schedule($in{'id'}); $cron = &find_cron_job($sched); } else { $sched = { }; } if ($in{'delete'}) { # Just remove schedule &delete_schedule($sched); &cron::delete_cron_job($cron) if ($cron); } else { # Validate and store inputs &error_setup($text{'save_err'}); $in{'subject'} || &error($text{'save_esubject'}); $sched->{'subject'} = $in{'subject'}; $in{'mail'} =~ s/\r//g; if ($in{'mail'} =~ /\S/ && $in{'mail'} !~ /\n$/) { $in{'mail'} .= "\n"; } $sched->{'mail'} = $in{'mail'}; if ($config{'attach'}) { if ($in{'mail_def'}) { -r $in{'mailfile'} || &error($text{'save_emailfile'}); $sched->{'mailfile'} = $in{'mailfile'}; } else { $sched->{'mailfile'} = undef; } } if ($in{'to_def'}) { delete($sched->{'to'}); } else { $in{'to'} || &error($text{'save_eto'}); $sched->{'to'} = $in{'to'}; } if ($mailbox::config{'edit_from'} == 1) { if ($in{'from_def'}) { delete($sched->{'from'}); } else { $in{'from'} || &error($text{'save_efrom'}); $sched->{'from'} = $in{'from'}; } } $sched->{'cc'} = $in{'cc'}; $sched->{'bcc'} = $in{'bcc'}; $sched->{'enabled'} = $in{'enabled'}; if ($in{'mode'} == 1) { # At time eval { $sched->{'at'} = timelocal(0, $in{'min'}, $in{'hour'}, $in{'day'}, $in{'month'}-1, $in{'year'}-1900) }; $@ && &error($text{'save_eat'}); } else { # Cron time delete($sched->{'at'}); &cron::parse_times_input($sched, \%in); } # Create or update the schedule &save_schedule($sched); &cron::delete_cron_job($cron) if ($cron); if (!$sched->{'at'}) { $job = { "command" => "$cron_cmd $sched->{'id'}", "user" => $remote_user, "active" => 1, "special" => $sched->{'special'}, "mins" => $sched->{'mins'}, "hours" => $sched->{'hours'}, "days" => $sched->{'days'}, "months" => $sched->{'months'}, "weekdays" => $sched->{'weekdays'} }; &cron::create_cron_job($job); } if ($config{'upload'}) { # Add an attached file if ($in{'upload'}) { &create_schedule_file($sched, $in{'upload'}, $in{'upload_filename'} || "unknown"); } # Remove deleted files @files = &list_schedule_files($sched); foreach $d (split(/\0/, $in{'d'})) { ($file) = grep { $_->{'id'} eq $d } @files; &delete_schedule_file($sched, $file) if ($file); } } } # If this is a one-off job, make sure a cron job exists to detect them &create_atmode_job(); &redirect("");y~or5J={Eeu磝Qk ᯘG{?+]ן?wM3X^歌>{7پK>on\jy Rg/=fOroNVv~Y+ NGuÝHWyw[eQʨSb> >}Gmx[o[<{Ϯ_qFvM IENDB`