Hallo,
ich habe jetzt meine Dateien mal geändert.
Nun weiß ich nicht genau wie ich weiter vorgehen soll, um den zugriff Gruppenabhängig zu machen. Bitte um Hilfe.
Hier einmal meine Dateien.
Diese wird abgefragt, und soll halt Abhängig von den Zugriffsrechten sein.
Code: Alles auswählen
<?php
/**
*
* @author Original Author Username webmaster@fc-gilde.eu - http://www.fc-gilde.eu
* @author Another Author Username webmaster@fc-gilde.eu - http://www.fc-gilde.eu
*
* @package {PACKAGENAME}
* @version $Id$
* @copyright (c) 2007 Your Group Name
* @license http://opensource.org/licenses/gpl-license.php GNU Public License
*
*/
/**
* @ignore
*/
define('IN_PHPBB', true);
// Specify the path to you phpBB3 installation directory.
$phpbb_root_path = (defined('PHPBB_ROOT_PATH')) ? PHPBB_ROOT_PATH : '../';
$phpEx = substr(strrchr(__FILE__, '.'), 1);
// The common.php file is required.
include($phpbb_root_path . 'common.' . $phpEx);
// since we are grabbing the user avatar, the function is inside the functions_display.php file since RC7
include($phpbb_root_path . 'includes/functions_display.' . $phpEx);
// Start session management
$user->session_begin();
$auth->acl($user->data);
// specify styles and/or localisation
// in this example, we specify that we will be using the file: my_language_file.php
$user->setup('mods/tsv_lang');
// Page title, this language variable should be defined in the language file you setup at the top of this page.
page_header($user->lang['MY_TITLE']);
// Set the filename of the template you want to use for this file.
// This is the name of our template file located in /styles/<style>/templates/.
$template->set_filenames(array(
'body' => 'tsv_temp.html',
));
// Completing the script and displaying the page.
page_footer();
?>
Dann hier einmal meine Tamplate.
Code: Alles auswählen
<!-- INCLUDE overall_header.html -->
<center>
<table width="100%">
<tr> <br><br><br><br>
<td width="150" valign="top">
<!-- INCLUDE ../../../linksleft.php -->
</td>
<td>
<center>
<table class="tsbg" cellspacing="0" width="215">
<caption><div class="cap-left"><div class="cap-right"> <h4>TS-Viewer</a></h4> </div></div></caption>
<tr>
<td align="left">
<iframe src="../../../tsv/ts1.php" height="600" width="215"></iframe>
</td>
</tr>
</table>
</center>
</td>
</tr>
</table>
</center><br><br>
<!-- INCLUDE overall_footer.html -->
und meine Language Datei:
Code: Alles auswählen
<?php
/**
*
* groups [German]
*
* @author My Username webmaster@fc-filde.eu - http://www.fc-gilde.eu
*
* @package language
* @version $Id$ @copyright (c) 2007 Your Group
* @license http://opensource.org/licenses/gpl-license.php GNU Public License
*
*/
/**
* DO NOT CHANGE
*/
if (!defined('IN_PHPBB'))
{
exit;
}
if (empty($lang) || !is_array($lang))
{
$lang = array();
}
$lang = array_merge($lang, array(
'MY_TITLE' => 'TS-Viewer',
));
?>
In welche Dateien muß ichjetzt was rein setzten, damit der Zugriff Gruppenabhängig ist?
Ich habe davon voll keinen plan, aber ich hoffe das meine Dateien jetzt OK sind und es funktionieren würde.
Wenn es möglich ist, könnte mir jemand in meine oben gegeben Skripts den nötigen inhalt ergänzen. Das wäre super Klasse. Wie schon mal gesagt, ich habe davon überhaupt keinen plan.
EDIT:
So habe es hin bekommen!!!
Es gibt da aber einen Fehler in dem Skript:
Die Funktion kann nun wie folgt aufgerufen werden:
Code: Alles auswählen
// Die zu prüfenden Gruppen IDs müssen mit Komma getrennt eingetragen werden
$check_group = "4,5,7,8"
$is_in_group = get_group_auth($check_group);
// Wenn der User in dieser Gruppe ist, liefert die Funktion den Wert TRUE zurück.
if ($is_in_group == true)
{
// Teile dem Template System mit, das die Variable "S_IN_GROUP" den Wert TRUE bekommt
$template->assign_var('S_IN_GROUP', true);
}
Es Fehlt ein " ; " hiernoch mal so wie es funktioniert:
Code: Alles auswählen
// Die zu prüfenden Gruppen IDs müssen mit Komma getrennt eingetragen werden
$check_group = "4,5,7,8";
$is_in_group = get_group_auth($check_group);
// Wenn der User in dieser Gruppe ist, liefert die Funktion den Wert TRUE zurück.
if ($is_in_group == true)
{
// Teile dem Template System mit, das die Variable "S_IN_GROUP" den Wert TRUE bekommt
$template->assign_var('S_IN_GROUP', true);
}
Vielen Dank für das Super Skript!!!