request['do'] OR $this->request['do'] == 'form' ) { /* Simply return the log in page */ $this->_showForm(); } else { /* Error: No input */ if ( ! $_POST['username'] OR ! $_POST['password'] ) { $this->registry->output->addWarning( "Необходимо ввести имя пользователя и пароль" ); $this->_showForm(); } /* Now authenticate against legacy file */ $result = $this->registry->legacy->authenticateLogIn( $this->request['username'], $this->request['password'] ); if ( $result !== TRUE ) { /* .. then it contains an error message */ $this->registry->output->addWarning( $result ); $this->_showForm(); } /* Still here? We're good to go. Create session and forward */ $this->request['s'] = $this->member->sessionClass()->createSession( $this->registry->legacy->fetchMemberData(), $this->registry->legacy->fetchAuthKey() ); $this->registry->autoLoadNextAction( 'overview' ); return; } } /** * Shows the log in form * * @access private * @return void */ public function _showForm() { $this->registry->output->setTitle( "Авторизация" ); $this->registry->output->setNextAction( 'index&do=login' ); $this->registry->output->addContent( $this->registry->legacy->fetchLogInForm() ); $this->registry->output->sendOutput(); exit(); } } ?>