SetAdminToolbar($tpl); SetCommonFooter($tpl); $users = GetUsersInfos(); $tpl->setCurrentBlock("users_table"); if (is_array($users)) { foreach ($users as $user) { // Assign data to the delete projects list $tpl->setCurrentBlock("delete_users"); $tpl->setVariable("USER_ID", $user["Id"]); $tpl->setVariable("USER_USERNAME", $user["username"]); $tpl->setVariable("USER_FULLNAME", EncodeString($user["FullName"])); $tpl->setVariable("USER_EMAIL", ObfuscateEmail($user["email"])); $tpl->setVariable("USER_CAN_UPLOAD", $user["CanUpload"]); $tpl->setVariable("USER_IS_POWER", $user["IsPower"]); $tpl->setVariable("USER_IS_ADMIN", $user["IsAdmin"]); $projectsNames = GetProjectsNamesListFromIds($user["ProjectsList"]); if (is_string($projectsNames)) { die($projectsNames); } $tpl->setVariable("USER_PROJECTS_LIST", implode(", ", $projectsNames)); $tpl->parseCurrentBlock("delete_users"); } } else { if ($msg != "") { $msg .= "<br>"; } $msg .= "Warning: There are no users in the system, this should not happen !!!!"; } $tpl->parseCurrentBlock("users_table"); $tpl->setVariable("MESSAGE", $msg); $tpl->show();
} elseif ($_POST["email"] == "") { $result = "The E-Mail cannot be blank"; } else { $result = ModifyMyDetails(GetLoggedUserId(), $_POST["md5_hash"], $_POST["full_name"], $_POST["email"]); } if ($result == "") { $msg = "Details set successfully"; } else { $msg = "Error while setting details: " . $result; } } $userId = GetLoggedUserId(); $tpl = new HTML_Template_IT("./"); $tpl->loadTemplatefile("edit_my_details.tpl.html", true, true); SetCommonLoginStatus($tpl); SetCommonToolbar($tpl); SetCommonFooter($tpl); $userInfos = GetUserInfosById($userId); $ProjectsList = GetProjectsNamesListFromIds($userInfos["ProjectsList"]); if (is_string($ProjectsList)) { die($ProjectsList); } $tpl->setVariable("NAME", $userInfos["username"]); $tpl->setVariable("FULL_NAME", EncodeString(trim($userInfos["FullName"]))); $tpl->setVariable("EMAIL", trim($userInfos["email"])); $tpl->setVariable("CAN_UPLOAD", $userInfos["CanUpload"]); $tpl->setVariable("IS_POWER", $userInfos["IsPower"]); $tpl->setVariable("IS_ADMIN", $userInfos["IsAdmin"]); $tpl->setVariable("PROJECTS_LIST", implode(", ", $ProjectsList)); $tpl->setVariable("MESSAGE", $msg); $tpl->Show();