Esempio n. 1
0
            $nasbwdurl = mysql_real_escape_string($_POST['editnasbwdurl']);
            $netid = vf($_POST['networkselect']);
            simple_update_field('nas', 'nastype', $nastype, $targetnas);
            simple_update_field('nas', 'nasip', $nasip, $targetnas);
            simple_update_field('nas', 'nasname', $nasname, $targetnas);
            simple_update_field('nas', 'bandw', $nasbwdurl, $targetnas);
            simple_update_field('nas', 'netid', $netid, $targetnas);
            zb_NasConfigSave();
            log_register("NAS EDIT " . $nasip);
            rcms_redirect("?module=nas&edit=" . $nasid);
        }
        $nasdata = zb_NasGetData($nasid);
        $currentnetid = $nasdata['netid'];
        $currentnasip = $nasdata['nasip'];
        $currentnasname = $nasdata['nasname'];
        $currentnastype = $nasdata['nastype'];
        $currentbwdurl = $nasdata['bandw'];
        $nastypes = array('local' => 'Local NAS', 'rscriptd' => 'rscriptd', 'mikrotik' => 'MikroTik', 'radius' => 'Radius');
        $editinputs = multinet_network_selector($currentnetid) . "<br>";
        $editinputs .= wf_Selector('editnastype', $nastypes, 'NAS type', $currentnastype, true);
        $editinputs .= wf_TextInput('editnasip', 'IP', $currentnasip, true, '15');
        $editinputs .= wf_TextInput('editnasname', 'NAS name', $currentnasname, true, '15');
        $editinputs .= wf_TextInput('editnasbwdurl', 'Bandwidthd URL', $currentbwdurl, true, '25');
        $editinputs .= wf_Submit('Save');
        $editform = wf_Form('', 'POST', $editinputs, 'glamour');
        show_window(__('Edit') . ' NAS', $editform);
        show_window('', wf_Link("?module=nas", 'Back', true, 'ubButton'));
    }
} else {
    show_error(__('You cant control this module'));
}
Esempio n. 2
0
function multinet_show_service_add_form()
{
    $form = '
        <form action="" method="POST" class="glamour">
        <input type="hidden" name="serviceadd" value="true">
        ' . multinet_network_selector() . ' ' . __('Service network') . ' <br>
        <input type="text" name="servicename" size="15"> ' . __('Service description') . '<sup>*</sup> <br>
        <input type="submit" value="' . __('Add') . '">
        </form>
        <div style="clear:both;"></div>
        ';
    show_window(__('Add service'), $form);
}
Esempio n. 3
0
 function web_MigrationPreprocessing($filename, $delimiter, $encoding)
 {
     $path = 'exports/';
     $raw_data = file_get_contents($path . $filename);
     $parsed_data = array();
     if ($encoding != 'utf-8') {
         $raw_data = iconv($encoding, 'utf-8', $raw_data);
     }
     $raw_data = explodeRows($raw_data);
     if (!empty($raw_data)) {
         foreach ($raw_data as $eachrow) {
             if (!empty($eachrow)) {
                 $parsed_data[] = explode($delimiter, $eachrow);
             }
         }
     }
     if (sizeof($parsed_data) > 1) {
         $col_count = sizeof($parsed_data[0]);
         $cells = wf_TableCell(__('Column number'));
         $cells .= wf_TableCell(__('Column content'));
         $rows = wf_TableRow($cells, 'row1');
         foreach ($parsed_data[0] as $col_num => $col_data) {
             $cells = wf_TableCell($col_num);
             $cells .= wf_TableCell($col_data);
             $rows .= wf_TableRow($cells, 'row3');
         }
         $first_row = wf_TableBody($rows, '100%', '0', '');
         show_window(__('Found count of data columns'), $col_count);
         show_window(__('First of imported data rows'), $first_row);
         //construct of data processing form
         $rowNumArr = array();
         for ($i = 0; $i < $col_count; $i++) {
             $rowNumArr[$i] = $i;
         }
         $login_arr = $rowNumArr + array('RANDOM' => __('Generate Random'));
         $password_arr = $rowNumArr + array('RANDOM' => __('Generate Random'));
         $ip_arr = $rowNumArr;
         $mac_arr = $rowNumArr + array('RANDOM' => __('Generate Random'));
         $tariff_arr = $rowNumArr;
         $cash_arr = $rowNumArr;
         $credit_arr = $rowNumArr + array('ZERO' => __('Set to zero'));
         $creditex_arr = $rowNumArr + array('NONE' => __('Set to none'));
         $phone_arr = $rowNumArr + array('NONE' => __('Set to none'));
         $mobile_arr = $rowNumArr + array('NONE' => __('Set to none'));
         $email_arr = $rowNumArr + array('NONE' => __('Set to none'));
         $address_arr = $rowNumArr + array('NONE' => __('Set to none'));
         $realname_arr = $rowNumArr + array('NONE' => __('Set to none'));
         $contract_arr = $rowNumArr + array('NONE' => __('Set to none'));
         $ao_arr = $rowNumArr + array('AO_1' => __('AlwaysOnline=1'));
         $down_arr = $rowNumArr + array('DOWN_0' => __('Down=0'));
         $passive_arr = $rowNumArr + array('PASSIVE_0' => __('Passive=0'));
         $regtype_arr = array('SQL' => 'Show SQL dump', 'UB' => 'Ubilling live register');
         //data column setting form
         $inputs = wf_Selector('login_col', $login_arr, __('User login'), '', true);
         $inputs .= wf_Selector('password_col', $password_arr, __('User password'), '', true);
         $inputs .= wf_Selector('ip_col', $ip_arr, __('User IP'), '', true);
         $inputs .= wf_Selector('mac_col', $mac_arr, __('User MAC'), '', true);
         $inputs .= wf_Selector('tariff_col', $tariff_arr, __('User tariff'), '', true);
         $inputs .= wf_Selector('cash_col', $cash_arr, __('User cash'), '', true);
         $inputs .= wf_Selector('credit_col', $credit_arr, __('User credit limit'), '', true);
         $inputs .= wf_Selector('creditex_col', $creditex_arr, __('User credit expire date'), '', true);
         $inputs .= wf_Selector('phone_col', $phone_arr, __('User phone'), '', true);
         $inputs .= wf_Selector('mobile_col', $mobile_arr, __('User mobile'), '', true);
         $inputs .= wf_Selector('email_col', $email_arr, __('User email'), '', true);
         $inputs .= wf_Selector('address_col', $address_arr, __('User address'), '', true);
         $inputs .= wf_Selector('realname_col', $realname_arr, __('User realname'), '', true);
         $inputs .= wf_Selector('contract_col', $contract_arr, __('User contract'), '', true);
         $inputs .= wf_Selector('ao_col', $ao_arr, __('User AlwaysOnline state'), '', true);
         $inputs .= wf_Selector('down_col', $down_arr, __('User Down state'), '', true);
         $inputs .= wf_Selector('passive_col', $passive_arr, __('User Passive state'), '', true);
         $inputs .= wf_Selector('regtype', $regtype_arr, __('User registration mode'), '', true);
         $inputs .= multinet_network_selector() . __('Target network') . wf_delimiter();
         $inputs .= wf_HiddenInput('import_rawdata', base64_encode(serialize($parsed_data)));
         $inputs .= wf_Submit('Save this column pointers and continue import');
         $colform = wf_Form("?module=migration&setpointers=true", 'POST', $inputs, 'glamour');
         show_window(__('Select data columns and their values'), $colform);
     } else {
         show_error(__('Parsing error'));
     }
 }
Esempio n. 4
0
function dhcp_show_add_form()
{
    $form = '
        <form action="" method="POST">
        ' . multinet_network_selector() . ' ' . __('Network') . '<br>
        <input type="hidden" name="adddhcp">
        <input type="hidden" name="dhcpconfig"> <!-- ' . __('DHCP config') . '<br> -->
        <input type="text" name="dhcpconfname"> ' . __('DHCP config name') . '<br>
        <input type="submit" value="' . __('Save') . '">
        </form>
        ';
    show_window(__('Add DHCP network'), $form);
}
Esempio n. 5
0
/**
 * Retruns nas creation form
 * 
 * @return string
 */
function web_NasAddForm()
{
    $nastypes = array('local' => 'Local NAS', 'rscriptd' => 'rscriptd', 'mikrotik' => 'MikroTik', 'radius' => 'Radius');
    $inputs = multinet_network_selector() . wf_tag('label', false, '', 'for="networkselect"') . __('Network') . wf_tag('label', true) . wf_tag('br');
    $inputs .= wf_Selector('newnastype', $nastypes, __('NAS type'), '', true);
    $inputs .= wf_TextInput('newnasip', __('IP'), '', true);
    $inputs .= wf_TextInput('newnasname', __('NAS name'), '', true);
    $inputs .= wf_TextInput('newbandw', __('Bandwidthd URL'), '', true);
    $inputs .= wf_Submit(__('Create'));
    $form = wf_Form('', 'POST', $inputs, 'glamour');
    return $form;
}