Skip to content

Commit d0e7a8f

Browse files
author
Till Brehm
committed
Merge branch '5626-tools' into 'stable-3.1'
Combine Tools -> Password & Language and Tools ->Interface See merge request ispconfig/ispconfig3!1073
2 parents 489ff51 + 94ba1c2 commit d0e7a8f

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

57 files changed

+249
-594
lines changed

interface/web/tools/form/interface_settings.tform.php

Lines changed: 0 additions & 189 deletions
This file was deleted.

interface/web/tools/form/user_settings.tform.php

Lines changed: 78 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,46 @@
9292
}
9393
}
9494
}
95+
//* Pick out modules
96+
//* TODO: limit to activated modules of the user
97+
$modules_list = array();
98+
if($_SESSION["s"]["user"]["typ"] == 'admin') {
99+
$handle = @opendir(ISPC_WEB_PATH);
100+
while ($file = @readdir($handle)) {
101+
if ($file != '.' && $file != '..') {
102+
if(@is_dir(ISPC_WEB_PATH."/$file")) {
103+
if(is_file(ISPC_WEB_PATH."/$file/lib/module.conf.php") and $file != 'login' && $file != 'designer' && $file != 'mailuser') {
104+
$modules_list[$file] = $file;
105+
}
106+
}
107+
}
108+
}
109+
} else {
110+
$tmp = $app->db->queryOneRecord("SELECT * FROM sys_user where username = ?", $_SESSION["s"]["user"]['username']);
111+
$modules = $tmp['modules'];
112+
//$modules = $conf['interface_modules_enabled'];
113+
if($_SESSION["s"]["user"]["typ"] != 'admin' && $app->auth->has_clients($_SESSION['s']['user']['userid'])) {
114+
$modules .= ',client';
115+
}
116+
$tmp = explode(',', $modules);
117+
foreach($tmp as $m) {
118+
$modules_list[$m] = $m;
119+
}
120+
}
121+
122+
//* Load themes
123+
$themes_list = array();
124+
$handle = @opendir(ISPC_THEMES_PATH);
125+
while ($file = @readdir($handle)) {
126+
if (substr($file, 0, 1) != '.') {
127+
if(@is_dir(ISPC_THEMES_PATH."/$file")) {
128+
if(!file_exists(ISPC_THEMES_PATH."/$file/ispconfig_version") || (@file_exists(ISPC_THEMES_PATH."/$file/ispconfig_version") && trim(@file_get_contents(ISPC_THEMES_PATH."/$file/ispconfig_version")) == ISPC_APP_VERSION)) {
129+
$themes_list[$file] = $file;
130+
}
131+
}
132+
}
133+
}
134+
95135

96136
$form['tabs']['users'] = array (
97137
'title' => 'Settings',
@@ -141,6 +181,44 @@
141181
'maxlength' => '2',
142182
'rows' => '',
143183
'cols' => ''
184+
),
185+
'startmodule' => array (
186+
'datatype' => 'VARCHAR',
187+
'formtype' => 'SELECT',
188+
'validators' => array ( 0 => array ( 'type' => 'NOTEMPTY',
189+
'errmsg'=> 'startmodule_empty'),
190+
1 => array ( 'type' => 'REGEX',
191+
'regex' => '/^[a-z0-9\_]{0,64}$/',
192+
'errmsg'=> 'startmodule_regex'),
193+
),
194+
'regex' => '',
195+
'errmsg' => '',
196+
'default' => '',
197+
'value' => $modules_list,
198+
'separator' => '',
199+
'width' => '30',
200+
'maxlength' => '255',
201+
'rows' => '',
202+
'cols' => ''
203+
),
204+
'app_theme' => array (
205+
'datatype' => 'VARCHAR',
206+
'formtype' => 'SELECT',
207+
'validators' => array ( 0 => array ( 'type' => 'NOTEMPTY',
208+
'errmsg'=> 'app_theme_empty'),
209+
1 => array ( 'type' => 'REGEX',
210+
'regex' => '/^[a-z0-9\_]{0,64}$/',
211+
'errmsg'=> 'app_theme_regex'),
212+
),
213+
'regex' => '',
214+
'errmsg' => '',
215+
'default' => 'default',
216+
'value' => $themes_list,
217+
'separator' => '',
218+
'width' => '30',
219+
'maxlength' => '255',
220+
'rows' => '',
221+
'cols' => ''
144222
)
145223
//#################################
146224
// ENDE Datenbankfelder

0 commit comments

Comments
 (0)