All pastes #81714 Raw Edit

naderman

public php v1 · immutable
·published 2006-07-07 19:58 UTC
rendered paste body
<?php/**** @package events* @version $Id: action_forum_permissions.php,v 1.14 2005/12/25 00:09:26 davidmj Exp $* @copyright (c) 2005 phpBB Group* @license http://opensource.org/licenses/gpl-license.php GNU Public License**//*** Returns which info this action needs to receive from the trigger as a minimum*/function eva_forum_permissions_requires(){	return EVT_DATA_USER;}/*** Returns which info this action can handle*/function eva_forum_permissions_requests(){	return EVT_DATA_USER | EVT_DATA_FORUM;}/*** Changes a user's permissions*/function eva_forum_permissions_execute(&$options, &$info){	global $phpbb_root_path, $phpEx, $events, $db;	$forum_ids = $options['f_ids'];	unset($options['f_ids']);	// if the trigger forum was selected, get its id	if ($forum_ids[0] == -1)	{		$forum_ids[0] = $data[EVT_DATA_FORUM]['forum_id'];	}	// make sure we have a username	$events->expand_info(array(EVT_DATA_USER => array('users.username')));	// Instantiate a new auth admin object in readiness	require_once($phpbb_root_path . 'includes/functions_admin.'.$phpEx);	$auth_admin = new auth_admin();	// set the forum permissions and log the action	$auth_admin->acl_set('user', $forum_ids, $info[EVT_DATA_USER]['user_id'], $options);	$events->add_log('LOG_ACL_USER_ADD', $info[EVT_DATA_USER]['username']);}?>