| Author |
Message |
spyce
Joined: 15 Jul 2007 Posts: 14
|
|
I'm back. |
|
So sorry... haha. But I discovered another fault with the protected post script- though it's probably just minor. As I said before, it works fine- I can create a protected post, enter the password, then view it, without much of a problem. The slight problem is that once the password gets entered just once, the entry remains open for all to see. I only want those who have the password to be able to view the entry, and all others to just be locked out.
|
|
| Tue Jul 31, 2007 3:01 am |
|
 |
Guest
|
|
|
Please login to hide the ads.
|
|
|
|
 |
scottdallas

Joined: 04 May 2006 Posts: 2027 Location: US |
|
|
|
Are you sure everyone can see it or is it just your cache? Cutenews.ru has leaves you logged in for like a year unless you tell it to log you out.
_________________ www.scodal.com is an example of cnr as a social forum - www.scottdizzle.com is an example of cnr as a personal website to share whatever cool stuff i feel like. i have another, but it's nsfw. pm me  |
|
| Tue Jul 31, 2007 6:08 pm |
|
 |
spyce
Joined: 15 Jul 2007 Posts: 14
|
|
|
|
No, others can see. I checked from other computers, and I even had a friend check from her computer. She said she could see the entry without having to enter any password.
|
|
| Tue Jul 31, 2007 9:51 pm |
|
 |
FI-DD
Admin

Joined: 22 Sep 2005 Posts: 2857 Location: Germany |
|
|
|
In inc/show.news.php change this:
 |  | if (!$cache = cute_cache($row['id'], $cache_uniq, $post.($page > 1 ? '.'.$page : ''))){ |
to this:
 |  | if ((!$cache = cute_cache($row['id'], $cache_uniq, $post.($page > 1 ? '.'.$page : ''))) or ($row['pass'] != '' and $_COOKIE['protected_'.md5x($row['id'])] != md5x($row['pass']))){ |
|
|
| Tue Jul 31, 2007 10:58 pm |
|
 |
scottdallas

Joined: 04 May 2006 Posts: 2027 Location: US |
|
|
|
Hm, does that code react like that by default to everyone? I'm gonna play with it cause if not that could be a neat feature to show future articles until you type in their password. I'm not sure what kind of scenario might need that but it might be neat.
_________________ www.scodal.com is an example of cnr as a social forum - www.scottdizzle.com is an example of cnr as a personal website to share whatever cool stuff i feel like. i have another, but it's nsfw. pm me  |
|
| Wed Aug 01, 2007 12:11 am |
|
 |
spyce
Joined: 15 Jul 2007 Posts: 14
|
|
|
|
 |  | In inc/show.news.php change this:
 |  | if (!$cache = cute_cache($row['id'], $cache_uniq, $post.($page > 1 ? '.'.$page : ''))){ |
to this:
 |  | if ((!$cache = cute_cache($row['id'], $cache_uniq, $post.($page > 1 ? '.'.$page : ''))) or ($row['pass'] != '' and $_COOKIE['protected_'.md5x($row['id'])] != md5x($row['pass']))){ |
|
That worked perfectly. Thank you
 |  | Hm, does that code react like that by default to everyone? I'm gonna play with it cause if not that could be a neat feature to show future articles until you type in their password. I'm not sure what kind of scenario might need that but it might be neat. |
Are you talking to me (about the code acting funny)? If so, then I'm going to say that I would assume so, after testing it out on my mom's computer, and trying to have a friend access it, and both receiving the same result.
|
|
| Wed Aug 01, 2007 12:34 am |
|
 |
FI-DD
Admin

Joined: 22 Sep 2005 Posts: 2857 Location: Germany |
|
|
|
 |  | Hm, does that code react like that by default to everyone? I'm gonna play with it cause if not that could be a neat feature to show future articles until you type in their password. I'm not sure what kind of scenario might need that but it might be neat. |
Yes, the code reacted like this to everyone. Once the corrected password was typed in the unprotected post was cached and available for everyone without entering the password. This is fixed now.
|
|
| Wed Aug 01, 2007 6:03 pm |
|
 |
scottdallas

Joined: 04 May 2006 Posts: 2027 Location: US |
|
|
|
Fixed.. or altered to work differently I think it has potential working in it's 'incorrect' state.
_________________ www.scodal.com is an example of cnr as a social forum - www.scottdizzle.com is an example of cnr as a personal website to share whatever cool stuff i feel like. i have another, but it's nsfw. pm me  |
|
| Wed Aug 01, 2007 9:26 pm |
|
 |
|