public static function getCurrentUserId() { // get curent user data $user_data = parent::getSession('curent_user'); $_get_id_user = isset($_GET['id_user']) ? $_GET['id_user'] : null; $_post_id_user = isset($_POST['id_user']) ? $_POST['id_user'] : null; return self::is_SuperUserSession() ? $_post_id_user ? $_post_id_user : ($_get_id_user ? $_get_id_user : $user_data['id_user']) : parent::getSession('id_user'); }
function __construct() { // clear messages and errors classModel::$errors = classModel::$messages = array(); // set logout link authModel::$logoutLink = $this->makeURI(array("controller" => "auth", "action" => "logout")); // check logining if (!authModel::is_Authorized()) { header("Location: " . $this->makeURI(array("controller" => "auth"))); } else { authModel::$userData = classModel::getSession("userData"); } // create top menu self::createTopMenu(); }