Dear ZF-guru's,
[FIXED]
Today I've spent my day trying to put a website, that works fine locally, online. However when I put it online it seems to work at first and loads the view of the index controller and index action (nothing special there). And when I go to /authentication/login it still works. But when I sent the form ZF seems to have difficulty with the Zend_Loader.
My system runs on php 5.2.11.
The error I get:
Code:
Warning: include_once(Zend/Auth/Adapter/Dbtable.php) [function.include-once]: failed to open stream: No such file or directory in /home/sitede01/domains/sitedezign.net/library/Zend/Loader.php on line 146
Warning: include_once() [function.include]: Failed opening 'Zend/Auth/Adapter/Dbtable.php' for inclusion (include_path='/home/sitede01/domains/sitedezign.net/application/../library:/home/sitede01/domains/sitedezign.net/library/.:/usr/local/lib/php') in /home/sitede01/domains/sitedezign.net/library/Zend/Loader.php on line 146
Fatal error: Class 'Zend_Auth_Adapter_Dbtable' not found in /home/sitede01/domains/sitedezign.net/application/controllers/AuthenticationController.php on line 61
My index.php:
Code:
<?php
// Define path to application directory
defined('APPLICATION_PATH')
|| define('APPLICATION_PATH', realpath(dirname(__FILE__) . '/../application'));
// Define application environment
defined('APPLICATION_ENV')
|| define('APPLICATION_ENV', (getenv('APPLICATION_ENV') ? getenv('APPLICATION_ENV') : 'production'));
// Ensure library/ is on include_path
set_include_path(implode('/', array(
realpath(APPLICATION_PATH . '/../library'),
get_include_path(),
)));
/*
* This makes sure the sessions are deleted when the browser is closed.
* If this is set to a long time it is possible to work without cookies,
* however it would make anonymous login impossible.
*
*/
ini_set('session.cookie_lifetime',0);
/*
* set locale options to dutch
*/
date_default_timezone_set('Europe/Amsterdam');
/** Zend_Application */
require_once 'Zend/Application.php';
// Create application, bootstrap, and run
$application = new Zend_Application(
APPLICATION_ENV,
APPLICATION_PATH . '/configs/application.ini'
);
$application->bootstrap()
->run();
And the controller:
Code:
<?php
class AuthenticationController extends Zend_Controller_Action
{
private $redirector = null;
public function init(){
$this->redirector = $this->_helper->getHelper('Redirector');
}
public function loginAction()
{
$auth = Zend_Auth::getInstance();
$authStorage = $auth->getStorage();
if(!$authStorage->isEmpty()){
$this->redirector->gotoUrl('/');
}
$this->view->title = 'Login';
$this->view->headTitle($this->view->title, 'PREPEND');
$form = new Form_AuthenticationLogin();
if($this->getRequest()->isPost()){
$formData = $this->getRequest()->getPost();
if($form->isValid($formData)){
$naam = $form->getValue('naam');
$password = $form->getValue('password');
$authAdapter = $this->getAuthAdapter();
$authAdapter->setIdentity($naam)
->setCredential($password);
$result = $authAdapter->authenticate();
if($result->isValid()){
$authStorage->write($authAdapter->getResultRowObject(null, 'pass'));
$this->redirector->gotoSimple('list', 'courses');
}else{
$form->populate($formData);
$this->view->content = $form;
}
}else{
$form->populate($formData);
$this->view->content = $form;
}
}else{
$this->view->content = $form;
}
}
private function getAuthAdapter()
{
$authAdapter = new Zend_Auth_Adapter_Dbtable(Zend_Db_Table::getDefaultAdapter());
$authAdapter->setTableName('auth')
->setIdentityColumn('name')
->setCredentialColumn('pass')
->setCredentialTreatment('SHA1(?)');
return $authAdapter;
}
}
Anybody that knows what going wrong?