Added portal permissions -- It is now possible to show the Portal only to the users and groups we want to

This commit is contained in:
Marc Alexander
2010-12-02 17:24:07 +00:00
parent ff9e9c6061
commit b2a591bb35
6 changed files with 17 additions and 6 deletions

View File

@@ -463,6 +463,7 @@ Deny from All
break;]]></action>
</edit>
</open>
<!-- @todo: check if we need this -- I guess not -->
<open src="includes/cache.php">
<edit>
<find><![CDATA[}
@@ -545,7 +546,7 @@ Deny from All
</edit>
<edit>
<find><![CDATA['U_PRIVATEMSGS' => append_sid("{$phpbb_root_path}ucp.$phpEx", 'i=pm&amp;folder=inbox'),]]></find>
<action type="before-add"><![CDATA[ 'U_PORTAL' => (isset($config['board3_enable']) && $config['board3_enable'] == true) ? append_sid("{$phpbb_root_path}portal.$phpEx") : '',]]></action>
<action type="before-add"><![CDATA[ 'U_PORTAL' => (isset($config['board3_enable']) && $config['board3_enable'] && $auth->acl_get('u_view_portal')) ? append_sid("{$phpbb_root_path}portal.$phpEx") : '',]]></action>
</edit>
</open>
<open src="includes/session.php">

View File

@@ -23,8 +23,8 @@ class acp_portal_info
'title' => 'ACP_PORTAL',
'version' => '2.0.0',
'modes' => array(
'config' => array('title' => 'ACP_PORTAL_GENERAL_INFO', 'auth' => 'acl_a_portal', 'cat' => array('ACP_PORTAL')),
'modules' => array('title' => 'ACP_PORTAL_MODULES', 'auth' => 'acl_a_portal', 'cat' => array('ACP_PORTAL')),
'config' => array('title' => 'ACP_PORTAL_GENERAL_INFO', 'auth' => 'acl_a_manage_portal', 'cat' => array('ACP_PORTAL')),
'modules' => array('title' => 'ACP_PORTAL_MODULES', 'auth' => 'acl_a_manage_portal', 'cat' => array('ACP_PORTAL')),
),
);
}

View File

@@ -59,11 +59,13 @@ $versions = array(
'2.0.0-dev2' => array(
'permission_add' => array(
array('a_portal'),
array('a_manage_portal', 1),
array('u_view_portal', 1),
),
'permission_set' => array(
array('ADMINISTRATORS', 'a_portal', 'group'),
array('ADMINISTRATORS', 'a_manage_portal', 'group'),
array('REGISTERED', 'u_view_portal', 'group'),
),
'table_add' => array(

View File

@@ -100,5 +100,9 @@ $lang = array_merge($lang, array(
'UP_TO_DATE' => '%s ist aktuell',
'VERSION_CHECK' => 'MOD Version Check',
// Adding the permissions
'acl_a_manage_portal' => array('lang' => 'Kann Portal-Einstellungen ändern', 'cat' => 'misc'),
'acl_u_view_portal' => array('lang' => 'Kann das Portal sehen', 'cat' => 'misc'),
));
?>

View File

@@ -98,5 +98,9 @@ $lang = array_merge($lang, array(
'RELEASE_ANNOUNCEMENT' => 'Ankündigungsthema',
'UP_TO_DATE' => '%s ist aktuell',
'VERSION_CHECK' => 'MOD Version Check',
// Adding the permissions
'acl_a_manage_portal' => array('lang' => 'Can alter Portal settings', 'cat' => 'misc'),
'acl_u_view_portal' => array('lang' => 'Can view the Portal', 'cat' => 'misc'),
));
?>

View File

@@ -33,7 +33,7 @@ $user->setup('mods/portal');
* Make sure we do an isset first,
* else we will get errors if someone uninstalls the portal and forgets to remove portal.php
*/
if (!isset($config['board3_enable']) || !$config['board3_enable'])
if (!isset($config['board3_enable']) || !$config['board3_enable'] || !$auth->acl_get('u_view_portal'))
{
redirect(reapply_sid($phpbb_root_path . 'index.' . $phpEx));
}