Page 1 of 1

Special requirement: password input BEFORE posting

Posted: Tue Aug 19, 2008 8:18 am
by Chrysanthemum
Script URL:
Version of script: 1.6 modified 14 February 2008
Hosting company: NetBenefit
URL of phpinfo.php:
URL of session_test.php:
What terms did you try when SEARCHING for a solution: looked on this forum.

Write your message below:

My client has bought a licence for GBook :-) (If you wish to check, Klemen, see exchange of e-mails on 10 August with "Rachel".)

It works fine but, as this is located in part of the client's rebuilt web site and still in the development area, I can't give the URL here.

My client wishes to use the script as a way of having a page to which only an officer of the organisation (the Secretary) can post announcements, eg excerpts from press releases from a member of the organisation.

I'd be grateful if someone could tell me how to cut-and-paste the bit of the script that asks for the password into that part of the script where the messages are composed. Ie so that one has to put in the password before posting as well as before deleting or editing a post.

I think this would be the simplest way of doing it. It would be more elegant if I could put the message composition - ie from

<a href="gbook.php?a=sign">'.$lang['t48'].'</a>

into a separate web page without breaking anything, as well as having the password input required to post a message, but I am not confident of being able to do that successfully.

Posted: Sat Aug 23, 2008 10:39 am
by Klemen
Well, you could simply delete the <a href="gbook.php?a=sign">'.$lang['t48'].'</a> links and tell your secretary to bookmark (or access) gbook with ?a=sign to get to the sign page, then add something like this for the password:

to the signup form (function printSign from line 818):

Code: Select all

<tr>
<td><b>Password</b></td>
<td><input type="password" name="pass" size="30" /></td>
</tr>
and add a check for password before posting, something like this to line 79, just below

Code: Select all

} elseif($a=='add') {
add

Code: Select all

$pass=gbook_input($_POST['pass'],$lang['e09']);
if ($pass != $settings[apass]) {problem($lang['e16']);} 
Haven't tested anything though so make sure you BACKUP your old files before testing this :wink:

Posted: Sat Aug 23, 2008 5:15 pm
by Chrysanthemum
Klemen wrote:Well, you could simply ...

Haven't tested anything though so make sure you BACKUP your old files before testing this :wink:
Thank you, Klemen, I have done that, and it works perfectly.

I am very grateful to you for your trouble.