View previous topic :: View next topic |
Author |
Message |
Yamilka Lurker

Joined: 06 Sep 2004 Posts: 4 Location: Mexico
|
Posted: Fri Nov 12, 2004 10:36 am Post subject: I don't want validate information |
|
|
Hi Dan
I have a doubt about the calendar; if I don |
|
Back to top |
|
 |
Dan Admin / Developer

Joined: 19 Feb 2001 Posts: 2057
|
Posted: Sun Nov 14, 2004 3:58 am Post subject: |
|
|
Hi,
I'm afraid I don't understand the question particularly well. Are you asking if you can validate submissions, or something specific to private networks, or...?
Quote: | what would you recommend I change in your code in order to do so? Because what I am changing makes send me error. |
I need more information to be able to address that, i.e. what you have changed, what the errors are, and what you're trying to accomplish.
Cheers,
Dan |
|
Back to top |
|
 |
btravis427 Lurker

Joined: 21 Jul 2005 Posts: 6
|
Posted: Thu Jul 21, 2005 12:01 pm Post subject: allowing anonymous submissions WITHOUT admin approval cycle? |
|
|
I'm guessing this was the original question. In any case, it is what I want to do -- i.e. allow anyone, without logging in, to make/change/delete entries. Easy??
Thanks. |
|
Back to top |
|
 |
Dan Admin / Developer

Joined: 19 Feb 2001 Posts: 2057
|
Posted: Thu Jul 21, 2005 12:16 pm Post subject: |
|
|
You can allow anonymous submissions, but do you really want to allow anyone to make edits? It could be done by removing the user id checks, but I would strongly recommend against it.
Cheers,
Dan |
|
Back to top |
|
 |
btravis427 Lurker

Joined: 21 Jul 2005 Posts: 6
|
Posted: Thu Jul 21, 2005 1:08 pm Post subject: well.... |
|
|
my thinking was, if I allow anonymous (unchecked by admin) submissions, I probably need to also allow those people to edit/remove the same entries, right? So, perhaps one idea is to have an 'anonymous' userid (aka default user for those not logged in) in the 'user' (or some new alternative) group, with defined privs?
Thanks,
Bob |
|
Back to top |
|
 |
Dan Admin / Developer

Joined: 19 Feb 2001 Posts: 2057
|
Posted: Thu Jul 21, 2005 2:28 pm Post subject: |
|
|
Ok, that makes some sense.
I haven't tested this, but a quick addition might do the trick. In index.php, after session_start() at the top, try adding:
Code: | if (!isset($HTTP_SESSION_VARS['user_id'])) {
$HTTP_SESSION_VARS['user_id'] = '0'
} |
The idea being to set a default user id if they aren't logged in, with '0' being what anonymous submissions get entered as. Hopefully, that will trigger the necessary authorizations for editing/deleting.
Cheers,
Dan |
|
Back to top |
|
 |
btravis427 Lurker

Joined: 21 Jul 2005 Posts: 6
|
Posted: Thu Jul 21, 2005 2:54 pm Post subject: nope... :-) |
|
|
Didn't seem to affect the 'edit' behavior. But it did manage to completely disable login from that browser! Not sure why (had to switch to IE to let myself log in again)..... and this was after resetting index.php to its pristine state. Some cookies, I deleted the ones I could find, but didn't help?
Last edited by btravis427 on Thu Jul 21, 2005 3:02 pm; edited 1 time in total |
|
Back to top |
|
 |
Dan Admin / Developer

Joined: 19 Feb 2001 Posts: 2057
|
Posted: Thu Jul 21, 2005 3:02 pm Post subject: |
|
|
I was worried that would happen... Let's try tweaking it a bit to:
Code: | if (!isset($HTTP_SESSION_VARS['user_id']) && ($go != "do_login")) {
$HTTP_SESSION_VARS['user_id'] = '0'
} |
and move that to just after the header() lines near the top of index.php.
Cheers,
Dan |
|
Back to top |
|
 |
btravis427 Lurker

Joined: 21 Jul 2005 Posts: 6
|
Posted: Thu Jul 21, 2005 4:00 pm Post subject: |
|
|
No, it still doesn't think anonymous (or any other, of course) entries are editable/deletable by unlogged in user. But in any case, what would I change/set to allow anonymous additions without admin/moderator validation?
Thanks for all the quick responses, too!
/bob |
|
Back to top |
|
 |
Dan Admin / Developer

Joined: 19 Feb 2001 Posts: 2057
|
Posted: Thu Jul 21, 2005 4:45 pm Post subject: |
|
|
Ah, I just found one more thing that needs to be changed. Near the top of lib.php, in the valid_int() function, you'll see:
if (is_integer($num) && ($num > 0)) {
That needs to be changed to:
if (is_integer($num) && ($num >= 0)) {
in order for the '0' user id override to have any effect.
Quote: | in any case, what would I change/set to allow anonymous additions without admin/moderator validation? |
It's one of the settable options when you're logged in as admin (admin footer links).
Cheers,
Dan |
|
Back to top |
|
 |
btravis427 Lurker

Joined: 21 Jul 2005 Posts: 6
|
Posted: Thu Jul 21, 2005 4:51 pm Post subject: |
|
|
Thanks -- I'll try the enhanced =0 stuff in a bit. But I don't see any relevant admin footer item for submission validation -- just the entry to go see if there are any needing validation.... |
|
Back to top |
|
 |
Dan Admin / Developer

Joined: 19 Feb 2001 Posts: 2057
|
Posted: Thu Jul 21, 2005 5:04 pm Post subject: |
|
|
It's under "Set Variables" at the bottom of that same dropdown menu: "Allow Anonymous"
Cheers,
Dan |
|
Back to top |
|
 |
btravis427 Lurker

Joined: 21 Jul 2005 Posts: 6
|
Posted: Fri Jul 22, 2005 10:14 am Post subject: |
|
|
Yes, but when allowed all those submissions still need admin approval before they show up on the calendar, right? |
|
Back to top |
|
 |
Dan Admin / Developer

Joined: 19 Feb 2001 Posts: 2057
|
|
Back to top |
|
 |
|