ich verstehe nicht genau, was man mit DIESEM MOD machen muss, damit es funktioniert.
Hier mal der Code:
Code: Alles auswählen
<?php
/***************************************************************************
* name.php Gruppenverwaltung zum Schutz von Websites
* -------------------
* copyright : (C) 2002
* email : mail
*
*
* uses phpBB technology (c) 2001 phpBB Group <http://www.phpbb.com/>
*
***************************************************************************/
/* **************************************************************************
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
***************************************************************************/
define('IN_PHPBB', true);
$phpbb_root_path = './';
include($phpbb_root_path . 'extension.inc');
include($phpbb_root_path . 'common.'.$phpEx);
//
// Start session management
//
$userdata = session_pagestart($user_ip, PAGE_INDEX);
init_userprefs($userdata);
//
// End session management
//
include($phpbb_root_path . 'includes/page_header.'.$phpEx);
// User die zugriff haben: es sind gruppen_ids, gruppennamen und user_ids erlaubt wobei bei den gruppen namen und ids ein g am anfang angehängt werden muss.
$allowed_u = array();
$allowed_u[] = 'g3'; //gruppe
$access_allowed = false;
if( in_array($userdata['user_id'],$allowed_u))
{
$access_allowed = true;
}
else
{
$sql = "SELECT g.group_id, g.group_name
FROM " . USER_GROUP_TABLE . " ug, " . GROUPS_TABLE . " g
WHERE ug.user_id = '" . $userdata['user_id'] . "'
AND g.group_id = ug.group_id";
if ( !($result = $db->sql_query($sql)) )
{
message_die(GENERAL_ERROR, 'Could not get user group.', '', __LINE__, __FILE__, $sql);
}
$access_allowed = false;
while( list($group_id, $group_name) = $db->sql_fetchrow($result) )
{
if( in_array('g' . $group_id[group_id],$allowed_u ))
{
$access_allowed = true;
break;
}
if( in_array('g' . $group_name[group_name],$allowed_u))
{
$access_allowed = true;
break;
}
}
if( !$access_allowed )
{
message_die(GENERAL_MESSAGE, 'Sie haben keinen Zugriff auf diese Seite.');
}
}
include($phpbb_root_path . 'includes/page_tail.'.$phpEx);
?>
Code: Alles auswählen
$phpbb_root_path = './'; muss entsprechend angepasst werden
Vor include($phpbb_root_path . 'includes/page_tail.'.$phpEx); kommt der Inhalt der Website
$allowed_u[] = 'g3'; //gruppe ist ein Array mit den Gruppen. Für mehrere Gruppen einfach
$allowed_u[] = 'g3'; //gruppe
$allowed_u[] = 'g4'; //gruppe
usw.
Also ich möchte die gesammte ignorlist da einbaun, aber wie??
mfg