Pagina 1 van 1

Couldn't update private forum permissions

Geplaatst: 23 jan 2004, 20:24
door fairyfeller
Hallo,

Ik heb een probleem waar ik al enige tijd een oplossing voor zoek... Ik heb dit al geplaatst op PHBB.com, eerst natuurlijk zelf flink gezocht, maar kan geen passend antwoord vinden. Misschien heeft iemand een idee of wil de moeite nemen om eens mee te denken... Dit is de foutmelding wanneer ik bij permissions meer dan één persoon of groep moderator wil maken van een forum:

Couldn't update private forum permissions

DEBUG MODE

SQL Error : 1062 Duplicate entry '0' for key 1

INSERT INTO phpbb_auth_access (forum_id, group_id, auth_mod) VALUES (6, 5, 1)

Line : 400
File : /home/bovennat/public_html/forum/admin/admin_ug_auth.php

------------------------------------------------------------------------------------
Mijn tabellen
------------------------------------------------------------------------------------

TABLE phpbb_auth_access forum_id smallint ( 5 ) DEFAULT '0' NOT NULL UNSIGNED;
TABLE phpbb_auth_access group_id mediumint( 8 ) DEFAULT '0' NOT NULL;
TABLE phpbb_auth_access auth_mod tinyint ( 1 ) DEFAULT '0' NOT NULL;

group_id & forum_id INDEX

------------------------------------------------------------------------------------
Informatie
------------------------------------------------------------------------------------
URL: This is in my admin, so no use
Template(s) used: subsilver
Any and all MODs: calender, profil, extr. styles.
Do you use a port of phpBB:
Version of phpBB: 2.06
Version of PHP: 4.3.4
Which database server and version: 4.0.15-standard
Host: own domain, unix/apache server
Did someone install this for you/who: I did
Is this an upgrade/from what to what: fresh install
Is this a conversion/from what to what: no
Have you searched for your problem: yes (see bottom)
If so, what terms did you try: permissions, 1062, admin_ug_auth.php
State the nature of your problem:
Do you have a test account for us: No, this happens only in the admin section, rest works fine


Ik heb het originele admin_ug_auth.php bestand opnieuw gedownload, online gezet - helpt niet. Ook heb ik de fix.php tool gebruikt, maar ik kom er niet uit....

Hier een stukje code uit het admin_ug_auth.php bestand:

(regels 360 - 440)

$delete_sql = '';
while( list($forum_id, $action) = @each($forum_auth_action) )
{
if ( $action == 'delete' )
{
$delete_sql .= ( ( $delete_sql != '' ) ? ', ' : '' ) . $forum_id;
}
else
{
if ( $action == 'insert' )
{
$sql_field = '';
$sql_value = '';
while ( list($auth_type, $value) = @each($update_acl_status[$forum_id]) )
{
$sql_field .= ( ( $sql_field != '' ) ? ', ' : '' ) . $auth_type;
$sql_value .= ( ( $sql_value != '' ) ? ', ' : '' ) . $value;
}
$sql_field .= ( ( $sql_field != '' ) ? ', ' : '' ) . 'auth_mod';
$sql_value .= ( ( $sql_value != '' ) ? ', ' : '' ) . ( ( !isset($update_mod_status[$forum_id]) ) ? 0 : $update_mod_status[$forum_id]);

$sql = "INSERT INTO " . AUTH_ACCESS_TABLE . " (forum_id, group_id, $sql_field)
VALUES ($forum_id, $group_id, $sql_value)";
}
else
{
$sql_values = '';
while ( list($auth_type, $value) = @each($update_acl_status[$forum_id]) )
{
$sql_values .= ( ( $sql_values != '' ) ? ', ' : '' ) . $auth_type . ' = ' . $value;
}
$sql_values .= ( ( $sql_values != '' ) ? ', ' : '' ) . 'auth_mod = ' . ( ( !isset($update_mod_status[$forum_id]) ) ? 0 : $update_mod_status[$forum_id]);

$sql = "UPDATE " . AUTH_ACCESS_TABLE . "
SET $sql_values
WHERE group_id = $group_id
AND forum_id = $forum_id";
}
if( !($result = $db->sql_query($sql)) )
{
message_die(GENERAL_ERROR, "Couldn't update private forum permissions", "", __LINE__, __FILE__, $sql);
}
}
}

if ( $delete_sql != '' )
{
$sql = "DELETE FROM " . AUTH_ACCESS_TABLE . "
WHERE group_id = $group_id
AND forum_id IN ($delete_sql)";
if( !($result = $db->sql_query($sql)) )
{
message_die(GENERAL_ERROR, "Couldn't delete permission entries", "", __LINE__, __FILE__, $sql);
}
}

$l_auth_return = ( $mode == 'user' ) ? $lang['Click_return_userauth'] : $lang['Click_return_groupauth'];
$message = $lang['Auth_updated'] . '<br /><br />' . sprintf($l_auth_return, '<a href="' . append_sid("admin_ug_auth.$phpEx?mode=$mode") . '">', '</a>') . '<br /><br />' . sprintf($lang['Click_return_admin_index'], '<a href="' . append_sid("index.$phpEx?pane=right") . '">', '</a>');
}

//
// Update user level to mod for appropriate users
//
$sql = "SELECT u.user_id
FROM " . AUTH_ACCESS_TABLE . " aa, " . USER_GROUP_TABLE . " ug, " . USERS_TABLE . " u
WHERE ug.group_id = aa.group_id
AND u.user_id = ug.user_id
AND u.user_level NOT IN (" . MOD . ", " . ADMIN . ")
GROUP BY u.user_id
HAVING SUM(aa.auth_mod) > 0";
if ( !($result = $db->sql_query($sql)) )
{
message_die(GENERAL_ERROR, "Couldn't obtain user/group permissions", "", __LINE__, __FILE__, $sql);
}

$set_mod = '';
while( $row = $db->sql_fetchrow($result) )
{
$set_mod .= ( ( $set_mod != '' ) ? ', ' : '' ) . $row['user_id'];
}
$db->sql_freeresult($result);



Heel erg bedankt voor het meedenken alvast!