Changeset 707
- Timestamp:
- 07/17/07 00:18:17 (17 months ago)
- Location:
- trunk
- Files:
-
- 1 added
- 12 modified
-
CHANGELOG (modified) (1 diff)
-
configs/database/database.sql (modified) (1 diff)
-
gui/admin/settings.php (modified) (2 diffs)
-
gui/client/add_mail_acc.php (modified) (1 diff)
-
gui/client/catchall.php (modified) (5 diffs)
-
gui/client/edit_alias.php (modified) (3 diffs)
-
gui/client/index.php (modified) (1 diff)
-
gui/include/ispcp-lib.php (modified) (1 diff)
-
gui/include/login-functions.php (modified) (4 diffs)
-
gui/lostpassword.php (modified) (1 diff)
-
gui/themes/omega_original/admin/settings.tpl (modified) (1 diff)
-
gui/themes/omega_original/client/add_mail_acc.tpl (modified) (3 diffs)
-
gui/themes/omega_original/css/tooltip.js (added)
Legend:
- Unmodified
- Added
- Removed
-
trunk/CHANGELOG
r706 r707 8 8 | * gui: disable stats-alias in client menu | 9 9 \_________________________________________________________________/ 10 11 2007-07-16 Benedikt Heintel 12 - GUI: 13 * Fixed #457: Improved max-attempts limit for lost password's CAPTCHA 14 * Fixed serveral errors. 15 - SQL: 16 * Added: cpatcha_count on table login in database.sql 10 17 11 18 2007-07-16 Raphael Geissert -
trunk/configs/database/database.sql
r625 r707 359 359 `ipaddr` varchar(15) default NULL, 360 360 `lastaccess` int(10) unsigned default NULL, 361 `login_count` tinyint(1) default NULL, 361 `login_count` tinyint(1) default 0, 362 `captcha_count` tinyint(1) default 0, 362 363 `user_name` varchar(255) default NULL 363 364 ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; -
trunk/gui/admin/settings.php
r685 r707 83 83 'BRUTEFORCE_BLOCK_TIME_VALUE' => $cfg['BRUTEFORCE_BLOCK_TIME'], 84 84 'BRUTEFORCE_BETWEEN_TIME_VALUE' => $cfg['BRUTEFORCE_BETWEEN_TIME'], 85 'BRUTEFORCE_MAX_CAPTCHA' => $cfg['BRUTEFORCE_MAX_CAPTCHA'], 85 86 'DOMAIN_ROWS_PER_PAGE' => $cfg['DOMAIN_ROWS_PER_PAGE'] 86 87 ) … … 141 142 'TR_BRUTEFORCE_BLOCK_TIME' => tr('Blocktime (minutes)'), 142 143 'TR_BRUTEFORCE_BETWEEN_TIME' => tr('Block time between logins (seconds)'), 144 'TR_BRUTEFORCE_MAX_CAPTCHA' => tr('Max number of Chapcha geraneration'), 143 145 'TR_OTHER_SETTINGS' => tr('Other settings'), 144 146 'TR_USER_INITIAL_LANG' => tr('Default language'), -
trunk/gui/client/add_mail_acc.php
r702 r707 1 1 <?php 2 2 /** 3 * ispCP (OMEGA) - Virtual Hosting Control System | Omega Version3 * ispCP ω (OMEGA) a Virtual Hosting Control System 4 4 * 5 5 * @copyright 2001-2006 by moleSoftware GmbH -
trunk/gui/client/catchall.php
r662 r707 1 1 <?php 2 2 /** 3 * ispCP (OMEGA) - Virtual Hosting Control System | Omega Version 4 * 5 * @copyright 2001-2006 by moleSoftware GmbH 6 * @copyright 2006-2007 by ispCP | http://isp-control.net 7 * @link http://isp-control.net 8 * @author ispCP Team (2007) 9 * 10 * @license 11 * This program is free software; you can redistribute it and/or modify it under 12 * the terms of the MPL General Public License as published by the Free Software 13 * Foundation; either version 1.1 of the License, or (at your option) any later 14 * version. 15 * You should have received a copy of the MPL Mozilla Public License along with 16 * this program; if not, write to the Open Source Initiative (OSI) 17 * http://opensource.org | osi@opensource.org 18 **/ 19 3 * ispCP ω (OMEGA) a Virtual Hosting Control System 4 * 5 * @copyright 2001-2006 by moleSoftware GmbH 6 * @copyright 2006-2007 by ispCP | http://isp-control.net 7 * @link http://isp-control.net 8 * @author ispCP Team (2007) 9 * @license This program is free software; you can redistribute it and/or modify it under 10 * the terms of the MPL General Public License as published by the Free Software 11 * Foundation; either version 1.1 of the License, or (at your option) any later 12 * version. 13 * You should have received a copy of the MPL Mozilla Public License along with 14 * this program; if not, write to the Open Source Initiative (OSI) 15 * http://opensource.org | osi@opensource.org 16 */ 20 17 21 18 require '../include/ispcp-lib.php'; … … 24 21 25 22 $tpl = new pTemplate(); 26 27 $tpl -> define_dynamic('page', $cfg['CLIENT_TEMPLATE_PATH'].'/catchall.tpl'); 28 29 $tpl -> define_dynamic('page_message', 'page'); 30 31 $tpl -> define_dynamic('logged_from', 'page'); 32 33 $tpl -> define_dynamic('mail_message', 'page'); 34 35 $tpl -> define_dynamic('mail_item', 'page'); 36 37 $tpl -> define_dynamic('mail_auto_respond', 'mail_item'); 38 39 $tpl -> define_dynamic('mails_total', 'page'); 40 41 $tpl -> define_dynamic('catchall_message', 'page'); 42 43 $tpl -> define_dynamic('catchall_item', 'page'); 44 45 $tpl -> define_dynamic('ftp_message', 'page'); 46 47 $tpl -> define_dynamic('ftp_item', 'page'); 48 49 $tpl -> define_dynamic('no_mails', 'page'); 50 51 // 23 $tpl->define_dynamic('page', $cfg['CLIENT_TEMPLATE_PATH'] . '/catchall.tpl'); 24 $tpl->define_dynamic('page_message', 'page'); 25 $tpl->define_dynamic('logged_from', 'page'); 26 $tpl->define_dynamic('mail_message', 'page'); 27 $tpl->define_dynamic('mail_item', 'page'); 28 $tpl->define_dynamic('mail_auto_respond', 'mail_item'); 29 $tpl->define_dynamic('mails_total', 'page'); 30 $tpl->define_dynamic('catchall_message', 'page'); 31 $tpl->define_dynamic('catchall_item', 'page'); 32 $tpl->define_dynamic('ftp_message', 'page'); 33 $tpl->define_dynamic('ftp_item', 'page'); 34 $tpl->define_dynamic('no_mails', 'page'); 35 52 36 // page functions. 53 // 54 55 function gen_user_mail_action($mail_id, $mail_status) 56 { 57 37 38 function gen_user_mail_action($mail_id, $mail_status) { 58 39 global $cfg; 59 40 60 61 62 41 if ($mail_status === $cfg['ITEM_OK_STATUS']) { 63 64 return array(tr('Delete'), "delete_mail_acc.php?id=$mail_id", "edit_mail_acc.php?id=$mail_id"); 65 66 } else { 67 42 return array(tr('Delete'), "delete_mail_acc.php?id=$mail_id", "edit_mail_acc.php?id=$mail_id"); 43 } else { 68 44 return array(tr('N/A'), '#', '#'); 69 70 } 71 } 72 73 function gen_user_mail_auto_respond(&$tpl, $mail_id, $mail_type, $mail_status, $mail_auto_respond) 74 { 75 45 } 46 } 47 48 function gen_user_mail_auto_respond(&$tpl, $mail_id, $mail_type, $mail_status, $mail_auto_respond) { 76 49 global $cfg; 77 50 78 51 if (preg_match('/_mail$/', $mail_type) == 1) { 79 80 52 if ($mail_status === $cfg['ITEM_OK_STATUS']) { 81 82 53 if ($mail_auto_respond === '_no_') { 83 84 $tpl -> assign( 85 array( 86 'AUTO_RESPOND_ACTION' => tr('Enable'), 87 'AUTO_RESPOND_ACTION_SCRIPT' => "enable_mail_arsp.php?id=$mail_id" 88 ) 89 ); 90 54 $tpl->assign( 55 array('AUTO_RESPOND_ACTION' => tr('Enable'), 56 'AUTO_RESPOND_ACTION_SCRIPT' => "enable_mail_arsp.php?id=$mail_id" 57 ) 58 ); 91 59 } else { 92 93 $tpl -> assign( 94 array( 95 'AUTO_RESPOND_ACTION' => tr('Disable'), 96 'AUTO_RESPOND_ACTION_SCRIPT' => "disable_mail_arsp.php?id=$mail_id" 97 ) 98 ); 99 60 $tpl->assign( 61 array('AUTO_RESPOND_ACTION' => tr('Disable'), 62 'AUTO_RESPOND_ACTION_SCRIPT' => "disable_mail_arsp.php?id=$mail_id" 63 ) 64 ); 100 65 } 101 102 $tpl -> parse('MAIL_AUTO_RESPOND', 'mail_auto_respond'); 103 66 $tpl->parse('MAIL_AUTO_RESPOND', 'mail_auto_respond'); 104 67 } else { 105 106 $tpl -> assign('MAIL_AUTO_RESPOND', ''); 107 68 $tpl->assign('MAIL_AUTO_RESPOND', ''); 108 69 } 109 110 } else { 111 112 $tpl -> assign('MAIL_AUTO_RESPOND', ''); 113 114 } 115 116 } 117 118 function gen_page_dmn_mail_list(&$tpl, &$sql, $dmn_id, $dmn_name) 119 { 120 70 } else { 71 $tpl->assign('MAIL_AUTO_RESPOND', ''); 72 } 73 } 74 75 function gen_page_dmn_mail_list(&$tpl, &$sql, $dmn_id, $dmn_name) { 121 76 $dmn_query = <<<SQL_QUERY 122 123 77 select 124 125 78 mail_id, mail_acc, mail_type, status, mail_auto_respond 126 127 79 from 128 129 80 mail_users 130 131 81 where 132 133 82 domain_id = '$dmn_id' 134 135 83 and 136 137 84 sub_id = 0 138 139 85 and 140 141 86 (mail_type = 'normal_mail' 142 87 or 143 88 mail_type = 'normal_forward') 144 145 89 order by 146 147 90 mail_type desc, 148 149 91 mail_id 150 151 92 SQL_QUERY; 152 93 153 94 $rs = execute_query($sql, $dmn_query); 154 95 155 if ($rs -> RecordCount() == 0) { 156 96 if ($rs->RecordCount() == 0) { 157 97 return 0; 158 159 } else { 160 161 while (!$rs -> EOF) { 162 163 list($mail_action, $mail_action_script, $mail_edit_script) = gen_user_mail_action($rs -> fields['mail_id'], $rs -> fields['status']); 164 165 $mail_acc = decode_idna($rs -> fields['mail_acc']); 166 167 $show_dmn_name = decode_idna($dmn_name); 168 169 170 $tpl -> assign( 171 array( 172 'MAIL_ACC' => $mail_acc."@".$show_dmn_name, 173 'MAIL_TYPE' => user_trans_mail_type($rs -> fields['mail_type']), 174 'MAIL_STATUS' => translate_dmn_status($rs -> fields['status']), 175 'MAIL_ACTION' => $mail_action, 176 'MAIL_ACTION_SCRIPT' => $mail_action_script, 177 'MAIL_EDIT_SCRIPT' => $mail_edit_script 178 ) 179 ); 98 } else { 99 while (!$rs->EOF) { 100 list($mail_action, $mail_action_script, $mail_edit_script) = gen_user_mail_action($rs->fields['mail_id'], $rs->fields['status']); 101 $mail_acc = decode_idna($rs->fields['mail_acc']); 102 $show_dmn_name = decode_idna($dmn_name); 103 104 $tpl->assign( 105 array('MAIL_ACC' => $mail_acc . "@" . $show_dmn_name, 106 'MAIL_TYPE' => user_trans_mail_type($rs->fields['mail_type']), 107 'MAIL_STATUS' => translate_dmn_status($rs->fields['status']), 108 'MAIL_ACTION' => $mail_action, 109 'MAIL_ACTION_SCRIPT' => $mail_action_script, 110 'MAIL_EDIT_SCRIPT' => $mail_edit_script 111 ) 112 ); 180 113 181 114 gen_user_mail_auto_respond($tpl, 182 $rs -> fields['mail_id'], 183 $rs -> fields['mail_type'], 184 $rs -> fields['status'], 185 $rs -> fields['mail_auto_respond']); 186 187 $tpl -> parse('MAIL_ITEM', '.mail_item'); 188 189 $rs -> MoveNext(); 190 115 $rs->fields['mail_id'], 116 $rs->fields['mail_type'], 117 $rs->fields['status'], 118 $rs->fields['mail_auto_respond']); 119 120 $tpl->parse('MAIL_ITEM', '.mail_item'); 121 $rs->MoveNext(); 191 122 } 192 123 193 return $rs -> RecordCount(); 194 195 } 196 197 } 198 199 function gen_page_sub_mail_list(&$tpl, &$sql, $dmn_id, $dmn_name) 200 { 201 124 return $rs->RecordCount(); 125 } 126 } 127 128 function gen_page_sub_mail_list(&$tpl, &$sql, $dmn_id, $dmn_name) { 202 129 $sub_query = <<<SQL_QUERY 203 130 … … 211 138 t2.status, 212 139 t2.mail_auto_respond 213 214 140 from 215 216 141 subdomain as t1, 217 218 142 mail_users as t2 219 220 143 where 221 222 144 t1.domain_id = '$dmn_id' 223 224 145 and 225 226 146 t2.domain_id = '$dmn_id' 227 228 147 and 229 230 148 (t2.mail_type = 'subdom_mail' 231 149 or 232 150 t2.mail_type = 'subdom_forward') 233 234 151 and 235 236 152 t1.subdomain_id = t2.sub_id 237 238 239 153 order by 240 241 154 t2.mail_type desc, t2.mail_id 242 243 155 SQL_QUERY; 244 156 245 157 $rs = execute_query($sql, $sub_query); 246 158 247 if ($rs -> RecordCount() == 0) { 248 159 if ($rs->RecordCount() == 0) { 249 160 return 0; 250 251 } else { 252 253 while (!$rs -> EOF) { 254 255 list($mail_action, $mail_action_script, $mail_edit_script) = gen_user_mail_action($rs -> fields['mail_id'], $rs -> fields['status']); 256 257 $mail_acc = decode_idna($rs -> fields['mail_acc']); 258 259 $show_sub_name = decode_idna($rs -> fields['sub_name']); 260 261 $show_dmn_name = decode_idna($dmn_name); 262 263 $tpl -> assign( 264 array( 265 'MAIL_ACC' => $mail_acc."@".$show_sub_name.".".$show_dmn_name, 266 'MAIL_TYPE' => user_trans_mail_type($rs -> fields['mail_type']), 267 'MAIL_STATUS' => user_trans_item_status($rs -> fields['status']), 268 'MAIL_ACTION' => $mail_action, 269 'MAIL_ACTION_SCRIPT' => $mail_action_script, 270 'MAIL_EDIT_SCRIPT' => $mail_edit_script 271 ) 272 ); 161 } else { 162 while (!$rs->EOF) { 163 list($mail_action, $mail_action_script, $mail_edit_script) = gen_user_mail_action($rs->fields['mail_id'], $rs->fields['status']); 164 165 $mail_acc = decode_idna($rs->fields['mail_acc']); 166 167 $show_sub_name = decode_idna($rs->fields['sub_name']); 168 169 $show_dmn_name = decode_idna($dmn_name); 170 171 $tpl->assign( 172 array('MAIL_ACC' => $mail_acc . "@" . $show_sub_name . "." . $show_dmn_name, 173 'MAIL_TYPE' => user_trans_mail_type($rs->fields['mail_type']), 174 'MAIL_STATUS' => user_trans_item_status($rs->fields['status']), 175 'MAIL_ACTION' => $mail_action, 176 'MAIL_ACTION_SCRIPT' => $mail_action_script, 177 'MAIL_EDIT_SCRIPT' => $mail_edit_script 178 ) 179 ); 273 180 274 181 gen_user_mail_auto_respond($tpl, 275 $rs -> fields['mail_id'], 276 $rs -> fields['mail_type'], 277 $rs -> fields['status'], 278 $rs -> fields['mail_auto_respond']); 279 280 $tpl -> parse('MAIL_ITEM', '.mail_item'); 281 282 $rs -> MoveNext(); 283 182 $rs->fields['mail_id'], 183 $rs->fields['mail_type'], 184 $rs->fields['status'], 185 $rs->fields['mail_auto_respond']); 186 187 $tpl->parse('MAIL_ITEM', '.mail_item'); 188 189 $rs->MoveNext(); 284 190 } 285 191 286 return $rs -> RecordCount(); 287 288 } 289 290 } 291 292 function gen_page_als_mail_list(&$tpl, &$sql, $dmn_id, $dmn_name) 293 { 294 192 return $rs->RecordCount(); 193 } 194 } 195 196 function gen_page_als_mail_list(&$tpl, &$sql, $dmn_id, $dmn_name) { 295 197 $als_query = <<<SQL_QUERY 296 297 198 select 298 299 199 t1.alias_id as als_id, 300 200 t1.alias_name as als_name, … … 304 204 t2.status, 305 205 t2.mail_auto_respond 306 307 206 from 308 309 207 domain_aliasses as t1, 310 208 mail_users as t2 311 312 209 where 313 314 210 t1.domain_id = '$dmn_id' 315 316 211 and 317 318 212 t2.domain_id = '$dmn_id' 319 320 213 and 321 322 214 t1.alias_id = t2.sub_id 323 324 215 and 325 326 216 (t2.mail_type = 'alias_mail' 327 217 or 328 218 t2.mail_type = 'alias_forward') 329 330 219 order by 331 332 220 t2.mail_type desc, t2.mail_id 333 334 221 SQL_QUERY; 335 222 336 223 $rs = execute_query($sql, $als_query); 337 224 338 if ($rs -> RecordCount() == 0) { 339 225 if ($rs->RecordCount() == 0) { 340 226 return 0; 341 342 } else { 343 344 while (!$rs -> EOF) { 345 346 list($mail_action, $mail_action_script, $mail_edit_script) = gen_user_mail_action($rs -> fields['mail_id'], $rs -> fields['status']); 347 348 349 $mail_acc = decode_idna($rs -> fields['mail_acc']); 350 351 $show_dmn_name = decode_idna($dmn_name); 352 353 $show_als_name = decode_idna($rs -> fields['als_name']); 354 355 $tpl -> assign( 356 array( 357 'MAIL_ACC' => $mail_acc."@".$show_als_name, 358 'MAIL_TYPE' => user_trans_mail_type($rs -> fields['mail_type']), 359 'MAIL_STATUS' => user_trans_item_status($rs -> fields['status']), 360 'MAIL_ACTION' => $mail_action, 361 'MAIL_ACTION_SCRIPT' => $mail_action_script, 362 'MAIL_EDIT_SCRIPT' => $mail_edit_script 363 ) 364 ); 227 } else { 228 while (!$rs->EOF) { 229 list($mail_action, $mail_action_script, $mail_edit_script) = gen_user_mail_action($rs->fields['mail_id'], $rs->fields['status']); 230 231 $mail_acc = decode_idna($rs->fields['mail_acc']); 232 233 $show_dmn_name = decode_idna($dmn_name); 234 235 $show_als_name = decode_idna($rs->fields['als_name']); 236 237 $tpl->assign( 238 array('MAIL_ACC' => $mail_acc . "@" . $show_als_name, 239 'MAIL_TYPE' => user_trans_mail_type($rs->fields['mail_type']), 240 'MAIL_STATUS' => user_trans_item_status($rs->fields['status']), 241 'MAIL_ACTION' => $mail_action, 242 'MAIL_ACTION_SCRIPT' => $mail_action_script, 243 'MAIL_EDIT_SCRIPT' => $mail_edit_script 244 ) 245 ); 365 246 366 247 gen_user_mail_auto_respond($tpl, 367 $rs -> fields['mail_id'], 368 $rs -> fields['mail_type'], 369 $rs -> fields['status'], 370 $rs -> fields['mail_auto_respond']); 371 372 $tpl -> parse('MAIL_ITEM', '.mail_item'); 373 374 $rs -> MoveNext(); 375 248 $rs->fields['mail_id'], 249 $rs->fields['mail_type'], 250 $rs->fields['status'], 251 $rs->fields['mail_auto_respond']); 252 253 $tpl->parse('MAIL_ITEM', '.mail_item'); 254 255 $rs->MoveNext(); 376 256 } 377 257 378 return $rs -> RecordCount(); 379 380 } 381 382 } 383 384 function gen_user_catchall_action($mail_id, $mail_status) 385 { 386 258 return $rs->RecordCount(); 259 } 260 } 261 262 function gen_user_catchall_action($mail_id, $mail_status) { 387 263 global $cfg; 388 264 389 265 if ($mail_status === $cfg['ITEM_ADD_STATUS']) { 390 391 266 return array(tr('N/A'), '#'); 392 393 267 } else if ($mail_status === $cfg['ITEM_OK_STATUS']) { 394 395 268 return array(tr('Delete CatchAll'), "delete_catchall.php?id=$mail_id"); 396 397 269 } else if ($mail_status === $cfg['ITEM_CHANGE_STATUS']) { 398 399 270 return array(tr('N/A'), '#'); 400 401 271 } else if ($mail_status === $cfg['ITEM_DELETE_STATUS']) { 402 403 272 return array(tr('N/A'), '#'); 404 405 } else { 406 273 } else { 407 274 return null; 408 409 } 410 411 } 412 413 function gen_catchall_item(&$tpl, $action, $dmn_id, $dmn_name, $mail_id, $mail_acc, $mail_status, $ca_type) 414 { 415 416 $show_dmn_name = decode_idna($dmn_name); 275 } 276 } 277 278 function gen_catchall_item(&$tpl, $action, $dmn_id, $dmn_name, $mail_id, $mail_acc, $mail_status, $ca_type) { 279 $show_dmn_name = decode_idna($dmn_name); 417 280 418 281 if ($action === 'create') { 419 420 $tpl -> assign( 421 array( 422 'CATCHALL_DOMAIN' => $show_dmn_name, 423 'CATCHALL_ACC' => tr('None'), 424
