__construct() защищенный Метод

Load the database object
protected __construct ( )
Пример #1
0
 /**
  * Initialize the controller
  *
  * 1. Import the user
  * 2. Call the parent constructor
  * 3. Authenticate the user
  * 4. Load the language files
  * DO NOT CHANGE THIS ORDER!
  */
 public function __construct()
 {
     $this->import('BackendUser', 'User');
     parent::__construct();
     $this->User->authenticate();
     \System::loadLanguageFile('default');
 }
Пример #2
0
 /**
  * Initialize the controller
  *
  * 1. Import the user
  * 2. Call the parent constructor
  * 3. Authenticate the user
  * 4. Load the language files
  * DO NOT CHANGE THIS ORDER!
  */
 public function __construct()
 {
     $this->import('BackendUser', 'User');
     parent::__construct();
     $this->User->authenticate();
     // Password change required
     if ($this->User->pwChange) {
         /** @var SessionInterface $session */
         $session = \System::getContainer()->get('session');
         $objSession = $this->Database->prepare("SELECT su FROM tl_session WHERE sessionID=? AND pid=?")->execute($session->getId(), $this->User->id);
         if (!$objSession->su) {
             $this->redirect('contao/password.php');
         }
     }
     // Front end redirect
     if (\Input::get('do') == 'feRedirect') {
         $this->redirectToFrontendPage(\Input::get('page'), \Input::get('article'));
     }
     // Convenience functions
     if ($this->User->isAdmin) {
         // Maintenance mode off
         if (\Input::get('mmo')) {
             \Config::persist('maintenanceMode', false);
             $this->redirect($this->getReferer());
         }
         // Build internal cache
         if (\Input::get('bic')) {
             $this->import('Automator');
             $this->Automator->generateInternalCache();
             $this->redirect($this->getReferer());
         }
     }
     \System::loadLanguageFile('default');
     \System::loadLanguageFile('modules');
 }
Пример #3
0
 /**
  * Get the current action
  *
  * @param string $strAction
  *
  * @throws \Exception
  */
 public function __construct($strAction)
 {
     if ($strAction == '') {
         throw new \Exception('Missing Ajax action');
     }
     $this->strAction = $strAction;
     parent::__construct();
 }
Пример #4
0
 /**
  * Constructor
  */
 public function __construct()
 {
     try {
         $this->apiKey = Config::get('clr_api_key');
         $this->soap = new SoapClient(Config::get('clr_wsdl_url'));
     } catch (Exception $e) {
         $this->log('Kein API-Key oder WSDL-File für cleverreach.de in den Einstellungen hinterlegt', 'CleverReach::construct', TL_ERROR);
     }
     parent::__construct();
 }
Пример #5
0
 /**
  * Initialize the controller
  *
  * 1. Import the user
  * 2. Call the parent constructor
  * 3. Authenticate the user
  * 4. Load the language files
  * DO NOT CHANGE THIS ORDER!
  */
 public function __construct()
 {
     $this->import('BackendUser', 'User');
     parent::__construct();
     $this->User->authenticate();
     \System::loadLanguageFile('default');
     $strFile = \Input::get('src', true);
     $strFile = base64_decode($strFile);
     $strFile = preg_replace('@^/+@', '', rawurldecode($strFile));
     $this->strFile = $strFile;
 }
Пример #6
0
 /**
  * Initialize the controller
  *
  * 1. Import the user
  * 2. Call the parent constructor
  * 3. Authenticate the user
  * 4. Load the language files
  * DO NOT CHANGE THIS ORDER!
  */
 public function __construct()
 {
     $this->import('BackendUser', 'User');
     parent::__construct();
     $this->User->authenticate();
     // Password change required
     if ($this->User->pwChange) {
         $objSession = $this->Database->prepare("SELECT su FROM tl_session WHERE hash=?")->execute($this->getSessionHash('BE_USER_AUTH'));
         if (!$objSession->su) {
             $this->redirect('contao/password.php');
         }
     }
     // Front end redirect
     if (\Input::get('do') == 'feRedirect') {
         $this->redirectToFrontendPage(\Input::get('page'), \Input::get('article'));
     }
     \System::loadLanguageFile('default');
     \System::loadLanguageFile('modules');
 }
Пример #7
0
 /**
  * Initialize the controller
  *
  * 1. Import the user
  * 2. Call the parent constructor
  * 3. Login the user
  * 4. Load the language files
  * DO NOT CHANGE THIS ORDER!
  */
 public function __construct()
 {
     $this->import('BackendUser', 'User');
     parent::__construct();
     // Login
     if ($this->User->login()) {
         $strUrl = 'contao/main.php';
         // Redirect to the last page visited
         if (\Input::get('referer', true) != '') {
             $strUrl = base64_decode(\Input::get('referer', true));
         }
         $this->redirect($strUrl);
     } elseif (!empty($_POST['username']) && !empty($_POST['password'])) {
         $this->reload();
     } elseif ($this->User->logout()) {
         $this->reload();
     }
     \System::loadLanguageFile('default');
     \System::loadLanguageFile('tl_user');
 }
 /**
  * Import the back end user object
  */
 public function __construct()
 {
     parent::__construct();
     $this->import('BackendUser', 'User');
 }
 /**
  * Import the back end user object
  */
 public function __construct()
 {
     parent::__construct();
     \System::loadLanguageFile('foundation');
     $this->import('BackendUser', 'User');
 }