Example #1
0
                if (isset($wancfg['wireless'])) {
                    handle_wireless_post();
                }
                conf_mount_ro();
                write_config();
                if (file_exists("{$g['tmp_path']}/.interfaces.apply")) {
                    $toapplylist = unserialize(file_get_contents("{$g['tmp_path']}/.interfaces.apply"));
                } else {
                    $toapplylist = array();
                }
                $toapplylist[$if]['ifcfg'] = $old_wancfg;
                $toapplylist[$if]['ppps'] = $old_ppps;
                file_put_contents("{$g['tmp_path']}/.interfaces.apply", serialize($toapplylist));
                mark_subsystem_dirty('interfaces');
                /* regenerate cron settings/crontab file */
                configure_cron();
                header("Location: interfaces.php?if={$if}");
                exit;
            }
        }
    }
}
// end if ($_POST)
function handle_wireless_post()
{
    global $_POST, $config, $g, $wancfg, $if, $wl_countries_attr, $wlanbaseif;
    if (!is_array($wancfg['wireless'])) {
        $wancfg['wireless'] = array();
    }
    $wancfg['wireless']['standard'] = $_POST['standard'];
    $wancfg['wireless']['mode'] = $_POST['mode'];
 function snort_deinstall_cron($cronmatch)
 {
     global $config, $g;
     if (!$config['cron']['item']) {
         return;
     }
     $x = 0;
     $is_installed = false;
     foreach ($config['cron']['item'] as $item) {
         if (strstr($item['command'], $cronmatch)) {
             $is_installed = true;
             break;
         }
         $x++;
     }
     if ($is_installed == true) {
         unset($config['cron']['item'][$x]);
     }
     configure_cron();
 }