Skip to content

Commit 49779a6

Browse files
author
thom
committed
Combine user and interface settings (#5626)
1 parent aab989f commit 49779a6

29 files changed

+249
-65
lines changed

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

interface/web/tools/lib/lang/ar_usersettings.lng

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,4 +9,7 @@ $wb['generate_password_txt'] = 'Generate Password';
99
$wb['repeat_password_txt'] = 'Repeat Password';
1010
$wb['password_mismatch_txt'] = 'The passwords do not match.';
1111
$wb['password_match_txt'] = 'The passwords do match.';
12+
$wb['language_txt'] = 'Language';
13+
$wb['startmodule_txt'] = 'Startmodule';
14+
$wb['app_theme_txt'] = 'Design';
1215
?>

interface/web/tools/lib/lang/bg_usersettings.lng

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,4 +9,7 @@ $wb['generate_password_txt'] = 'Generate Password';
99
$wb['repeat_password_txt'] = 'Repeat Password';
1010
$wb['password_mismatch_txt'] = 'The passwords do not match.';
1111
$wb['password_match_txt'] = 'The passwords do match.';
12+
$wb['language_txt'] = 'Language';
13+
$wb['startmodule_txt'] = 'Startmodule';
14+
$wb['app_theme_txt'] = 'Design';
1215
?>

interface/web/tools/lib/lang/br_usersettings.lng

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,4 +9,7 @@ $wb['generate_password_txt'] = 'Gerar Senha';
99
$wb['repeat_password_txt'] = 'Repetir Senha';
1010
$wb['password_mismatch_txt'] = 'As senhas não coincidem.';
1111
$wb['password_match_txt'] = 'As senhas coincidem.';
12+
$wb['language_txt'] = 'Idioma';
13+
$wb['startmodule_txt'] = 'Módulo Inicial';
14+
$wb['app_theme_txt'] = 'Tema';
1215
?>

interface/web/tools/lib/lang/ca_usersettings.lng

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,4 +9,7 @@ $wb['generate_password_txt'] = 'Générer mot de passe';
99
$wb['repeat_password_txt'] = 'Retaper le mot de passe';
1010
$wb['password_mismatch_txt'] = 'Les mots de passe ne correspondent pas.';
1111
$wb['password_match_txt'] = 'Les mots de passe correspondent.';
12+
$wb['language_txt'] = 'Language';
13+
$wb['startmodule_txt'] = 'Page d\'accueil';
14+
$wb['app_theme_txt'] = 'Interface';
1215
?>

interface/web/tools/lib/lang/cz_usersettings.lng

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,4 +9,7 @@ $wb['repeat_password_txt'] = 'Opakujte heslo';
99
$wb['password_mismatch_txt'] = 'Hesla se neshodují.';
1010
$wb['password_match_txt'] = 'Hesla se shodují.';
1111
$wb['password_txt'] = 'Heslo';
12+
$wb['language_txt'] = 'Jazyk';
13+
$wb['startmodule_txt'] = 'Výchozí modul po přihlášení';
14+
$wb['app_theme_txt'] = 'Výchozí grafické téma';
1215
?>

interface/web/tools/lib/lang/de_usersettings.lng

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,4 +9,7 @@ $wb['generate_password_txt'] = 'Passwort erzeugen';
99
$wb['repeat_password_txt'] = 'Passwort wiederholen';
1010
$wb['password_mismatch_txt'] = 'Die Passwörter stimmen nicht überein.';
1111
$wb['password_match_txt'] = 'Die Passwörter stimmen überein.';
12+
$wb['language_txt'] = 'Sprache';
13+
$wb['startmodule_txt'] = 'Startmodul';
14+
$wb['app_theme_txt'] = 'Design';
1215
?>

interface/web/tools/lib/lang/dk_usersettings.lng

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,4 +9,7 @@ $wb['repeat_password_txt'] = 'Gentage Adgangskode';
99
$wb['password_mismatch_txt'] = 'Adgangskoderne stemmer ikke overens.';
1010
$wb['password_match_txt'] = 'Adgangskoderne stemmer overens.';
1111
$wb['password_txt'] = 'Password';
12+
$wb['language_txt'] = 'Sprog';
13+
$wb['startmodule_txt'] = 'Startmodule';
14+
$wb['app_theme_txt'] = 'Design';
1215
?>

interface/web/tools/lib/lang/el_usersettings.lng

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,4 +9,6 @@ $wb['generate_password_txt'] = 'Generate Password';
99
$wb['repeat_password_txt'] = 'Repeat Password';
1010
$wb['password_mismatch_txt'] = 'The passwords do not match.';
1111
$wb['password_match_txt'] = 'The passwords do match.';
12+
$wb['startmodule_txt'] = 'Startmodule';
13+
$wb['app_theme_txt'] = 'Design';
1214
?>

interface/web/tools/lib/lang/en_usersettings.lng

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,4 +9,11 @@ $wb['generate_password_txt'] = 'Generate Password';
99
$wb['repeat_password_txt'] = 'Repeat Password';
1010
$wb['password_mismatch_txt'] = 'The passwords do not match.';
1111
$wb['password_match_txt'] = 'The passwords do match.';
12+
$wb["language_txt"] = 'Language';
13+
$wb["startmodule_txt"] = 'Startmodule';
14+
$wb["app_theme_txt"] = 'Design';
15+
$wb['startmodule_empty'] = 'Startmodule empty.';
16+
$wb['startmodule_regex'] = 'Invalid chars in Startmodule.';
17+
$wb['app_theme_empty'] = 'App theme empty.';
18+
$wb['app_theme_regex'] = 'Invalid chars in App theme.';
1219
?>

0 commit comments

Comments
 (0)