The script that checks visitor's permissions is in includes/auth.php
What you need to do is store the accepted password in session and then authorize visitor using that password.
I don't know how your code is working, but assuming that the category password stored in the database in "cat_pass" field.
The user entered passwords stored in session (or even in the database for members if you decide go more advanced
) in "cat_pass" in the following format: cat_id,password|cat_id,password (each category separated with a "|" and each cat id separated from password with a comma)
And finally the authorization process:
in includes/auth.php find:
foreach ($cat_cache as $key => $val) {
if ($val['auth_viewcat'] != AUTH_ALL) {
Replace it with:
/*
category password
start
*/
global $site_sess;
$cat_pass = array();
$pass = explode("|", $site_sess->get_session_var("cat_pass"));
foreach($pass as $key)
{
$val = explode(",", $key);
if (count($val) > 1)
$cat_pass[$val[0]] = $val[1];
}
/*
category password
end
*/
foreach ($cat_cache as $key => $val) {
/*
category password
start
*/
if ($cat_cache[$key]['cat_pass'])
{
if(isset($cat_pass[$key]) && $cat_pass[$key] == $cat_cache[$key]['cat_pass'])
{
$cat_cache[$key]['auth_viewcat'] = AUTH_ALL; //password accepted
}
else
{
$cat_cache[$key]['auth_viewcat'] = AUTH_ADMIN; //password denied
}
}
/*
category password
end
*/
if ($val['auth_viewcat'] != AUTH_ALL) {
Using this method, you don't need set categories permission to private, all you need to do is set a password.