PHP Classes

AdminPro getUser

Recommend this page to a friend!

      AdminPro class  >  All threads  >  AdminPro getUser  >  (Un) Subscribe thread alerts  
Subject:AdminPro getUser
Summary:get user on a nonprotected page?
Date:2009-09-24 04:47:00
Update:2009-09-25 20:14:28

  1. AdminPro getUser   Reply   Report abuse  
dizzledammit - 2009-09-24 04:47:00
Hello all. I must say that AdminPro is great. However, I'm having trouble getting the username on a nonprotected page. Any ideas? Thanks!

  2. Re: AdminPro getUser   Reply   Report abuse  
Philip Monos - 2009-09-24 14:21:07 - In reply to message 1 from dizzledammit
Create a class "noprotect" extending class "protect" wher you redefine method makeErrorHtml() to an empty function. Then use "noprotect" to access the user.
Here is a simple script where I have tested it.

class noprotect extends protect
// Redéfine makeErrorHtml méthod
function makeErrorHtml()

$noprot=new noprotect();
if ($user == "")
echo "No user is connected";
} else {
echo "User $user is connected";

Hope that helps.


  3. Re: AdminPro getUser   Reply   Report abuse  
dizzledammit - 2009-09-25 20:14:28 - In reply to message 2 from Philip Monos
Many thanks! :)