Verzeichnisstruktur phpBB-2.0.0


Veröffentlicht
03.04.2002

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

admin_disallow.php

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


001  <?php
002  /***************************************************************************
003   *                            admin_disallow.php
004   *                            -------------------
005   *   begin                : Tuesday, Oct 05, 2001
006   *   copyright            : (C) 2001 The phpBB Group
007   *   email                : support@phpbb.com
008   *
009   *   $Id$
010   *
011   *
012   ***************************************************************************/
013   
014  /***************************************************************************
015   *
016   *   This program is free software; you can redistribute it and/or modify
017   *   it under the terms of the GNU General Public License as published by
018   *   the Free Software Foundation; either version 2 of the License, or
019   *   (at your option) any later version.
020   *
021   ***************************************************************************/
022   
023  define('IN_PHPBB', 1);
024   
025  if( !empty($setmodules) )
026  {
027      $filename = basename(__FILE__);
028      $module['Users']['Disallow'] = $filename;
029   
030      return;
031  }
032   
033  //
034  // Include required files, get $phpEx and check permissions
035  //
036  $phpbb_root_path = "./../";
037  require($phpbb_root_path . 'extension.inc');
038  require('./pagestart.' . $phpEx);
039   
040  if( isset($HTTP_POST_VARS['add_name']) )
041  {
042      include($phpbb_root_path . 'includes/functions_validate.'.$phpEx);
043   
044      $disallowed_user = ( isset($HTTP_POST_VARS['disallowed_user']) ) ? trim($HTTP_POST_VARS['disallowed_user']) : trim($HTTP_GET_VARS['disallowed_user']);
045   
046      if ($disallowed_user == '')
047      {
048          message_die(GENERAL_MESSAGE, $lang['Fields_empty']);
049      }
050      if( !validate_username($disallowed_user) )
051      {
052          $message = $lang['Disallowed_already'];
053      }
054      else
055      {
056          $sql = "INSERT INTO " . DISALLOW_TABLE . " (disallow_username) 
057              VALUES('" . str_replace("\'", "''", $disallowed_user) . "')";
058          $result = $db->sql_query( $sql );
059          if ( !$result )
060          {
061              message_die(GENERAL_ERROR, "Could not add disallowed user.", "",__LINE__, __FILE__, $sql);
062          }
063          $message = $lang['Disallow_successful'];
064      }
065   
066      $message .= "<br /><br />" . sprintf($lang['Click_return_disallowadmin'], "<a href=\"" . append_sid("admin_disallow.$phpEx") . "\">", "</a>") . "<br /><br />" . sprintf($lang['Click_return_admin_index'], "<a href=\"" . append_sid("index.$phpEx?pane=right") . "\">", "</a>");
067   
068      message_die(GENERAL_MESSAGE, $message);
069  }
070  else if( isset($HTTP_POST_VARS['delete_name']) )
071  {
072      $disallowed_id = ( isset($HTTP_POST_VARS['disallowed_id']) ) ? intval( $HTTP_POST_VARS['disallowed_id'] ) : intval( $HTTP_GET_VARS['disallowed_id'] );
073      
074      $sql = "DELETE FROM " . DISALLOW_TABLE . " 
075          WHERE disallow_id = $disallowed_id";
076      $result = $db->sql_query($sql);
077      if( !$result )
078      {
079          message_die(GENERAL_ERROR, "Couldn't removed disallowed user.", "",__LINE__, __FILE__, $sql);
080      }
081   
082      $message .= $lang['Disallowed_deleted'] . "<br /><br />" . sprintf($lang['Click_return_disallowadmin'], "<a href=\"" . append_sid("admin_disallow.$phpEx") . "\">", "</a>") . "<br /><br />" . sprintf($lang['Click_return_admin_index'], "<a href=\"" . append_sid("index.$phpEx?pane=right") . "\">", "</a>");
083   
084      message_die(GENERAL_MESSAGE, $message);
085   
086  }
087   
088  //
089  // Grab the current list of disallowed usernames...
090  //
091  $sql = "SELECT * 
092      FROM " . DISALLOW_TABLE;
093  $result = $db->sql_query($sql);
094  if( !$result )
095  {
096      message_die(GENERAL_ERROR, "Couldn't get disallowed users.", "", __LINE__, __FILE__, $sql );
097  }
098   
099  $disallowed = $db->sql_fetchrowset($result);
100   
101  //
102  // Ok now generate the info for the template, which will be put out no matter
103  // what mode we are in.
104  //
105  $disallow_select = '<select name="disallowed_id">';
106   
107  if( trim($disallowed) == "" )
108  {
109      $disallow_select .= '<option value="">' . $lang['no_disallowed'] . '</option>';
110  }
111  else 
112  {
113      $user = array();
114      for( $i = 0; $i < count($disallowed); $i++ )
115      {
116          $disallow_select .= '<option value="' . $disallowed[$i]['disallow_id'] . '">' . $disallowed[$i]['disallow_username'] . '</option>';
117      }
118  }
119   
120  $disallow_select .= '</select>';
121   
122  $template->set_filenames(array(
123      "body" => "admin/disallow_body.tpl")
124  );
125   
126  $template->assign_vars(array(
127      "S_DISALLOW_SELECT" => $disallow_select,
128      "S_FORM_ACTION" => append_sid("admin_disallow.$phpEx"),
129   
130      "L_INFO" => $output_info,
131      "L_DISALLOW_TITLE" => $lang['Disallow_control'],
132      "L_DISALLOW_EXPLAIN" => $lang['Disallow_explain'],
133      "L_DELETE" => $lang['Delete_disallow'],
134      "L_DELETE_DISALLOW" => $lang['Delete_disallow_title'],
135      "L_DELETE_EXPLAIN" => $lang['Delete_disallow_explain'],
136      "L_ADD" => $lang['Add_disallow'],
137      "L_ADD_DISALLOW" => $lang['Add_disallow_title'],
138      "L_ADD_EXPLAIN" => $lang['Add_disallow_explain'],
139      "L_USERNAME" => $lang['Username'])
140  );
141   
142  $template->pparse("body");
143   
144  include('./page_footer_admin.'.$phpEx);
145   
146  ?>