Wie heeft er zin.

Hulp nodig bij een modificaties of op zoek naar een MOD? Bekijk ons archief. Support wordt helaas niet meer verleend.
Forumregels

Sinds 1 januari 2009 wordt phpBB2 niet meer ondersteund.
Onderstaande informatie is verouderd en dient uitsluitend als archief.
phpBB2.0.x
Gesloten
Mwtvz
Berichten: 52
Lid geworden op: 10 sep 2005, 21:33

Wie heeft er zin.

Bericht door Mwtvz » 14 sep 2005, 20:25

Ik heb dus die gast prission gedownload en ik heb die files geweizigd.

Ik krijg telkens een error

Ik weet dan heb ik iets fout getypt.


Kan iemand ff de files veranderen ik heb verder geen mods geinstaleerd behalve portal,echte naam.

Gebruikersavatar
Paul
Beheerder
Beheerder
Berichten: 20316
Lid geworden op: 23 okt 2003, 11:38
Locatie: Utrecht
Contacteer:

Bericht door Paul » 14 sep 2005, 20:28

En ik snap dit niet. Leg is duidelijker uit, en geef aan welke fouten ;)

Mwtvz
Berichten: 52
Lid geworden op: 10 sep 2005, 21:33

Bericht door Mwtvz » 14 sep 2005, 20:33

Een fout over die en die en die lijn.

Ik wou gewoon vragen of 1 van jullie dat kon doen.


Btw dit is het klad blok:

##############################################################
## MOD Title: Guest permission
## MOD Author: Niels < ncr@db9.dk > (Niels Chr. Rød) http://mods.db9.dk
## MOD Description: This mod will make it posible to give
## guest users ACL permission (private).
## This way you may give guest users
## more/different access than reg users.
## MOD Version: 1.0.2
## MOD Compatibility: 2.0.6
##
## Installation Level: Easy
## Installation Time: 2 Minutes
## Files To Edit: 3
## includes/auth.php
## includes/functions.php
## includes/functions_search.php
##
## Included Files: 0
##
##############################################################
## For Security Purposes, Please Check: http://www.phpbb.com/mods/ for the
## latest version of this MOD. Downloading this MOD from other sites could cause malicious code
## to enter into your phpBB Forum. As such, phpBB will not offer support for MOD's not offered
## in our MOD-Database, located at: http://www.phpbb.com/mods/
##############################################################
## Author Notes:
##
## 1. Full MOD description
## -----------
## This mod will make it posible to give guest users ACL
## permission (private). This way you may give guest users
## more/different access than reg users.
## You may even make guest users "moderators" of a specific forum.
## Guest useername are "-1" or "Anonymous" when ever you look
## it up in ACP
##
## To look up the guest user permission in admin panel, fill
## username with -1 this will bring up the user permission page,
## for guest users
##
## 2. EasyMOD
## -----------
## This MOD is compatible and can be installed by EasyMOD
## of Nuttzy (but is not officially EasyMOD Compliant)!
## http://area51.phpbb.com/phpBB22/viewforum.php?sid=&f=15
##
## 3. Official last version link
## -----------
## Meanwhile the phpBB group validation and as the MOD is not yet
## in the phpBB MOD database, check this official link for updates...
## http://mods.db9.dk/viewtopic.php?t=1440
##
## 4. Warning
## -----------
## Since this mod, changes the permission system, make shure
## you know what you are doing install only this mod if you
## really need it !
##
##############################################################
## MOD History:
##
## 2003-12-14 - Version 1.0.2
## - phpBB template & EasyMOD compliance enhancement
##
## ????-??-?? - Version 1.0.1
## - a typo in the how-to caused faunctions_search.php to fail
## now corrected
##
## ????-??-?? - Version 1.0.0
## - Considered as final and made 2.0.6 + EM ready
##
## ????-??-?? - Version 0.9.3
## - change to functions_search.php
##
## ????-??-?? - Version 0.9.2
## - the file functions_validate.php should have been
## functions.php + corrected a find tag
##
## ????-??-?? - Version 0.9.1
## - corrected the how-to
##
## ????-??-?? - Version 0.9.0
## - initial BETA
##
##############################################################
## Before Adding This MOD To Your Forum, You Should Back Up All Files Related To This MOD
##############################################################
#
#-----[ OPEN ]------------------------------------------------
#
includes/auth.php

#
#-----[ FIND ]------------------------------------------------
#
if ( $userdata['session_logged_in'] )
{

#
#-----[ REPLACE WITH ]----------------------------------------
#

// 2 lines deleted - Guest permission MOD

#
#-----[ FIND ]------------------------------------------------
#
while( $row = $db->sql_fetchrow($result) );
}
}

#
#-----[ REPLACE WITH ]----------------------------------------
#

// Start add - Guest permission MOD
while( $row = $db->sql_fetchrow($result) );
}
// End add - Guest permission MOD

#
#-----[ FIND ]------------------------------------------------
#
$auth_user[$key] = ( $userdata['session_logged_in'] ) ? auth_check_user(AUTH_ACL, $key, $u_access, $is_admin) : 0;

#
#-----[ REPLACE WITH ]----------------------------------------
#

// Start add - Guest permission MOD
$auth_user[$key] = auth_check_user(AUTH_ACL, $key, $u_access, $is_admin);
// End add - Guest permission MOD

#
#-----[ FIND ]------------------------------------------------
#
$auth_user[$f_forum_id][$key] = ( $userdata['session_logged_in'] ) ? auth_check_user(AUTH_ACL, $key, $u_access[$f_forum_id], $is_admin) : 0;

#
#-----[ REPLACE WITH ]----------------------------------------
#

// Start add - Guest permission MOD
$auth_user[$f_forum_id][$key] = auth_check_user(AUTH_ACL, $key, $u_access[$f_forum_id], $is_admin);
// End add - Guest permission MOD

#
#-----[ FIND ]------------------------------------------------
#
$auth_user['auth_mod'] = ( $userdata['session_logged_in'] ) ? auth_check_user(AUTH_MOD, 'auth_mod', $u_access, $is_admin) : 0;

#
#-----[ REPLACE WITH ]----------------------------------------
#
# Do not do this line, if you plan NOT to give guest users
# moderator permissions in any forum!
#

// Start add - Guest permission MOD
$auth_user['auth_mod'] = auth_check_user(AUTH_MOD, 'auth_mod', $u_access, $is_admin);
// End add - Guest permission MOD

#
#-----[ FIND ]------------------------------------------------
#
$auth_user[$f_forum_id]['auth_mod'] = ( $userdata['session_logged_in'] ) ? auth_check_user(AUTH_MOD, 'auth_mod', $u_access[$f_forum_id], $is_admin) : 0;

#
#-----[ REPLACE WITH ]----------------------------------------
#

// You may choise NOT to do these lines below, if you plan NOT to give guest users moderator permissions in any forum
// the outcommented line is the original line, comment it back if you like.
// $auth_user[$f_forum_id]['auth_mod'] = ( $userdata['session_logged_in'] ) ? auth_check_user(AUTH_MOD, 'auth_mod', $u_access[$f_forum_id], $is_admin) : 0;
// the line below are the newly inserted line, witch have replaced the line above.
$auth_user[$f_forum_id]['auth_mod'] = auth_check_user(AUTH_MOD, 'auth_mod', $u_access[$f_forum_id], $is_admin) ;
// End add - Guest permission MOD

#
#-----[ OPEN ]------------------------------------------------
#
includes/functions.php

#
#-----[ FIND ]------------------------------------------------
#
$sql .= ( ( is_integer($user) ) ? "user_id = $user" : "username = '" . $user . "'" ) . " AND user_id <> " . ANONYMOUS;

#
#-----[ REPLACE WITH ]----------------------------------------
#

// Start add - Guest permission MOD
$sql .= ( ( is_integer($user) || $user == ANONYMOUS ) ? "user_id = $user" : "username = '" . $user . "'" ) ;
// End add - Guest permission MOD

#
#-----[ OPEN ]------------------------------------------------
#
includes/functions_search.php

#
#-----[ FIND ]------------------------------------------------
#
global $starttime, $gen_simple_header;

#
#-----[ IN-LINE FIND ]----------------------------------------
#
;

#
#-----[ IN-LINE BEFORE, ADD ]---------------------------------
#
, $userdata

#
#-----[ SAVE/CLOSE ALL FILES ]--------------------------------
#
# EoM

Gebruikersavatar
Bee
Berichten: 13403
Lid geworden op: 29 aug 2004, 10:30

Bericht door Bee » 14 sep 2005, 20:34

En welke fout krijg je dan. Een fout is heel erg onduidelijk.
... Maar ik modereer (nog) niet.

Mwtvz
Berichten: 52
Lid geworden op: 10 sep 2005, 21:33

Bericht door Mwtvz » 14 sep 2005, 20:37

w8 dan moet ik alles weer weizigen w8

Mwtvz
Berichten: 52
Lid geworden op: 10 sep 2005, 21:33

Bericht door Mwtvz » 14 sep 2005, 20:47

Parse error: parse error, unexpected '}' in /vhost/usr/diabloforum/phpBB2/includes/auth.php on line 290


Auht:

<?php
/***************************************************************************
* auth.php
* -------------------
* begin : Saturday, Feb 13, 2001
* copyright : (C) 2001 The phpBB Group
* email : support@phpbb.com
*
* $Id: auth.php,v 1.37.2.5 2004/03/01 16:49:03 psotfx Exp $
*
*
***************************************************************************/

/***************************************************************************
*
* 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.
*
***************************************************************************/

/*
$type's accepted (pre-pend with AUTH_):
VIEW, READ, POST, REPLY, EDIT, DELETE, STICKY, ANNOUNCE, VOTE, POLLCREATE

Possible options ($type/forum_id combinations):

* If you include a type and forum_id then a specific lookup will be done and
the single result returned

* If you set type to AUTH_ALL and specify a forum_id an array of all auth types
will be returned

* If you provide a forum_id a specific lookup on that forum will be done

* If you set forum_id to AUTH_LIST_ALL and specify a type an array listing the
results for all forums will be returned

* If you set forum_id to AUTH_LIST_ALL and type to AUTH_ALL a multidimensional
array containing the auth permissions for all types and all forums for that
user is returned

All results are returned as associative arrays, even when a single auth type is
specified.

If available you can send an array (either one or two dimensional) containing the
forum auth levels, this will prevent the auth function having to do its own
lookup
*/
function auth($type, $forum_id, $userdata, $f_access = '')
{
global $db, $lang;

switch( $type )
{
case AUTH_ALL:
$a_sql = 'a.auth_view, a.auth_read, a.auth_post, a.auth_reply, a.auth_edit, a.auth_delete, a.auth_sticky, a.auth_announce, a.auth_vote, a.auth_pollcreate';
$auth_fields = array('auth_view', 'auth_read', 'auth_post', 'auth_reply', 'auth_edit', 'auth_delete', 'auth_sticky', 'auth_announce', 'auth_vote', 'auth_pollcreate');
break;

case AUTH_VIEW:
$a_sql = 'a.auth_view';
$auth_fields = array('auth_view');
break;

case AUTH_READ:
$a_sql = 'a.auth_read';
$auth_fields = array('auth_read');
break;
case AUTH_POST:
$a_sql = 'a.auth_post';
$auth_fields = array('auth_post');
break;
case AUTH_REPLY:
$a_sql = 'a.auth_reply';
$auth_fields = array('auth_reply');
break;
case AUTH_EDIT:
$a_sql = 'a.auth_edit';
$auth_fields = array('auth_edit');
break;
case AUTH_DELETE:
$a_sql = 'a.auth_delete';
$auth_fields = array('auth_delete');
break;

case AUTH_ANNOUNCE:
$a_sql = 'a.auth_announce';
$auth_fields = array('auth_announce');
break;
case AUTH_STICKY:
$a_sql = 'a.auth_sticky';
$auth_fields = array('auth_sticky');
break;

case AUTH_POLLCREATE:
$a_sql = 'a.auth_pollcreate';
$auth_fields = array('auth_pollcreate');
break;
case AUTH_VOTE:
$a_sql = 'a.auth_vote';
$auth_fields = array('auth_vote');
break;
case AUTH_ATTACH:
break;

default:
break;
}

//
// If f_access has been passed, or auth is needed to return an array of forums
// then we need to pull the auth information on the given forum (or all forums)
//
if ( empty($f_access) )
{
$forum_match_sql = ( $forum_id != AUTH_LIST_ALL ) ? "WHERE a.forum_id = $forum_id" : '';

$sql = "SELECT a.forum_id, $a_sql
FROM " . FORUMS_TABLE . " a
$forum_match_sql";
if ( !($result = $db->sql_query($sql)) )
{
message_die(GENERAL_ERROR, 'Failed obtaining forum access control lists', '', __LINE__, __FILE__, $sql);
}

$sql_fetchrow = ( $forum_id != AUTH_LIST_ALL ) ? 'sql_fetchrow' : 'sql_fetchrowset';

if ( !($f_access = $db->$sql_fetchrow($result)) )
{
$db->sql_freeresult($result);
return array();
}
$db->sql_freeresult($result);
}

//
// If the user isn't logged on then all we need do is check if the forum
// has the type set to ALL, if yes they are good to go, if not then they
// are denied access
//
$u_access = array();

$forum_match_sql = ( $forum_id != AUTH_LIST_ALL ) ? "AND a.forum_id = $forum_id" : '';

$sql = "SELECT a.forum_id, $a_sql, a.auth_mod
FROM " . AUTH_ACCESS_TABLE . " a, " . USER_GROUP_TABLE . " ug
WHERE ug.user_id = ".$userdata['user_id']. "
AND ug.user_pending = 0
AND a.group_id = ug.group_id
$forum_match_sql";
if ( !($result = $db->sql_query($sql)) )
{
message_die(GENERAL_ERROR, 'Failed obtaining forum access control lists', '', __LINE__, __FILE__, $sql);
}

if ( $row = $db->sql_fetchrow($result) )
{
do
{
if ( $forum_id != AUTH_LIST_ALL)
{
$u_access[] = $row;
}
else
{
$u_access[$row['forum_id']][] = $row;
}
}
while( $row = $db->sql_fetchrow($result) );
}
}
$db->sql_freeresult($result);
}

$is_admin = ( $userdata['user_level'] == ADMIN && $userdata['session_logged_in'] ) ? TRUE : 0;

$auth_user = array();
for($i = 0; $i < count($auth_fields); $i++)
{
$key = $auth_fields[$i];

//
// If the user is logged on and the forum type is either ALL or REG then the user has access
//
// If the type if ACL, MOD or ADMIN then we need to see if the user has specific permissions
// to do whatever it is they want to do ... to do this we pull relevant information for the
// user (and any groups they belong to)
//
// Now we compare the users access level against the forums. We assume here that a moderator
// and admin automatically have access to an ACL forum, similarly we assume admins meet an
// auth requirement of MOD
//
if ( $forum_id != AUTH_LIST_ALL )
{
$value = $f_access[$key];

switch( $value )
{
case AUTH_ALL:
$auth_user[$key] = TRUE;
$auth_user[$key . '_type'] = $lang['Auth_Anonymous_Users'];
break;

case AUTH_REG:
$auth_user[$key] = ( $userdata['session_logged_in'] ) ? TRUE : 0;
$auth_user[$key . '_type'] = $lang['Auth_Registered_Users'];
break;

case AUTH_ACL:
$auth_user[$key] = auth_check_user(AUTH_ACL, $key, $u_access, $is_admin);
$auth_user[$key . '_type'] = $lang['Auth_Users_granted_access'];
break;

case AUTH_MOD:
$auth_user[$key] = ( $userdata['session_logged_in'] ) ? auth_check_user(AUTH_MOD, 'auth_mod', $u_access, $is_admin) : 0;
$auth_user[$key . '_type'] = $lang['Auth_Moderators'];
break;

case AUTH_ADMIN:
$auth_user[$key] = $is_admin;
$auth_user[$key . '_type'] = $lang['Auth_Administrators'];
break;

default:
$auth_user[$key] = 0;
break;
}
}
else
{
for($k = 0; $k < count($f_access); $k++)
{
$value = $f_access[$k][$key];
$f_forum_id = $f_access[$k]['forum_id'];

switch( $value )
{
case AUTH_ALL:
$auth_user[$f_forum_id][$key] = TRUE;
$auth_user[$f_forum_id][$key . '_type'] = $lang['Auth_Anonymous_Users'];
break;

case AUTH_REG:
$auth_user[$f_forum_id][$key] = ( $userdata['session_logged_in'] ) ? TRUE : 0;
$auth_user[$f_forum_id][$key . '_type'] = $lang['Auth_Registered_Users'];
break;

case AUTH_ACL:
$auth_user[$f_forum_id][$key] = auth_check_user(AUTH_ACL, $key, $u_access[$f_forum_id], $is_admin);
$auth_user[$f_forum_id][$key . '_type'] = $lang['Auth_Users_granted_access'];
break;

case AUTH_MOD:
$auth_user[$f_forum_id][$key] = ( $userdata['session_logged_in'] ) ? auth_check_user(AUTH_MOD, 'auth_mod', $u_access[$f_forum_id], $is_admin) : 0;
$auth_user[$f_forum_id][$key . '_type'] = $lang['Auth_Moderators'];
break;

case AUTH_ADMIN:
$auth_user[$f_forum_id][$key] = $is_admin;
$auth_user[$f_forum_id][$key . '_type'] = $lang['Auth_Administrators'];
break;

default:
$auth_user[$f_forum_id][$key] = 0;
break;
}
}
}
}

//
// Is user a moderator?
//
if ( $forum_id != AUTH_LIST_ALL )
{
$auth_user['auth_mod'] = ( $userdata['session_logged_in'] ) ? auth_check_user(AUTH_MOD, 'auth_mod', $u_access, $is_admin) : 0;
}
else
{
for($k = 0; $k < count($f_access); $k++)
{
$f_forum_id = $f_access[$k]['forum_id'];

$auth_user[$f_forum_id]['auth_mod'] = ( $userdata['session_logged_in'] ) ? auth_check_user(AUTH_MOD, 'auth_mod', $u_access[$f_forum_id], $is_admin) : 0;
}
}

return $auth_user;
}

function auth_check_user($type, $key, $u_access, $is_admin)
{
$auth_user = 0;

if ( count($u_access) )
{
for($j = 0; $j < count($u_access); $j++)
{
$result = 0;
switch($type)
{
case AUTH_ACL:
$result = $u_access[$j][$key];

case AUTH_MOD:
$result = $result || $u_access[$j]['auth_mod'];

case AUTH_ADMIN:
$result = $result || $is_admin;
break;
}

$auth_user = $auth_user || $result;
}
}
else
{
$auth_user = $is_admin;
}

return $auth_user;
}

?>

ElbertF
Berichten: 5803
Lid geworden op: 12 okt 2004, 08:34
Contacteer:

Bericht door ElbertF » 14 sep 2005, 21:06

Dat is duidelijker, maar wijzig je bericht even en zet de code tussen

Code: Selecteer alles

 BBCode-tags. Dit is vrij onleesbaar (door het gebrek aan tabs voorafgaand aan de regels).

Gesloten