Verzeichnisstruktur phpBB-3.1.0


Veröffentlicht
27.10.2014

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: 19.86 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;
029          global $phpbb_root_path, $phpbb_admin_path, $phpEx, $phpbb_container, $phpbb_dispatcher;
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_var('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                              trigger_error($user->lang['NO_AUTH_OPERATION'] . adm_back_link($this->u_action), E_USER_WARNING);
122                          }
123   
124                          set_config('record_online_users', 1, true);
125                          set_config('record_online_date', time(), true);
126                          add_log('admin', 'LOG_RESET_ONLINE');
127   
128                          if ($request->is_ajax())
129                          {
130                              trigger_error('RESET_ONLINE_SUCCESS');
131                          }
132                      break;
133   
134                      case 'stats':
135                          if (!$auth->acl_get('a_board'))
136                          {
137                              trigger_error($user->lang['NO_AUTH_OPERATION'] . adm_back_link($this->u_action), E_USER_WARNING);
138                          }
139   
140                          $sql = 'SELECT COUNT(post_id) AS stat
141                              FROM ' . POSTS_TABLE . '
142                              WHERE post_visibility = ' . ITEM_APPROVED;
143                          $result = $db->sql_query($sql);
144                          set_config('num_posts', (int) $db->sql_fetchfield('stat'), true);
145                          $db->sql_freeresult($result);
146   
147                          $sql = 'SELECT COUNT(topic_id) AS stat
148                              FROM ' . TOPICS_TABLE . '
149                              WHERE topic_visibility = ' . ITEM_APPROVED;
150                          $result = $db->sql_query($sql);
151                          set_config('num_topics', (int) $db->sql_fetchfield('stat'), true);
152                          $db->sql_freeresult($result);
153   
154                          $sql = 'SELECT COUNT(user_id) AS stat
155                              FROM ' . USERS_TABLE . '
156                              WHERE user_type IN (' . USER_NORMAL . ',' . USER_FOUNDER . ')';
157                          $result = $db->sql_query($sql);
158                          set_config('num_users', (int) $db->sql_fetchfield('stat'), true);
159                          $db->sql_freeresult($result);
160   
161                          $sql = 'SELECT COUNT(attach_id) as stat
162                              FROM ' . ATTACHMENTS_TABLE . '
163                              WHERE is_orphan = 0';
164                          $result = $db->sql_query($sql);
165                          set_config('num_files', (int) $db->sql_fetchfield('stat'), true);
166                          $db->sql_freeresult($result);
167   
168                          $sql = 'SELECT SUM(filesize) as stat
169                              FROM ' . ATTACHMENTS_TABLE . '
170                              WHERE is_orphan = 0';
171                          $result = $db->sql_query($sql);
172                          set_config('upload_dir_size', (float) $db->sql_fetchfield('stat'), true);
173                          $db->sql_freeresult($result);
174   
175                          if (!function_exists('update_last_username'))
176                          {
177                              include($phpbb_root_path . "includes/functions_user.$phpEx");
178                          }
179                          update_last_username();
180   
181                          add_log('admin', 'LOG_RESYNC_STATS');
182   
183                          if ($request->is_ajax())
184                          {
185                              trigger_error('RESYNC_STATS_SUCCESS');
186                          }
187                      break;
188   
189                      case 'user':
190                          if (!$auth->acl_get('a_board'))
191                          {
192                              trigger_error($user->lang['NO_AUTH_OPERATION'] . adm_back_link($this->u_action), E_USER_WARNING);
193                          }
194   
195                          // Resync post counts
196                          $start = $max_post_id = 0;
197   
198                          // Find the maximum post ID, we can only stop the cycle when we've reached it
199                          $sql = 'SELECT MAX(forum_last_post_id) as max_post_id
200                              FROM ' . FORUMS_TABLE;
201                          $result = $db->sql_query($sql);
202                          $max_post_id = (int) $db->sql_fetchfield('max_post_id');
203                          $db->sql_freeresult($result);
204   
205                          // No maximum post id? :o
206                          if (!$max_post_id)
207                          {
208                              $sql = 'SELECT MAX(post_id) as max_post_id
209                                  FROM ' . POSTS_TABLE;
210                              $result = $db->sql_query($sql);
211                              $max_post_id = (int) $db->sql_fetchfield('max_post_id');
212                              $db->sql_freeresult($result);
213                          }
214   
215                          // Still no maximum post id? Then we are finished
216                          if (!$max_post_id)
217                          {
218                              add_log('admin', 'LOG_RESYNC_POSTCOUNTS');
219                              break;
220                          }
221   
222                          $step = ($config['num_posts']) ? (max((int) ($config['num_posts'] / 5), 20000)) : 20000;
223                          $db->sql_query('UPDATE ' . USERS_TABLE . ' SET user_posts = 0');
224   
225                          while ($start < $max_post_id)
226                          {
227                              $sql = 'SELECT COUNT(post_id) AS num_posts, poster_id
228                                  FROM ' . POSTS_TABLE . '
229                                  WHERE post_id BETWEEN ' . ($start + 1) . ' AND ' . ($start + $step) . '
230                                      AND post_postcount = 1 AND post_visibility = ' . ITEM_APPROVED . '
231                                  GROUP BY poster_id';
232                              $result = $db->sql_query($sql);
233   
234                              if ($row = $db->sql_fetchrow($result))
235                              {
236                                  do
237                                  {
238                                      $sql = 'UPDATE ' . USERS_TABLE . " SET user_posts = user_posts + {$row['num_posts']} WHERE user_id = {$row['poster_id']}";
239                                      $db->sql_query($sql);
240                                  }
241                                  while ($row = $db->sql_fetchrow($result));
242                              }
243                              $db->sql_freeresult($result);
244   
245                              $start += $step;
246                          }
247   
248                          add_log('admin', 'LOG_RESYNC_POSTCOUNTS');
249   
250                          if ($request->is_ajax())
251                          {
252                              trigger_error('RESYNC_POSTCOUNTS_SUCCESS');
253                          }
254                      break;
255   
256                      case 'date':
257                          if (!$auth->acl_get('a_board'))
258                          {
259                              trigger_error($user->lang['NO_AUTH_OPERATION'] . adm_back_link($this->u_action), E_USER_WARNING);
260                          }
261   
262                          set_config('board_startdate', time() - 1);
263                          add_log('admin', 'LOG_RESET_DATE');
264   
265                          if ($request->is_ajax())
266                          {
267                              trigger_error('RESET_DATE_SUCCESS');
268                          }
269                      break;
270   
271                      case 'db_track':
272                          switch ($db->get_sql_layer())
273                          {
274                              case 'sqlite':
275                              case 'sqlite3':
276                                  $db->sql_query('DELETE FROM ' . TOPICS_POSTED_TABLE);
277                              break;
278   
279                              default:
280                                  $db->sql_query('TRUNCATE TABLE ' . TOPICS_POSTED_TABLE);
281                              break;
282                          }
283   
284                          // This can get really nasty... therefore we only do the last six months
285                          $get_from_time = time() - (6 * 4 * 7 * 24 * 60 * 60);
286   
287                          // Select forum ids, do not include categories
288                          $sql = 'SELECT forum_id
289                              FROM ' . FORUMS_TABLE . '
290                              WHERE forum_type <> ' . FORUM_CAT;
291                          $result = $db->sql_query($sql);
292   
293                          $forum_ids = array();
294                          while ($row = $db->sql_fetchrow($result))
295                          {
296                              $forum_ids[] = $row['forum_id'];
297                          }
298                          $db->sql_freeresult($result);
299   
300                          // Any global announcements? ;)
301                          $forum_ids[] = 0;
302   
303                          // Now go through the forums and get us some topics...
304                          foreach ($forum_ids as $forum_id)
305                          {
306                              $sql = 'SELECT p.poster_id, p.topic_id
307                                  FROM ' . POSTS_TABLE . ' p, ' . TOPICS_TABLE . ' t
308                                  WHERE t.forum_id = ' . $forum_id . '
309                                      AND t.topic_moved_id = 0
310                                      AND t.topic_last_post_time > ' . $get_from_time . '
311                                      AND t.topic_id = p.topic_id
312                                      AND p.poster_id <> ' . ANONYMOUS . '
313                                  GROUP BY p.poster_id, p.topic_id';
314                              $result = $db->sql_query($sql);
315   
316                              $posted = array();
317                              while ($row = $db->sql_fetchrow($result))
318                              {
319                                  $posted[$row['poster_id']][] = $row['topic_id'];
320                              }
321                              $db->sql_freeresult($result);
322   
323                              $sql_ary = array();
324                              foreach ($posted as $user_id => $topic_row)
325                              {
326                                  foreach ($topic_row as $topic_id)
327                                  {
328                                      $sql_ary[] = array(
329                                          'user_id'        => (int) $user_id,
330                                          'topic_id'        => (int) $topic_id,
331                                          'topic_posted'    => 1,
332                                      );
333                                  }
334                              }
335                              unset($posted);
336   
337                              if (sizeof($sql_ary))
338                              {
339                                  $db->sql_multi_insert(TOPICS_POSTED_TABLE, $sql_ary);
340                              }
341                          }
342   
343                          add_log('admin', 'LOG_RESYNC_POST_MARKING');
344   
345                          if ($request->is_ajax())
346                          {
347                              trigger_error('RESYNC_POST_MARKING_SUCCESS');
348                          }
349                      break;
350   
351                      case 'purge_cache':
352                          $config->increment('assets_version', 1);
353                          $cache->purge();
354   
355                          // Clear permissions
356                          $auth->acl_clear_prefetch();
357                          phpbb_cache_moderators($db, $cache, $auth);
358   
359                          add_log('admin', 'LOG_PURGE_CACHE');
360   
361                          if ($request->is_ajax())
362                          {
363                              trigger_error('PURGE_CACHE_SUCCESS');
364                          }
365                      break;
366   
367                      case 'purge_sessions':
368                          if ((int) $user->data['user_type'] !== USER_FOUNDER)
369                          {
370                              trigger_error($user->lang['NO_AUTH_OPERATION'] . adm_back_link($this->u_action), E_USER_WARNING);
371                          }
372   
373                          $tables = array(CONFIRM_TABLE, SESSIONS_TABLE);
374   
375                          foreach ($tables as $table)
376                          {
377                              switch ($db->get_sql_layer())
378                              {
379                                  case 'sqlite':
380                                  case 'sqlite3':
381                                      $db->sql_query("DELETE FROM $table");
382                                  break;
383   
384                                  default:
385                                      $db->sql_query("TRUNCATE TABLE $table");
386                                  break;
387                              }
388                          }
389   
390                          // let's restore the admin session
391                          $reinsert_ary = array(
392                                  'session_id'            => (string) $user->session_id,
393                                  'session_page'            => (string) substr($user->page['page'], 0, 199),
394                                  'session_forum_id'        => $user->page['forum'],
395                                  'session_user_id'        => (int) $user->data['user_id'],
396                                  'session_start'            => (int) $user->data['session_start'],
397                                  'session_last_visit'    => (int) $user->data['session_last_visit'],
398                                  'session_time'            => (int) $user->time_now,
399                                  'session_browser'        => (string) trim(substr($user->browser, 0, 149)),
400                                  'session_forwarded_for'    => (string) $user->forwarded_for,
401                                  'session_ip'            => (string) $user->ip,
402                                  'session_autologin'        => (int) $user->data['session_autologin'],
403                                  'session_admin'            => 1,
404                                  'session_viewonline'    => (int) $user->data['session_viewonline'],
405                          );
406   
407                          $sql = 'INSERT INTO ' . SESSIONS_TABLE . ' ' . $db->sql_build_array('INSERT', $reinsert_ary);
408                          $db->sql_query($sql);
409   
410                          add_log('admin', 'LOG_PURGE_SESSIONS');
411   
412                          if ($request->is_ajax())
413                          {
414                              trigger_error('PURGE_SESSIONS_SUCCESS');
415                          }
416                      break;
417                  }
418              }
419          }
420   
421          // Version check
422          $user->add_lang('install');
423   
424          if ($auth->acl_get('a_server') && version_compare(PHP_VERSION, '5.3.3', '<'))
425          {
426              $template->assign_vars(array(
427                  'S_PHP_VERSION_OLD'    => true,
428                  '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>'),
429              ));
430          }
431   
432          $version_helper = $phpbb_container->get('version_helper');
433          try
434          {
435              $recheck = $request->variable('versioncheck_force', false);
436              $updates_available = $version_helper->get_suggested_updates($recheck);
437   
438              $template->assign_var('S_VERSION_UP_TO_DATE', empty($updates_available));
439          }
440          catch (\RuntimeException $e)
441          {
442              $template->assign_vars(array(
443                  'S_VERSIONCHECK_FAIL'        => true,
444                  'VERSIONCHECK_FAIL_REASON'    => ($e->getMessage() !== $user->lang('VERSIONCHECK_FAIL')) ? $e->getMessage() : '',
445              ));
446          }
447   
448          /**
449          * Notice admin
450          *
451          * @event core.acp_main_notice
452          * @since 3.1.0-RC3
453          */
454          $phpbb_dispatcher->dispatch('core.acp_main_notice');
455   
456          // Get forum statistics
457          $total_posts = $config['num_posts'];
458          $total_topics = $config['num_topics'];
459          $total_users = $config['num_users'];
460          $total_files = $config['num_files'];
461   
462          $start_date = $user->format_date($config['board_startdate']);
463   
464          $boarddays = (time() - $config['board_startdate']) / 86400;
465   
466          $posts_per_day = sprintf('%.2f', $total_posts / $boarddays);
467          $topics_per_day = sprintf('%.2f', $total_topics / $boarddays);
468          $users_per_day = sprintf('%.2f', $total_users / $boarddays);
469          $files_per_day = sprintf('%.2f', $total_files / $boarddays);
470   
471          $upload_dir_size = get_formatted_filesize($config['upload_dir_size']);
472   
473          $avatar_dir_size = 0;
474   
475          if ($avatar_dir = @opendir($phpbb_root_path . $config['avatar_path']))
476          {
477              while (($file = readdir($avatar_dir)) !== false)
478              {
479                  if ($file[0] != '.' && $file != 'CVS' && strpos($file, 'index.') === false)
480                  {
481                      $avatar_dir_size += filesize($phpbb_root_path . $config['avatar_path'] . '/' . $file);
482                  }
483              }
484              closedir($avatar_dir);
485   
486              $avatar_dir_size = get_formatted_filesize($avatar_dir_size);
487          }
488          else
489          {
490              // Couldn't open Avatar dir.
491              $avatar_dir_size = $user->lang['NOT_AVAILABLE'];
492          }
493   
494          if ($posts_per_day > $total_posts)
495          {
496              $posts_per_day = $total_posts;
497          }
498   
499          if ($topics_per_day > $total_topics)
500          {
501              $topics_per_day = $total_topics;
502          }
503   
504          if ($users_per_day > $total_users)
505          {
506              $users_per_day = $total_users;
507          }
508   
509          if ($files_per_day > $total_files)
510          {
511              $files_per_day = $total_files;
512          }
513   
514          if ($config['allow_attachments'] || $config['allow_pm_attach'])
515          {
516              $sql = 'SELECT COUNT(attach_id) AS total_orphan
517                  FROM ' . ATTACHMENTS_TABLE . '
518                  WHERE is_orphan = 1
519                      AND filetime < ' . (time() - 3*60*60);
520              $result = $db->sql_query($sql);
521              $total_orphan = (int) $db->sql_fetchfield('total_orphan');
522              $db->sql_freeresult($result);
523          }
524          else
525          {
526              $total_orphan = false;
527          }
528   
529          $dbsize = get_database_size();
530   
531          $template->assign_vars(array(
532              'TOTAL_POSTS'        => $total_posts,
533              'POSTS_PER_DAY'        => $posts_per_day,
534              'TOTAL_TOPICS'        => $total_topics,
535              'TOPICS_PER_DAY'    => $topics_per_day,
536              'TOTAL_USERS'        => $total_users,
537              'USERS_PER_DAY'        => $users_per_day,
538              'TOTAL_FILES'        => $total_files,
539              'FILES_PER_DAY'        => $files_per_day,
540              'START_DATE'        => $start_date,
541              'AVATAR_DIR_SIZE'    => $avatar_dir_size,
542              'DBSIZE'            => $dbsize,
543              'UPLOAD_DIR_SIZE'    => $upload_dir_size,
544              'TOTAL_ORPHAN'        => $total_orphan,
545              'S_TOTAL_ORPHAN'    => ($total_orphan === false) ? false : true,
546              'GZIP_COMPRESSION'    => ($config['gzip_compress'] && @extension_loaded('zlib')) ? $user->lang['ON'] : $user->lang['OFF'],
547              'DATABASE_INFO'        => $db->sql_server_info(),
548              'BOARD_VERSION'        => $config['version'],
549   
550              'U_ACTION'            => $this->u_action,
551              'U_ADMIN_LOG'        => append_sid("{$phpbb_admin_path}index.$phpEx", 'i=logs&amp;mode=admin'),
552              'U_INACTIVE_USERS'    => append_sid("{$phpbb_admin_path}index.$phpEx", 'i=inactive&amp;mode=list'),
553              'U_VERSIONCHECK'    => append_sid("{$phpbb_admin_path}index.$phpEx", 'i=update&amp;mode=version_check'),
554              'U_VERSIONCHECK_FORCE'    => append_sid("{$phpbb_admin_path}index.$phpEx", 'versioncheck_force=1'),
555   
556              'S_ACTION_OPTIONS'    => ($auth->acl_get('a_board')) ? true : false,
557              'S_FOUNDER'            => ($user->data['user_type'] == USER_FOUNDER) ? true : false,
558              )
559          );
560   
561          $log_data = array();
562          $log_count = false;
563   
564          if ($auth->acl_get('a_viewlogs'))
565          {
566              view_log('admin', $log_data, $log_count, 5);
567   
568              foreach ($log_data as $row)
569              {
570                  $template->assign_block_vars('log', array(
571                      'USERNAME'    => $row['username_full'],
572                      'IP'        => $row['ip'],
573                      'DATE'        => $user->format_date($row['time']),
574                      'ACTION'    => $row['action'])
575                  );
576              }
577          }
578   
579          if ($auth->acl_get('a_user'))
580          {
581              $user->add_lang('memberlist');
582   
583              $inactive = array();
584              $inactive_count = 0;
585   
586              view_inactive_users($inactive, $inactive_count, 10);
587   
588              foreach ($inactive as $row)
589              {
590                  $template->assign_block_vars('inactive', array(
591                      'INACTIVE_DATE'    => $user->format_date($row['user_inactive_time']),
592                      'REMINDED_DATE'    => $user->format_date($row['user_reminded_time']),
593                      'JOINED'        => $user->format_date($row['user_regdate']),
594                      'LAST_VISIT'    => (!$row['user_lastvisit']) ? ' - ' : $user->format_date($row['user_lastvisit']),
595   
596                      'REASON'        => $row['inactive_reason'],
597                      'USER_ID'        => $row['user_id'],
598                      'POSTS'            => ($row['user_posts']) ? $row['user_posts'] : 0,
599                      'REMINDED'        => $row['user_reminded'],
600   
601                      'REMINDED_EXPLAIN'    => $user->lang('USER_LAST_REMINDED', (int) $row['user_reminded'], $user->format_date($row['user_reminded_time'])),
602   
603                      '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')),
604                      'USERNAME'            => get_username_string('username', $row['user_id'], $row['username'], $row['user_colour']),
605                      'USER_COLOR'        => get_username_string('colour', $row['user_id'], $row['username'], $row['user_colour']),
606   
607                      'U_USER_ADMIN'    => append_sid("{$phpbb_admin_path}index.$phpEx", "i=users&amp;mode=overview&amp;u={$row['user_id']}"),
608                      'U_SEARCH_USER'    => ($auth->acl_get('u_search')) ? append_sid("{$phpbb_root_path}search.$phpEx", "author_id={$row['user_id']}&amp;sr=posts") : '',
609                  ));
610              }
611   
612              $option_ary = array('activate' => 'ACTIVATE', 'delete' => 'DELETE');
613              if ($config['email_enable'])
614              {
615                  $option_ary += array('remind' => 'REMIND');
616              }
617   
618              $template->assign_vars(array(
619                  'S_INACTIVE_USERS'        => true,
620                  'S_INACTIVE_OPTIONS'    => build_select($option_ary))
621              );
622          }
623   
624          // Warn if install is still present
625          if (file_exists($phpbb_root_path . 'install') && !is_file($phpbb_root_path . 'install'))
626          {
627              $template->assign_var('S_REMOVE_INSTALL', true);
628          }
629   
630          // Warn if no search index is created
631          if ($config['num_posts'] && class_exists($config['search_type']))
632          {
633              $error = false;
634              $search_type = $config['search_type'];
635              $search = new $search_type($error, $phpbb_root_path, $phpEx, $auth, $config, $db, $user);
636   
637              if (!$search->index_created())
638              {
639                  $template->assign_vars(array(
640                      'S_SEARCH_INDEX_MISSING'    => true,
641                      '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>'),
642                  ));
643              }
644          }
645   
646          if (!defined('PHPBB_DISABLE_CONFIG_CHECK') && file_exists($phpbb_root_path . 'config.' . $phpEx) && phpbb_is_writable($phpbb_root_path . 'config.' . $phpEx))
647          {
648              // World-Writable? (000x)
649              $template->assign_var('S_WRITABLE_CONFIG', (bool) (@fileperms($phpbb_root_path . 'config.' . $phpEx) & 0x0002));
650          }
651   
652          if (extension_loaded('mbstring'))
653          {
654              $template->assign_vars(array(
655                  'S_MBSTRING_LOADED'                        => true,
656                  'S_MBSTRING_FUNC_OVERLOAD_FAIL'            => (intval(@ini_get('mbstring.func_overload')) & (MB_OVERLOAD_MAIL | MB_OVERLOAD_STRING)),
657                  'S_MBSTRING_ENCODING_TRANSLATION_FAIL'    => (@ini_get('mbstring.encoding_translation') != 0),
658                  'S_MBSTRING_HTTP_INPUT_FAIL'            => !in_array(@ini_get('mbstring.http_input'), array('pass', '')),
659                  'S_MBSTRING_HTTP_OUTPUT_FAIL'            => !in_array(@ini_get('mbstring.http_output'), array('pass', '')),
660              ));
661          }
662   
663          // Fill dbms version if not yet filled
664          if (empty($config['dbms_version']))
665          {
666              set_config('dbms_version', $db->sql_server_info(true));
667          }
668   
669          $this->tpl_name = 'acp_main';
670          $this->page_title = 'ACP_MAIN';
671      }
672  }
673