Changeset 632
- Timestamp:
- 06/01/07 18:37:34
(2 years ago)
- Author:
- rats
- Message:
Fixed #333: Variables "{1}" in the Admin Log
Fixed #340: Logo upload not possible
-
Files:
-
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
| r628 |
r632 |
|
| 11 | 11 | \_________________________________________________________________/ |
|---|
| 12 | 12 | |
|---|
| 13 | | 2007-06-01 Henrik Schytte |
|---|
| | 13 | 2007-06-01 Henrik Schytte |
|---|
| 14 | 14 | - GUI |
|---|
| 15 | 15 | * Fixed #325: ispCP wasn't ready for small Screens (1024x768) |
|---|
| 16 | | * Fixed new Icons for the Filemanager, too ;) |
|---|
| | 16 | * Fixed new Icons for the Filemanager, too ;) |
|---|
| 17 | 17 | |
|---|
| 18 | 18 | 2007-06-01 Benedikt Heintel |
|---|
| 19 | 19 | - SETUP |
|---|
| 20 | 20 | * fixed serveral install bugs |
|---|
| | 21 | - GUI |
|---|
| | 22 | * Fixed #333: Variables "{1}" in the Admin Log |
|---|
| | 23 | * Fixed #340: Logo upload not possible |
|---|
| 21 | 24 | |
|---|
| 22 | 25 | 2007-05-31 Benedikt Heintel |
|---|
| r613 |
r632 |
|
| 1 | 1 | <?php |
|---|
| 2 | 2 | /** |
|---|
| 3 | | * ispCP (OMEGA) - Virtual Hosting Control System | Omega Version |
|---|
| | 3 | * ispCP (OMEGA) a Virtual Hosting Control System |
|---|
| 4 | 4 | * |
|---|
| 5 | 5 | * @copyright 2001-2006 by moleSoftware GmbH |
|---|
| … | … | |
| 172 | 172 | $log_message = $rs->fields['log_message']; |
|---|
| 173 | 173 | $replaces = array( |
|---|
| 174 | | '/[^a-zA-Z](delete)[^a-zA-Z]/i' => '<font color="#FF0000"><strong>\\{1}</strong></font>', |
|---|
| 175 | | '/[^a-zA-Z](add)[^a-zA-Z]/i' => '<font color="#CC6600"><strong>\\{1}</strong></font>', |
|---|
| 176 | | '/[^a-zA-Z](change)[^a-zA-Z]/i' => '<font color="#3300FF"><strong>\\{1}</strong></font>', |
|---|
| 177 | | '/[^a-zA-Z](edit)[^a-zA-Z]/i' => '<font color="#CC6600"><strong>\\{1}</strong></font>', |
|---|
| 178 | | '/[^a-zA-Z](unknown)[^a-zA-Z]/i'=> '<font color="#CC00FF"><strong>\\{1}</strong></font>', |
|---|
| 179 | | '/[^a-zA-Z](logged)[^a-zA-Z]/i' => '<font color="#339966"><strong>\\{1}</strong></font>', |
|---|
| 180 | | '/(bad password login data)/i' => '<font color="#FF0000"><strong>\\{1}</strong></font>' |
|---|
| | 174 | '/[^a-zA-Z](delete)[^a-zA-Z]/i' => '<font color="#FF0000"><strong>\\1</strong></font>', |
|---|
| | 175 | '/[^a-zA-Z](add)[^a-zA-Z]/i' => '<font color="#CC6600"><strong>\\1</strong></font>', |
|---|
| | 176 | '/[^a-zA-Z](change)[^a-zA-Z]/i' => '<font color="#3300FF"><strong>\\1</strong></font>', |
|---|
| | 177 | '/[^a-zA-Z](edit)[^a-zA-Z]/i' => '<font color="#CC6600"><strong>\\1</strong></font>', |
|---|
| | 178 | '/[^a-zA-Z](unknown)[^a-zA-Z]/i'=> '<font color="#CC00FF"><strong>\\1</strong></font>', |
|---|
| | 179 | '/[^a-zA-Z](logged)[^a-zA-Z]/i' => '<font color="#339966"><strong>\\1</strong></font>', |
|---|
| | 180 | '/(bad password login data)/i' => '<font color="#FF0000"><strong>\\1</strong></font>' |
|---|
| 181 | 181 | ); |
|---|
| 182 | 182 | |
|---|
| … | … | |
| 209 | 209 | |
|---|
| 210 | 210 | switch ($_POST['uaction_clear']) { |
|---|
| 211 | | |
|---|
| 212 | | case 0: |
|---|
| | 211 | |
|---|
| | 212 | case 0: |
|---|
| 213 | 213 | $query = <<<SQL_QUERY |
|---|
| 214 | 214 | delete |
|---|
| … | … | |
| 217 | 217 | SQL_QUERY; |
|---|
| 218 | 218 | break; |
|---|
| 219 | | |
|---|
| | 219 | |
|---|
| 220 | 220 | case 2: |
|---|
| 221 | 221 | //2 Weeks |
|---|
| 222 | | |
|---|
| 223 | | $query = <<<SQL_QUERY |
|---|
| 224 | | delete |
|---|
| 225 | | from |
|---|
| 226 | | log |
|---|
| 227 | | where |
|---|
| | 222 | |
|---|
| | 223 | $query = <<<SQL_QUERY |
|---|
| | 224 | delete |
|---|
| | 225 | from |
|---|
| | 226 | log |
|---|
| | 227 | where |
|---|
| 228 | 228 | DATE_SUB(CURDATE(), INTERVAL 14 DAY) |
|---|
| 229 | | >= log_time |
|---|
| 230 | | |
|---|
| | 229 | >= log_time |
|---|
| | 230 | |
|---|
| 231 | 231 | SQL_QUERY; |
|---|
| 232 | 232 | |
|---|
| 233 | 233 | break; |
|---|
| 234 | | |
|---|
| | 234 | |
|---|
| 235 | 235 | case 4: |
|---|
| 236 | 236 | $query = <<<SQL_QUERY |
|---|
| … | … | |
| 238 | 238 | from |
|---|
| 239 | 239 | log |
|---|
| 240 | | where |
|---|
| | 240 | where |
|---|
| 241 | 241 | DATE_SUB(CURDATE(), INTERVAL 1 MONTH) |
|---|
| 242 | | >= log_time |
|---|
| 243 | | SQL_QUERY; |
|---|
| 244 | | |
|---|
| | 242 | >= log_time |
|---|
| | 243 | SQL_QUERY; |
|---|
| | 244 | |
|---|
| 245 | 245 | break; |
|---|
| 246 | 246 | case 26: |
|---|
| … | … | |
| 249 | 249 | from |
|---|
| 250 | 250 | log |
|---|
| 251 | | where |
|---|
| | 251 | where |
|---|
| 252 | 252 | DATE_SUB(CURDATE(), INTERVAL 6 MONTH) |
|---|
| 253 | | >= log_time |
|---|
| | 253 | >= log_time |
|---|
| 254 | 254 | SQL_QUERY; |
|---|
| 255 | 255 | break; |
|---|
| 256 | | |
|---|
| | 256 | |
|---|
| 257 | 257 | case 52; |
|---|
| 258 | 258 | $query = <<<SQL_QUERY |
|---|
| … | … | |
| 260 | 260 | from |
|---|
| 261 | 261 | log |
|---|
| 262 | | where |
|---|
| | 262 | where |
|---|
| 263 | 263 | DATE_SUB(CURDATE(), INTERVAL 1 YEAR) |
|---|
| 264 | | >= log_time |
|---|
| 265 | | SQL_QUERY; |
|---|
| 266 | | |
|---|
| | 264 | >= log_time |
|---|
| | 265 | SQL_QUERY; |
|---|
| | 266 | |
|---|
| 267 | 267 | break; |
|---|
| 268 | | |
|---|
| | 268 | |
|---|
| 269 | 269 | } |
|---|
| 270 | | |
|---|
| 271 | | $rs = exec_query($sql, $query, array()); |
|---|
| 272 | | |
|---|
| | 270 | |
|---|
| | 271 | $rs = exec_query($sql, $query, array()); |
|---|
| | 272 | |
|---|
| 273 | 273 | } |
|---|
| 274 | 274 | } |
|---|
| r606 |
r632 |
|
| 1 | 1 | <?php |
|---|
| 2 | 2 | /** |
|---|
| 3 | | * ispCP (OMEGA) - Virtual Hosting Control System | Omega Version |
|---|
| | 3 | * ispCP (OMEGA) a Virtual Hosting Control System |
|---|
| 4 | 4 | * |
|---|
| 5 | 5 | * @copyright 2001-2006 by moleSoftware GmbH |
|---|
| … | … | |
| 18 | 18 | **/ |
|---|
| 19 | 19 | |
|---|
| 20 | | function save_layout(&$sql) |
|---|
| 21 | | { |
|---|
| | 20 | include '../include/ispcp-lib.php'; |
|---|
| | 21 | |
|---|
| | 22 | check_login(); |
|---|
| | 23 | |
|---|
| | 24 | function save_layout(&$sql) { |
|---|
| 22 | 25 | |
|---|
| 23 | 26 | if (isset($_POST['uaction']) && $_POST['uaction'] === 'save_layout') { |
|---|
| … | … | |
| 43 | 46 | } |
|---|
| 44 | 47 | |
|---|
| 45 | | function update_logo() |
|---|
| 46 | | { |
|---|
| | 48 | function update_logo() { |
|---|
| 47 | 49 | global $cfg; |
|---|
| 48 | 50 | |
|---|
| … | … | |
| 85 | 87 | } |
|---|
| 86 | 88 | |
|---|
| 87 | | $fname = $_FILES['logo_file']['name']; |
|---|
| | 89 | $fname = $_FILES['logo_file']['tmp_name']; |
|---|
| 88 | 90 | |
|---|
| 89 | 91 | // Make sure it is really an image |
|---|
| … | … | |
| 93 | 95 | } |
|---|
| 94 | 96 | |
|---|
| 95 | | // $fsize = $_FILES['logo_file']['size']; |
|---|
| | 97 | // $fsize = $_FILES['logo_file']['size']; |
|---|
| 96 | 98 | |
|---|
| 97 | 99 | $newFName = get_user_name($user_id) . '.' . $fext; |
|---|
| … | … | |
| 99 | 101 | $path1 = substr($_SERVER['SCRIPT_FILENAME'],0, strpos($_SERVER['SCRIPT_FILENAME'], '/admin/layout.php')+1); |
|---|
| 100 | 102 | |
|---|
| 101 | | // $path2 = substr($cfg['ROOT_TEMPLATE_PATH'],0, strpos($cfg['ROOT_TEMPLATE_PATH'], '/tpl')+1); |
|---|
| | 103 | // $path2 = substr($cfg['ROOT_TEMPLATE_PATH'],0, strpos($cfg['ROOT_TEMPLATE_PATH'], '/tpl')+1); |
|---|
| 102 | 104 | |
|---|
| 103 | 105 | $logoFile = $path1 . '/themes/user_logos/' . $newFName; |
|---|
| 104 | | move_uploaded_file($_FILES['logo_file']['tmp_name'], $logoFile); |
|---|
| | 106 | move_uploaded_file($fname, $logoFile); |
|---|
| 105 | 107 | chmod ($logoFile, 0644); |
|---|
| 106 | 108 | |
|---|
| … | … | |
| 112 | 114 | } |
|---|
| 113 | 115 | |
|---|
| 114 | | function update_user_gui_props($file_name, $user_id) |
|---|
| 115 | | { |
|---|
| | 116 | function update_user_gui_props($file_name, $user_id) { |
|---|
| 116 | 117 | global $sql; |
|---|
| 117 | 118 | |
|---|
| … | … | |
| 130 | 131 | |
|---|
| 131 | 132 | |
|---|
| 132 | | function gen_def_layout(&$tpl, $user_def_layout) |
|---|
| 133 | | { |
|---|
| | 133 | // unused? can be deleted? |
|---|
| | 134 | /* |
|---|
| | 135 | function gen_def_layout(&$tpl, $user_def_layout) { |
|---|
| 134 | 136 | $layouts = array('blue', 'green', 'red', 'yellow'); |
|---|
| 135 | 137 | |
|---|
| … | … | |
| 158 | 160 | |
|---|
| 159 | 161 | } |
|---|
| 160 | | |
|---|
| 161 | | include '../include/ispcp-lib.php'; |
|---|
| 162 | | |
|---|
| 163 | | check_login(); |
|---|
| | 162 | */ |
|---|
| 164 | 163 | |
|---|
| 165 | 164 | $tpl = new pTemplate(); |
|---|
| … | … | |
| 173 | 172 | |
|---|
| 174 | 173 | |
|---|
| 175 | | |
|---|
| 176 | | |
|---|
| 177 | | |
|---|
| 178 | 174 | save_layout($sql); |
|---|
| 179 | 175 | |
|---|
| 180 | 176 | update_logo(); |
|---|
| 181 | 177 | |
|---|
| 182 | | global $cfg; |
|---|
| 183 | 178 | $theme_color = $cfg['USER_INITIAL_THEME']; |
|---|
| 184 | 179 | |
|---|
|