1
bimmer528
[Solved}Pagetype=[username] ?
  • 2003/12/21 1:22

  • bimmer528

  • Just popping in

  • Posts: 19

  • Since: 2002/9/19


Please excuse me for my lack of php knowledge here but here we go.

Is there a way to restrict a page to a certian XOOPS user only instead of group?

Like for example..

if ($xoopsUser== 'someuser')
{
content....
}

else
{ echo "something"; }


Possibly with the use of this code here?


$xoopsOption['pagetype'] = "admin";

$message 'You Do Not Have Acess Rights To This Area | Taking You Back.....';



if ( 
$xoopsUser ) {
    if ( !
$xoopsUser->isAdmin() ) {
        
redirect_header("http://url",2$message);
        exit();
    }
} else {
    
redirect_header("http://url/",2$message);
    exit();
}

 
?>


2
bimmer528
Re: [Solved}Pagetype=[username] ?
  • 2003/12/21 3:48

  • bimmer528

  • Just popping in

  • Posts: 19

  • Since: 2002/9/19


Figured it out.

$userid $xoopsUser->getVar('uid');


if (
$userid == '1') {
echo 
" We can access the page"
}

else { 
echo 
"We Can NOT access the page";
}

Login

Who's Online

373 user(s) are online (140 user(s) are browsing Support Forums)


Members: 0


Guests: 373


more...

Donat-O-Meter

Stats
Goal: $100.00
Due Date: Sep 30
Gross Amount: $0.00
Net Balance: $0.00
Left to go: $100.00
Make donations with PayPal!

Latest GitHub Commits