public function logout()
 {
     $userid = cCfg::getUserData('id');
     $sess = session_id();
     if ($userid !== false && $sess) {
         $where = array(array('session', '=', $sess), 'AND', array('ip', '=', $_SERVER['REMOTE_ADDR']));
         $result = cDb::delete('core_authentications', $where);
     }
     $this->clearSessions();
     header('Location: ' . cBuildIndex::getActionUrl(cCfg::getDefaultPage('name')));
 }