I have used usercake to make a login system, I am now altering it to suit my needs.
Originally I a list dir setup on the page to show all of the "help files" within a specific folder. It worked fine but it was not secure and anyone could view. So I have changed my security but am now having a few problems with my code:
//Links for logged in user
if(isUserLoggedIn()) {
//Links for permission level 3 (BOF)
if ($loggedInUser->checkPermission(array(3))){
if ($handle = opendir('CD500/')) {
while (false !== ($file = readdir($handle)))
{
if ($file != '.' && $file != '..'){
$thelist .= '<a href="/CD500/'.$file.'' target='_blank' >'.$file.'</a></br>';
}
}
closedir($handle);
}
echo "
<div id='output'>
List of help files:</div>
<div id='List'>
$thelist
This is the whole completed package. I am wondering if its simple as too many if statements?
It does not parse, the html loads and images appear but this just never materializes.
I set up:
//Links for logged in user
if(isUserLoggedIn()) {
//Links for permission level 3 (BOF)
if ($loggedInUser->checkPermission(array(3))){
foreach(glob('./BOF/*.*') as $filename){
echo $filename ;
}
}
My only problem whilst this works, is to make it presentable which I have so far failed to do.
I would Ideally like to fix the first solution, if not how can I style the second?