|
92 | 92 | } |
93 | 93 | } |
94 | 94 | } |
| 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 | + |
95 | 135 |
|
96 | 136 | $form['tabs']['users'] = array ( |
97 | 137 | 'title' => 'Settings', |
|
141 | 181 | 'maxlength' => '2', |
142 | 182 | 'rows' => '', |
143 | 183 | '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' => '' |
144 | 222 | ) |
145 | 223 | //################################# |
146 | 224 | // ENDE Datenbankfelder |
|
0 commit comments