| Conditions | 3 |
| Paths | 3 |
| Total Lines | 16 |
| Code Lines | 8 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 37 | public function __construct() |
||
| 38 | { |
||
| 39 | parent::__construct(); |
||
| 40 | |||
| 41 | if (!static::connectDb($this->config->db)) { |
||
| 42 | throw new \Exception('Cannot connect to database.'); |
||
| 43 | } |
||
| 44 | |||
| 45 | $this->db = new Database($this->config->db); |
||
| 46 | |||
| 47 | if (!Auth::isLogged()) { |
||
| 48 | die('Usuario no identificado1'); |
||
|
|
|||
| 49 | header('Location: ' . BASE_URL . '/index.php?module=Admin&controller=Auth'); |
||
| 50 | } |
||
| 51 | |||
| 52 | $this->username = Auth::$user->name; |
||
| 53 | } |
||
| 55 |
In general, usage of exit should be done with care and only when running in a scripting context like a CLI script.