diff options
Diffstat (limited to 'inc/defaultdata.inc.php')
-rw-r--r-- | inc/defaultdata.inc.php | 204 |
1 files changed, 0 insertions, 204 deletions
diff --git a/inc/defaultdata.inc.php b/inc/defaultdata.inc.php deleted file mode 100644 index 2d993e72..00000000 --- a/inc/defaultdata.inc.php +++ /dev/null @@ -1,204 +0,0 @@ -<?php - -/** - * This class is supposed to fill the database with default entries (where required). - * The insertion should be non-destructive, so if an entry already exists (and - * possibly changed), it should be skipped. - */ -class DefaultData -{ - - public static function populate() - { - self::addSettingCategories(); - self::addSettings(); - } - - /** - * Categories for basic system config / config variables - */ - private static function addSettingCategories() - { - $cats = array( - 1 => 30, // Inactivity/Shutdown - 2 => 50, // Internet access - 3 => 100, // Timesync - 4 => 10, // System config - //5 => 15, // Public Shared folder - 6 => 20000, // Unassigned/no category - 7 => 20, - ); - foreach ($cats as $cat => $sort) { - Database::exec("INSERT IGNORE INTO cat_setting (catid, sortval) VALUES (:catid, :sortval)", array( - 'catid' => $cat, - 'sortval' => $sort - )); - } - } - - /** - * Settings for basic system config - */ - private static function addSettings() - { - $data = array( - array( - 'setting' => 'SLX_ADDONS', - 'catid' => '6', - 'defaultvalue' => 'vmware', - 'permissions' => '2', - 'validator' => '' - ), - array( - 'setting' => 'SLX_BIOS_CLOCK', - 'catid' => '3', - 'defaultvalue' => 'off', - 'permissions' => '2', - 'validator' => 'list:off|local|utc' - ), - array( - 'setting' => 'SLX_LOGOUT_TIMEOUT', - 'catid' => '1', - 'defaultvalue' => '2700', - 'permissions' => '2', - 'validator' => 'regex:/^\d*$/' - ), - array( - 'setting' => 'SLX_NET_DOMAIN', - 'catid' => '2', - 'defaultvalue' => '', - 'permissions' => '2', - 'validator' => '' - ), - array( - 'setting' => 'SLX_NTP_SERVER', - 'catid' => '3', - 'defaultvalue' => '0.de.pool.ntp.org 1.de.pool.ntp.org', - 'permissions' => '2', - 'validator' => '' - ), - array( - 'setting' => 'SLX_PROXY_BLACKLIST', - 'catid' => '2', - 'defaultvalue' => '', - 'permissions' => '2', - 'validator' => '' - ), - array( - 'setting' => 'SLX_PROXY_IP', - 'catid' => '2', - 'defaultvalue' => '', - 'permissions' => '2', - 'validator' => '' - ), - array( - 'setting' => 'SLX_PROXY_MODE', - 'catid' => '2', - 'defaultvalue' => 'off', - 'permissions' => '2', - 'validator' => 'list:off|on|auto' - ), - array( - 'setting' => 'SLX_PROXY_PORT', - 'catid' => '2', - 'defaultvalue' => '', - 'permissions' => '2', - 'validator' => 'regex:/^\d*$/' - ), - array( - 'setting' => 'SLX_PROXY_TYPE', - 'catid' => '2', - 'defaultvalue' => 'socks5', - 'permissions' => '2', - 'validator' => 'list:socks4|socks5|http-connect|http-relay' - ), - array( - 'setting' => 'SLX_REMOTE_LOG_SESSIONS', - 'catid' => '6', - 'defaultvalue' => 'anonymous', - 'permissions' => '2', - 'validator' => 'list:yes|anonymous|no' - ), - array( - 'setting' => 'SLX_ROOT_PASS', - 'catid' => '4', - 'defaultvalue' => '', - 'permissions' => '2', - 'validator' => 'function:linuxPassword' - ), - array( - 'setting' => 'SLX_DEMO_PASS', - 'catid' => '4', - 'defaultvalue' => '', - 'permissions' => '2', - 'validator' => 'function:linuxPassword' - ), - array( - 'setting' => 'SLX_BWIDM_AUTH', - 'catid' => '4', - 'defaultvalue' => 'no', - 'permissions' => '2', - 'validator' => 'list:yes|no' - ), - array( - 'setting' => 'SLX_SHUTDOWN_SCHEDULE', - 'catid' => '1', - 'defaultvalue' => '22:10 00:00', - 'permissions' => '2', - 'validator' => 'regex:/^(\s*\d{1,2}:\d{1,2})*\s*$/' - ), - array( - 'setting' => 'SLX_SHUTDOWN_TIMEOUT', - 'catid' => '1', - 'defaultvalue' => '1200', - 'permissions' => '2', - 'validator' => 'regex:/^\d*$/' - ), - /* - array( - 'setting' => 'SLX_COMMON_SHARE_PATH', - 'catid' => '5', - 'defaultvalue' => '', - 'permissions' => '2', - 'validator' => 'function:networkShare' - ), - array( - 'setting' => 'SLX_COMMON_SHARE_AUTH', - 'catid' => '5', - 'defaultvalue' => 'guest', - 'permissions' => '2', - 'validator' => 'list:guest|user' - ), - */ - array( - 'setting' => 'SLX_BENCHMARK_VM', - 'catid' => '6', - 'defaultvalue' => '', - 'permissions' => '2', - 'validator' => '' - ), - array( - 'setting' => 'SLX_VMCHOOSER_TAB', - 'catid' => '7', - 'defaultvalue' => 'AUTO', - 'permissions' => '2', - 'validator' => 'list:0|1|2|AUTO' - ), - array( - 'setting' => 'SLX_VMCHOOSER_TEMPLATES', - 'catid' => '7', - 'defaultvalue' => 'IGNORE', - 'permissions' => '2', - 'validator' => 'list:IGNORE|BUMP' - ), - array( - 'setting' => 'SLX_VMCHOOSER_FORLOCATION', - 'catid' => '7', - 'defaultvalue' => 'BUMP', - 'permissions' => '2', - 'validator' => 'list:IGNORE|BUMP|EXCLUSIVE' - ), - ); - } - -} |