예제 #1
0
         $edited_Cronjob->dbinsert();
         $Messages->add(T_('New job has been scheduled.'), 'success');
         // Redirect so that a reload doesn't write to the DB twice:
         header_redirect('?ctrl=crontab', 303);
         // Will EXIT
         // We have EXITed already at this point!!
     }
     break;
 case 'update':
     // Check that this action request is not a CSRF hacked request:
     $Session->assert_received_crumb('crontask');
     // Check that we have permission to edit options:
     $current_User->check_perm('options', 'edit', true, NULL);
     if ($edited_Cronjob->load_from_Request($cron_job_names, $cron_job_params)) {
         // We could load data from form without errors:
         if ($edited_Cronjob->dbupdate()) {
             // The job was updated successfully
             $Messages->add(T_('The scheduled job has been updated.'), 'success');
         } else {
             // Errors on updating, probably this job has not "pending" status
             $Messages->add(T_('This scheduled job can not be updated.'), 'error');
         }
         // Redirect so that a reload doesn't write to the DB twice:
         header_redirect('?ctrl=crontab', 303);
         // Will EXIT
         // We have EXITed already at this point!!
     }
     break;
 case 'delete':
     // Check that this action request is not a CSRF hacked request:
     $Session->assert_received_crumb('crontask');