Gossamer Forum
Home : Products : DBMan : Customization :

Not Authorized to Modify -- HELP!!!

Quote Reply
Not Authorized to Modify -- HELP!!!
Hello, fellow DBHeads! I'm having a most peculiar problem and I'm hoping that someone might be able to see something that I'm missing, because I have no idea what is going on. I should start off by saying that I'm using the Relational Mod and the file Upload Mod, as well a few others that shouldn't really matter so much (like SSI and what not). The problem I'm having is this:

I have it set in the CFG file of the "parent" database that users are only able to modify their own record. ($auth_modify_own = 1;) and everything goes just fine as far as adding and viewing and what not goes. The problem comes in modifying. For some reason, when users go to modify their record they can get into the modify_record_form just fine, but when the hit the "Modify Record" button to submit the changes, the database tells them that they are "Not Authorized to Modify this record." Now, theoretically, they should be the only ones who ARE authorized to modify the record. I checked to make sure that the UserID they're logged in with and the UserID of the record are the same (you can see where I have those variables printing out on the actual form when you view my code... They're the same). I'm just dumbfounded and frustrated beyond hope! Anyone who can help me out with this problem will officially receive nothing but utter worship from me for the next seven months. (I would do eight months, but my February is booked *grin*).

To take a look at the functioning database (and to try and modify a record) go ahead and go to this address:

http://www4.addr.com/...apter.cgi?db=chapter

You can log in there with

username: alabama
password: alabama35


There is a record in there already for this user, so feel free to try modifying it and see what you get.

If you would like to view the code of my files you can do so at the following addresses:

CFG File: http://www4.addr.com/...f/gt/chapter_cfg.txt
CGI File: http://www4.addr.com/...f/gt/chapter_cgi.txt
HTML File: http://www4.addr.com/...t/chapterhtml_pl.txt


Many many thanks in advance crew. You may noticed I've renamed a couple of the subroutines in the html file and what not, but the overall structure of DBMan hasn't changed much. Hope there's someone out there kind enough to help. Cheers!

WretchedHive
Quote Reply
Re: [wretchedhive] Not Authorized to Modify -- HELP!!! In reply to
Looking at your html_record_form you have both:

<INPUT TYPE="HIDDEN" NAME="ID" VALUE="$rec{''}">
and
<input type="hidden" name="ID" value="$rec{'ID'}">

You should perhaps remove the first and just use it once within your form.

I didn't see a field for your userid? In your .cfg file you have:

userid => [0, 'alpha', -2, 355, 0, '', ''],

Please note that the -2 only works when using the autogenerate function.
If you want this to be a hidden filed that is automatically filled in when a registered user adds a record there is a thread in the FAQ under admin called "How can I get the userid to be displayed in the add form?" The codes were also recently added to a thread reply.

I also didn't see a field referenced for Graphic.

I usually include something like this in the html_record_form:

<P>
<B>Include Photo?:</B> &nbsp; &nbsp; Check here if uploading a photo: &nbsp; |; print &build_checkbox_field("Graphic",$rec{'Graphic'}); print qq|</font></TD></TR>
|;

before:

if ($form_upload_add) {

I'm not sure if not having set $auth_signup = 0;
would make a difference? Are you not allowing people to signup to become registered users?

Hope this helps

Unoffical DBMan FAQ

http://creativecomputingweb.com/dbman/index.shtml/
Quote Reply
Re: [LoisC] Not Authorized to Modify -- HELP!!! In reply to
Hey there, Lois. Well, I'm not sure exactly what kind of mystical voodoun powers you have, but just making those minor changes (getting rid of the extra ID field and adding the userid Mod) seemed to do the trick. I also got rid of the "-2" in the userid definition in the .cfg file. There is a field in there for the graphic, its just buried in an "if...then" statement. All seems to be working well, now... Hopefully this will help some wayward searcher who's perusing the boards for a solution to the same problem.

Now, to answer your question... Indeed, I don't want people to be able to signup for their own username/password... Only want people to be able to add/modify a record if I let them. Now that I made those two fixed, this doesn't seem to be a problem at all.

Again, many thanks... Now, when do you want that unabated worship to begin? Wink
Quote Reply
Re: [wretchedhive] Not Authorized to Modify -- HELP!!! In reply to
Laughing :)

Just glad I could be of help and that you got it all working.

Unoffical DBMan FAQ

http://creativecomputingweb.com/dbman/index.shtml/