Ignore:
Timestamp:
Mar 31, 2010, 6:32:40 PM (14 years ago)
Author:
george
Message:
  • Upraveno: Aktualizace fóra.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/forum/includes/acp/acp_main.php

    r400 r702  
    33*
    44* @package acp
    5 * @version $Id: acp_main.php 9171 2008-12-04 14:53:04Z acydburn $
     5* @version $Id$
    66* @copyright (c) 2005 phpBB Group
    77* @license http://opensource.org/licenses/gpl-license.php GNU Public License
     
    9797                                                $confirm = true;
    9898                                                $confirm_lang = 'PURGE_CACHE_CONFIRM';
     99                                        break;
     100                                        case 'purge_sessions':
     101                                                $confirm = true;
     102                                                $confirm_lang = 'PURGE_SESSIONS_CONFIRM';
    99103                                        break;
    100104
     
    342346                                                add_log('admin', 'LOG_PURGE_CACHE');
    343347                                        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;
    344394                                }
    345395                        }
     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&amp;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                        ));
    346424                }
    347425
     
    436514                        'TOTAL_ORPHAN'          => $total_orphan,
    437515                        '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'],
    439517                        'DATABASE_INFO'         => $db->sql_server_info(),
    440518                        'BOARD_VERSION'         => $config['version'],
     
    443521                        'U_ADMIN_LOG'           => append_sid("{$phpbb_admin_path}index.$phpEx", 'i=logs&amp;mode=admin'),
    444522                        'U_INACTIVE_USERS'      => append_sid("{$phpbb_admin_path}index.$phpEx", 'i=inactive&amp;mode=list'),
     523                        'U_VERSIONCHECK'        => append_sid("{$phpbb_admin_path}index.$phpEx", 'i=update&amp;mode=version_check'),
     524                        'U_VERSIONCHECK_FORCE'  => append_sid("{$phpbb_admin_path}index.$phpEx", 'i=1&amp;versioncheck_force=1'),
    445525
    446526                        'S_ACTION_OPTIONS'      => ($auth->acl_get('a_board')) ? true : false,
     
    469549                if ($auth->acl_get('a_user'))
    470550                {
     551                        $user->add_lang('memberlist');
     552
    471553                        $inactive = array();
    472554                        $inactive_count = 0;
     
    478560                                $template->assign_block_vars('inactive', array(
    479561                                        'INACTIVE_DATE' => $user->format_date($row['user_inactive_time']),
     562                                        'REMINDED_DATE' => $user->format_date($row['user_reminded_time']),
    480563                                        'JOINED'                => $user->format_date($row['user_regdate']),
    481564                                        'LAST_VISIT'    => (!$row['user_lastvisit']) ? ' - ' : $user->format_date($row['user_lastvisit']),
     565
    482566                                        'REASON'                => $row['inactive_reason'],
    483567                                        'USER_ID'               => $row['user_id'],
    484                                         'USERNAME'              => $row['username'],
    485                                         'U_USER_ADMIN'  => append_sid("{$phpbb_admin_path}index.$phpEx", "i=users&amp;mode=overview&amp;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&amp;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&amp;mode=overview&amp;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']}&amp;sr=posts") : '',
     579                                ));
    487580                        }
    488581
     
    500593
    501594                // 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'))
    503596                {
    504597                        $template->assign_var('S_REMOVE_INSTALL', true);
    505598                }
    506599
    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))
    508601                {
    509602                        // World-Writable? (000x)
    510603                        $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));
    511610                }
    512611
Note: See TracChangeset for help on using the changeset viewer.