Can't set permissions for pages

This mod will make it posible to specify permissions to all "special pages, like MEMBERLIST, PROFILE VIEW and so on.
The permissions support USERGROUP, making this tool very powerfull

Moderator: Moderators

Forum rules
The content in this forum is dated Dec. 21 2005 and can be used as Archive only. This Forum is LOCKED and READ ONLY !

Can't set permissions for pages

Postby cmisker on Tue 09. Sep, 2003 14:41

Hi,

I can't set the permissions for pages, for example for the Shoutbox. I assume you set these in the permissions of a user or usergroup. But I can't see where.

Everything installed fine, except for this part in the Extra permissions mod:

Code: Select all
#
includes/functions_admin.php

#-----[ FIND ]------------------------------------------
#
$sql = "SELECT forum_id, forum_name
FROM " . FORUMS_TABLE . "

#
#-----[ IN-LINE FIND ]------------------------------------------
#
FROM " . FORUMS_TABLE . "

#
#-----[ IN-LINE AFTER ADD ]------------------------------------------
#
WHERE forum_id > 0


This is because I installed Ptirhil Categories-mod, I think. This is the full code of functions_admin.php. Could you tell me what I'm doing wrong?

Code: Select all
<?php
/***************************************************************************
*                            functions_admin.php
*                            -------------------
*   begin                : Saturday, Feb 13, 2001
*   copyright            : (C) 2001 The phpBB Group
*   email                : support@phpbb.com
*
*   $Id: functions_admin.php,v 1.5.2.3 2002/07/19 17:03:47 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.
*
*
***************************************************************************/

//-- mod : hiérarchie des rubriques ----------------------------------------------------------------
//-- add v 1.0.9
include_once( $phpbb_root_path . 'includes/functions.' . $phpEx );
//-- fin mod : hiérarchie des rubriques ------------------------------------------------------------

//
// Simple version of jumpbox, just lists authed forums
//
//-- mod : hiérarchie des rubriques ----------------------------------------------------------------
//--delete
// function make_forum_select($box_name, $ignore_forum = false, $select_forum = '')
//-- add v 1.0.9
function make_forum_select($box_name, $ignore_forum = false, $select_forum = '', $for_prune=false)
//-- fin mod : hiérarchie des rubriques ------------------------------------------------------------
{
   global $db, $userdata;

   $is_auth_ary = auth(AUTH_READ, AUTH_LIST_ALL, $userdata);

//-- mod : hiérarchie des rubriques ----------------------------------------------------------------
//-- add v 1.0.9
   global $phpEx, $lang;

   $category_rows = array();
   $category_rows = get_auth_cat();

   // add Index
   $forum_list .= '<option value="' . ( ($for_prune) ? 'C0' : -1 ) . '">[' . $lang['Forum_index'] . ']</option>';

   // get cats
   for ( $i = 0; $i < count($category_rows); $i++ )
   {
      // increment
      $inc = '';
      for ($k = 1; $k < $category_rows[$i]['level']; $k++) $inc = '|&nbsp;&nbsp;&nbsp;' . $inc;
      $inc = ( ($category_rows[$i]['level'] > 0) ? '|&nbsp;&nbsp;&nbsp;' : '|--' ) . $inc;
      $inc .= ($category_rows[$i]['level'] > 0) ? '|--' : '';

      // add cat
      $forum_list .= '<option value="' . ( ($for_prune) ? 'C' . $category_rows[$i]['cat_id'] : -1 ) . '">' . $inc . '[' . $category_rows[$i]['cat_title'] . ']' . '</option>';

      $sql = "select * from " . FORUMS_TABLE . " where cat_id = " . $category_rows[$i]['cat_id'];
      if ( !($result = $db->sql_query($sql)) ) message_die(GENERAL_ERROR, 'Couldn not obtain forums information', '', __LINE__, __FILE__, $sql);
      while( $row = $db->sql_fetchrow($result) )
      {
         if ( $is_auth_ary[$row['forum_id']]['auth_read'] && $ignore_forum != $row['forum_id'] )
         {
            $selected = ( $select_forum == $row['forum_id'] ) ? ' selected="selected"' : '';
            $forum_list .= '<option value="' . $row['forum_id'] . '"' . $selected .'>' . '|&nbsp;&nbsp;&nbsp;' . $inc . '&nbsp;' . $row['forum_name'] . '</option>';
         }
      }
   }

//-- delete
//   $sql = "SELECT forum_id, forum_name
//      FROM " . FORUMS_TABLE . "
//      ORDER BY cat_id, forum_order";
//   if ( !($result = $db->sql_query($sql)) )
//   {
//      message_die(GENERAL_ERROR, 'Couldn not obtain forums information', '', __LINE__, __FILE__, $sql);
//   }
//
//   $forum_list = '';
//   while( $row = $db->sql_fetchrow($result) )
//   {
//      if ( $is_auth_ary[$row['forum_id']]['auth_read'] && $ignore_forum != $row['forum_id'] )
//      {
//         $selected = ( $select_forum == $row['forum_id'] ) ? ' selected="selected"' : '';
//         $forum_list .= '<option value="' . $row['forum_id'] . '"' . $selected .'>' . $row['forum_name'] . '</option>';
//      }
//   }
//
//-- fin mod : hiérarchie des rubriques ------------------------------------------------------------

   $forum_list = ( $forum_list == '' ) ? '<option value="-1">-- ! No Forums ! --</option>' : '<select name="' . $box_name . '">' . $forum_list . '</select>';

   return $forum_list;
}

//
// Synchronise functions for forums/topics
//
function sync($type, $id = false)
{
   global $db;

   switch($type)
   {
      case 'all forums':
         $sql = "SELECT forum_id
            FROM " . FORUMS_TABLE;
         if ( !($result = $db->sql_query($sql)) )
         {
            message_die(GENERAL_ERROR, 'Could not get forum IDs', '', __LINE__, __FILE__, $sql);
         }

         while( $row = $db->sql_fetchrow($result) )
         {
            sync('forum', $row['forum_id']);
         }
            break;

      case 'all topics':
         $sql = "SELECT topic_id
            FROM " . TOPICS_TABLE;
         if ( !($result = $db->sql_query($sql)) )
         {
            message_die(GENERAL_ERROR, 'Could not get topic ID', '', __LINE__, __FILE__, $sql);
         }

         while( $row = $db->sql_fetchrow($result) )
         {
            sync('topic', $row['topic_id']);
         }
         break;

        case 'forum':
         $sql = "SELECT MAX(post_id) AS last_post, COUNT(post_id) AS total
            FROM " . POSTS_TABLE . "
            WHERE forum_id = $id";
         if ( !($result = $db->sql_query($sql)) )
         {
            message_die(GENERAL_ERROR, 'Could not get post ID', '', __LINE__, __FILE__, $sql);
         }

         if ( $row = $db->sql_fetchrow($result) )
         {
            $last_post = ( $row['last_post'] ) ? $row['last_post'] : 0;
            $total_posts = ($row['total']) ? $row['total'] : 0;
         }
         else
         {
            $last_post = 0;
            $total_posts = 0;
         }

         $sql = "SELECT COUNT(topic_id) AS total
            FROM " . TOPICS_TABLE . "
            WHERE forum_id = $id";
         if ( !($result = $db->sql_query($sql)) )
         {
            message_die(GENERAL_ERROR, 'Could not get topic count', '', __LINE__, __FILE__, $sql);
         }

         $total_topics = ( $row = $db->sql_fetchrow($result) ) ? ( ( $row['total'] ) ? $row['total'] : 0 ) : 0;

         $sql = "UPDATE " . FORUMS_TABLE . "
            SET forum_last_post_id = $last_post, forum_posts = $total_posts, forum_topics = $total_topics
            WHERE forum_id = $id";
         if ( !$db->sql_query($sql) )
         {
            message_die(GENERAL_ERROR, 'Could not update forum', '', __LINE__, __FILE__, $sql);
         }
         break;

      case 'topic':
         $sql = "SELECT MAX(post_id) AS last_post, MIN(post_id) AS first_post, COUNT(post_id) AS total_posts
            FROM " . POSTS_TABLE . "
            WHERE topic_id = $id";
         if ( !($result = $db->sql_query($sql)) )
         {
            message_die(GENERAL_ERROR, 'Could not get post ID', '', __LINE__, __FILE__, $sql);
         }

         if ( $row = $db->sql_fetchrow($result) )
         {
            $sql = ( $row['total_posts'] ) ? "UPDATE " . TOPICS_TABLE . " SET topic_replies = " . ( $row['total_posts'] - 1 ) . ", topic_first_post_id = " . $row['first_post'] . ", topic_last_post_id = " . $row['last_post'] . " WHERE topic_id = $id" : "DELETE FROM " . TOPICS_TABLE . " WHERE topic_id = $id";
            if ( !$db->sql_query($sql) )
            {
               message_die(GENERAL_ERROR, 'Could not update topic', '', __LINE__, __FILE__, $sql);
            }
         }
         break;
   }

   return true;
}

?>
cmisker
Poster
Poster
 
Posts: 125
Joined: Mon 11. Nov, 2002 20:15

Postby cmisker on Thu 11. Sep, 2003 17:02

Anyone? Or maybe, since I assume it's just a viewing problem, you can give me the link which I can use to set the permissions? It might be an ugly solution, but it will work.

Please, I really do need help, because people are abusing my shoutbox.

Thanks.
cmisker
Poster
Poster
 
Posts: 125
Joined: Mon 11. Nov, 2002 20:15

Postby Niels on Sun 14. Sep, 2003 21:37

you should be able to set the permission for the shoutbox, same way as if it was a forum.
Inside "forum permission"


about your problem with admin_fuction.php, you may try modify this
Code: Select all
$sql = "select * from " . FORUMS_TABLE . " where cat_id = " . $category_rows[$i]['cat_id'];

instead, but I'm not shure how it would behaive as I haven't tryed the mod you have installed
(if a how-to is EM ready, it will mostly be bullet prof, since a machine is more picky than a human. :D)
User avatar
Niels
Poster
Poster
 
Posts: 4390
Joined: Sat 27. Jul, 2002 15:46

Postby cmisker on Mon 15. Sep, 2003 07:38

Niels wrote:you should be able to set the permission for the shoutbox, same way as if it was a forum.
Inside "forum permission"
Unfortanely, that doesn't work. Because the category mod also "messes" with the way the selectbox works for forum permissions. (So Shoutbox doesn't show up).

Is there a way I can like.. use an URL to go to the Shoutbox permissions page? Like something like: http://fc.misker.com/forum/admin/admin_ ... e=Shoutbox

Or something like that?

about your problem with admin_fuction.php, you may try modify this
Code: Select all
$sql = "select * from " . FORUMS_TABLE . " where cat_id = " . $category_rows[$i]['cat_id'];

instead, but I'm not shure how it would behaive as I haven't tryed the mod you have installed
I'll try this tonight.

Thanks for your support!
cmisker
Poster
Poster
 
Posts: 125
Joined: Mon 11. Nov, 2002 20:15

Postby Niels on Tue 16. Sep, 2003 23:24

Unfortanely, that doesn't work. Because the category mod also "messes" with the way the selectbox works for forum permissions. (So Shoutbox doesn't show up).


then these 2 mods are not compatible, with each other....I guess.

you may as a work around do the shoutbox without the extra permission mod, a post in the shoutbox forum explain this
(if a how-to is EM ready, it will mostly be bullet prof, since a machine is more picky than a human. :D)
User avatar
Niels
Poster
Poster
 
Posts: 4390
Joined: Sat 27. Jul, 2002 15:46


Return to Extra permission [2.0.6/EM]

Who is online

Users browsing this forum: No registered users and 1 guest

cron