Zum Inhalt springen

CHC Forum Administration für "normale" User

Erstellt am 6. August 2004 · 32 Antworten · letzte Antwort am 22. April 2005 · Seite 1 von 2

Tags: Frage

doku ·

is schon klar, aber soo einfach scheint´s nich zu funken.

auszug aus dem tut "backend-programming"

2) Adding to the global $TBE_MODULES array
When your module is configured you must also enable it in the global $TBE_MODULES array. The default values (and
syntax derived from this) of this array is seen in the bottom of the default tables.php file:
$TBE_MODULES = Array (
"web" => "layout,modules,info,perm,func,list,ts",
"file" => "list,images",
"doc" => "", // This should always be empty!
"spacer1"=>"",
"user" => "task,setup",
"tools" => "beuser,dbint,log,config,isearch,install,phpadmin",
"help" => "welcome,aboutmodules,quick,about"
);

das hab ich wahlweise in die "haupt"-ext_tables.php als auch in die ext_tables.php der extension hinzugefügt

$TBE_MODULES["web"] .= ",tools_txchcforumM1";

es kommt trotzdem

This module "tools_txchcforumM1" is not enabled in TBE_MODULES

naja, bei meinem halbwissen ist das eh ein stochern im nebel.... 8-) 8-)

Unbekannter Benutzer ·

schau mal auf mein voriges posting, den fehler hatt ich grade auch, mit der besagten änderung spielts nun ohne probs. administration ohne problemem möglich

doku ·

mannomann...
du hast ein zweites posting geschrieben, während ich hier mühsam meine fehlerergüsse eingetippt habe... 8-) 8-)

danke 😉

maxhb ·
doku schrieb

is schon klar, aber soo einfach scheint´s nich zu funken.

Doch doch, ist eigentlich ganz leicht.
Folgende Anpassungen:

mod1/conf.php:

...
$MCONF["name"]="web_txchcforumM1";
...

ext_tables.php:

if (TYPO3_MODE=="BE")	{
t3lib_extMgm::addModule("web","txchcforumM1","",t3lib_extMgm::extPath($_EXTKEY)."mod1/");
}

mod1/indexd.php:

// Access check!
		// The page will show only if there is a valid page and if this page may be viewed by the user
		$this->pageinfo = t3lib_BEfunc::readPageAccess($this->id, $this->perms_clause);
		$access = is_array($this->pageinfo) ? 1 : 0;
		$access= $this->id = 1;

Die Änderung in der index.php ist nicht sauber. Das Hauptproblem besteht darin, dass der die Variable $this->id nie initialisiert wird und ich leider auch nicht weiss, welcher Wert dort eingetragen werden sollte, vermutlich die aktuell gewählte Seiten-ID...

Werde mal den Autoren der Extension anschreiben.

CU
maxhb

Unbekannter Benutzer ·
// If you chose "web" as main module, you will need to consider the $this->id parameter which will contain the uid-number of the page clicked in the page tree
doku ·

ich krieg die krise...

plötzlich läßt sich mein server nichtmal mehr anpingen... #evil# #evil#
dieser provider macht mich langsam wahnsinnig...

Unbekannter Benutzer ·

wasn das fürn provider?
s4f?
ne mal im ernst. besagte änderungen laufen bei mir stabil

@maxhb
aber mit

$access = $this->id = 1
würdest du ja nur den zugriff auf der seite mit der id 1 zulassen wenn dem so wäre wie du bei der id vermutest, oder?
doku ·

provider is der betreiber dieses forums. da aber deren website auch nicht mehr ansprechbar is wird bestimmt heftigst an der lösung gearbeitet... 😉

nenee, der provider is wirklich absolut spitze, muß ich wirklich mal sagen. es gab nur in den letzten drei monaten drei zwei-stündige ausfälle, wovon der letzte vorgestern war. leider hänge ich in diesen momenten immer gerade vor der kiste... 🙁

das problem hat auch mit dem kram hier ga nix zu tun.

maxhb ·
Daniel_S schrieb
// If you chose "web" as main module, you will need to consider the $this->id parameter which will contain the uid-number of the page clicked in the page tree

Gelesen hab ich's auch, aber wo bekomme ich $this->id her???

CU
maxhb

maxhb ·
Daniel_S schrieb

aber mit

$access = $this->id = 1

würdest du ja nur den zugriff auf der seite mit der id 1 zulassen wenn dem so wäre wie du bei der id vermutest, oder?

Ne, die Abfrage lautet ja:

if (($this->id && $access) || ($BE_USER->user['admin'] && !$this->id))

Da kommt es nur darauf an, dass die $this->id nicht false / empty / 0 ist 😉

Ist aber wie gesagt keine saubere Lösung ...

Vielleicht ist der Web-Modulbereich auch nicht die richtige Stelle für das Forum, da sollten ja eigentlich Dinge untergebracht sein, die sich auf eine konkrete Seite beziehen und das Forum-modul bezieht sich ja auf die komplette T3-Installation. Von daher war der Tools-Bereich eiegentlich i.O., nur eben nicht für !admins freizugeben.

CU
maxhb

maxhb ·

HI!
Habe folgendes an den Autoren Zach Davis geschickt, Antwort werde ich hier veröffentlichen:

maxhb schrieb

Hi Zach!
It's me again :-)

A little problem with the chc_forum extension:
It's located within the tools module section which can not be used by non admin users. This will prevent any "normal" user from being forum admin.
Workaround: Move Module to Web-Modules section by modifying the souirce code.
This works fine for me but the user authorization needs to be adjusted. Probably Web-Modules isn't even the right plcae to insert chc_forum ...

Best regards
Marc

CU
maxhb

maxhb ·
Daniel_S schrieb

schau dir mal die klasse t3lib/class.t3lib_scbase.php an. in zeile 145 wird id initialisiert...
um dann in init() verwendet zu werden zeile 251

Guter Tipp!!!
Das komische ist, dass in der init()-Methode der Klasse t3lib_SCbase der Wert $this->id korrekt gesetzt wird. Diese Methode wird auch im Forumsmodul per parent::init() aufgerufen, kommt aber scheinbar nur auf der Startseite der Forumsadministration an. Klickt man dort ein bestimmtes Forum an, dann verliert $this->id seinen Wert und alles ist hin 😢

CU
maxhb

maxhb ·

Heureka!
In der Datei typo3conf/ext/chc_forum/mod1/index.php folgende Änderunge einpflegen:

...
	function main() {
		global $BE_USER, $LANG, $BACK_PATH, $TCA_DESCR, $TCA, $CLIENT, $TYPO3_CONF_VARS;
		
		// Feel like doing some debugging? Uncomment this line for some help...
		//$this->debug  = 1; // uncomment for debugging;

// Modified by Marc Wöhlken (woehlken@quadracom.de)
		// Set fpid (pid of forum we'll be working with) -- we prefer a fpid sent via post over one sent via get.
		$this->fpid = t3lib_div::GPvar('fpid');
		if ((!empty($this->fpid)) && ($this->id=='0') ) $this->id=$this->fpid;
// END

		// Access check!
		// The page will show only if there is a valid page and if this page may be viewed by the user
		$this->pageinfo = t3lib_BEfunc::readPageAccess($this->id, $this->perms_clause);
		$access = is_array($this->pageinfo) ? 1 : 0;
		if (($this->id && $access) || ($BE_USER->user['admin'] && !$this->id)) {
			
			// Set the lang object
			$this->lang = $LANG;
			
			// Place post and get vars in an attribute -- easier to work with.
			$this->post = $GLOBALS['HTTP_POST_VARS'];
			$this->get = $GLOBALS['HTTP_GET_VARS'];
			
			// Debugging...
			if ($this->debug == 1) {
				$this->content .= 'POST:'.t3lib_div::view_array($this->post).'<br />'; // uncomment for debugging.
				$this->content .= 'GET:'.t3lib_div::view_array($this->get).'<br />'; // uncomment for debugging.
			}
// Modified by Marc Wöhlken (woehlken@quadracom.de)
// Code moved to top of function
/*
			// Set fpid (pid of forum we'll be working with) -- we prefer a fpid sent via post over one sent via get.
			$this->fpid = $this->post['fpid'];
			if (empty($this->fpid)) $this->fpid = $this->get['fpid'];
*/
// END	
			
			if ($this->fpid) {
				$where = 'pid='.$this->fpid;
				$qresults = $GLOBALS['TYPO3_DB']->exec_SELECTquery('*', 'tx_chcforum_f_conf', "pid=$this->fpid", '', '', '');
				while ($row = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($qresults)) {
					$this->feusers_pid = $row['feusers_pid'];
				}
			}
...

Thx Daniel_S, war ein super Tipp!

CU
maxhb

doku ·

könntest du vielleicht dein posting editieren und alle notwendigen schritte nochmal zusammenfassen?
merci!

doku ·
maxhb schrieb
doku schrieb

könntest du vielleicht dein posting editieren und alle notwendigen schritte nochmal zusammenfassen?
merci!

Nö!

danke! 😃