Форуми / Cotonti / Extensions / Password-protect Category [Solved]

tensh
#1 21.04.2009 18:37
Hi;

Is there a possibility to separately password-protect a Category using a plugin? Maybe this can be done at least based on plugin "adminlogin"? I need a fast answer.

Thanks in advance :)

OK, I nearly got it, just need small tip:

How to make this script execute only in list.php?c=myname and not in all categories? Currently it asks for password in all categories. I need an "if" statement like "IF category ID = something THEN", but I'm new to Sed and Cotonti plugins and don't know Cotonti functions that well.

Hello? :) Any help?

Відредаговано: tensh (21.04.2009 21:22, 15 років тому)
Kort
#2 21.04.2009 20:08
create myname.list.tpl
SED.by - создание сайтов, разработка плагинов и тем для Котонти
tensh
#3 21.04.2009 20:12
I mean a php statement in a plugin, something like:

IF category ID = (my variable) THEN { ... } or:
IF category NAME = (my variable) THEN { ... }

Just I don't know Cotonti functions that well.

Is it "$category['id']" or something...?

Ok, found it out eventually. problem solved.

Відредаговано: tensh (21.04.2009 21:22, 15 років тому)
pieter
#4 21.04.2009 22:06
And what was the solution?
... can we help you ...
tensh
#5 21.04.2009 22:14
$res = sed_sql_query("SELECT * FROM $db_structure");
	while($row = mysql_fetch_assoc($res))
	if ($c==$row['structure_code'])
	{
		$category_path = $row['structure_path'];
	}

	if($category_path==2)  {   blabla... }

By now I entered just "2", but the plugin is not finished. Gonna add Plugin configuration entries.
Also, RSS feeds are not protected, I'm not sure how to do this. Hack rss.php? :P Or create a plugin for RSS? I will see.
aiwass
#6 21.04.2009 23:42
I just don't get the point of password protection for a category of pages, where one would be needed to type in a password to view the contents.

I have, however a similar section on my website called list.php?c=tutorials and this section is for members only and to protect that against any other which is not a member, just add rights for members to view and no guests. This applies for RSS aswell.

To see what i'm talking about :
http://www.megamind.dk/temporary/rss.php?c=tutorials (Blank !)
http://www.megamind.dk/temporary/list.php?c=tutorials

Why make something that you can easily protect with setting rights for different groups in the Admin portion of the website ?
Take all that money that we spend on weapons and defences each year and instead spend it feeding and clothing and educating the poor of the world, which it would many times over, not one human being excluded, and we could explore space, together, both inner and outer, forever, in peace. - Bill Hicks

https://evlear.com
tensh
#7 22.04.2009 14:23
I'm working on a project where one user needs two levels of access. It means that by login in he has regular Cotonti rights to view come categories (not viewed by guests), but to access another category, another password is needed. One user name represents one group of people, so multiple people will log in to on user name, but only group's chief will have access to higher level of access.

It's a very custom implementation anyway.
aiwass
#8 22.04.2009 23:05
# tensh : I'm working on a project where one user needs two levels of access. It means that by login in he has regular Cotonti rights to view come categories (not viewed by guests), but to access another category, another password is needed. One user name represents one group of people, so multiple people will log in to on user name, but only group's chief will have access to higher level of access.

It's a very custom implementation anyway.

No shit, sounds complicated. Wasn't there a plugin that allowed users to be part of 2 group levels in this forum ? Maybe that one can help you on your quest !?!

Otherwise you can achieve this by a simple .htaccess file if you run a parallel system in another /catalog. It might be a quick and fairly dirty solution. :)
Take all that money that we spend on weapons and defences each year and instead spend it feeding and clothing and educating the poor of the world, which it would many times over, not one human being excluded, and we could explore space, together, both inner and outer, forever, in peace. - Bill Hicks

https://evlear.com