// require_once("./classes/debugHelper.php"); require_once "./includes/sessiondata.php"; $action = isset($_POST["action"]) ? $_POST["action"] : ""; //****************************************************** //** sTeam Stuff //****************************************************** //login und $steam def. in "./includes/login.php" $steam = new steam_connector($config_server_ip, $config_server_port, $login_name, $login_pwd); if (!$steam || !$steam->get_login_status()) { header("Location: {$config_webserver_ip}/index.html"); exit; } if ($action == "change") { $user_prefs = array(OBJ_DESC => $_POST["USER_DESCRIPTION"], USER_ADRESS => $_POST["USER_ADRESS"], USER_EMAIL => $_POST["USER_EMAIL"], USER_LANGUAGE => $_POST["user_language"], "bid:user_callto" => $_POST["user_callto"], "bid:user_im_adress" => $_POST["user_im_adress"], "bid:user_im_protocol" => $_POST["user_im_protocol"], "bid:treeview_mini" => $_POST["treeview_mini"], "bid:show_hidden" => $_POST["show_hidden"]); $user_prefs["bid:treeview"] = isset($_POST["treeview"]) ? $_POST["treeview"] : "on"; $steam->get_login_user()->set_attributes($user_prefs); } $_SESSION["treeview"] = $steam->get_login_user()->get_attribute("bid:treeview") == "on" ? true : false; $_SESSION["treeview_mini"] = $steam->get_login_user()->get_attribute("bid:treeview_mini") == "on" ? true : false; $_SESSION["show_hidden"] = $steam->get_login_user()->get_attribute("bid:show_hidden") == "on" ? true : false; $_SESSION["language"] = $language_map_counter[$steam->get_login_user()->get_attribute(USER_LANGUAGE)]; //after save action and disconnect close window and update the opener if ($action && $action == "change") { echo "<html>\n<body onload='javascript:window.opener.top.location.reload();"; echo "window.close();'>\n</body>\n</html>"; exit; } //****************************************************** //** Display Stuff //****************************************************** //template stuff
//** Get Post data //****************************************************** $object_id = isset($_GET["id"]) ? $_GET["id"] : 0; $object_id = isset($_POST["id"]) ? $_POST["id"] : $object_id; $action = isset($_POST["mission"]) ? $_POST["mission"] : ""; //****************************************************** //** sTeam Server Connection //****************************************************** $steam = new steam_connector($config_server_ip, $config_server_port, $login_name, $login_pwd); $error = array(); if (!$steam || !$steam->get_login_status()) { $do_login = True; $error[] = "error_not_logged_in"; } else { /** log-in user */ $steamUser = $steam->get_login_user(); /** id of the log-in user */ $steamUserId = $steamUser == 0 ? 0 : $steamUser->get_id(); /** name of the log-in user */ $steamUserName = $steamUser == 0 ? "" : $steamUser->get_name(); /** the current object */ $object = $object_id != 0 ? steam_factory::get_object($steam, $object_id) : NULL; /** the content of the message object */ $object_content = $object->get_content(1); /** additional required attributes */ $attrib = $object->get_attributes(array(OBJ_NAME, OBJ_DESC, OBJ_CREATION_TIME, OBJ_LAST_CHANGED), 1); /** get the annotating category */ $category = $object->get_annotating(1); /** check the rights of the log-in user */ $allowed_write = $object->check_access_write($steamUser, 1); // flush the buffer
function setBidLastSessionTime($config_server_ip, $config_server_port, $login_name, $login_pwd, $connect = true) { try { //login und $steam def. in "./includes/login.php" $steam = new steam_connector($config_server_ip, $config_server_port, $login_name, $login_pwd); if ($steam->get_login_status()) { $steamUser = $steam->get_login_user(); $bidLastSessionTime = $steamUser->get_attribute("bid:last_session_time"); if (!$bidLastSessionTime || !$connect) { $bidLastSessionTime = array(); $bidLastSessionTime[0] = $bidLastSessionTime[1] = time(); } else { $bidLastSessionTime[0] = $bidLastSessionTime[1]; $bidLastSessionTime[1] = time(); } $steamUser->set_attribute("bid:last_session_time", $bidLastSessionTime); $steam->disconnect(); } } catch (Exception $e) { } }