예제 #1
0
     if (!empty($newtariffname)) {
         $billing->createtariff($newtariffname);
         $billing->edittariff($newtariffname, $tariffoptions);
         log_register("TARIFF CREATE `" . $newtariffname . "`");
     }
 }
 if (isset($_GET['action'])) {
     if (isset($_GET['tariffname'])) {
         $tariffname = $_GET['tariffname'];
         if ($_GET['action'] == 'delete') {
             if (!zb_TariffProtected($tariffname)) {
                 $billing->deletetariff($tariffname);
                 log_register("TARIFF DELETE `" . $tariffname . "`");
                 zb_LousyTariffDelete($tariffname);
                 zb_TariffDeleteSpeed($tariffname);
                 $dshaper = new DynamicShaper();
                 $dshaper->flushTariff($tariffname);
                 rcms_redirect('?module=tariffs');
             } else {
                 log_register("TARIFF DELETE TRY USED `" . $tariffname . "`");
                 show_error(__('Tariff is used by some users'));
                 show_window('', wf_Link('?module=tariffs', __('Back'), true, 'ubButton'));
             }
         }
         if ($_GET['action'] == 'edit') {
             if (isset($_POST['options']['Fee'])) {
                 $tariffoptions = $_POST['options'];
                 $tariffoptions['Fee'] = trim($tariffoptions['Fee']);
                 $billing->edittariff($tariffname, $tariffoptions);
                 log_register("TARIFF CHANGE `" . $tariffname . "`");
                 rcms_redirect('?module=tariffs');
예제 #2
0
<?php

if (cfr('DSHAPER')) {
    $alterconf = $ubillingConfig->getAlter();
    if (isset($alterconf['DSHAPER_ENABLED'])) {
        if ($alterconf['DSHAPER_ENABLED']) {
            $dshaper = new DynamicShaper();
            //if someone deleting time rule
            if (isset($_GET['delete'])) {
                $dshaper->delete($_GET['delete']);
                rcms_redirect("?module=dshaper");
            }
            //if someone adding time rule
            if (isset($_POST['newdshapetariff'])) {
                $dshaper->create($_POST['newdshapetariff'], $_POST['newthreshold1'], $_POST['newthreshold2'], $_POST['newspeed']);
                rcms_redirect("?module=dshaper");
            }
            //timerule editing subroutine
            if (isset($_GET['edit'])) {
                if (isset($_POST['editdshapetariff'])) {
                    $dshaper->edit($_GET['edit'], $_POST['editthreshold1'], $_POST['editthreshold2'], $_POST['editspeed']);
                    rcms_redirect("?module=dshaper");
                }
                //show edit form
                show_window(__('Edit time shaper rule'), $dshaper->renderEditForm($_GET['edit']));
            } else {
                //show rules lister
                show_window('', wf_modalAuto(wf_img('skins/add_icon.png') . ' ' . __('Add new time shaper rule'), __('Create'), $dshaper->renderAddForm(), 'ubButton'));
                show_window(__('Available dynamic shaper time rules'), $dshaper->renderList());
            }
        } else {