Verzeichnisstruktur phpBB-3.2.0


Veröffentlicht
06.01.2017

So funktioniert es


Auf das letzte Element klicken. Dies geht jeweils ein Schritt zurück

Auf das Icon klicken, dies öffnet das Verzeichnis. Nochmal klicken schließt das Verzeichnis.
Auf den Verzeichnisnamen klicken, dies zeigt nur das Verzeichnis mit Inhalt an

(Beispiel Datei-Icons)

Auf das Icon klicken um den Quellcode anzuzeigen

acp_main.php

Zuletzt modifiziert: 09.10.2024, 12:52 - Dateigröße: 21.30 KiB


001  <?php
002  /**
003  *
004  * This file is part of the phpBB Forum Software package.
005  *
006  * @copyright (c) phpBB Limited <https://www.phpbb.com>
007  * @license GNU General Public License, version 2 (GPL-2.0)
008  *
009  * For full copyright and license information, please see
010  * the docs/CREDITS.txt file.
011  *
012  */
013   
014  /**
015  * @ignore
016  */
017  if (!defined('IN_PHPBB'))
018  {
019      exit;
020  }
021   
022  class acp_main
023  {
024      var $u_action;
025   
026      function main($id, $mode)
027      {
028          global $config, $db, $cache, $user, $auth, $template, $request, $phpbb_log;
029          global $phpbb_root_path, $phpbb_admin_path, $phpEx, $phpbb_container, $phpbb_dispatcher, $phpbb_filesystem;
030   
031          // Show restore permissions notice
032          if ($user->data['user_perm_from'] && $auth->acl_get('a_switchperm'))
033          {
034              $this->tpl_name = 'acp_main';
035              $this->page_title = 'ACP_MAIN';
036   
037              $sql = 'SELECT user_id, username, user_colour
038                  FROM ' . USERS_TABLE . '
039                  WHERE user_id = ' . $user->data['user_perm_from'];
040              $result = $db->sql_query($sql);
041              $user_row = $db->sql_fetchrow($result);
042              $db->sql_freeresult($result);
043   
044              $perm_from = get_username_string('full', $user_row['user_id'], $user_row['username'], $user_row['user_colour']);
045   
046              $template->assign_vars(array(
047                  'S_RESTORE_PERMISSIONS'        => true,
048                  'U_RESTORE_PERMISSIONS'        => append_sid("{$phpbb_root_path}ucp.$phpEx", 'mode=restore_perm'),
049                  'PERM_FROM'                    => $perm_from,
050                  'L_PERMISSIONS_TRANSFERRED_EXPLAIN'    => sprintf($user->lang['PERMISSIONS_TRANSFERRED_EXPLAIN'], $perm_from, append_sid("{$phpbb_root_path}ucp.$phpEx", 'mode=restore_perm')),
051              ));
052   
053              return;
054          }
055   
056          $action = $request->variable('action', '');
057   
058          if ($action)
059          {
060              if ($action === 'admlogout')
061              {
062                  $user->unset_admin();
063                  redirect(append_sid("{$phpbb_root_path}index.$phpEx"));
064              }
065   
066              if (!confirm_box(true))
067              {
068                  switch ($action)
069                  {
070                      case 'online':
071                          $confirm = true;
072                          $confirm_lang = 'RESET_ONLINE_CONFIRM';
073                      break;
074                      case 'stats':
075                          $confirm = true;
076                          $confirm_lang = 'RESYNC_STATS_CONFIRM';
077                      break;
078                      case 'user':
079                          $confirm = true;
080                          $confirm_lang = 'RESYNC_POSTCOUNTS_CONFIRM';
081                      break;
082                      case 'date':
083                          $confirm = true;
084                          $confirm_lang = 'RESET_DATE_CONFIRM';
085                      break;
086                      case 'db_track':
087                          $confirm = true;
088                          $confirm_lang = 'RESYNC_POST_MARKING_CONFIRM';
089                      break;
090                      case 'purge_cache':
091                          $confirm = true;
092                          $confirm_lang = 'PURGE_CACHE_CONFIRM';
093                      break;
094                      case 'purge_sessions':
095                          $confirm = true;
096                          $confirm_lang = 'PURGE_SESSIONS_CONFIRM';
097                      break;
098   
099                      default:
100                          $confirm = true;
101                          $confirm_lang = 'CONFIRM_OPERATION';
102                  }
103   
104                  if ($confirm)
105                  {
106                      confirm_box(false, $user->lang[$confirm_lang], build_hidden_fields(array(
107                          'i'            => $id,
108                          'mode'        => $mode,
109                          'action'    => $action,
110                      )));
111                  }
112              }
113              else
114              {
115                  switch ($action)
116                  {
117   
118                      case 'online':
119                          if (!$auth->acl_get('a_board'))
120                          {
121                              send_status_line(403, 'Forbidden');
122                              trigger_error($user->lang['NO_AUTH_OPERATION'] . adm_back_link($this->u_action), E_USER_WARNING);
123                          }
124   
125                          $config->set('record_online_users', 1, false);
126                          $config->set('record_online_date', time(), false);
127                          $phpbb_log->add('admin', $user->data['user_id'], $user->ip, 'LOG_RESET_ONLINE');
128   
129                          if ($request->is_ajax())
130                          {
131                              trigger_error('RESET_ONLINE_SUCCESS');
132                          }
133                      break;
134   
135                      case 'stats':
136                          if (!$auth->acl_get('a_board'))
137                          {
138                              send_status_line(403, 'Forbidden');
139                              trigger_error($user->lang['NO_AUTH_OPERATION'] . adm_back_link($this->u_action), E_USER_WARNING);
140                          }
141   
142                          $sql = 'SELECT COUNT(post_id) AS stat
143                              FROM ' . POSTS_TABLE . '
144                              WHERE post_visibility = ' . ITEM_APPROVED;
145                          $result = $db->sql_query($sql);
146                          $config->set('num_posts', (int) $db->sql_fetchfield('stat'), false);
147                          $db->sql_freeresult($result);
148   
149                          $sql = 'SELECT COUNT(topic_id) AS stat
150                              FROM ' . TOPICS_TABLE . '
151                              WHERE topic_visibility = ' . ITEM_APPROVED;
152                          $result = $db->sql_query($sql);
153                          $config->set('num_topics', (int) $db->sql_fetchfield('stat'), false);
154                          $db->sql_freeresult($result);
155   
156                          $sql = 'SELECT COUNT(user_id) AS stat
157                              FROM ' . USERS_TABLE . '
158                              WHERE user_type IN (' . USER_NORMAL . ',' . USER_FOUNDER . ')';
159                          $result = $db->sql_query($sql);
160                          $config->set('num_users', (int) $db->sql_fetchfield('stat'), false);
161                          $db->sql_freeresult($result);
162   
163                          $sql = 'SELECT COUNT(attach_id) as stat
164                              FROM ' . ATTACHMENTS_TABLE . '
165                              WHERE is_orphan = 0';
166                          $result = $db->sql_query($sql);
167                          $config->set('num_files', (int) $db->sql_fetchfield('stat'), false);
168                          $db->sql_freeresult($result);
169   
170                          $sql = 'SELECT SUM(filesize) as stat
171                              FROM ' . ATTACHMENTS_TABLE . '
172                              WHERE is_orphan = 0';
173                          $result = $db->sql_query($sql);
174                          $config->set('upload_dir_size', (float) $db->sql_fetchfield('stat'), false);
175                          $db->sql_freeresult($result);
176   
177                          if (!function_exists('update_last_username'))
178                          {
179                              include($phpbb_root_path . "includes/functions_user.$phpEx");
180                          }
181                          update_last_username();
182   
183                          $phpbb_log->add('admin', $user->data['user_id'], $user->ip, 'LOG_RESYNC_STATS');
184   
185                          if ($request->is_ajax())
186                          {
187                              trigger_error('RESYNC_STATS_SUCCESS');
188                          }
189                      break;
190   
191                      case 'user':
192                          if (!$auth->acl_get('a_board'))
193                          {
194                              send_status_line(403, 'Forbidden');
195                              trigger_error($user->lang['NO_AUTH_OPERATION'] . adm_back_link($this->u_action), E_USER_WARNING);
196                          }
197   
198                          // Resync post counts
199                          $start = $max_post_id = 0;
200   
201                          // Find the maximum post ID, we can only stop the cycle when we've reached it
202                          $sql = 'SELECT MAX(forum_last_post_id) as max_post_id
203                              FROM ' . FORUMS_TABLE;
204                          $result = $db->sql_query($sql);
205                          $max_post_id = (int) $db->sql_fetchfield('max_post_id');
206                          $db->sql_freeresult($result);
207   
208                          // No maximum post id? :o
209                          if (!$max_post_id)
210                          {
211                              $sql = 'SELECT MAX(post_id) as max_post_id
212                                  FROM ' . POSTS_TABLE;
213                              $result = $db->sql_query($sql);
214                              $max_post_id = (int) $db->sql_fetchfield('max_post_id');
215                              $db->sql_freeresult($result);
216                          }
217   
218                          // Still no maximum post id? Then we are finished
219                          if (!$max_post_id)
220                          {
221                              $phpbb_log->add('admin', $user->data['user_id'], $user->ip, 'LOG_RESYNC_POSTCOUNTS');
222                              break;
223                          }
224   
225                          $step = ($config['num_posts']) ? (max((int) ($config['num_posts'] / 5), 20000)) : 20000;
226                          $db->sql_query('UPDATE ' . USERS_TABLE . ' SET user_posts = 0');
227   
228                          while ($start < $max_post_id)
229                          {
230                              $sql = 'SELECT COUNT(post_id) AS num_posts, poster_id
231                                  FROM ' . POSTS_TABLE . '
232                                  WHERE post_id BETWEEN ' . ($start + 1) . ' AND ' . ($start + $step) . '
233                                      AND post_postcount = 1 AND post_visibility = ' . ITEM_APPROVED . '
234                                  GROUP BY poster_id';
235                              $result = $db->sql_query($sql);
236   
237                              if ($row = $db->sql_fetchrow($result))
238                              {
239                                  do
240                                  {
241                                      $sql = 'UPDATE ' . USERS_TABLE . " SET user_posts = user_posts + {$row['num_posts']} WHERE user_id = {$row['poster_id']}";
242                                      $db->sql_query($sql);
243                                  }
244                                  while ($row = $db->sql_fetchrow($result));
245                              }
246                              $db->sql_freeresult($result);
247   
248                              $start += $step;
249                          }
250   
251                          $phpbb_log->add('admin', $user->data['user_id'], $user->ip, 'LOG_RESYNC_POSTCOUNTS');
252   
253                          if ($request->is_ajax())
254                          {
255                              trigger_error('RESYNC_POSTCOUNTS_SUCCESS');
256                          }
257                      break;
258   
259                      case 'date':
260                          if (!$auth->acl_get('a_board'))
261                          {
262                              send_status_line(403, 'Forbidden');
263                              trigger_error($user->lang['NO_AUTH_OPERATION'] . adm_back_link($this->u_action), E_USER_WARNING);
264                          }
265   
266                          $config->set('board_startdate', time() - 1);
267                          $phpbb_log->add('admin', $user->data['user_id'], $user->ip, 'LOG_RESET_DATE');
268   
269                          if ($request->is_ajax())
270                          {
271                              trigger_error('RESET_DATE_SUCCESS');
272                          }
273                      break;
274   
275                      case 'db_track':
276                          switch ($db->get_sql_layer())
277                          {
278                              case 'sqlite3':
279                                  $db->sql_query('DELETE FROM ' . TOPICS_POSTED_TABLE);
280                              break;
281   
282                              default:
283                                  $db->sql_query('TRUNCATE TABLE ' . TOPICS_POSTED_TABLE);
284                              break;
285                          }
286   
287                          // This can get really nasty... therefore we only do the last six months
288                          $get_from_time = time() - (6 * 4 * 7 * 24 * 60 * 60);
289   
290                          // Select forum ids, do not include categories
291                          $sql = 'SELECT forum_id
292                              FROM ' . FORUMS_TABLE . '
293                              WHERE forum_type <> ' . FORUM_CAT;
294                          $result = $db->sql_query($sql);
295   
296                          $forum_ids = array();
297                          while ($row = $db->sql_fetchrow($result))
298                          {
299                              $forum_ids[] = $row['forum_id'];
300                          }
301                          $db->sql_freeresult($result);
302   
303                          // Any global announcements? ;)
304                          $forum_ids[] = 0;
305   
306                          // Now go through the forums and get us some topics...
307                          foreach ($forum_ids as $forum_id)
308                          {
309                              $sql = 'SELECT p.poster_id, p.topic_id
310                                  FROM ' . POSTS_TABLE . ' p, ' . TOPICS_TABLE . ' t
311                                  WHERE t.forum_id = ' . $forum_id . '
312                                      AND t.topic_moved_id = 0
313                                      AND t.topic_last_post_time > ' . $get_from_time . '
314                                      AND t.topic_id = p.topic_id
315                                      AND p.poster_id <> ' . ANONYMOUS . '
316                                  GROUP BY p.poster_id, p.topic_id';
317                              $result = $db->sql_query($sql);
318   
319                              $posted = array();
320                              while ($row = $db->sql_fetchrow($result))
321                              {
322                                  $posted[$row['poster_id']][] = $row['topic_id'];
323                              }
324                              $db->sql_freeresult($result);
325   
326                              $sql_ary = array();
327                              foreach ($posted as $user_id => $topic_row)
328                              {
329                                  foreach ($topic_row as $topic_id)
330                                  {
331                                      $sql_ary[] = array(
332                                          'user_id'        => (int) $user_id,
333                                          'topic_id'        => (int) $topic_id,
334                                          'topic_posted'    => 1,
335                                      );
336                                  }
337                              }
338                              unset($posted);
339   
340                              if (sizeof($sql_ary))
341                              {
342                                  $db->sql_multi_insert(TOPICS_POSTED_TABLE, $sql_ary);
343                              }
344                          }
345   
346                          $phpbb_log->add('admin', $user->data['user_id'], $user->ip, 'LOG_RESYNC_POST_MARKING');
347   
348                          if ($request->is_ajax())
349                          {
350                              trigger_error('RESYNC_POST_MARKING_SUCCESS');
351                          }
352                      break;
353   
354                      case 'purge_cache':
355                          $config->increment('assets_version', 1);
356                          $cache->purge();
357   
358                          // Remove old renderers from the text_formatter service. Since this
359                          // operation is performed after the cache is purged, there is not "current"
360                          // renderer and in effect all renderers will be purged
361                          $phpbb_container->get('text_formatter.cache')->tidy();
362   
363                          // Clear permissions
364                          $auth->acl_clear_prefetch();
365                          phpbb_cache_moderators($db, $cache, $auth);
366   
367                          $phpbb_log->add('admin', $user->data['user_id'], $user->ip, 'LOG_PURGE_CACHE');
368   
369                          if ($request->is_ajax())
370                          {
371                              trigger_error('PURGE_CACHE_SUCCESS');
372                          }
373                      break;
374   
375                      case 'purge_sessions':
376                          if ((int) $user->data['user_type'] !== USER_FOUNDER)
377                          {
378                              send_status_line(403, 'Forbidden');
379                              trigger_error($user->lang['NO_AUTH_OPERATION'] . adm_back_link($this->u_action), E_USER_WARNING);
380                          }
381   
382                          $tables = array(CONFIRM_TABLE, SESSIONS_TABLE);
383   
384                          foreach ($tables as $table)
385                          {
386                              switch ($db->get_sql_layer())
387                              {
388                                  case 'sqlite3':
389                                      $db->sql_query("DELETE FROM $table");
390                                  break;
391   
392                                  default:
393                                      $db->sql_query("TRUNCATE TABLE $table");
394                                  break;
395                              }
396                          }
397   
398                          // let's restore the admin session
399                          $reinsert_ary = array(
400                                  'session_id'            => (string) $user->session_id,
401                                  'session_page'            => (string) substr($user->page['page'], 0, 199),
402                                  'session_forum_id'        => $user->page['forum'],
403                                  'session_user_id'        => (int) $user->data['user_id'],
404                                  'session_start'            => (int) $user->data['session_start'],
405                                  'session_last_visit'    => (int) $user->data['session_last_visit'],
406                                  'session_time'            => (int) $user->time_now,
407                                  'session_browser'        => (string) trim(substr($user->browser, 0, 149)),
408                                  'session_forwarded_for'    => (string) $user->forwarded_for,
409                                  'session_ip'            => (string) $user->ip,
410                                  'session_autologin'        => (int) $user->data['session_autologin'],
411                                  'session_admin'            => 1,
412                                  'session_viewonline'    => (int) $user->data['session_viewonline'],
413                          );
414   
415                          $sql = 'INSERT INTO ' . SESSIONS_TABLE . ' ' . $db->sql_build_array('INSERT', $reinsert_ary);
416                          $db->sql_query($sql);
417   
418                          $phpbb_log->add('admin', $user->data['user_id'], $user->ip, 'LOG_PURGE_SESSIONS');
419   
420                          if ($request->is_ajax())
421                          {
422                              trigger_error('PURGE_SESSIONS_SUCCESS');
423                          }
424                      break;
425                  }
426              }
427          }
428   
429          // Version check
430          $user->add_lang('install');
431   
432          if ($auth->acl_get('a_server') && version_compare(PHP_VERSION, '5.4', '<'))
433          {
434              $template->assign_vars(array(
435                  'S_PHP_VERSION_OLD'    => true,
436                  'L_PHP_VERSION_OLD'    => sprintf($user->lang['PHP_VERSION_OLD'], '<a href="https://www.phpbb.com/community/viewtopic.php?f=14&amp;t=2152375">', '</a>'),
437              ));
438          }
439   
440          if ($auth->acl_get('a_board'))
441          {
442              /* @var $version_helper \phpbb\version_helper */
443              $version_helper = $phpbb_container->get('version_helper');
444              try
445              {
446                  $recheck = $request->variable('versioncheck_force', false);
447                  $updates_available = $version_helper->get_suggested_updates($recheck);
448   
449                  $template->assign_var('S_VERSION_UP_TO_DATE', empty($updates_available));
450              }
451              catch (\RuntimeException $e)
452              {
453                  $message = call_user_func_array(array($user, 'lang'), array_merge(array($e->getMessage()), $e->get_parameters()));
454                  $template->assign_vars(array(
455                      'S_VERSIONCHECK_FAIL'        => true,
456                      'VERSIONCHECK_FAIL_REASON'    => ($e->getMessage() !== 'VERSIONCHECK_FAIL') ? $message : '',
457                  ));
458              }
459          }
460          else
461          {
462              // We set this template var to true, to not display an outdated version notice.
463              $template->assign_var('S_VERSION_UP_TO_DATE', true);
464          }
465   
466          // Incomplete update?
467          if (phpbb_version_compare($config['version'], PHPBB_VERSION, '<'))
468          {
469              $template->assign_var('S_UPDATE_INCOMPLETE', true);
470          }
471   
472          /**
473          * Notice admin
474          *
475          * @event core.acp_main_notice
476          * @since 3.1.0-RC3
477          */
478          $phpbb_dispatcher->dispatch('core.acp_main_notice');
479   
480          // Get forum statistics
481          $total_posts = $config['num_posts'];
482          $total_topics = $config['num_topics'];
483          $total_users = $config['num_users'];
484          $total_files = $config['num_files'];
485   
486          $start_date = $user->format_date($config['board_startdate']);
487   
488          $boarddays = (time() - $config['board_startdate']) / 86400;
489   
490          $posts_per_day = sprintf('%.2f', $total_posts / $boarddays);
491          $topics_per_day = sprintf('%.2f', $total_topics / $boarddays);
492          $users_per_day = sprintf('%.2f', $total_users / $boarddays);
493          $files_per_day = sprintf('%.2f', $total_files / $boarddays);
494   
495          $upload_dir_size = get_formatted_filesize($config['upload_dir_size']);
496   
497          $avatar_dir_size = 0;
498   
499          if ($avatar_dir = @opendir($phpbb_root_path . $config['avatar_path']))
500          {
501              while (($file = readdir($avatar_dir)) !== false)
502              {
503                  if ($file[0] != '.' && $file != 'CVS' && strpos($file, 'index.') === false)
504                  {
505                      $avatar_dir_size += filesize($phpbb_root_path . $config['avatar_path'] . '/' . $file);
506                  }
507              }
508              closedir($avatar_dir);
509   
510              $avatar_dir_size = get_formatted_filesize($avatar_dir_size);
511          }
512          else
513          {
514              // Couldn't open Avatar dir.
515              $avatar_dir_size = $user->lang['NOT_AVAILABLE'];
516          }
517   
518          if ($posts_per_day > $total_posts)
519          {
520              $posts_per_day = $total_posts;
521          }
522   
523          if ($topics_per_day > $total_topics)
524          {
525              $topics_per_day = $total_topics;
526          }
527   
528          if ($users_per_day > $total_users)
529          {
530              $users_per_day = $total_users;
531          }
532   
533          if ($files_per_day > $total_files)
534          {
535              $files_per_day = $total_files;
536          }
537   
538          if ($config['allow_attachments'] || $config['allow_pm_attach'])
539          {
540              $sql = 'SELECT COUNT(attach_id) AS total_orphan
541                  FROM ' . ATTACHMENTS_TABLE . '
542                  WHERE is_orphan = 1
543                      AND filetime < ' . (time() - 3*60*60);
544              $result = $db->sql_query($sql);
545              $total_orphan = (int) $db->sql_fetchfield('total_orphan');
546              $db->sql_freeresult($result);
547          }
548          else
549          {
550              $total_orphan = false;
551          }
552   
553          $dbsize = get_database_size();
554   
555          $template->assign_vars(array(
556              'TOTAL_POSTS'        => $total_posts,
557              'POSTS_PER_DAY'        => $posts_per_day,
558              'TOTAL_TOPICS'        => $total_topics,
559              'TOPICS_PER_DAY'    => $topics_per_day,
560              'TOTAL_USERS'        => $total_users,
561              'USERS_PER_DAY'        => $users_per_day,
562              'TOTAL_FILES'        => $total_files,
563              'FILES_PER_DAY'        => $files_per_day,
564              'START_DATE'        => $start_date,
565              'AVATAR_DIR_SIZE'    => $avatar_dir_size,
566              'DBSIZE'            => $dbsize,
567              'UPLOAD_DIR_SIZE'    => $upload_dir_size,
568              'TOTAL_ORPHAN'        => $total_orphan,
569              'S_TOTAL_ORPHAN'    => ($total_orphan === false) ? false : true,
570              'GZIP_COMPRESSION'    => ($config['gzip_compress'] && @extension_loaded('zlib')) ? $user->lang['ON'] : $user->lang['OFF'],
571              'DATABASE_INFO'        => $db->sql_server_info(),
572              'BOARD_VERSION'        => $config['version'],
573   
574              'U_ACTION'            => $this->u_action,
575              'U_ADMIN_LOG'        => append_sid("{$phpbb_admin_path}index.$phpEx", 'i=logs&amp;mode=admin'),
576              'U_INACTIVE_USERS'    => append_sid("{$phpbb_admin_path}index.$phpEx", 'i=inactive&amp;mode=list'),
577              'U_VERSIONCHECK'    => append_sid("{$phpbb_admin_path}index.$phpEx", 'i=update&amp;mode=version_check'),
578              'U_VERSIONCHECK_FORCE'    => append_sid("{$phpbb_admin_path}index.$phpEx", 'versioncheck_force=1'),
579   
580              'S_VERSIONCHECK'    => ($auth->acl_get('a_board')) ? true : false,
581              'S_ACTION_OPTIONS'    => ($auth->acl_get('a_board')) ? true : false,
582              'S_FOUNDER'            => ($user->data['user_type'] == USER_FOUNDER) ? true : false,
583              )
584          );
585   
586          $log_data = array();
587          $log_count = false;
588   
589          if ($auth->acl_get('a_viewlogs'))
590          {
591              view_log('admin', $log_data, $log_count, 5);
592   
593              foreach ($log_data as $row)
594              {
595                  $template->assign_block_vars('log', array(
596                      'USERNAME'    => $row['username_full'],
597                      'IP'        => $row['ip'],
598                      'DATE'        => $user->format_date($row['time']),
599                      'ACTION'    => $row['action'])
600                  );
601              }
602          }
603   
604          if ($auth->acl_get('a_user'))
605          {
606              $user->add_lang('memberlist');
607   
608              $inactive = array();
609              $inactive_count = 0;
610   
611              view_inactive_users($inactive, $inactive_count, 10);
612   
613              foreach ($inactive as $row)
614              {
615                  $template->assign_block_vars('inactive', array(
616                      'INACTIVE_DATE'    => $user->format_date($row['user_inactive_time']),
617                      'REMINDED_DATE'    => $user->format_date($row['user_reminded_time']),
618                      'JOINED'        => $user->format_date($row['user_regdate']),
619                      'LAST_VISIT'    => (!$row['user_lastvisit']) ? ' - ' : $user->format_date($row['user_lastvisit']),
620   
621                      'REASON'        => $row['inactive_reason'],
622                      'USER_ID'        => $row['user_id'],
623                      'POSTS'            => ($row['user_posts']) ? $row['user_posts'] : 0,
624                      'REMINDED'        => $row['user_reminded'],
625   
626                      'REMINDED_EXPLAIN'    => $user->lang('USER_LAST_REMINDED', (int) $row['user_reminded'], $user->format_date($row['user_reminded_time'])),
627   
628                      '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')),
629                      'USERNAME'            => get_username_string('username', $row['user_id'], $row['username'], $row['user_colour']),
630                      'USER_COLOR'        => get_username_string('colour', $row['user_id'], $row['username'], $row['user_colour']),
631   
632                      'U_USER_ADMIN'    => append_sid("{$phpbb_admin_path}index.$phpEx", "i=users&amp;mode=overview&amp;u={$row['user_id']}"),
633                      'U_SEARCH_USER'    => ($auth->acl_get('u_search')) ? append_sid("{$phpbb_root_path}search.$phpEx", "author_id={$row['user_id']}&amp;sr=posts") : '',
634                  ));
635              }
636   
637              $option_ary = array('activate' => 'ACTIVATE', 'delete' => 'DELETE');
638              if ($config['email_enable'])
639              {
640                  $option_ary += array('remind' => 'REMIND');
641              }
642   
643              $template->assign_vars(array(
644                  'S_INACTIVE_USERS'        => true,
645                  'S_INACTIVE_OPTIONS'    => build_select($option_ary))
646              );
647          }
648   
649          // Warn if install is still present
650          if (file_exists($phpbb_root_path . 'install') && !is_file($phpbb_root_path . 'install'))
651          {
652              $template->assign_var('S_REMOVE_INSTALL', true);
653          }
654   
655          // Warn if no search index is created
656          if ($config['num_posts'] && class_exists($config['search_type']))
657          {
658              $error = false;
659              $search_type = $config['search_type'];
660              $search = new $search_type($error, $phpbb_root_path, $phpEx, $auth, $config, $db, $user, $phpbb_dispatcher);
661   
662              if (!$search->index_created())
663              {
664                  $template->assign_vars(array(
665                      'S_SEARCH_INDEX_MISSING'    => true,
666                      'L_NO_SEARCH_INDEX'            => $user->lang('NO_SEARCH_INDEX', $search->get_name(), '<a href="' . append_sid("{$phpbb_admin_path}index.$phpEx", 'i=acp_search&amp;mode=index') . '">', '</a>'),
667                  ));
668              }
669          }
670   
671          if (!defined('PHPBB_DISABLE_CONFIG_CHECK') && file_exists($phpbb_root_path . 'config.' . $phpEx) && $phpbb_filesystem->is_writable($phpbb_root_path . 'config.' . $phpEx))
672          {
673              // World-Writable? (000x)
674              $template->assign_var('S_WRITABLE_CONFIG', (bool) (@fileperms($phpbb_root_path . 'config.' . $phpEx) & 0x0002));
675          }
676   
677          if (extension_loaded('mbstring'))
678          {
679              $template->assign_vars(array(
680                  'S_MBSTRING_LOADED'                        => true,
681                  'S_MBSTRING_FUNC_OVERLOAD_FAIL'            => (intval(@ini_get('mbstring.func_overload')) & (MB_OVERLOAD_MAIL | MB_OVERLOAD_STRING)),
682                  'S_MBSTRING_ENCODING_TRANSLATION_FAIL'    => (@ini_get('mbstring.encoding_translation') != 0),
683                  'S_MBSTRING_HTTP_INPUT_FAIL'            => !in_array(@ini_get('mbstring.http_input'), array('pass', '')),
684                  'S_MBSTRING_HTTP_OUTPUT_FAIL'            => !in_array(@ini_get('mbstring.http_output'), array('pass', '')),
685              ));
686          }
687   
688          // Fill dbms version if not yet filled
689          if (empty($config['dbms_version']))
690          {
691              $config->set('dbms_version', $db->sql_server_info(true));
692          }
693   
694          $this->tpl_name = 'acp_main';
695          $this->page_title = 'ACP_MAIN';
696      }
697  }
698