Guest User

Untitled

a guest
Apr 21st, 2018
87
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 3.06 KB | None | 0 0
  1. <?php
  2.  
  3. class Application_Model_Auth {
  4.     private $authDetails = null;
  5.    
  6.     function __constructor() {
  7.         //$this->authDetails = array_merge($this->authDetails, $authDetails);
  8.         $this->authDetails = array('tablename' => 'customers',
  9.                              'username' => 'name',
  10.                              'password' => 'password',
  11.                              'salt' => 'salt');
  12.        
  13.     }
  14.    
  15.  
  16. gives me:
  17.  
  18. An error occurred
  19.  
  20. Application error
  21.  
  22. Exception information:
  23.  
  24. Message: SQLSTATE[HY000]: General error
  25.  
  26. Stack trace:
  27.  
  28. #0 /Users/Pascal/pear/share/pear/Zend/Db/Statement.php(300): Zend_Db_Statement_Pdo->_execute(Array)
  29. #1 /Users/Pascal/pear/share/pear/Zend/Db/Adapter/Abstract.php(479): Zend_Db_Statement->execute(Array)
  30. #2 /Users/Pascal/pear/share/pear/Zend/Db/Adapter/Pdo/Abstract.php(238): Zend_Db_Adapter_Abstract->query(Object(Zend_Db_Select), Array)
  31. #3 /Users/Pascal/pear/share/pear/Zend/Db/Adapter/Abstract.php(753): Zend_Db_Adapter_Pdo_Abstract->query(Object(Zend_Db_Select), Array)
  32. #4 /Users/Pascal/Sites/nlt-templater/backend/application/models/Auth.php(71): Zend_Db_Adapter_Abstract->fetchRow(Object(Zend_Db_Select))
  33. #5 /Users/Pascal/Sites/nlt-templater/backend/application/models/Auth.php(23): Application_Model_Auth->getSalt('estm')
  34. #6 /Users/Pascal/Sites/nlt-templater/backend/application/controllers/AuthController.php(36): Application_Model_Auth->isAuthorised(Object(Zend_Controller_Request_Http))
  35. #7 /Users/Pascal/pear/share/pear/Zend/Controller/Action.php(513): AuthController->loginAction()
  36. #8 /Users/Pascal/pear/share/pear/Zend/Controller/Dispatcher/Standard.php(295): Zend_Controller_Action->dispatch('loginAction')
  37. #9 /Users/Pascal/pear/share/pear/Zend/Controller/Front.php(954): Zend_Controller_Dispatcher_Standard->dispatch(Object(Zend_Controller_Request_Http), Object(Zend_Controller_Response_Http))
  38. #10 /Users/Pascal/pear/share/pear/Zend/Application/Bootstrap/Bootstrap.php(97): Zend_Controller_Front->dispatch()
  39. #11 /Users/Pascal/pear/share/pear/Zend/Application.php(366): Zend_Application_Bootstrap_Bootstrap->run()
  40. #12 /Users/Pascal/Sites/nlt-templater/backend/public/index.php(26): Zend_Application->run()
  41. #13 {main}  
  42. Request Parameters:
  43.  
  44. array (
  45.   'controller' => 'auth',
  46.   'action' => 'login',
  47.   'module' => 'default',
  48.   'username' => 'estm',
  49.   'password' => 'estm',
  50.   'login' => 'login',
  51. )  
  52.  
  53.  
  54.  
  55.  
  56.  
  57.  
  58.  
  59. <?php
  60.  
  61. class Application_Model_Auth {
  62.     private $authDetails = array('tablename' => 'customers',
  63.                          'username' => 'name',
  64.                          'password' => 'password',
  65.                          'salt' => 'salt');
  66.    
  67.     function __constructor() {
  68.         //$this->authDetails = array_merge($this->authDetails, $authDetails);
  69.         $this->authDetails = array('tablename' => 'customers',
  70.                              'username' => 'name',
  71.                              'password' => 'password',
  72.                              'salt' => 'salt');
  73.        
  74.     }
  75.    
  76.  
  77.  
  78.  
  79.  
  80. WORKS!! i coudl also change the array in the constructor to whatever i want. it still works.
Add Comment
Please, Sign In to add comment