Пример #1
0
$attr[] = set_s($p, 'ftp_client_disabled', Yii::t('admin', 'Disable the integrated FTP client (net2ftp)'), '', true);
$attr[] = set_s($p, 'user_chunkster', Yii::t('admin', 'Allow Users to run the Chunkster tool'), Yii::t('admin', 'This requires more configuration, see the How-To section on the Multicraft website.'), true);
$attr[] = set_s($p, 'ajax_updates_disabled', Yii::t('admin', 'Disable AJAX updates'), Yii::t('admin', 'Reduces HTTP requests but disables console/chat/status autorefresh'), true);
$attr[] = set_s($p, 'ajax_serverlist', Yii::t('admin', 'Use AJAX in the serverlist for faster loading'), Yii::t('admin', 'This will cause a separate HTTP request for each server visible on the list'), true);
$attr[] = set_s($p, 'sqlitecache_schema', Yii::t('admin', 'Use schema cache to reduce queries'), Yii::t('admin', 'Requires the PDO SQLite extension'), true);
$attr[] = set_s($p, 'sqlitecache_commands', Yii::t('admin', 'Use separate DB for command cache'), Yii::t('admin', 'Requires the PDO SQLite extension'), true);
$attr[] = set_t($p, 'timeout', Yii::t('admin', 'Timeout for client communication'), Yii::t('admin', 'in seconds'), true);
$attr[] = set_s($p, 'superuser_check_only', Yii::t('admin', 'Only check for updates as Superuser'), '', true);
$attr[] = set_s($p, 'register_disabled', Yii::t('admin', 'Disable User Registration'), Yii::t('admin', 'Disables the user registration functionality'), true);
$attr[] = set_t($p, 'login_tries', Yii::t('admin', 'Number of login attempts before blocking'), Yii::t('admin', '0 to disable'), true);
$attr[] = set_t($p, 'login_interval', Yii::t('admin', 'Login block interval'), Yii::t('admin', 'in seconds'), true);
$attr[] = set_t($p, 'reset_token_hours', Yii::t('admin', 'Reset Token Valid for (hours)'), Yii::t('admin', 'The reset token expires after the specified number of hours. Use 0 to disable the password reset functionality.'), true);
$attr[] = set_s($p, 'default_ignore_ip', Yii::t('admin', 'Allow IP change for login sessions by default'), Yii::t('admin', 'Allowing IP changes means that the login session will be considered valid even if a users IP changes. This is useful when logging in on mobile devices but it also means that stolen session cookies will be valid.'), true);
$attr[] = set_s($p, 'api_allow_get', Yii::t('admin', 'Allow GET requests to the API'), '', true);
$attr[] = set_s($p, 'enable_csrf_validation', Yii::t('admin', 'Enable CSRF validation'), '', true);
$attr[] = set_s($p, 'enable_cookie_validation', Yii::t('admin', 'Enable Cookie validation'), '', true);
$attr[] = array('label' => '', 'type' => 'raw', 'value' => CHtml::submitButton(Yii::t('admin', 'Save')));
$this->widget('zii.widgets.CDetailView', array('data' => array(), 'attributes' => $attr));
echo CHtml::endForm();
?>
<br/>
<br/>
<br/>
<br/>
<?php 
echo CHtml::script('
    advShow = false;
    imgOpen = "' . Theme::themeFile('images/icons/open.png') . '";
    imgClosed = "' . Theme::themeFile('images/icons/closed.png') . '";
    txtOpen = "' . Yii::t('admin', 'Hide Advanced Options') . '";
    txtClosed = "' . Yii::t('admin', 'Show Advanced Options') . '";
Пример #2
0
{
    $val = '';
    if (!$list) {
        $val = CHtml::textField('settings[' . $id . ']', @$p['config'][$id]);
    } else {
        $val = CHtml::dropDownList('settings[' . $id . ']', @$p['config'][$id], $list);
    }
    return array('label' => $desc, 'type' => 'raw', 'value' => $val, 'hint' => $hint);
}
function set_s($p, $id, $desc, $hint = '')
{
    return array('label' => $desc, 'type' => 'raw', 'value' => CHtml::dropDownList('settings[' . $id . ']', @$p['config'][$id] ? 'sel_true' : 'sel_false', array('sel_true' => 'True', 'sel_false' => 'False')), 'hint' => $hint);
}
echo 'Basic configuration. More settings will be available in the panel under Settings-&gt;Panel Configuration.<br/><br/>';
$attr[] = array('label' => '', 'type' => 'raw', 'value' => CHtml::submitButton('Save'));
$attr[] = set_t($p, 'admin_email', 'Administrator contact Email', 'empty to hide the "Support" menu entry');
$attr[] = set_s($p, 'api_enabled', 'Enable the Multicraft API');
$attr[] = set_t($p, 'api_ips', Yii::t('admin', 'Restrict API IPs'), Yii::t('admin', 'Only allow these IPs to use the API, empty for no restriction.'));
$attr[] = set_s($p, 'hide_userlist', 'Hide the userlist from normal users');
$attr[] = set_s($p, 'ftp_client_disabled', 'Disable the integrated FTP client (net2ftp)');
$attr[] = set_t($p, 'theme', 'Theme', '', Controller::themeSelection());
$attr[] = set_t($p, 'language', 'Language', '', Controller::languageSelection());
if (@$p['config']['superuser'] != 'admin') {
    $attr[] = set_t($p, 'superuser', 'Root Superuser', 'Please create a user named "admin" and then set this to "admin"');
}
$attr[] = set_t($p, 'daemon_password', 'Password for daemon connections', 'Must be the same as "<b>password</b>" in your "<b>multicraft.conf</b>"');
$attr[] = set_t($p, 'login_tries', 'Number of login attempts before blocking', '0 to disable');
$attr[] = set_s($p, 'status_banner', 'Generate server status banners (requires GD)', '');
$attr[] = array('label' => '', 'type' => 'raw', 'value' => CHtml::submitButton('Save'));
$this->widget('zii.widgets.CDetailView', array('data' => array(), 'attributes' => $attr));
echo CHtml::endForm();