Пример #1
0
  You should have received a copy of the GNU Affero General Public License
  along with this program.  If not, see [http://www.gnu.org/licenses/].

- BoneOS source code is available via svn at [http://svn.code.sf.net/p/boneos/code/].
- look at TeeBX website [http://www.teebx.com] to get details about license.
*/
session_start();
require 'guiconfig.inc';
require_once '/etc/inc/tzdata.lib.php';
require_once '/etc/inc/utils.lib.php';
require 'include/ui.langdef.inc';
require 'libs-php/cfgform.class.php';
// define some constants needed in fbegin.inc to conditionally load some js utilities and style sheets
define('INCLUDE_FORMSTYLE', true);
// instantiate the config form object
$form = new cfgForm('sys_general.php', 'method=post|name=iform|id=iform');
// set session name
$sessionName = 'frmSysGenCfg';
// set pointers to the actual configuration variables
$cfgPtr['hostname'] =& $config['system']['hostname'];
$cfgPtr['domain'] =& $config['system']['domain'];
$cfgPtr['username'] =& $config['system']['username'];
$cfgPtr['password'] =& $config['system']['password'];
$cfgPtr['webuiport'] =& $config['system']['webgui']['port'];
$cfgPtr['language'] =& $config['system']['webgui']['language'];
$cfgPtr['timezone'] =& $config['system']['timezone'];
$cfgPtr['timeupdateinterval'] =& $config['system']['time-update-interval'];
$cfgPtr['timeservers'] =& $config['system']['timeservers'];
// this content is stored encoded as base64
//$cfgPtr['notes'] = &$config['system']['notes'];
//
Пример #2
0
  but WITHOUT ANY WARRANTY; without even the implied warranty of
  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  GNU Affero General Public License for more details.

  You should have received a copy of the GNU Affero General Public License
  along with this program.  If not, see [http://www.gnu.org/licenses/].

- TeeBX Source code is available via svn at [http://code.google.com/p/teebx/source/checkout].
- look at TeeBX website [http://www.teebx.com] to get details about license.
*/
session_start();
require 'guiconfig.inc';
require 'appliancebone.lib.php';
require 'libs-php/cfgform.class.php';
define('INCLUDE_FORMSTYLE', true);
$form = new cfgForm('sys_logs.php', 'method=post|name=iform|id=iform');
// set a pointer to the actual configuration variables
$cfgPtr =& $config['system']['syslog'];
// set session name
$sessionName = 'frmSyslogCfg';
if ($_POST) {
    $form->wake($_SESSION[$sessionName]);
    $form->validForm();
    $input_errors = $form->get_errQueue();
    if (count($input_errors) == 0) {
        $cfgPtr['mode'] = $form->getFieldSelectedOpts('mode');
        $cfgPtr['buffer'] = $form->getFieldSelectedOpts('buffer');
        $host = $form->getTextFld('remotehost');
        unset($cfgPtr['remotehost'], $cfgPtr['remoteport']);
        if ($host != '') {
            $cfgPtr['remotehost'] = $form->getTextFld('remotehost');
Пример #3
0
// initialize local variables
//
// set a pointer to the actual configuration variables
$cfgPtr =& $config['system']['storage'];
// form object session name
$cfgSvcName = 'frmSvcCfg';
// json return data
$data = array();
$data['retval'] = 1;
$data['errors'] = array();
// basics checks
if (!isset($_POST)) {
    $data['errors'][] = _('Missing parameters, process aborted!');
}
// instantiate the service binding configuration form object
$confForm = new cfgForm('sys_storage_edit.php', 'method=post|name=confform|id=confform');
// get back the form object state and update it according to user input
$confForm->wake($_SESSION[$cfgSvcName]);
// validate user input
$confForm->validForm();
$data['errors'] = $confForm->get_errQueue();
// something failed?
if (count($data['errors']) > 0) {
    exit(json_encode($data));
}
$svcMount = $confForm->getFldValue('fsmount');
$cfgPtr['fsmounts'][$svcMount]['uuid'] = $confForm->getFldValue('uuid');
$cfgPtr['fsmounts'][$svcMount]['label'] = $confForm->getFldValue('label');
$cfgPtr['fsmounts'][$svcMount]['filesystem'] = $confForm->getFldValue('filesystem');
$cfgPtr['fsmounts'][$svcMount]['comment'] = $confForm->getFldValue('desc');
$cfgPtr['fsmounts'][$svcMount]['active'] = $confForm->getFldValue('active');
Пример #4
0
                }
                $accessAllowed = true;
            }
        }
    }
}
// forbidden
if (!$accessAllowed) {
    //redirect to an error page
    include 'include/blankpagetpl.php';
    exit;
}
// instantiate the disk initialization form object
$initForm = new cfgForm('sys_storage_init.php', 'method=post|name=iform|id=iform');
// instantiate the service binding configuration form object
$confForm = new cfgForm('sys_services_set.php', 'method=post|name=confform|id=confform');
$cfgSvcName = 'frmSvcCfg';
// label for the device fieldset
$fsetLabel = $_POST['dev'];
$devModel = getDevModel($_POST['dev']);
if ($devModel !== false) {
    $fsetLabel .= " ({$devModel})";
}
// inizialization UI
$initForm->startFieldset('fset_init', _('Disk Device') . ": {$fsetLabel}");
$initForm->startBlock('rw_label');
$initForm->setLabel(null, _('Partition label'), 'label', 'class=labelcol');
$initForm->startBlock('rw_label', 'right');
$initForm->setField('part_label', 'text', 'size=11|maxlength=11|class=required', false, '');
$initForm->setInputText('part_label', $partLabel);
$initForm->setBlockHint('part_label', _('Enter the label for this disk partition.') . '<br>' . _('Only letters A-z, numbers and underscore allowed.'));
Пример #5
0
$cfgPtr['exthostname'] =& $config['interfaces']['lan']['exthostname'];
// dynamic dns settings
$cfgPtr['hostnameupdatesrc'] =& $config['interfaces']['lan']['hostnameupdatesrc'];
$cfgPtr['dyndnsusername'] =& $config['dyndns']['username'];
$cfgPtr['dyndnspassword'] =& $config['dyndns']['password'];
$cfgPtr['dyndnstype'] =& $config['dyndns']['type'];
$cfgPtr['dyndnsenable'] =& $config['dyndns']['enable'];
$cfgPtr['dyndnswildcard'] =& $config['dyndns']['wildcard'];
// static routes
$cfgPtr['route'] =& $config['system']['staticroutes']['route'];
// get ethernet interfaces list
$netInterfaces = network_get_interfaces();
// temporary variable to check later if static ip address is changed
$oldIpaddr = $netInterfaces[$cfgPtr['if']]['ipaddr'];
// instantiate the config form object
$form = new cfgForm('sys_network.php', 'method=post|name=iform|id=iform');
// initialize form
$form->startWrapper('tab-1');
$form->startFieldset('fset_lanport', _('Port') . " {$cfgPtr['if']} ({$netInterfaces[$cfgPtr['if']]['mac']})");
// if address mode selector
$form->startBlock('rw_usedhcp');
$form->setLabel(null, _('Settings'), 'dhcp', 'class=labelcol');
$form->startBlock('rw_usedhcp', 'right');
$form->setField('dhcp', 'select', 'name=dhcp', false, 'yes');
$selectOpts['yes'] = _('configured via DHCP client');
$selectOpts['no'] = _('configured manually');
$form->setSelectOptFill('dhcp', $selectOpts);
$form->setFieldOptionsState('dhcp', $cfgPtr['dhcp']);
unset($selectOpts);
//
$form->exitBlock();
Пример #6
0
                    system_reboot();
                    $keepmsg = _('The configuration has been restored. The PBX is now rebooting.');
                } else {
                    $errstr = _('The configuration could not be restored.');
                    if ($xmlerr) {
                        $errstr .= " (" . sprintf(_("XML error: %s") . ")", $xmlerr);
                    }
                    $input_errors[] = $errstr;
                }
            } else {
                $input_errors[] = _('The configuration could not be restored (file upload error).');
            }
        }
    }
}
$form = new cfgForm('maint_backup.php', 'enctype=multipart/form-data|method=post|name=iform|id=iform');
// initialize form
$form->startWrapper('tab-1');
// let user choose the task
$form->startFieldset('fset_task', _('Task selection'));
$form->startBlock('rw_task');
$form->setLabel(null, _('Task'), 'bck_task', 'class=labelcol');
$form->startBlock('rw_task', 'right');
$form->setField('bck_task', 'select', 'name=task');
$taskOpts['backup'] = _('Backup');
$taskOpts['restore'] = _('Restore');
$form->setSelectOptFill('bck_task', $taskOpts);
$form->setFieldOptionsState('bck_task', 'backup');
//
$form->exitBlock();
$form->startBlock('rw_file');