Kod
id_usera,haslo_md5
nie jestem pewien bezpieczeństwa swojego sposobu. Dodam jeszcze skromny kod:
<?php class autologin_Vapplet extends Vapplet { public function index_Action() { throw new VappletException('Hmmm !'); } public function Autologin_Action() { $oUser = new Vuser(); if(!$oUser->isAuth()) { $oInput = new Vinput(); $sAuthId = $aCookieAuth[1]; $sAuthPs = $aCookieAuth[0]; if($sAuthId && $sAuthPs) { $oModel = $this->setModel('user'); $aUserData = $oModel->getUser($sAuthId); if($aUserData['user_pass'] == $sAuthPs) { $oUser->setAuth(true); $oUser->name = $aUserData['user_name']; $oUser->id = $aUserData['user_id']; if($aUserData['user_admin'] == 'y') $oUser->setGroup('administrator'); } } } } public function SetCookie_Action() { } public function HasCookie_Action() { $oInput = new Vinput(); return $oInput->cookie('auth'); } public function DeleteCookie_Action() { } } ?>