welche Datei? -> Benutzergruppenrechte ändern

Fragen zu allen Themen rund ums Programmieren außerhalb von phpBB können hier gestellt werden - auch zu anderen Programmiersprachen oder Software wie Webservern und Editoren.
Benutzeravatar
leopittoni
Mitglied
Beiträge: 1162
Registriert: 26.04.2004 20:17

welche Datei? -> Benutzergruppenrechte ändern

Beitrag von leopittoni »

Hallo

Die Rechte für Benutzergruppen werden doch in der "admin_ug_auth.php" vergeben, oder? Aber wo, ich finde leider die Stelle nicht...

Wer kann mir helfen?

Danke, Léo
Benutzeravatar
S2B
Ehemaliges Teammitglied
Beiträge: 3258
Registriert: 10.08.2004 22:48
Wohnort: Aachen
Kontaktdaten:

Beitrag von S2B »

Code: Alles auswählen

					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);
					}
:wink:
Gruß, S2B
Keinen Support per ICQ/PM!
Hier kann man meine PHP-Skripte und meine MODs für phpBB runterladen.
Benutzeravatar
leopittoni
Mitglied
Beiträge: 1162
Registriert: 26.04.2004 20:17

Beitrag von leopittoni »

Hmm, in welcher Datei hast Du denn das gefunden, finde es nirgens...

Wie kann ich "manuell" einen Eintag vornehmen?

also:

Code: Alles auswählen

$sql = "INSERT INTO " . AUTH_ACCESS_TABLE . " (auth_view, auth_read, auth_post, auth_reply, auth_edit, auth_delete, auth_sticky, auth_announce)
VALUES ('1', '1', '1', '1', '1', '0', '0', '0');
gibt leider eine Fehlermeldung...

Hat jemand eine Idee?

Danke, Léo
Benutzeravatar
S2B
Ehemaliges Teammitglied
Beiträge: 3258
Registriert: 10.08.2004 22:48
Wohnort: Aachen
Kontaktdaten:

Beitrag von S2B »

leopittoni hat geschrieben:Hmm, in welcher Datei hast Du denn das gefunden, finde es nirgens...
admin/admin_ug_auth.php, Zeile 360. :wink:
leopittoni hat geschrieben:

Code: Alles auswählen

$sql = "INSERT INTO " . AUTH_ACCESS_TABLE . " (auth_view, auth_read, auth_post, auth_reply, auth_edit, auth_delete, auth_sticky, auth_announce)
VALUES ('1', '1', '1', '1', '1', '0', '0', '0');
gibt leider eine Fehlermeldung...
Und welche? :wink:
Gruß, S2B
Keinen Support per ICQ/PM!
Hier kann man meine PHP-Skripte und meine MODs für phpBB runterladen.
Benutzeravatar
leopittoni
Mitglied
Beiträge: 1162
Registriert: 26.04.2004 20:17

Beitrag von leopittoni »

Code: Alles auswählen

Couldn't update auth access

DEBUG MODE

SQL Error : 1064 You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '; WHERE group_id = 21' at line 2

INSERT INTO phpbb_auth_access (auth_view, auth_read, auth_post, auth_reply, auth_edit, auth_delete, auth_sticky, auth_announce) VALUES ('1', '1', '1', '1', '1', '0', '0', '0'); WHERE group_id = 21

Line : 438
File : admin_forums.php
Danke, Léo
Benutzeravatar
S2B
Ehemaliges Teammitglied
Beiträge: 3258
Registriert: 10.08.2004 22:48
Wohnort: Aachen
Kontaktdaten:

Beitrag von S2B »

Dein Code sieht so ähnlich aus, richtig?

Code: Alles auswählen

$sql = "INSERT INTO " . AUTH_ACCESS_TABLE . " (auth_view, auth_read, auth_post, auth_reply, auth_edit, auth_delete, auth_sticky, auth_announce)
VALUES ('1', '1', '1', '1', '1', '0', '0', '0');
WHERE group_id = $variable";
Versuch mal das:

Code: Alles auswählen

[...]
VALUES ('1', '1', '1', '1', '1', '0', '0', '0')";
Gruß, S2B
Keinen Support per ICQ/PM!
Hier kann man meine PHP-Skripte und meine MODs für phpBB runterladen.
Benutzeravatar
leopittoni
Mitglied
Beiträge: 1162
Registriert: 26.04.2004 20:17

Beitrag von leopittoni »

Ok, danke! Nun kommt keine Fehlermeldung mehr, die Rechte für das entsprechende Forum werden aber nicht vergeben...

Léo
Benutzeravatar
leopittoni
Mitglied
Beiträge: 1162
Registriert: 26.04.2004 20:17

Beitrag von leopittoni »

Ich habe es mal so versucht:

Code: Alles auswählen

$sql = "UPDATE " . AUTH_ACCESS_TABLE . " (auth_view, auth_read, auth_post, auth_reply, auth_edit, auth_delete, auth_sticky, auth_announce, auth_pollcreate, auth_attachments, auth_mod)
VALUES (1, 1, 1, 1, 1, 0, 0, 0, 1, 1, 0);
WHERE group_id = $new_group_id"; 
Dann kommt aber folgende Fehlermeldung:

Code: Alles auswählen

Couldn't update auth access

DEBUG MODE

SQL Error : 1064 You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '(auth_view, auth_read, auth_post, auth_reply, auth_edit, auth_de

UPDATE phpbb_auth_access (auth_view, auth_read, auth_post, auth_reply, auth_edit, auth_delete, auth_sticky, auth_announce, auth_pollcreate, auth_attachments, auth_mod) VALUES (1, 1, 1, 1, 1, 0, 0, 0, 1, 1, 0); WHERE group_id = 3

Line : 439
File : admin_forums.php
Wer kann mir helfen?

Danke, Léo
fanrpg
Mitglied
Beiträge: 2909
Registriert: 13.12.2004 22:41

Beitrag von fanrpg »

Code: Alles auswählen

$sql = "INSERT INTO " . AUTH_ACCESS_TABLE . " (auth_view, auth_read, auth_post, auth_reply, auth_edit, auth_delete, auth_sticky, auth_announce, auth_pollcreate, auth_attachments, auth_mod) 
VALUES (1, 1, 1, 1, 1, 0, 0, 0, 1, 1, 0)
WHERE group_id = $new_group_id";
Benutzeravatar
leopittoni
Mitglied
Beiträge: 1162
Registriert: 26.04.2004 20:17

Beitrag von leopittoni »

Hallo

Mit "INSERT INTO" ists dasselbe, kommt auch die Fehlermeldung...

Léo
Antworten

Zurück zu „Coding & Technik“