ich suche eine möglichkeit wie man eine seperate phpBB Seite mittels Benutzergruppe zu schützen.
Hat da jemand eine Idee wie man das hinbekommt?

Vielen Dank für eure Hilfe!
Code: Alles auswählen
$allowed_u[] = 'g3'; //gruppe ist ein Array mit den Gruppen. Für mehrere Gruppen einfach
$allowed_u[] = 'g3'; //gruppe
$allowed_u[] = 'g4'; //gruppe
Code: Alles auswählen
$allowed_u[] = 'Gruppename';
Code: Alles auswählen
$allowed_u[] = 'Gruppenname1';
$allowed_u[] = 'Gruppenname4';
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[] = 'fotostory'; //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.');
}
}
echo "
<html>
<head>
<title>Windel - Fotostory</title>
</head>
<table width='100%' cellspacing='2' cellpadding='2' border='0' align='center'>
<tr>
<td align='left' class='nav'><a href='{U_INDEX}' class='nav'>{L_INDEX}</a></td>
</tr>
</table>
<table width='100%' cellpadding='3' cellspacing='1' border='0' class='forumline'>
<tr>
<th class='thHead'><b>Windel - Fotostory</b></th>
</tr>
<tr>
<td class='row1' align='center'><span class='mainmenu'><b>Seite ist noch nicht ganz fertig</b></span></td>
</tr>
</table>
<table width='100%' cellspacing='2' border='0' align='center'>
<tr>
<td align='right' valign='middle' nowrap='nowrap'><span class='gensmall'>{S_TIMEZONE}</span><br /><br />{JUMPBOX}</td>
</tr>
</table>
</html>
";
include($phpbb_root_path . 'includes/page_tail.'.$phpEx);
?>