Login Contentpart

Post custom hacks and enhancements for phpwcms here only. Maybe some of these things will be included in official release later.
jscholtysik

Post by jscholtysik »

Hi stemmen,


why do you make make three threads with nearly the same content? Isn't one thread enough... ;-)

TRIPLE POST !!


Joachim
gent
Posts: 163
Joined: Tue 16. Dec 2003, 13:51
Location: Berlin

Post by gent »

phalancs wrote:@gent:

In the meantime try the following, to have a structure to be only visible when logged in (for me it worked only like that):
ok, that works.

but (yes there is a but), i need to set two logins on my page.
one login for 10 ppl and the other login for 20 other ppl.
one of the first group dont have to login to the 2. login.
and finaly into the loginareas there is different content.

i guess the only way to do so, is to set the rights for the menustructure.
but this dont work with this hack at the moment.
markoehl
Posts: 50
Joined: Thu 29. Dec 2005, 11:08
Location: Zürich
Contact:

Post by markoehl »

gent wrote:
but (yes there is a but), i need to set two logins on my page.
one login for 10 ppl and the other login for 20 other ppl.
one of the first group dont have to login to the 2. login.
and finaly into the loginareas there is different content.

i guess the only way to do so, is to set the rights for the menustructure.
but this dont work with this hack at the moment.
found something for you:

search in include/inc_front/front.func.inc.php

Code: Select all

		$data[$row["acat_id"]] = array(	"acat_id"		=> $row["acat_id"],
											"acat_name"		=> $row["acat_name"],
											"acat_info"		=> $row["acat_info"],
											"acat_struct"	=> $row["acat_struct"],
											"acat_sort"		=> $row["acat_sort"],
											"acat_hidden"	=> $row["acat_hidden"],
											"acat_regonly"	=> $row["acat_regonly"],
											"acat_ssl"		=> $row["acat_ssl"],
											"acat_template"	=> $row["acat_template"],
											"acat_alias"	=> $row["acat_alias"],
											"acat_topcount"	=> $row["acat_topcount"],
											"acat_redirect"	=> $row["acat_redirect"],
											"acat_order"	=> $row["acat_order"],
											"acat_timeout"	=> $row["acat_cache"],
											"acat_nosearch"	=> $row["acat_nosearch"],
											"acat_nositemap"=> $row["acat_nositemap"],
											"acat_permit"	=> !empty($row["acat_permit"]) ? explode(',', $row["acat_permit"]) : array()
										  );
replace with

Code: Select all

			//PWmod
			$permissioncheck = !$row["acat_permit"] ? 1 : 0;
			if (isset($_SESSION["wcs_user_id"]) AND $row["acat_permit"]) {
				$temparray = explode(',', $row["acat_permit"]);
				foreach($temparray as $value) {
					if ($_SESSION["wcs_user_id"] == $value) {
						$permissioncheck = 1;
						break;
					}
				}
			}

			if ($permissioncheck == 1) {
			$data[$row["acat_id"]] = array(	"acat_id"		=> $row["acat_id"],
											"acat_name"		=> $row["acat_name"],
											"acat_info"		=> $row["acat_info"],
											"acat_struct"	=> $row["acat_struct"],
											"acat_sort"		=> $row["acat_sort"],
											"acat_hidden"	=> $row["acat_hidden"],
											"acat_regonly"	=> $row["acat_regonly"],
											"acat_ssl"		=> $row["acat_ssl"],
											"acat_template"	=> $row["acat_template"],
											"acat_alias"	=> $row["acat_alias"],
											"acat_topcount"	=> $row["acat_topcount"],
											"acat_redirect"	=> $row["acat_redirect"],
											"acat_order"	=> $row["acat_order"],
											"acat_timeout"	=> $row["acat_cache"],
											"acat_nosearch"	=> $row["acat_nosearch"],
											"acat_nositemap"=> $row["acat_nositemap"],
											"acat_permit"	=> !empty($row["acat_permit"]) ? explode(',', $row["acat_permit"]) : array()
										  );
			}
			//End PWmod
this way the whole permission thing is working for the frontend too. But only for the strukture level and the Sitemap.

Check it out...
gent
Posts: 163
Joined: Tue 16. Dec 2003, 13:51
Location: Berlin

Post by gent »

markoehl wrote: this way the whole permission thing is working for the frontend too. But only for the strukture level and the Sitemap.

Check it out...
it is working :)
i can define one user for structur-level-1, and another to only see the level-2. thats great.

now i have the next question.
in ur example u have the structur-level "Test" with the login-contentpart.
is there a way, to only show this login-form if the user is not loged in?
and if the user is loged in, there will be a other text?
markoehl
Posts: 50
Joined: Thu 29. Dec 2005, 11:08
Location: Zürich
Contact:

Post by markoehl »

gent wrote: in ur example u have the structur-level "Test" with the login-contentpart.
is there a way, to only show this login-form if the user is not loged in?
and if the user is loged in, there will be a other text?
You keep me busy ;-)
I updated the script. Please download the zip-file and update the files

Download Script: http://www.pagewerkstatt.ch/phpwcms_mod_login.zip (Last update 19.1.06)
gent
Posts: 163
Joined: Tue 16. Dec 2003, 13:51
Location: Berlin

Post by gent »

great work !

thank you :)
i love it :)
phalancs
Posts: 793
Joined: Thu 19. Feb 2004, 05:09
Location: Germany

great

Post by phalancs »

Wow that is perfect!!!

I feel like having it all solved with that user right enhancement!

I have put it all together and enhanced it a lot.
Somehow it turned into something new:

Login-Logout Panel:

http://www.phpwcms.de/forum/viewtopic.p ... highlight=
2008
User avatar
StudioZ
Posts: 802
Joined: Fri 28. May 2004, 19:57
Location: Québec, Canada
Contact:

Post by StudioZ »

Greetings Markoehl 8)
This is a really awesome hack.
Got it working on 1.2.6 (2005.12.14)
Great job! Thanks so much ! :D :D :D

Cheers,
Image
PhpWCMS Evangelist, -- iRoutier.com Running phpWCMS 1.4.2, r354 -> Great Version!!!!
zed
Posts: 25
Joined: Sun 5. Jun 2005, 17:25
Location: Basel/Zürich, Switzerland
Contact:

Post by zed »

hey markoehl

if i log in as a frontend user i get the following error:

Code: Select all

error while getting link article list: SELECT article_id, article_title, article_cid FROM phpwcms_article WHERE article_id =18;
if i then go back in the browser, im logged in and everything is works fine.
seems that the redirection after clicking "Anmelden" goes wrong. (?)
btw i'm using 1.2.5 DEV

have you any suggestions to solve this problem?

greets zed
bw
Posts: 12
Joined: Tue 24. Jan 2006, 21:02
Location: Zürich
Contact:

Fehlermeldung beim Einlogen

Post by bw »

Vielen Dank an Markus Köhl für diesen Login - Contentpart

Zwei Dinge beschäftigen mich momentan:

1. Ich erhalte beim Einlogen folgende Fehlermeldung

Code: Select all

Notice: Undefined index: wcs_user_fe in /var/www/vhosts/qs-letten.ch/httpdocs/schule/cms/index.php on line 85
2. Ich weiss (trotz Anleitung) nicht, wie das Auslogen funktioniert.

Unter http://www.qs-letten.ch/schule/cms/index.php kann
man mein Problemchen anschauen. Login ist unten rechts.

;-)bw
markoehl
Posts: 50
Joined: Thu 29. Dec 2005, 11:08
Location: Zürich
Contact:

Re: Fehlermeldung beim Einlogen

Post by markoehl »

Notice: Undefined index: wcs_user_fe in /var/www/vhosts/qs-letten.ch/httpdocs/schule/cms/index.php on line 85
Zip File herunterladen und inc_front/ ersetzen. Habe kleine Modifikation eingefügt. Es gab vermutlich einen Konflikt weil du die GLOBAL_VARS ausgeschaltet hast. Habe Zeile 198 angepasst.
Download Script: http://www.pagewerkstatt.ch/phpwcms_mod_login.zip (Last update 24.1.06)
Ich weiss (trotz Anleitung) nicht, wie das Auslogen funktioniert.
- in der Struktur einen Menüpunkt Logout erstellen (sichtbar, nicht öffentlich)
- Artikel zum Menüpunkt hinzufügen mit weiterleitung zu "phpwcms.php?do=logout"

So erscheint der Menüpunkt nur wenn der Benutzer angemeldet ist. wenns immer noch nicht klappt melde dich einfach bei mir.
Gruzz aus Zürich
Markus
bw
Posts: 12
Joined: Tue 24. Jan 2006, 21:02
Location: Zürich
Contact:

Post by bw »

Danke für die schnelle Antwort!

Leider erhalte ich nach deinen Modifikationen folgende neue Fehlermeldung:

Code: Select all

Notice: Undefined index: form_loginname in /var/www/vhosts/qs-letten.ch/httpdocs/schule/cms/include/inc_front/content/cnt203.article.inc.php on line 198
Gruss
Beat
markoehl
Posts: 50
Joined: Thu 29. Dec 2005, 11:08
Location: Zürich
Contact:

Post by markoehl »

bw wrote: Leider erhalte ich nach deinen Modifikationen folgende neue Fehlermeldung:
t
Habe nochmals angepasst..
bw
Posts: 12
Joined: Tue 24. Jan 2006, 21:02
Location: Zürich
Contact:

Fehlermeldungen sind weg :-)

Post by bw »

Mit deinen Anpassungen läufts perfekt.

Danke!


Eine Frage noch:

Ich habe unten rechts einen Login-Link. Gäbe es eine Möglichkeit diesen in einen Logout-Link zu verwandeln, wenn man sich eingelogt hat?


Gruss
Beat
markoehl
Posts: 50
Joined: Thu 29. Dec 2005, 11:08
Location: Zürich
Contact:

Re: Fehlermeldungen sind weg :-)

Post by markoehl »

bw wrote: Ich habe unten rechts einen Login-Link. Gäbe es eine Möglichkeit diesen in einen Logout-Link zu verwandeln, wenn man sich eingelogt hat?
sehe da keine Möglichkeit... Das Bild ist über die Vorlage definiert. Dort kannst du keinen Code einbauen und somit auch keine Funktionialität nutzen. Aber ich denke es ist in der Fusszeile gut verpackt und stört dort nicht...
Post Reply