Forum password

Forum password [Paid] 1.7

No permission to buy ($35.00)

AndyB

Well-known member
AndyB submitted a new resource:

Forum password - Password protect forums and threads.

Premium upgrade:

This XF2 add-on along with the entire collection can be purchased for $25.00 USD. Your Premium upgrade will allow you to download as many XF2 add-ons as you like for one year. Please see the entire collection located in the Resources area at this URL:

https://www.xf2addons.com/

Note: all my XF1 add-ons are still 100% free and are supported by donations.

Description:

Password protect forums and threads.

(Example of Forum password page)...

Read more about this resource...
 
You should use a proper forum <select> instead of a imple textbox which is unintuitive and error-prone.

Or even better: Get rid of the setting altogether and move it to edit forum, this way each forum could have an individual pasword (like in vBulletin).
 
@AndyB I have found one bug, User will see password fields When direct URL access to thread but why marking thread are read without entering thread?
 
@AndyB I have found one bug, User will see password fields When direct URL access to thread but why marking thread are read without entering thread?

@AndyB

Hello,

Here is the cause of the problem.

PHP:
// get parent       
$parent = parent::actionIndex($params);

What triggers its functions

HTTP:
$threadRepo->markThreadReadByVisitor($thread, $lastPost->post_date);
$threadRepo->logThreadView($thread);
 
@AndyB I am getting lot of Server error log. Please let me know this fix update.

Code:
ErrorException: [E_NOTICE] Undefined index: password src/addons/Andy/ForumPassword/Pub/Controller/ForumPassword.php:19

Generated by: Black Knight May 26, 2018 at 7:41 PM

Stack trace

#0 src/addons/Andy/ForumPassword/Pub/Controller/ForumPassword.php(19): XF::handlePhpError(8, '[E_NOTICE] Unde...', '/home/nadda/pub...', 19, Array)
#1 src/XF/Mvc/Dispatcher.php(249): Andy\ForumPassword\Pub\Controller\ForumPassword->actionSave(Object(XF\Mvc\ParameterBag))
#2 src/XF/Mvc/Dispatcher.php(88): XF\Mvc\Dispatcher->dispatchClass('Andy\\ForumPassw...', 'Save', 'html', Object(XF\Mvc\ParameterBag), '', Object(Andy\ForumPassword\Pub\Controller\ForumPassword), NULL)
#3 src/XF/Mvc/Dispatcher.php(41): XF\Mvc\Dispatcher->dispatchLoop(Object(XF\Mvc\RouteMatch))
#4 src/XF/App.php(1931): XF\Mvc\Dispatcher->run()
#5 src/XF.php(328): XF\App->run()
#6 index.php(13): XF::runApp('XF\\Pub\\App')
#7 {main}

Request state

array(4) {
  ["url"] => string(19) "/forumpassword/save"
  ["referrer"] => bool(false)
  ["_GET"] => array(0) {
  }
  ["_POST"] => array(0) {
  }
}

Code:
ErrorException: [E_NOTICE] Undefined index: threadId src/addons/Andy/ForumPassword/Pub/Controller/ForumPassword.php:16

Generated by: Black Knight May 26, 2018 at 7:41 PM

Stack trace

#0 src/addons/Andy/ForumPassword/Pub/Controller/ForumPassword.php(16): XF::handlePhpError(8, '[E_NOTICE] Unde...', '/home/nadda/pub...', 16, Array)
#1 src/XF/Mvc/Dispatcher.php(249): Andy\ForumPassword\Pub\Controller\ForumPassword->actionSave(Object(XF\Mvc\ParameterBag))
#2 src/XF/Mvc/Dispatcher.php(88): XF\Mvc\Dispatcher->dispatchClass('Andy\\ForumPassw...', 'Save', 'html', Object(XF\Mvc\ParameterBag), '', Object(Andy\ForumPassword\Pub\Controller\ForumPassword), NULL)
#3 src/XF/Mvc/Dispatcher.php(41): XF\Mvc\Dispatcher->dispatchLoop(Object(XF\Mvc\RouteMatch))
#4 src/XF/App.php(1931): XF\Mvc\Dispatcher->run()
#5 src/XF.php(328): XF\App->run()
#6 index.php(13): XF::runApp('XF\\Pub\\App')
#7 {main}

Request state

array(4) {
  ["url"] => string(19) "/forumpassword/save"
  ["referrer"] => bool(false)
  ["_GET"] => array(0) {
  }
  ["_POST"] => array(0) {
  }
}

Code:
ErrorException: [E_NOTICE] Undefined index: nodeId src/addons/Andy/ForumPassword/Pub/Controller/ForumPassword.php:13

Generated by: Black Knight May 26, 2018 at 7:41 PM

Stack trace

#0 src/addons/Andy/ForumPassword/Pub/Controller/ForumPassword.php(13): XF::handlePhpError(8, '[E_NOTICE] Unde...', '/home/nadda/pub...', 13, Array)
#1 src/XF/Mvc/Dispatcher.php(249): Andy\ForumPassword\Pub\Controller\ForumPassword->actionSave(Object(XF\Mvc\ParameterBag))
#2 src/XF/Mvc/Dispatcher.php(88): XF\Mvc\Dispatcher->dispatchClass('Andy\\ForumPassw...', 'Save', 'html', Object(XF\Mvc\ParameterBag), '', Object(Andy\ForumPassword\Pub\Controller\ForumPassword), NULL)
#3 src/XF/Mvc/Dispatcher.php(41): XF\Mvc\Dispatcher->dispatchLoop(Object(XF\Mvc\RouteMatch))
#4 src/XF/App.php(1931): XF\Mvc\Dispatcher->run()
#5 src/XF.php(328): XF\App->run()
#6 index.php(13): XF::runApp('XF\\Pub\\App')
#7 {main}

Request state

array(4) {
  ["url"] => string(19) "/forumpassword/save"
  ["referrer"] => bool(false)
  ["_GET"] => array(0) {
  }
  ["_POST"] => array(0) {
  }
}
 
looks like the table wasn't created after updating
Code:
XF\Db\Exception: MySQL statement prepare error [1146]: Table 'pointsixtyfive_xenforo.xf_andy_forum_password' doesn't exist in src/XF/Db/AbstractStatement.php at line 212
XF\Db\AbstractStatement->getException() in src/XF/Db/Mysqli/Statement.php at line 196
XF\Db\Mysqli\Statement->getException() in src/XF/Db/Mysqli/Statement.php at line 39
XF\Db\Mysqli\Statement->prepare() in src/XF/Db/Mysqli/Statement.php at line 54
XF\Db\Mysqli\Statement->execute() in src/XF/Db/AbstractAdapter.php at line 79
XF\Db\AbstractAdapter->query() in src/XF/Db/AbstractAdapter.php at line 91
XF\Db\AbstractAdapter->fetchOne() in src/addons/Andy/ForumPassword/XF/Pub/Controller/Forum.php at line 83
Andy\ForumPassword\XF\Pub\Controller\Forum->actionIndex() in src/XF/Mvc/Dispatcher.php at line 249
XF\Mvc\Dispatcher->dispatchClass() in src/XF/Mvc/Dispatcher.php at line 88
XF\Mvc\Dispatcher->dispatchLoop() in src/XF/Mvc/Dispatcher.php at line 41
XF\Mvc\Dispatcher->run() in src/XF/App.php at line 1891
XF\App->run() in src/XF.php at line 328
XF::runApp() in index.php at line 13
 
@AndyB Please Add NOINDEX meta tag to the Password protect forums. Adding noindex,nofollow meta tag to the Password protect forums page. source will ensure that the page will disappear from the index, exclude from XML sitemap generation.
 
Server error log: Does not know this server error log from PHP 7.4.0

Code:
ErrorException: [E_NOTICE] Trying to access array offset on value of type null src\addons\Andy\ForumPassword\XF\Pub\Controller\Thread.php:75

Generated by: Nirjonadda Mar 29, 2020 at 8:53 PM

Stack trace

#0 src\addons\Andy\ForumPassword\XF\Pub\Controller\Thread.php(75): XF::handlePhpError(8, '[E_NOTICE] Tryi...', 'C:\\wamp64\\www\\f...', 75, Array)
#1 src\XF\Mvc\Dispatcher.php(350): Andy\ForumPassword\XF\Pub\Controller\Thread->actionIndex(Object(XF\Mvc\ParameterBag))
#2 src\XF\Mvc\Dispatcher.php(257): XF\Mvc\Dispatcher->dispatchClass('XF:Thread', 'Index', Object(XF\Mvc\RouteMatch), Object(Siropu\AdsManager\XF\Pub\Controller\Thread), NULL)
#3 src\XF\Mvc\Dispatcher.php(113): XF\Mvc\Dispatcher->dispatchFromMatch(Object(XF\Mvc\RouteMatch), Object(Siropu\AdsManager\XF\Pub\Controller\Thread), NULL)
#4 src\XF\Mvc\Dispatcher.php(55): XF\Mvc\Dispatcher->dispatchLoop(Object(XF\Mvc\RouteMatch))
#5 src\XF\App.php(2184): XF\Mvc\Dispatcher->run()
#6 src\XF.php(391): XF\App->run()
#7 index.php(20): XF::runApp('XF\\Pub\\App')
#8 {main}

Request state

<pre class='xdebug-var-dump' dir='ltr'>
<small>C:\wamp64\www\forum\src\XF\Debugger.php:28:</small>
<b>array</b> <i>(size=4)</i>
  'url' <font color='#888a85'>=&gt;</font> <small>string</small> <font color='#cc0000'>'/forum/index.php?threads/password.2/'</font> <i>(length=36)</i>
  'referrer' <font color='#888a85'>=&gt;</font> <small>string</small> <font color='#cc0000'>'/forum/index.php?forums/forum-password.3/'</font> <i>(length=57)</i>
  '_GET' <font color='#888a85'>=&gt;</font>
    <b>array</b> <i>(size=1)</i>
      'threads/password_2/' <font color='#888a85'>=&gt;</font> <small>string</small> <font color='#cc0000'>''</font> <i>(length=0)</i>
  '_POST' <font color='#888a85'>=&gt;</font>
    <b>array</b> <i>(size=0)</i>
      <i><font color='#888a85'>empty</font></i>
</pre>
 
Any way to exclude usergroups? This addon is exactly what i need but it just needs a feature to exclude usergroups of choice.
 
@AndyB Please Add NOINDEX meta tag to the Password protect forums. Adding noindex,nofollow meta tag to the Password protect forums page. source will ensure that the page will disappear from the index, exclude from XML sitemap generation.

@AndyB Please add support Excluded from XML sitemap generation because Google Status: Error Submitted URL returned 403
 
Back
Top Bottom