Having a werid issue with a plugin...HELP
it's a cool little app but I can't get a hold of creator for
some reason I was wonder if you guys can help me out here...
The plugin works like this:
With the "User Access Manager"-plugin you can manage the access to your posts, pages and files. You only create a user group, put registered users to this and set up the rights for this group. From now on the post/page is only accessible for the specified group. This plugin is useful if you need a member area or a private section at your blog.
Feature list
- User groups
- User-defined post/page title (if no access)
- User-defined post/page text (if no access)
- Hide complete post/page
- Hide pages in navigation
- Redirecting users to other pages (if no access)
- Recursive locking of posts/pages
- Limited access to uploaded files
and a .htpasswd in my upload folder. Now even if I give a subscriber access to the site an add them to the group I want when they try to login
the protected upload folder is forcing the subscriber to submit a password
but even if you add you login details it won't let you in.
And I think because of the plugin creating the .htaccess & .htpasswd files
it is screwing up my post and drafts.
I have a feeling this is an easy fix but you never know, anyone want to have a quick look for I'd really appreciate.
I'm not sure if I should post the code here or not...
// Make .htaccess file to protect data
// get url
$wud = wp_upload_dir();
$url = $DOCUMENT_ROOT.$wud['basedir']."/";
if(!file_exists($url.".htaccess"))
{
$areaname = "uploads";
$user = "admin";
# create password
$array = array();
$length = 10;
$capitals = true;
if($length < 8)
$length = mt_rand(8,20);
# numbers
for($i=48;$i<58;$i++)
$array[] = chr($i);
# small
for($i=97;$i<122;$i++)
$array[] = chr($i);
# capitals
if($capitals)
for($i=65;$i<90;$i++)
$array[] = chr($i);
# specialchar:
if($specialSigns)
{
for($i=33;$i<47;$i++)
$array[] = chr($i);
for($i=59;$i<64;$i++)
$array[] = chr($i);
for($i=91;$i<96;$i++)
$array[] = chr($i);
for($i=123;$i<126;$i++)
$array[] = chr($i);
}
mt_srand((double)microtime()*1000000);
$password = '';
for ($i=1; $i<=$length; $i++)
{
$rnd = mt_rand( 0, count($array)-1 );
$password .= $array[$rnd];
}
// make .htaccess and .htpasswd
$htaccess_txt = "AuthType Basic"."\n";
$htaccess_txt .= "AuthName \"".$areaname."\""."\n";
$htaccess_txt .= "AuthUserFile ".$url.".htpasswd"."\n";
$htaccess_txt .= "require valid-user"."\n";
$htpasswd_txt .= "$user:".md5($passwort)."\n";
// save files
$htaccess= fopen($url.".htaccess", "w");
$htpasswd= fopen($url.".htpasswd", "w");
fputs($htaccess, $htaccess_txt);
fputs($htpasswd, $htpasswd_txt);
fclose($htaccess);
fclose($htpasswd);
-
Tommo2007 -
Thanks
{{ DiscussionBoard.errors[342929].message }} -