| 1 | <?php |
| 2 | /* |
| 3 | * SkladovySystem - Storage management system compatible with LMS |
| 4 | * Copyright (C) 2011 Thomas Mudrunka |
| 5 | * |
| 6 | * This program is free software: you can redistribute it and/or modify |
| 7 | * it under the terms of the GNU Affero General Public License as |
| 8 | * published by the Free Software Foundation, either version 3 of the |
| 9 | * License, or (at your option) any later version. |
| 10 | * |
| 11 | * This program is distributed in the hope that it will be useful, |
| 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 14 | * GNU Affero General Public License for more details. |
| 15 | * |
| 16 | * You should have received a copy of the GNU Affero General Public License |
| 17 | * along with this program. If not, see <http://www.gnu.org/licenses/>. |
| 18 | */ |
| 19 | |
| 20 | /** |
| 21 | * Trida implementuje podpurne funkce spolecne pro vsechny implementace tridy Sklad_Auth |
| 22 | * |
| 23 | * @package Sklad_Auth_common |
| 24 | * @author Tomas Mudrunka |
| 25 | */ |
| 26 | class Sklad_Auth_common { |
| 27 | function get_user($die=true) { |
| 28 | if(isset($this->user)) return $this->user; |
| 29 | if($die) die('No user authorized!!!'); |
| 30 | return false; |
| 31 | } |
| 32 | |
| 33 | function get_user_id($die=true) { |
| 34 | $user = $this->get_user($die); |
| 35 | return $user['id']; |
| 36 | } |
| 37 | } |
| 38 | |
| 39 | require_once(BACKEND_AUTH.'.php'); |