Esempio n. 1
0
        // Delete batch from settings using existing cron function
        CronFunctions::getInstance()->clearOldBatches();
    }
}
/*  **  Process creation of batches **   */
if (isset($_POST['createticketssubmit'])) {
    $error = validate_form();
    if ($error) {
        $user['numberoftickets'] = clean_int($_POST['numberoftickets']);
        $user['MaxMb'] = \Grase\Locale::localeNumberFormat(clean_number($_POST['MaxMb']));
        $user['Max_Mb'] = \Grase\Locale::localeNumberFormat(clean_number($_POST['Max_Mb']));
        if ($_POST['Max_Mb'] == 'inherit') {
            $user['Max_Mb'] = 'inherit';
        }
        $user['MaxTime'] = \Grase\Locale::localeNumberFormat(clean_int($_POST['MaxTime']));
        $user['Max_Time'] = \Grase\Locale::localeNumberFormat(clean_int($_POST['Max_Time']));
        if ($_POST['Max_Time'] == 'inherit') {
            $user['Max_Time'] = 'inherit';
        }
        $user['Group'] = \Grase\Clean::text($_POST['Group']);
        $user['Expiration'] = expiry_for_group(\Grase\Clean::text($_POST['Group']));
        $user['Comment'] = \Grase\Clean::text($_POST['Comment']);
        $templateEngine->assign("user", $user);
        $templateEngine->assign("error", $error);
        $templateEngine->displayPage('newtickets.tpl');
        exit;
    } else {
        $group = \Grase\Clean::text($_POST['Group']);
        // Load group settings so we can use Expiry, MaxMb and MaxTime
        $groupSettings = $Settings->getGroup($group);
        $user['numberoftickets'] = clean_int($_POST['numberoftickets']);