Changeset 702 for trunk/forum/includes/acp/acp_main.php
- Timestamp:
- Mar 31, 2010, 6:32:40 PM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/forum/includes/acp/acp_main.php
r400 r702 3 3 * 4 4 * @package acp 5 * @version $Id : acp_main.php 9171 2008-12-04 14:53:04Z acydburn$5 * @version $Id$ 6 6 * @copyright (c) 2005 phpBB Group 7 7 * @license http://opensource.org/licenses/gpl-license.php GNU Public License … … 97 97 $confirm = true; 98 98 $confirm_lang = 'PURGE_CACHE_CONFIRM'; 99 break; 100 case 'purge_sessions': 101 $confirm = true; 102 $confirm_lang = 'PURGE_SESSIONS_CONFIRM'; 99 103 break; 100 104 … … 342 346 add_log('admin', 'LOG_PURGE_CACHE'); 343 347 break; 348 349 case 'purge_sessions': 350 if ((int) $user->data['user_type'] !== USER_FOUNDER) 351 { 352 trigger_error($user->lang['NO_AUTH_OPERATION'] . adm_back_link($this->u_action), E_USER_WARNING); 353 } 354 355 $tables = array(CONFIRM_TABLE, SESSIONS_TABLE); 356 357 foreach ($tables as $table) 358 { 359 switch ($db->sql_layer) 360 { 361 case 'sqlite': 362 case 'firebird': 363 $db->sql_query("DELETE FROM $table"); 364 break; 365 366 default: 367 $db->sql_query("TRUNCATE TABLE $table"); 368 break; 369 } 370 } 371 372 // let's restore the admin session 373 $reinsert_ary = array( 374 'session_id' => (string) $user->session_id, 375 'session_page' => (string) substr($user->page['page'], 0, 199), 376 'session_forum_id' => $user->page['forum'], 377 'session_user_id' => (int) $user->data['user_id'], 378 'session_start' => (int) $user->data['session_start'], 379 'session_last_visit' => (int) $user->data['session_last_visit'], 380 'session_time' => (int) $user->time_now, 381 'session_browser' => (string) trim(substr($user->browser, 0, 149)), 382 'session_forwarded_for' => (string) $user->forwarded_for, 383 'session_ip' => (string) $user->ip, 384 'session_autologin' => (int) $user->data['session_autologin'], 385 'session_admin' => 1, 386 'session_viewonline' => (int) $user->data['session_viewonline'], 387 ); 388 389 $sql = 'INSERT INTO ' . SESSIONS_TABLE . ' ' . $db->sql_build_array('INSERT', $reinsert_ary); 390 $db->sql_query($sql); 391 392 add_log('admin', 'LOG_PURGE_SESSIONS'); 393 break; 344 394 } 345 395 } 396 } 397 398 // Version check 399 $user->add_lang('install'); 400 401 if ($auth->acl_get('a_server') && version_compare(PHP_VERSION, '5.2.0', '<')) 402 { 403 $template->assign_vars(array( 404 'S_PHP_VERSION_OLD' => true, 405 'L_PHP_VERSION_OLD' => sprintf($user->lang['PHP_VERSION_OLD'], '<a href="http://www.phpbb.com/community/viewtopic.php?f=14&t=1958605">', '</a>'), 406 )); 407 } 408 409 $latest_version_info = false; 410 if (($latest_version_info = obtain_latest_version_info(request_var('versioncheck_force', false))) === false) 411 { 412 $template->assign_var('S_VERSIONCHECK_FAIL', true); 413 } 414 else 415 { 416 $latest_version_info = explode("\n", $latest_version_info); 417 418 $latest_version = str_replace('rc', 'RC', strtolower(trim($latest_version_info[0]))); 419 $current_version = str_replace('rc', 'RC', strtolower($config['version'])); 420 421 $template->assign_vars(array( 422 'S_VERSION_UP_TO_DATE' => version_compare($current_version, $latest_version, '<') ? false : true, 423 )); 346 424 } 347 425 … … 436 514 'TOTAL_ORPHAN' => $total_orphan, 437 515 'S_TOTAL_ORPHAN' => ($total_orphan === false) ? false : true, 438 'GZIP_COMPRESSION' => ($config['gzip_compress'] ) ? $user->lang['ON'] : $user->lang['OFF'],516 'GZIP_COMPRESSION' => ($config['gzip_compress'] && @extension_loaded('zlib')) ? $user->lang['ON'] : $user->lang['OFF'], 439 517 'DATABASE_INFO' => $db->sql_server_info(), 440 518 'BOARD_VERSION' => $config['version'], … … 443 521 'U_ADMIN_LOG' => append_sid("{$phpbb_admin_path}index.$phpEx", 'i=logs&mode=admin'), 444 522 'U_INACTIVE_USERS' => append_sid("{$phpbb_admin_path}index.$phpEx", 'i=inactive&mode=list'), 523 'U_VERSIONCHECK' => append_sid("{$phpbb_admin_path}index.$phpEx", 'i=update&mode=version_check'), 524 'U_VERSIONCHECK_FORCE' => append_sid("{$phpbb_admin_path}index.$phpEx", 'i=1&versioncheck_force=1'), 445 525 446 526 'S_ACTION_OPTIONS' => ($auth->acl_get('a_board')) ? true : false, … … 469 549 if ($auth->acl_get('a_user')) 470 550 { 551 $user->add_lang('memberlist'); 552 471 553 $inactive = array(); 472 554 $inactive_count = 0; … … 478 560 $template->assign_block_vars('inactive', array( 479 561 'INACTIVE_DATE' => $user->format_date($row['user_inactive_time']), 562 'REMINDED_DATE' => $user->format_date($row['user_reminded_time']), 480 563 'JOINED' => $user->format_date($row['user_regdate']), 481 564 'LAST_VISIT' => (!$row['user_lastvisit']) ? ' - ' : $user->format_date($row['user_lastvisit']), 565 482 566 'REASON' => $row['inactive_reason'], 483 567 'USER_ID' => $row['user_id'], 484 'USERNAME' => $row['username'], 485 'U_USER_ADMIN' => append_sid("{$phpbb_admin_path}index.$phpEx", "i=users&mode=overview&u={$row['user_id']}")) 486 ); 568 'POSTS' => ($row['user_posts']) ? $row['user_posts'] : 0, 569 'REMINDED' => $row['user_reminded'], 570 571 'REMINDED_EXPLAIN' => $user->lang('USER_LAST_REMINDED', (int) $row['user_reminded'], $user->format_date($row['user_reminded_time'])), 572 573 'USERNAME_FULL' => get_username_string('full', $row['user_id'], $row['username'], $row['user_colour'], false, append_sid("{$phpbb_admin_path}index.$phpEx", 'i=users&mode=overview')), 574 'USERNAME' => get_username_string('username', $row['user_id'], $row['username'], $row['user_colour']), 575 'USER_COLOR' => get_username_string('colour', $row['user_id'], $row['username'], $row['user_colour']), 576 577 'U_USER_ADMIN' => append_sid("{$phpbb_admin_path}index.$phpEx", "i=users&mode=overview&u={$row['user_id']}"), 578 'U_SEARCH_USER' => ($auth->acl_get('u_search')) ? append_sid("{$phpbb_root_path}search.$phpEx", "author_id={$row['user_id']}&sr=posts") : '', 579 )); 487 580 } 488 581 … … 500 593 501 594 // Warn if install is still present 502 if (file_exists($phpbb_root_path . 'install') )595 if (file_exists($phpbb_root_path . 'install') && !is_file($phpbb_root_path . 'install')) 503 596 { 504 597 $template->assign_var('S_REMOVE_INSTALL', true); 505 598 } 506 599 507 if (!defined('PHPBB_DISABLE_CONFIG_CHECK') && file_exists($phpbb_root_path . 'config.' . $phpEx) && is_writable($phpbb_root_path . 'config.' . $phpEx))600 if (!defined('PHPBB_DISABLE_CONFIG_CHECK') && file_exists($phpbb_root_path . 'config.' . $phpEx) && phpbb_is_writable($phpbb_root_path . 'config.' . $phpEx)) 508 601 { 509 602 // World-Writable? (000x) 510 603 $template->assign_var('S_WRITABLE_CONFIG', (bool) (@fileperms($phpbb_root_path . 'config.' . $phpEx) & 0x0002)); 604 } 605 606 // Fill dbms version if not yet filled 607 if (empty($config['dbms_version'])) 608 { 609 set_config('dbms_version', $db->sql_server_info(true)); 511 610 } 512 611
Note:
See TracChangeset
for help on using the changeset viewer.