Recent Topics

Javascript password protection

Started by on Jul 13, 2010 – Contents updated: Jul 13, 2010

Jul 13, 2010 13:50    

Hello all

This will sound a stupid question but where would you insert a simple bit of javascript which requires a username and password before it lets you view the page?

I've tried doing it with a free html woidget but it displays the page's contents underneath the log in box.

TIA

[Asevo / 3.3.3]

Jul 13, 2010 19:43

Search the forum for "login_required = true"

Jul 15, 2010 12:35

Thanks, there's some interesting stuff there. What I'm looking for though is a way of letting x number of people all log on with the same username / password, then allowing them to enter their name and email themselves when they want to comment.

The login_required=true means you have to compile a list of individual users, all with the correct email address and so on, so I thought maybe a piece of javascript might do, but I can't work out where to put it.

Jul 15, 2010 18:32

Logged in users can't alter name and email fields in comments. Even if you manage to auto-fill them with javascript, b2evo won't save them.

What you need is edit the file /skins/_item_feedback.inc.php and allow logged in users edit their name/email.

Jul 15, 2010 18:39

Oh I see, I didn't realise that.

Your "Protected Posts" plugin is what I needed: one password for the whole group. no individual users.


Form is loading...

b2evo – This forum is powered by b2evolution CMS, a complete engine for your website.