News:

Bored?  Looking to kill some time?  Want to chat with other SMF users?  Join us in IRC chat or Discord

Main Menu

Password Protect Boards 0.2 released

Started by Dragooon, September 20, 2007, 11:09:35 PM

Previous topic - Next topic

babjusi

Quote from: Judgey on March 19, 2008, 11:41:03 AM
Sorry to ask i installed this mod, were can i find the settings for it plz

Many thx :)

At the Boards sections in the Acp of your forum. You can enable there on a board by board basis

alvinleephd

Tryinig to install this on 1.1.4.

I get this error:

Fatal error: packageinstall() [function.require]: Failed opening required '/home/alvinlee/public_html/Packages/temp/./add_settings.php' (include_path='.:/usr/php4/lib/php:/usr/local/php4/lib/php') in /home/alvinlee/public_html/Sources/Packages.php on line 552
Worthless Forums-A Place to Kill Time.  Get your fix.

Dragooon

Make sure there is a temp directory in Packages folder which is chmodded to 777

ElTigre

First, thanks for this Mod - Much appreciated!

Second, I'm new to this and am trying to install it from my admin but get this error: The package you are trying to download or install is either corrupt or not compatible with this version of SMF.

Any idea what is happening? I am using 1.1.4


Dragooon

Hmm.....Make sure Packages directory is chmodded to 777.

Jed C

i am having same prob
i created temp folder in Packages folder
but what does this mean
QuoteMake sure Packages directory is chmodded to 777


Jed C

i did find the info just after i posted  ::)
but it was getting late so i went to bed
i tried  what it says this morning but i get this message
Quoteyour sever does not give permission to change folder properties
i tried the mod again anyway but i still got the warning
i will dig about a little more to see what my server says
would like this to work as its just what i am after  ;)

Jed C

just confirm this is the message i get up

QuoteError in Package Installation
At least one error was encountered during a test installation of this package. It is strongly recommended that you do not continue with installation unless you know what you are doing, and have made a backup very recently. This error may be caused by a conflict between the package you're trying to install and another package you have already installed, an error in the package, a package which requires another package that you don't have installed yet, or a package designed for another version of SMF.

Dragooon

Does it shows any Test failed or what is below it?

Jed C

QuoteInstall Actions
Installations actions for "Password Protect Boards":
Installing this package will perform the following actions:
   Type    Action    Description
1.    Execute Modification    ./Sources/Load.php    Test failed
2.    Execute Modification    ./Sources/BoardIndex.php    Test successful
3.    Execute Modification    ./Sources/Subs-Boards.php    Test failed
4.    Execute Modification    ./Sources/ManageBoards.php    Test successful
5.    Execute Modification    ./Themes/default/languages/Modifications.english.php    Test successful
6.    Execute Modification    ./Themes/default/ManageBoards.template.php    Test successful
7.    Execute Modification    ./Themes/default/BoardIndex.template.php    Test successful
8.    Execute Code    add_settings.php    
9.    Extract File    ./Sources/passwdBoard.php    
10.    Extract File    ./Themes/default/passwdBoard.template.php    

Dragooon

Looks like another mod of yours is intefaring, install it and then do the manual changes required in Subs-Boards.php
See SMF Package Parser To now what all changes to do.

Jed C

before i go tinkering  :o
can i clarify.
i have a members area and only certain member groups can use this area
if i install this mod i can also make the member group use a password to access and use the area
also once they have logged into one of the boards would all the other boards in that category be usable without having to log into each one
i want to use this mod as an added extra security

Dragooon

Each board has an seperate password and one person can only enter that board with the board's correct PW and not the other boards.
But this mod saves the login info in a session so that they don't have to login again and again in the board.

Jed C

i might leave it for now Dragooon
could do with one for a category really (something for you to think about)  ;)
here is a list of my installed mods
if anyone else have same prob it might help narrow the conflict down

Mod Name     Version     
1.    Who Voted What?    1.1.3    
2.    Colorize Boards    2.2    
3.    Googlebot & Spiders Mod    2.0.3    
4.    Most Popular Topic Today    2.0    
5.    Post_As_An_Alternate_User    2.0    
6.    Sarcasmics smiley set    1.1    
7.    Spam Me Not Mod    1.02    
8.    Lots_o_Smileys    1.0    
9.    Popup PM Message - Uses The Same Window    1.3    
10.    Report Icon Mod    1.0    
11.    Todays Birthday    0.1    
12.    Add Domaintools to TrackIP    1.0    
13.    Admin member list registration date    1.0    
14.    Group Moderators    1.4    
15.    Custom Profile Field Mod    3.17    
16.    Custom Action Mod    2.04

gallloo

hello, congratulations for your mod.
I have a small and strange problem with it. I have assignned a password at a sub-forum but when I get into the container forum, the sub-forum doesn't appear if I'm not admin or with the cookie defined.

-Board
--Sub-board:with password ---> it isn't shown if I haven't got permissions.

Take a look.
hxxp:foro.code-makers.es/lab-b22.0/ [nonactive]

Thank you very much.

Dragooon

OK I got it, Its a bug
Open MessageIndex.php and find
$result = db_query("
SELECT
b.ID_BOARD, b.name, b.description, b.numTopics, b.numPosts,
m.posterName, m.posterTime, m.subject, m.ID_MSG, m.ID_TOPIC,
IFNULL(mem.realName, m.posterName) AS realName, " . (!$user_info['is_guest'] ? "
(IFNULL(lb.ID_MSG, 0) >= b.ID_MSG_UPDATED) AS isRead," : "1 AS isRead,") . "
IFNULL(mem.ID_MEMBER, 0) AS ID_MEMBER, IFNULL(mem2.ID_MEMBER, 0) AS ID_MODERATOR,
mem2.realName AS modRealName
FROM {$db_prefix}boards AS b
LEFT JOIN {$db_prefix}messages AS m ON (m.ID_MSG = b.ID_LAST_MSG)
LEFT JOIN {$db_prefix}members AS mem ON (mem.ID_MEMBER = m.ID_MEMBER)" . (!$user_info['is_guest'] ? "
LEFT JOIN {$db_prefix}log_boards AS lb ON (lb.ID_BOARD = b.ID_BOARD AND lb.ID_MEMBER = $ID_MEMBER)" : '') . "
LEFT JOIN {$db_prefix}moderators AS mods ON (mods.ID_BOARD = b.ID_BOARD)
LEFT JOIN {$db_prefix}members AS mem2 ON (mem2.ID_MEMBER = mods.ID_MEMBER)
WHERE b.ID_PARENT = $board
AND $user_info[query_see_board]", __FILE__, __LINE__);

And try replacing it with
// Password Protect Board Edits
if ($user_info['is_guest'])
$query_see_board = 'FIND_IN_SET(-1, b.memberGroups)';
// Administrators can see all boards.
elseif ($user_info['is_admin'])
$query_see_board = '1';
// Registered user.... just the groups in $user_info['groups'].
else
$query_see_board = '(FIND_IN_SET(' . implode(', b.memberGroups) OR FIND_IN_SET(', $user_info['groups']) . ', b.memberGroups))';
$result = db_query("
SELECT
b.ID_BOARD, b.name, b.description, b.numTopics, b.numPosts,
m.posterName, m.posterTime, m.subject, m.ID_MSG, m.ID_TOPIC,
IFNULL(mem.realName, m.posterName) AS realName, " . (!$user_info['is_guest'] ? "
(IFNULL(lb.ID_MSG, 0) >= b.ID_MSG_UPDATED) AS isRead," : "1 AS isRead,") . "
IFNULL(mem.ID_MEMBER, 0) AS ID_MEMBER, IFNULL(mem2.ID_MEMBER, 0) AS ID_MODERATOR,
mem2.realName AS modRealName
FROM {$db_prefix}boards AS b
LEFT JOIN {$db_prefix}messages AS m ON (m.ID_MSG = b.ID_LAST_MSG)
LEFT JOIN {$db_prefix}members AS mem ON (mem.ID_MEMBER = m.ID_MEMBER)" . (!$user_info['is_guest'] ? "
LEFT JOIN {$db_prefix}log_boards AS lb ON (lb.ID_BOARD = b.ID_BOARD AND lb.ID_MEMBER = $ID_MEMBER)" : '') . "
LEFT JOIN {$db_prefix}moderators AS mods ON (mods.ID_BOARD = b.ID_BOARD)
LEFT JOIN {$db_prefix}members AS mem2 ON (mem2.ID_MEMBER = mods.ID_MEMBER)
WHERE b.ID_PARENT = $board
AND $query_see_board", __FILE__, __LINE__);

NOTE : Please make backup before editing as this is untested.

gallloo

Oh oks, thank you very much, now it works fine  :)

soyabiatch

I tried to install on 2.0 and got

QuoteInstall Actions
Installations actions for "Password Protect Boards":
Installing this package will perform the following actions:   Type Action Description
1. Execute Modification ./Sources/Load.php Test failed
  1. Add After ./Sources/Load.php Test failed
  2. Add After ./Sources/Load.php Test failed
  3. Add After ./Sources/Load.php Test successful
  4. Add After ./Sources/Load.php Test successful
  5. Add After ./Sources/Load.php Test failed

2. Execute Modification ./Sources/BoardIndex.php Test failed
  1. Add After ./Sources/BoardIndex.php Test failed
  2. Add After ./Sources/BoardIndex.php Test failed
  3. Add Before ./Sources/BoardIndex.php Test failed
  4. Replace ./Sources/BoardIndex.php Test failed
  5. Replace ./Sources/BoardIndex.php Test failed

3. Execute Modification ./Sources/Subs-Boards.php Test failed
  1. Add After ./Sources/Subs-Boards.php Test failed
  2. Add After ./Sources/Subs-Boards.php Test failed
  3. Add Before ./Sources/Subs-Boards.php Test successful

4. Execute Modification ./Sources/ManageBoards.php Test successful
  1. Add After ./Sources/ManageBoards.php Test successful
  2. Add After ./Sources/ManageBoards.php Test successful

5. Execute Modification ./Themes/default/languages/Modifications.english.php Test successful
  1. Add Before ./Themes/default/languages/Modifications.english.php Test successful

6. Execute Modification ./Themes/default/ManageBoards.template.php Test successful
  1. Add Before ./Themes/default/ManageBoards.template.php Test successful

7. Execute Modification ./Themes/default/BoardIndex.template.php Test failed
  1. Add Before ./Themes/default/BoardIndex.template.php Test successful
  2. Replace ./Themes/default/BoardIndex.template.php Test failed

8. Execute Code add_settings.php 
9. Extract File ./Sources/passwdBoard.php 
10. Extract File ./Themes/default/passwdBoard.template.php


is it able to work on  2.0?

Dragooon


Advertisement: