/** * Initializes the database connection, and the configuration connections, * and then makes a call to an abstract method that must be defined in the * child classes in order to initialize the template system * * Contains the only statically called query in the entire application, as it * resides in an abstract class and the preparedQueryHandler depends on the fact * that it can derive the name of the class at run time and load those queries. */ public function __construct() { $this->db = DblFactory::getConn(); $this->config = ConfigFactory::getConfig(); /** STRONG AUTHENTICATION */ if (isset($_COOKIE['uName']) && isset($_COOKIE['pass'])) { $this->user = UserFactory::getUser($_COOKIE['uName'], md5($_COOKIE['pass'])); } else { // login as a dummy user who is only able to see news $this->user = ''; } $this->init(); }
public function getInstance() { $this->user = UserFactory::getUser($_COOKIE['uName'], md5($_COOKIE['pass'])); }