Brauche Hilfe mit dem group_acces - Mod/ snippet
Verfasst: 13.03.2005 22:16
Code: Alles auswählen
Notice: Use of undefined constant group_id - assumed 'group_id' in /usr/export/www/hosting/absolut3/bboy/final_v1/phpbb2/home.php on line 67
Notice: Use of undefined constant group_name - assumed 'group_name' in /usr/export/www/hosting/absolut3/bboy/final_v1/phpbb2/home.php on line 72
Notice: Undefined offset: 1 in /usr/export/www/hosting/absolut3/bboy/final_v1/phpbb2/home.php on line 65
Notice: Undefined offset: 0 in /usr/export/www/hosting/absolut3/bboy/final_v1/phpbb2/home.php on line 65
Notice: Use of undefined constant group_id - assumed 'group_id' in /usr/export/www/hosting/absolut3/bboy/final_v1/phpbb2/home.php on line 67
Notice: Use of undefined constant group_name - assumed 'group_name' in /usr/export/www/hosting/absolut3/bboy/final_v1/phpbb2/home.php on line 72
Notice: Use of undefined constant HAS_DIED - assumed 'HAS_DIED' in /usr/export/www/hosting/absolut3/bboy/final_v1/phpbb2/includes/functions.php on line 591
Notice: Undefined variable: page_title in /usr/export/www/hosting/absolut3/bboy/final_v1/phpbb2/includes/page_header.php on line 349
was mach ich falsch ?
ich hab alles geforderte included und auch das page_start is da.
hab ich da was falsch gemacht?
Das Script:
Code: Alles auswählen
<?PHP
$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.');
}
}
?>
abso
p.s.: sry wenns irgend ne noob-frage is, bin halt nun mal noch nicht lange dabei
