Esempio n. 1
0
 function lsChecklogged()
 {
     /* Check if user has been remembered */
     if (isset($_COOKIE['lc_cookname']) && isset($_COOKIE['lc_cookid'])) {
         $_SESSION['lc_username'] = $_COOKIE['lc_cookname'];
         $_SESSION['lc_idhash'] = $_COOKIE['lc_cookid'];
     }
     /* Username and idhash have been set */
     if (isset($_SESSION['lc_username']) && isset($_SESSION['lc_idhash']) && $_SESSION['lc_username'] != $this->username) {
         /* Confirm that username and userid are valid */
         if (!LS_userlogin::lsConfirmidhash($_SESSION['lc_username'], $_SESSION['lc_idhash'])) {
             /* Variables are incorrect, user not logged in */
             unset($_SESSION['lc_username']);
             unset($_SESSION['lc_idhash']);
             return false;
         }
         // Return the user data
         return LS_userlogin::lsUserinfo($_SESSION['lc_username']);
     } else {
         return false;
     }
 }