Verzeichnisstruktur phpBB-3.0.0


Veröffentlicht
12.12.2007

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_disallow.php

Zuletzt modifiziert: 09.10.2024, 12:51 - Dateigröße: 2.60 KiB


001  <?php
002  /**
003  *
004  * @package acp
005  * @version $Id$
006  * @copyright (c) 2005 phpBB Group
007  * @license http://opensource.org/licenses/gpl-license.php GNU Public License
008  *
009  */
010   
011  /**
012  * @ignore
013  */
014  if (!defined('IN_PHPBB'))
015  {
016      exit;
017  }
018   
019  /**
020  * @package acp
021  */
022  class acp_disallow
023  {
024      var $u_action;
025   
026      function main($id, $mode)
027      {
028          global $db, $user, $auth, $template, $cache;
029          global $config, $phpbb_root_path, $phpbb_admin_path, $phpEx;
030   
031          include($phpbb_root_path . 'includes/functions_user.' . $phpEx);
032   
033          $user->add_lang('acp/posting');
034   
035          // Set up general vars
036          $this->tpl_name = 'acp_disallow';
037          $this->page_title = 'ACP_DISALLOW_USERNAMES';
038   
039          $form_key = 'acp_disallow';
040          add_form_key($form_key);
041   
042          $disallow = (isset($_POST['disallow'])) ? true : false;
043          $allow = (isset($_POST['allow'])) ? true : false;
044   
045          if (($allow || $disallow) && !check_form_key($form_key))
046          {
047              trigger_error($user->lang['FORM_INVALID'] . adm_back_link($this->u_action), E_USER_WARNING);
048          }
049   
050          if ($disallow)
051          {
052              $disallowed_user = str_replace('*', '%', utf8_normalize_nfc(request_var('disallowed_user', '', true)));
053   
054              if (!$disallowed_user)
055              {
056                  trigger_error($user->lang['NO_USERNAME_SPECIFIED'] . adm_back_link($this->u_action), E_USER_WARNING);
057              }
058   
059              $sql = 'INSERT INTO ' . DISALLOW_TABLE . ' ' . $db->sql_build_array('INSERT', array('disallow_username' => $disallowed_user));
060              $db->sql_query($sql);
061   
062              $cache->destroy('_disallowed_usernames');
063   
064              $message = $user->lang['DISALLOW_SUCCESSFUL'];
065              add_log('admin', 'LOG_DISALLOW_ADD', str_replace('%', '*', $disallowed_user));
066   
067              trigger_error($message . adm_back_link($this->u_action));
068          }
069          else if ($allow)
070          {
071              $disallowed_id = request_var('disallowed_id', 0);
072   
073              if (!$disallowed_id)
074              {
075                  trigger_error($user->lang['NO_USERNAME_SPECIFIED'] . adm_back_link($this->u_action), E_USER_WARNING);
076              }
077   
078              $sql = 'DELETE FROM ' . DISALLOW_TABLE . '
079                  WHERE disallow_id = ' . $disallowed_id;
080              $db->sql_query($sql);
081   
082              $cache->destroy('_disallowed_usernames');
083   
084              add_log('admin', 'LOG_DISALLOW_DELETE');
085   
086              trigger_error($user->lang['DISALLOWED_DELETED'] . adm_back_link($this->u_action));
087          }
088   
089          // Grab the current list of disallowed usernames...
090          $sql = 'SELECT *
091              FROM ' . DISALLOW_TABLE;
092          $result = $db->sql_query($sql);
093   
094          $disallow_select = '';
095          while ($row = $db->sql_fetchrow($result))
096          {
097              $disallow_select .= '<option value="' . $row['disallow_id'] . '">' . str_replace('%', '*', $row['disallow_username']) . '</option>';
098          }
099          $db->sql_freeresult($result);
100   
101          $template->assign_vars(array(
102              'U_ACTION'                => $this->u_action,
103              'S_DISALLOWED_NAMES'    => $disallow_select)
104          );
105      }
106  }
107   
108  ?>