CINXE.COM

eduroam Configuration Assistant Tool

<!DOCTYPE html> <html xmlns='http://www.w3.org/1999/xhtml' lang='en' > <head lang='en'> <meta http-equiv='Content-Type' content='text/html; charset=UTF-8'> <title>eduroam Configuration Assistant Tool</title> <script type="text/javascript">ie_version = 0;</script> <!--[if IE]> <script type="text/javascript">ie_version=1;</script> <![endif]--> <!--[if IE 7]> <script type="text/javascript">ie_version=7;</script> <![endif]--> <!--[if IE 8]> <script type="text/javascript">ie_version=8;</script> <![endif]--> <!--[if IE 9]> <script type="text/javascript">ie_version=9;</script> <![endif]--> <!--[if IE 10]> <script type="text/javascript">ie_version=10;</script> <![endif]--> <!-- JQuery --> <script type="text/javascript" src="/external/jquery/jquery.js"></script> <script type="text/javascript" src="/external/jquery/jquery-ui.js"></script> <script type='text/javascript' src=""></script> <script type='text/javascript' src="/external/jquery/Timepicker/jquery-ui-sliderAccess.js"></script> <link type="text/css" rel="stylesheet" href="/external/jquery/jquery-ui.css" media="all" /> <link type="text/css" rel="stylesheet" href="" media="all" /> <script type="text/javascript"> var recognisedOS = ''; var downloadMessage; var recognisedOShs20 = 0; var noDisco = 1; var sbPage = 1; var lang = "en"; var dir = "/data/www/CAT-2.1.3/web/skins/modern"; const preloadIdPs = true; const apiURL = "/user/API.php"; const catInfo = "/skins/modern/user/cat_info.php"; const overviewUser = "/admin/overview_user.php"; const remindIdP = "/user/remindIdP.php"; const profile_list_size = 1; const generation_error = "This is embarrassing. Generation of your installer failed. System admins have been notified. We will try to take care of the problem as soon as possible."; var n; var profile; // var device_button_bg ="#0a698e"; var generateTimer; var pageWidth = 0; var device_button_fg; var catWelcome; var hide_images = 0; var front_page = 1; var download_link; var openroaming = 'none'; var preagreed = false; var pressedButton; var profileDevices; var recognisedOS; var currentDevice; const discoCountries = { 'AL': "Albania",'AR': "Argentina",'AM': "Armenia",'AU': "Australia",'AT': "Austria",'AZ': "Azerbaijan",'BD': "Bangladesh",'BE': "Belgium",'BR': "Brazil",'BG': "Bulgaria",'CA': "Canada",'CL': "Chile",'CO': "Colombia",'CR': "Costa Rica",'HR': "Croatia",'CZ': "Czechia",'DK': "Denmark",'EC': "Ecuador",'EE': "Estonia",'ET': "Ethiopia",'FI': "Finland",'FR': "France",'GE': "Georgia",'DE': "Germany",'GH': "Ghana",'GR': "Greece",'HU': "Hungary",'IS': "Iceland",'IE': "Ireland",'IL': "Israel",'IT': "Italy",'JP': "Japan",'KE': "Kenya",'KR': "Korea",'KS': "Kosovo",'LA': "Laos",'LV': "Latvia",'LI': "Liechtenstein",'LT': "Lithuania",'LU': "Luxembourg",'MK': "Macedonia",'MW': "Malawi",'MY': "Malaysia",'MT': "Malta",'MX': "Mexico",'MD': "Moldova",'ME': "Montenegro",'MA': "Morocco",'NL': "Netherlands",'NZ': "New Zealand",'NG': "Nigeria",'NO': "Norway",'OM': "Oman",'PK': "Pakistan",'PE': "Peru",'PH': "Philippines",'PL': "Poland",'PT': "Portugal",'RO': "Romania",'RS': "Serbia",'SG': "Singapore",'SK': "Slovakia",'SI': "Slovenia",'ZA': "South Africa",'ES': "Spain",'LK': "Sri Lanka",'SE': "Sweden",'CH': "Switzerland",'TZ': "Tanzania",'GEANT': "The GEANT country",'TR': "Turkey",'UG': "Uganda",'UA': "Ukraine",'AE': "United Arab Emirates",'UK': "United Kingdom",'UY': "Uruguay",'US': "U.S.A.",'ZM': "Zambia" }; var idpsLoaded = false; const guiTexts = { "noMatchingData": "no matching data found", "select": "select", "www": "WWW:", "email": "email:", "tel": "tel:", "problems": "If you encounter problems, then you can obtain direct assistance from your organisation at:", "problemsGeneric": "If you encounter problems you should ask those who gave you your account for help.", "unconfigurable": "This device cannot be configured with the settings used in your organisation.", "redirect": "Your site administrator has specified that this device should be configured with resources located on a local page. When you click <b>Continue</b> this page will be opened in a new window/tab.", "profile_redirect": "Your local administrator has specified a redirect to a local support page.<br>When you click <b>Continue</b> this support page will be opened in a new window/tab.", "continue": "Continue", "close": "Close", "noProviders": "No providers found for this email", "yourIdP": "Your IdP is:", "yourIdPs": "Your IdP could be one of:", "missingEmail": "Missing email address", "entryUpdate": "This entry was last updated at:", "openRoamingTouWarning": "If you intend to download an installer which also enables OpenRoaming then you must accept OpenRoaming Terms and Conditions.", "openRoamingText1": "If you select installers with OpenRoaming support, remember to indicate your consent.", "openRoamingText2": "The installer has built-in OpenRoaming support.", "openRoamingText3": "I want to use OpenRoaming and have read and accept <a href='https://wballiance.com/openroaming/toc-2020/' target='_blank'>OpenRoaming Terms and Conditions</a>", "openRoamingText4": "I have read and accept <a href='https://wballiance.com/openroaming/toc-2020/' target='_blank'>OpenRoaming Terms and Conditions</a>", "openRoamingDisabled": "OpenRoaming is not supported on this device", "downloadAnother": "Choose another installer to download", "downloadFor": "Download your installer for", "consortium": "eduroam庐", "consortiumOnly": "eduroam庐 only", "consortiumAndOR": "eduroam庐 and OpenRoaming", }; var discoTextStrings = { "title":"Organisation", "subtitle":"Select your organisation", "textHelp": "Help, my organisation is not on the list", "textHelpMore": "This system relies on information supplied by local eduroam庐 administrators. If your organisation is not on the list, then nag them to add information to the eduroam CAT database.", "textLocateMe": "Locate me more accurately using HTML5 Geo-Location", "textShowProviders": "Show organisations in", "textAllCountries": "all countries", "textSearch" : "or search for an organisation, for example University of Oslo", "textShowAllCountries": "show all countries", "textLimited1" : "Results limited to", "textLimited2" : "entries - show more", "textNearby" : "Nearby", "geoLoc_timeout" : "Location timeout", "geoLoc_posUnavailable" : "Could not get your position", "geoLoc_permDenied" : "Your browser has denied access to your location", "geoLoc_unknownError" : "Unknown location error", "geoLoc_here" : "You are here:", "geoLoc_getting" : "Getting your location...", "geoLoc_nearby" : "Nearby providers shown on top.", }; var roller; // controls if the system sliedes apper on the page if (roller === undefined) roller = 0; var noDisco; if (noDisco === undefined) noDisco = 0; var sbPage; if (sbPage === undefined) sbPage = 0; // used to keep the footer at the bottom while the window is resized $.fn.redraw = function() { $(this).each(function() { var redraw = this.offsetHeight; }); }; function otherInstallers() { clearUIsettings(); $(".guess_os").hide(); $("#message_only").hide(); $("#other_installers").show(); $("#devices").show(); $("#devices").redraw(); reset_footer(); } // Print the list of profiles for the given IdP (identified as inst_id) function listProfiles(inst_id,selected_profile) { var j; var otherdata; $('#welcome').hide(); $("#silverbullet").hide(); $('#user_welcome').hide(); $("#idp_logo").hide(); $("#fed_logo").hide(); $("#inst_id").val(inst_id); $("#profile_id").val(''); $(".signin_large").hide(); if (roller) Program.stop_program = 1; $("#profiles").hide(); $("#user_info").hide(); $("#devices").hide(); $("#profile_redirect").hide(); $.post(apiURL, {action: 'listProfiles', api_version: 2, lang: lang, idp: inst_id}, function(j) { result = j.status; if (j.otherdata !== undefined) otherdata = j.otherdata; if (! result) { alert(guiTexts.noMatchingData); document.location.href='/diag/'; } j = j.data; n = j.length; $("#profile_list").html(''); inst_name = j[0].idp_name; logo = j[0].logo; // the #inst_name is the hiddien form field used to carry the info $("#inst_name").val(inst_name); $("#inst_name_span").html(inst_name); $(".inst_name").text(inst_name); $("#user_page").show(); $("#institution_name").show(); if (n > profile_list_size) $("#profile_list").append('<option value="0" selected style="color:red"> --' + guiTexts.select + ' --</option>'); $.each(j,printP); if (n <= profile_list_size) $("#profile_list").append('<option value="0" selected style="display:none"> </option>'); if (logo == 1) { $("#idp_logo").attr("src",apiURL + "?action=sendLogo&api_version=2&idp="+inst_id); $("#idp_logo").show(); } $("#fed_logo").attr("src",apiURL +"?action=sendFedLogo&api_version=2&idp="+inst_id); if (otherdata !== undefined && otherdata['fedname'] !== undefined) { $("#fed_logo").attr("title",otherdata['fedname']); $("#fed_logo").attr("alt",otherdata['fedname']); } if (otherdata !== undefined && otherdata['fedurl'] !== undefined) { $("#fed_logo").css('cursor','pointer'); $("#fed_logo").click(function(event) { window.open(otherdata['fedurl'], '_blank'); }); } $("#fed_logo").show(); if (n > 1) { if (n <= profile_list_size) { $("#profile_list").attr('size',n+1); } else { $("#profile_list").attr('size',1); } $("#profiles").show(); } // depending on the case if we have one or multiple profiles we either // show the select or skip the selection and show the profile if (n > 1 && selected_profile) { var theProfile = $('#profile_list option[value='+selected_profile+']'); if ( theProfile.length == 1) { theProfile.attr("selected",true); showProfile(selected_profile); } } reset_footer(); }); } // the printP function prints an individual profile entry in the select function printP(i,v) { if (n == 1 ) { $("#profiles").hide(); $("#profile_list").append('<option value="'+v.profile+'" selected>'+v.display+'</option>'); showProfile(v.profile); } else { $("#profile_list").append('<option value="'+v.profile+'">'+v.display+'</option>'); } } // showProfile displays a single profile and the corresponding download buttons // the argument is the numeric profile identifier // Other than hiding unncecessay elements the function is essentially an AJAX // handler for profileAttributes call function showProfile(prof) { $("#profile_redirect").hide(); $("#silverbullet").hide(); $("#other_installers").hide(); $("#user_welcome").hide(); $("#devices").hide(); // no matching profile hide stuff and return if (prof == 0) { $("#user_info").hide(); // $("#devices").hide(); return; } var j, txt ; // set the global profile variable profile = prof; $("#profile_id").val(profile); txt = ''; $.post(apiURL, {action: 'profileAttributes', api_version: 2, lang: lang, profile: profile}, function(j1) { // j1 = JSON.parse(data); result = j1.status; if (! result) { alert(guiTexts.noMatchingData); document.location.href='/diag/'; } j = j1.data; if (j.description !== undefined && j.description) { $("#profile_desc").text(j.description); $("#profile_desc").css("display","inline-block"); // $("#profile_desc").show(); } else { $("#profile_desc").hide(); $("#profile_desc").text(''); } updateTxt = '<span class="user_info">'+guiTexts.entryUpdate+' '+j.last_changed+'</span><br/>'; openroamming = 'none'; preagreed = false; if (j.openroaming !== undefined) { var p = j.openroaming.match(/.*(?=-preagreed)/); if (p != null) { preagreed = true; openroaming = p[0]; } else { openroaming = j.openroaming; } } if (j.local_url !== undefined && j.local_url) txt = txt+'<span class="user_info">' + guiTexts.www + ' <a href="'+j.local_url+'" target="_blank">'+j.local_url+'</a></span><br/>'; if (j.local_email !== undefined && j.local_email) txt = txt+'<span class="user_info">' + guiTexts.email + ' <a href="mailto:'+j.local_email+'">'+j.local_email+'</a></span><br/>'; if (j.local_phone !== undefined && j.local_phone) txt = txt+'<span class="user_info">' + guiTexts.tel + ' ' +j.local_phone+'</span><br/>'; if (txt) txt = "<span class='user_info_header'>" + guiTexts.problems + "</span><br/>"+txt+updateTxt; else txt = "<span class='user_info_header'>" + guiTexts.problemsGeneric + '</span><br/>'+updateTxt; $("#user_info").html(txt); $("#user_info").show(); if (j.silverbullet) { $("#devices").hide(); $("#silverbullet").show(); return; } profileDevices = j.devices; currentDevice=findDevice(recognisedOS); // create the main download page section // test if we have a global profile redirect in this case the array // will only have a single element and it will have id 0 // such device id may not appear in any other situation if (profileDevices.length == 1 && profileDevices[0].id == '0') { $("#devices").hide(); $("#user_info").hide(); $("#profile_redirect_bt").attr('href',profileDevices[0].redirect); $("#profile_redirect").show(); reset_footer(); return; } updateGuessOsDiv(currentDevice); resetDevices(false); // first handle the guess_os part if (handleGuessOs(currentDevice) == 0) return; // now the full devices list $.each(j.devices,function(i,v) { // Now consider devices that cannot be configured due to unsupported // EAP methods. This can be recognised by the device status set to 1 // however we also need to make sure that the redirect has not been // set for this device. if (v.status > 0) { if( v.redirect == '0') { $("#"+v.id).addClass('disabledDevice'); $("#info_b_"+v.id).addClass('disabledDevice'); } } }); $("#devices").show(); reset_footer(); }) } function resetDevices(initial) { if (recognisedOS !== '' ) { mainOS(initial); } else { otherInstallers(); } $("#devices button").removeClass('alertButton'); $("#devices button").removeClass('disabledDevice'); $("#devices button").removeClass('hasAdditonalInfo'); $('#devices button').unbind('click'); $('#devices tr').show(); $('.device_info').html(''); $('.device_info').hide(); $("#user_welcome").hide(); $("#devices").unbind(); $("#devices").on('click', 'button', function(event) { event.preventDefault(); deviceButtonClick($(this)); }); } function clearUIsettings() { $("#other_installers").hide(); // $("#openroaming_check").prop("checked", false); $("#g_or_"+recognisedOS).css("background-color", "#bbb"); $("#g_or_"+recognisedOS).removeClass('enabled'); $("#openroaming_tou").hide(); $("#g_or_"+recognisedOS).hide(); $("button.dev_or").removeClass('enabled'); $("button.dev_or").css("background-color", "#bbb"); } function handlePreagreed() { if (!preagreed) { if (openroaming == 'ask') { $("#or_text_1").show(); } if (currentDevice.options.message_only != 1 && currentDevice.geteduroam != 1) { $("#openroaming_tou").show(); } } else { $("#openroaming_check").prop("checked", true); $("#openroaming_check").trigger("change"); } } function resetOpenRoaming(mainOs, hs20) { if (mainOs === '' ) { return; } $("#g_or_"+mainOs).css("background-color", "#bbb"); $("#g_or_"+mainOs).removeClass('enabled'); $("#g_or_"+mainOs).hide(); switch (openroaming) { case 'none': $("#download_button_header_"+mainOs).html(guiTexts.consortium); $("#g_"+mainOs).show(); $("#g_or_"+mainOs).hide(); break; case 'ask': if (hs20 == "1") { $("#or_text_1").html(guiTexts.openRoamingText1); $("#or_text_2").html(guiTexts.openRoamingText3); $("#g_"+mainOs).show(); handlePreagreed(); $("#download_button_header_"+mainOs).html(guiTexts.consortiumOnly); $("#g_"+mainOs).show(); $("#g_or_"+mainOs).show(); } else { $("#download_button_header_"+mainOs).html(guiTexts.consortium); } $("#g_"+mainOs).show(); break; case 'always': if (hs20 == "1") { $("#download_button_header_"+mainOs).html(guiTexts.consortiumAndOR); $("#or_text_1").html(guiTexts.openRoamingText2); $("#or_text_2").html(guiTexts.openRoamingText4); handlePreagreed(); $("#g_"+mainOs).hide(); $("#download_button_header_"+mainOs).html(guiTexts.consortiumAndOR); $("#g_or_"+mainOs).show(); } else { $("#openroaming_tou").hide(); $("#download_button_header_"+mainOs).html(guiTexts.consortium); $("#g_"+mainOs).show(); } break; } } function mainOS(initial) { clearUIsettings(); resetOpenRoaming(recognisedOS, recognisedOShs20); if (!initial) { $("div.guess_os").show(); } } /* now comes the definition of button click there are several types of button possible the main download button (.guess_os) my either generate immediate download action or can open up the extra info window; the device listing buttons (.other_os) just cause the device selection and call the main download screen; the info button (.more_info_b) just pop up the device info window */ function deviceButtonClick(button) { var device_id = button.attr("name"); var setOpenRoaming = 0; var info_id = 'info_'+device_id; if (button.hasClass("guess_os")) { // main download buttons first info_id = 'info_g_'+device_id; $('.device_info').hide(); if (button.hasClass("dev_or") && $("#openroaming_check").prop("checked") == false) { alert(guiTexts.openRoamingTouWarning); return; } pressedButton = button; if (button.hasClass('hasAdditonalInfo')) { $('#'+info_id).show(100); } else { if (button.hasClass("dev_or") && $("#openroaming_check").prop("checked") == true) { setOpenRoaming = 1; } doDownload(device_id,setOpenRoaming); } } else if (button.hasClass("other_os")) { // now the full list download buttons changeDevice(device_id); } else if (button.hasClass("more_info_b")) { if (button.hasClass("disabledDevice")) { alert(guiTexts.unconfigurable) } else { showMoreDeviceInfo(device_id); } } } function showMoreDeviceInfo(devId) { $("#info_window").html("<h2>"+$('#'+devId).text()+"</h2>"); $.post(apiURL, {action: 'deviceInfo', api_version: 2, lang: lang, device: devId, profile: profile, openroaming: openroaming}, deviceInfo); } function doDownload(devId, setOpenRoaming) { $('#download_info').hide(); generateTimer = $.now(); $("#devices").hide(); $("#user_welcome").show(); $.post(apiURL, {action: 'generateInstaller', api_version: 2, lang: lang, device: devId, profile: profile, openroaming: setOpenRoaming}, processDownload, "html"); } function findDevice(devId) { for (var i = 0; i < profileDevices.length; i++) { v = profileDevices[i]; if (v.id == devId) { return(v); } } return(null); } function deviceInfo(data) { var h = $("#info_window").html(); $("#info_window").html(h+data); $("#main_body").fadeTo("fast", 0.2,function() { var x = getWindowHCenter() - 350; var top = $("#main_body").get(0).getBoundingClientRect().top; if (top < -150) { $("#info_overlay").css("top", -top + 50); } $("#info_overlay").show(); }); } function handleGuessOs(recognisedDevice) { if (recognisedDevice == null) return 1; if (recognisedDevice.geteduroam == 1 && recognisedDevice.options.geteduroam_text !== undefined) { recognisedDevice.options.message_only = 1; recognisedDevice.message = recognisedDevice.options.geteduroam_text; } if(recognisedDevice.options.message_only == 1) { $("#guess_os").html("<div id='message_only'>"+recognisedDevice.message+"</div>"); return 1; } if(recognisedDevice.redirect != '0') { $('.device_info').html(''); $('.more_info_b').hide(); $("#g_"+recognisedOS+",#g_or_"+recognisedOS).addClass('hasAdditonalInfo'); i_div = $("#info_g_"+recognisedOS); t = guiTexts.redirect+ "<br><span class='redirect_link'><a href='"+recognisedDevice.redirect+"' target='_blank'>"+guiTexts.continue+"</a></span>"; i_div.html(t); $(".redirect_link").click(function(event) { i_div.hide('fast'); }); return 1; } // handle devices that cannot be configured due to lack of support // for required EAP methods /* if (recognisedDevice.status > 0 && recognisedDevice.redirect == '0') { // this requires a proper handler alert(guiTexts.unconfigurable); $("#devices").hide(); $("#user_info").hide(); $("#profile_redirtect_text").html(guiTexts.unconfigurable); $("span.redirect_link").hide(); $("#profile_redirect").show(); reset_footer(); return false; } */ // handle devices which require displaying extra information when // the dowmload button is pressed $('.device_info').html(''); if (recognisedDevice.device_customtext != '0' || recognisedDevice.eap_customtext != '0' || recognisedDevice.message != '0') { $("#g_"+recognisedOS+",#g_or_"+recognisedOS).addClass('hasAdditonalInfo'); i_div = $("#info_g_"+recognisedOS); /* if ($(this).hasClass("dev_or") && $("#openroaming_check").prop("checked") == false) { i_div.hide(); alert(guiTexts.openRoamingTouWarning); return; } */ // t = i_div.html(); t = ''; if (recognisedDevice.message != '0') { if (t != '') t += '<br>'; t += recognisedDevice.message; } if (recognisedDevice.device_customtext != '0') { if (t != '') t += '<br>'; t += recognisedDevice.device_customtext; } if (recognisedDevice.eap_customtext != '0') { if (t != '') t += '<br/>&nbsp;<br/>'; t += recognisedDevice.eap_customtext; } t += "<br><span class='redirect_link'>"+guiTexts.continue+"</span>"; i_div.html(t); $(".redirect_link").click(function(event) { i_div.hide('fast'); var dev_id = pressedButton.attr('name'); var setOpenRoaming = 0; if (pressedButton.hasClass("dev_or") && $("#openroaming_check").prop("checked") == true) { setOpenRoaming = 1; } if (recognisedDevice.status == 0) { doDownload(dev_id, setOpenRoaming); } }); } return 1; } function changeDevice(devId) { currentDevice = findDevice(devId); if (currentDevice.options.hs20 === undefined) { recognisedOShs20 = 0; } else { recognisedOShs20 = currentDevice.options.hs20; } recognisedOS = currentDevice.id; $("#device").val(currentDevice.id); updateGuessOsDiv(currentDevice); resetOpenRoaming(recognisedOS, recognisedOShs20); guessOsRes = handleGuessOs(currentDevice); if (guessOsRes == 0) return; if (guessOsRes == 2) { $("#devices").hide(); } else { $("#devices").show(); } $("div.guess_os").show(); $("#other_installers").hide(); reset_footer(); } function changeLang(l) { $("#lang").val(l); document.cat_form.submit(); } function updateGuessOsDiv(device) { $("#device_message").hide(); $("#guess_os").empty(); $("#download_another").remove(); $("#download_text_1").empty(); if (device != null) { $("#download_text_1").append("<div>"+guiTexts.downloadFor+" "+device.display+"</div>") $("#download_text_1").css('background-image', 'url("'+vendorlogo+device.group+'.png")'); if (device.status > 0) { $("#device_message").html(guiTexts.unconfigurable); $("#device_message").show(); } else { div1 = "<div>\ <div class='button_wrapper'>\ <button name='"+device.id+"' class='guess_os' id='g_"+device.id+"'>\ <div class='download_button_text_1' id='download_button_header_"+device.id+"'>"+guiTexts.consortiumOnly+"\ /div>\ </button>\ </div>\ <div class='button_wrapper'>\ <button name='"+device.id+"' class='guess_os dev_or' id='g_or_"+device.id+"'>\ <div name='"+device.id+"' class='download_button_text_1' id='download_button_or_header_"+device.id+"'>"+guiTexts.consortiumAndOR+"\ </div>\ </button>\ </div>\ <div class='button_wrapper'>\ <button name='"+device.id+"' class='more_info_b' id='g_info_b_"+device.id+"'>i</button>\ </div>\ </div>\ <div name='"+device.id+"' class='device_info' id='info_g_"+device.id+"'>XXXXX</div>\ <div id='more_i'><a href='javascript:showMoreDeviceInfo(\""+device.id+"\")'>See more installer information</a></div>"; $("#guess_os").prepend(div1); } } div2 ="<div id='download_another' class='sub_h guess_os'>\ <a href='javascript:otherInstallers()'>"+guiTexts.downloadAnother+"</a>\ </div>"; $("#guess_os_wrapper").append(div2); } function showInfo(data, title) { if (data.substring(0,8) == 'no_title') { data = data.substring(8,data.length); } else { data = "<h1>"+title+"</h1>"+data; } if (roller) Program.stop_program = 1; $("#main_body").fadeTo("fast", 0.1); $("#main_menu_content").html(data); $("#main_menu_info").show('fast'); } function infoCAT(k,subK,title) { $.post(catInfo, {page: k, subpage: subK, lang: lang}, function(data) { showInfo(data, title) }); } function waiting(action) { if (action == 'start') { var x = getWindowHCenter() - 16; $("#loading_ico").css('left',x+'px'); $("#loading_ico").attr('src','resources/images/icons/loading9.gif'); $("#loading_ico").show(); return; } if (action == 'stop') { $("#loading_ico").hide(); return; } } function goAdmin() { waiting('start'); window.location.replace(overviewUser+"?lang="+lang); } function remindIdPF() { mail = $("#remindIdP").val(); key = $("#remindIdPs").val(); if (mail == "") { alert(guiTexts.missingEmail); return; } waiting('start'); $.get(remindIdP, {key: key, mail: mail}, function(data) { $("#remindIdPl").html(""); try { j = JSON.parse(data); } catch(err) { alert(generation_error); return(false); } if (j.status == 0) { $("#remindIdPh").html(guiTexts.noProviders); waiting('stop'); return; } if (j.data.length == 1) { $("#remindIdPh").html(guiTexts.yourIdP); } else { $("#remindIdPh").html(guiTexts.yourIdPs); } $.each(j.data, function(i, v) { $("#remindIdPl").append('<li>' + v + '</li>'); }, 'html'); waiting('stop'); }); } /* Get horizontal center of the Browser Window */ function getWindowHCenter() { var windowWidth = 0; if ( typeof( window.innerWidth ) == 'number' ) { windowWidth = window.innerWidth; } else { if ( document.documentElement && document.documentElement.clientWidth ) { windowWidth = document.documentElement.clientWidth; } else { if ( document.body && document.body.clientWidth ) { windowWidth = document.body.clientWidth; } } } return(Math.round(windowWidth/2)); } function showTOU() { $("#all_tou_link").hide(); $("#tou_2").show(); } function back_to_downloads() { $("#devices").show(); $("#user_welcome").hide(); } function reset_footer() { var wh = parseInt($(window ).height()); var mph = parseInt($("#main_page").height()) + parseInt($("#footer").css("height")); if (wh > mph) { $("#wrap").css("min-height","100%"); $("#vertical_fill").css("height",wh - mph - 16); $("#vertical_fill").show(); } else { $("#wrap").css("min-height","auto"); $("#vertical_fill").hide(); } $("#institution_name").css("min-height", $("#inst_extra_text").height()); } function processDownload(data) { generateTimer = $.now() - generateTimer; if (generateTimer < 3000) generateTimer = 3000 - generateTimer; else generateTimer = 0; var j; try { j = JSON.parse(data).data; } catch(err) { alert(generation_error); return(false); } if ( j.link == 0 ) alert(generation_error); else { download_link = j.link; $("#download_info a").attr('href',download_link); $('#download_info').show(); if ( generateTimer > 0 ) { setTimeout("document.location.href=download_link",generateTimer); } else { document.location.href=download_link; } } } function discoJuiceCallback(e) { $("#profile_desc").hide(); $("#profile_desc").text(''); $("#welcome_top1").hide(); $("#top_invite").hide(); $("#institution_name").hide(); $("#front_page").hide(); if (roller) Program.stop_program = 1; $(this).addClass('pressed'); $('#welcome').hide(); $("#inst_name_span").html(""); $("#user_info").hide(); $("#devices").hide(); $("#profile_redirect").hide(); $("#profiles").hide(); $("#institutions").hide(); listProfiles(e.idp,0); } function loadDiscoJuice() { var metadata; if (preloadIdPs) metadata = allIdPs; else metadata = apiURL+"?action=listAllIdentityProviders&api_version=2&lang="+lang; discoTextStrings.discoPath = "external/discojuice/"; discoTextStrings.iconPath = apiURL + "?action=sendLogo&api_version=2&disco=1&lang=" + lang + "&idp="; discoTextStrings.overlay = true; discoTextStrings.cookie = true; discoTextStrings.type = false; discoTextStrings.country = true; discoTextStrings.location = true; discoTextStrings.countryAPI = apiURL+"?action=locateUser&api_version=2"; discoTextStrings.metadata = metadata; discoTextStrings.metadataPreloaded = preloadIdPs; discoTextStrings.callback = discoJuiceCallback; $(".signin").DiscoJuice(discoTextStrings); DiscoJuice.Constants.Countries = discoCountries; idpsLoaded = true; } $(document).ready(function() { var j ; if (ie_version == 0 ) $('body').addClass("use_borders"); else { if (ie_version == 8) $('body').addClass("old_ie"); if (ie_version < 8) $('body').addClass("no_borders"); if (ie_version > 9) $('body').addClass("no_borders"); } $("#devices").hide(); if (sbPage == 0) { $("#user_page").hide(); $("#institution_name").hide(); $("#user_info").hide(); } else { $("#user_page").show(); $("#institution_name").show(); $("#user_info").show(); } $("#profiles").hide(); $("#devices").hide(); $("#download_info a").css('font-weight','bold'); $("#profile_list").change(function(event) { showProfile($(this).val()); }); resetDevices(true); $(".signin").click(function(event) { event.preventDefault(); if (idpsLoaded) return; waiting('start'); const tmInt = setInterval(function() { if (!idpsLoaded) return; clearInterval(tmInt); waiting('stop'); DiscoJuice.UI.show(); }, 100); }); $("#main_menu_close").click(function(event) { $("#main_menu_info").hide('fast'); $("#main_body").fadeTo("fast", 1.0); if (roller) { Program.stop_program = 0; Program.nextStep(); } return(false); }); $("#info_menu_close").click(function(event) { $("#info_overlay").hide('fast'); $("#main_body").fadeTo("fast", 1.0); }); $("#hamburger").click(function(event) { $("#menu_top > ul").toggle(); }); $("#menu_top > ul >li").click(function(event) { if ($( window ).width() < 750 ) { $("#menu_top > ul").hide(); } }); catWelcome = $("#main_menu_content").html(); if (noDisco === 0) { if (preloadIdPs) { $.get(apiURL+"?action=listAllIdentityProviders&api_version=2&lang="+lang,function(data) { allIdPs = data; loadDiscoJuice(); }, "json"); } else { loadDiscoJuice(); } } // device_button_bg = $("button:first").css('background'); device_button_fg = $("button:first").css('color'); if (front_page) if (roller) $("#img_roll_1").fadeOut(0); $("#cursor").fadeOut(0); if (front_page) { $("#front_page").show(); if (roller) prepareAnimation(); } $("#openroaming_check").change(function(event) { if ($("#openroaming_check").prop("checked") == true) { $("[id^='g_or_']").css("background-color", $("button.guess_os").css("background-color")); $("[id^='g_or_']").addClass('enabled'); $("#device_list button.dev_or.hs20").css("background-color", $("button.guess_os").css("background-color")); $("#device_list button.dev_or.hs20").addClass('enabled'); } else { $("[id^='g_or_']").css("background-color", "#bbb"); $("[id^='g_or_']").removeClass('enabled'); $("#device_list button.dev_or").css("background-color", "#bbb"); $("#device_list button.dev_or").removeClass('enabled'); } }); setTimeout(() => { reset_footer(); }, 50); // reset_footer(); $( window ).resize(function(event) { if ($( window ).width() > 750) { $("#menu_top > ul").show(); } reset_footer(); }); }); </script> <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1.0, user-scalable=no"> <link rel='stylesheet' type='text/css' href='/skins/modern/resources/css/cat-user.css.php' />"; <link rel="stylesheet" media="screen" type="text/css" href="/skins/modern/diag/resources/css/diag.css" /> </head> <body> <div id='wrap' style='background-image:url("/skins/modern/resources/images/beta.png");'> <form id="cat_form" name="cat_form" accept-charset="UTF-8" action="/diag/diag.php" method="POST"> <div id='heading'><div id='cat_logo'> <a href='https://www.eduroam.org'><img id='logo_img' src='/resources/images/consortium_logo.png' alt='Consortium Logo'/></a> <span>Configuration Assistant Tool</span> </div><div id='motd'>CAT was recently upgraded to version 2.1.3. Please report any issues to the mailing list cat-users@lists.geant.org</div><img id='hamburger' src='/skins/modern/resources/images/icons/menu.png' alt='Menu'/><div id='menu_top'> <ul> <li><a href='/'>Start page</a></li> <li><span>About</span> <ul> <li><a href='javascript:infoCAT("about", "about_cat","About eduroam CAT")'>About eduroam CAT</a></li> <li><a href='https://www.eduroam.org'>About eduroam庐</a></li> </ul></li> <li><span>Language</span> <ul> <li><a href='javascript:changeLang("ar")'>丕賱毓乇亘賷丞</a></li> <li><a href='javascript:changeLang("bg")'>袘褗谢谐邪褉褋泻懈</a></li> <li><a href='javascript:changeLang("ca")'>Catal脿</a></li> <li><a href='javascript:changeLang("cs")'>膶e拧tina</a></li> <li><a href='javascript:changeLang("de")'>Deutsch</a></li> <li><a href='javascript:changeLang("el")'>螘位位畏谓喂魏维</a></li> <li><a href='javascript:changeLang("en")' class="selected-lang">English(GB)</a></li> <li><a href='javascript:changeLang("es")'>Espa帽ol</a></li> <li><a href='javascript:changeLang("et")'>Eesti</a></li> <li><a href='javascript:changeLang("fr")'>Fran莽ais</a></li> <li><a href='javascript:changeLang("hr")'>Hrvatski</a></li> <li><a href='javascript:changeLang("it")'>Italiano</a></li> <li><a href='javascript:changeLang("hu")'>Magyar</a></li> <li><a href='javascript:changeLang("nb")'>norsk</a></li> <li><a href='javascript:changeLang("pl")'>Polski</a></li> <li><a href='javascript:changeLang("pt")'>Portugu锚s</a></li> <li><a href='javascript:changeLang("sl")'>Sloven拧膷ina</a></li> <li><a href='javascript:changeLang("fi")'>Suomi</a></li> <li><a href='javascript:changeLang("tr")'>T眉rk莽e</a></li> <li><a href='javascript:changeLang("uk")'>校泻褉邪褩薪褋褜泻邪</a></li> </ul></li> <li><span>Help</span> <ul> <li><a href='javascript:infoCAT("help", "idp_not_listed","FAQ")'>My institution is not listed</a></li> <li><a href='javascript:infoCAT("help", "device_not_listed","FAQ")'>My device is not listed</a></li> <li><a href='javascript:infoCAT("help", "what_is_eduroam","FAQ")'>What is eduroam</a></li> <li><a href='javascript:infoCAT("help", "faq","FAQ")'>FAQ</a></li> <li><a href='javascript:infoCAT("help", "contact","FAQ")'>Contact</a></li> <li><a href='/diag/diag.php'>Diagnostics</a></li> </ul></li> <li><span>Manage</span> <ul> <li><a href='javascript:infoCAT("manage", "admin","eduroam庐 admin:<br>manage your IdP")'>eduroam庐 admin access</a></li> <li><a href='javascript:infoCAT("manage", "develop","Become a CAT developer")'>Become a CAT developer</a></li> </ul></li> <li><a href='javascript:infoCAT("tou", "tou","TOU")'>Terms of use</a></li> </ul></div></div> <script> var L_OK = 0; var L_WARN = 32; var L_ERROR = 256; var L_REMARK = 4; var global_info = new Array(); global_info[L_OK] = "All connectivity tests passed"; global_info[L_WARN] = "There were some warnings from connectivity tests"; global_info[L_REMARK] = "There were some remarks from connectivity tests"; global_info[L_ERROR] = "There were some errors from connectivity tests"; function countryAddSelect(selecthead, select, type) { if (selecthead !== '') { select = selecthead + select + '</td>'; } $('#select_'+type+'_country').hide(); var shtml = ''; if (type === 'idp' || type === 'sp') { shtml = '<table><tbody><tr id="row_'+type+'_country"></tr>'; shtml = shtml + '<tr id="row_'+type+'_institution" style="visibility: collapse;">'; shtml = shtml + '<td>' + "Select institiution:" + '</td><td></td></tr>'; if (type === 'idp') { shtml = shtml + '<tr id="row_idp_realm"></tr>'; } shtml = shtml + '</tbody></table>'; $('#select_' + type+'_area').html(shtml); $('#select_' + type+'_area').show(); $('#row_' + type+'_country').append(select); } else { shtml = '<div id="inst_asp_area"></div>'; $('#select_' + type+'_area').html(select + shtml); $('#select_' + type+'_area').show(); } reset_footer(); } function countrySelection(type1) { var type2; if (type1 === 'sp' || type1 === 'asp') { type2 = 'idp'; } if (type1 === 'idp') { type2 = 'sp'; } var options = ''; var selecthead = ''; if (type1 === 'sp' || type1 === 'idp') { selecthead = "<td>Select country or region: </td>"; selecthead = selecthead + '<td>\n'; } var select = '<select id="' + type1 + '_country" name="' + type1 + '_country" style="margin-left:0px; width:400px;">'; if ($("#"+type2+"_country").is('select')) { options = ($('#'+type2+'_country').html()); countryAddSelect(selecthead, select + options + '</select>', type1); } else { var comment = "<br><br>Fetching country/region list..."; inProgress(1, comment); $.ajax({ url: "findRealm.php", data: {type: "co", lang: lang}, dataType: "json", success:function(data) { if (data.status) { inProgress(0); options = '<option value=""></option>'; var countries = data.countries; for (var key in countries) { options = options + '<option value="'+key+'">' + countries[key] + '</option>'; } countryAddSelect(selecthead, select + options + '</select>', type1); } }, error:function() { passed = false; inProgress(0); alert('error'); } }); } } function isDomain(realm) { realm = trimRealm(realm); if (realm.indexOf('.') == -1) { return false; } var re = new RegExp(/^((([0-9]{1,3}\.){3}[0-9]{1,3})|(([a-zA-Z0-9]+(([\-]?[a-zA-Z0-9]+)*\.)+)*[a-zA-Z]{2,}))$/); if (re.test(realm)) { return true; } return false; } function testSociopath(realm, answer) { var comment = "Testing realm..."; inProgress(1, comment); if ($('#tested_realm').length == 0) { $('<input>').attr({ type: 'hidden', id: 'tested_realm', value: realm }).appendTo('form'); } $.ajax({ url: "processSociopath.php", data: {answer: answer}, dataType: "json", success:function(data) { $('#start_test_area').hide(); if (data) { inProgress(0); if (data['NEXTEXISTS']) { if ($('#sociopath_queries').html() == '') { var query = ''; if ($('#tested_realm').length == 0) { query = '<input type="hidden" id="tested_realm" value="' + realm + '">'; } query = query + '<div id="current_query">'+data['TEXT']+'</div>'; query = query + '<div><button class="diag_button" id="answer_yes">' + "Yes" + '</button>'; query = query + '<button style="margin-left:20px;" class="diag_button" id="answer_no">' + "No" + '</button>'; query = query + '<button style="margin-left:20px;" class="diag_button" id="answer_noidea">' + "I don't know" + '</button></div>'; $('#sociopath_queries').html(query); $('#sociopath_query_area').show(); } else { $('#current_query').html(data['TEXT']); } reset_footer(); } else { var realm = $('#tested_realm').val(); $('#tested_realm').remove(); $('#sociopath_query_area').hide(); $('#sociopath_queries').html(''); $('#start_test_area').show(); $('#after_stage_1').hide(); $('#before_stage_1').show(); $('#realm_by_select').show(); $('#position_info').show(); finalVerdict(realm, data['SUSPECTS']); reset_footer(); } } }, error:function() { inProgress(0); alert('error'); } }); } function finalVerdict(realm, verdict) { var title = "Diagnostic tests results for selected realm"; result = '<div class="padding">'; result = result + '<div><h3>'; result = result + "The result for tested realm: " + realm; result = result + '</h3></p><div style="padding: 5px;"><div style="padding: 0px;">'; result = result + "The system identified" + ' '; result = result + Object.keys(verdict).length + ' '; result = result + "suspected areas which potentially can cause a problem." + '<br>'; result = result + "Next to the problem description we show a speculated probability of this event."; result = result + '</div><div style="padding: 5px;"><table>'; k = 1; for (key in verdict) { result = result + '<tr><td>' + k + '.</td>'; k = k + 1; if (key === 'INFRA_DEVICE') { result = result + '<td>' + "Your device configuration is broken" + '</td>'; } if (key === 'INFRA_SP_80211') { result = result + '<td>' + "The Wi-Fi network in your vicinity has quality issues" + '</td>'; } if (key === 'INFRA_SP_LAN') { result = result + '<td>' + "The network environment around you is broken" + '</td>'; } if (key === 'INFRA_SP_RADIUS') { result = result + '<td>' + "The RADIUS server of your service provider is the source of the problem" + '</td>'; } if (key === 'INFRA_IDP_AUTHBACKEND') { result = result + '<td>' + "The RADIUS server in your home institution is currently unable to authenticate you" + '</td>'; } if (key === 'INFRA_NRO_SP') { result = result + '<td>' + "The national server in the country/region you are visiting is not functioning correctly" + '</td>'; } if (key === 'INFRA_LINK_ETLR_NRO_SP') { result = result + '<td>' + "The link between the national server of the country/region you are visiting and the top-level server is broken" + '</td>'; } if (key === 'INFRA_LINK_ETLR_NRO_IdP') { result = result + '<td>' + "The link between the national server of your home country/region and the top-level server is broken" + '</td>'; } if (key === 'INFRA_ETLR') { result = result + '<td>' + "The communication to the top-level server is down" + '</td>'; } if (key === 'INFRA_NRO_IdP') { result = result + '<td>' + "The national server in your home country/region is not functioning properly." + '</td>'; } if (key === 'INFRA_IdP_RADIUS') { result = result + '<td>' + "The RADIUS server of your home institution is the source of the problem" + '</td>'; } if (key === 'INFRA_NONEXISTENTREALM') { result = result + '<td>' + "This realm does not exist" + '</td>'; } result = result + '<td style="padding-left: 5px;">' + (verdict[key] * 100).toFixed(2) + "%</td></tr>"; } result = result + '</table></div></div>'; result = result + '</div>'; result = result + '</div></div>'; showInfo(result, title); } function formatMAC(e) { var r = /([a-f0-9]{2})([a-f0-9]{2})/i, str = e.target.value.replace(/[^a-f0-9]/ig, ""); while (r.test(str)) { str = str.replace(r, '$1' + ':' + '$2'); } e.target.value = str.slice(0, 17); if (e.target.value.length == 17) { activate_send(); } }; function isEmail(email, emptyuser) { if (typeof emptyuser === 'undefined') { re = /^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/; } else { re = /^((([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))|)@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/; } return re.test(email); }; function isOperatorName(str) { var re = /^(?=.{1,254}$)((?=[a-z0-9-]{1,63}\.)(xn--+)?[a-z0-9]+(-[a-z0-9]+)*\.)+[a-z]{2,63}$/; return re.test(str); } function inProgress(s, comment) { var b = true; if (s === 1) { var x = getWindowHCenter() - 16; var h = ($("body").height() - 128)/2; $("#loading_ico").css('left',x+'px'); $("#loading_ico").css('top',h+'px'); $("#loading_ico").show(); if (typeof comment !== 'undefined') { $("#load_comment").html(comment); } else { $("#load_comment").html(""); } } else { $("#loading_ico").hide(); b = false; $("#load_comment").html(""); } var catForm = document.forms['cat_form']; if (!catForm) { catForm = document.cat_form; } var elements = catForm.elements; for (var i = 0, len = elements.length; i < len; ++i) { elements[i].disabled = b; } } function trimRealm(r) { if (r.substring(0,1) == '@') { return r.substring(1); } return r; } function dec2hex (dec) { return ('0' + dec.toString(16)).substr(-2) } // generateId :: Integer -> String function generateId (len) { var arr = new Uint8Array((len || 40) / 2) window.crypto.getRandomValues(arr) return Array.from(arr, dec2hex).join('') } function runConnectionTests(data, realm, user, token, wherefrom) { dynamic_req = null; udp_req = null; var running = "<img style='vertical-align:middle' src='../resources/images/icons/loading51.gif' width='24' height='24'/><i>Running connectivity tests for this realm...</i>"; var testresult = "<a target='_blank' href='show_realmcheck.php?norefresh=1&token=" + token + "'>" + "New tests results are available, click to see" + '</a>'; if (wherefrom == 'diag') { $('#tests_info_area').css('color', 'black'); $('#tests_info_area').html(running); } if (wherefrom == 'show') { $('#run_tests').hide(); $('#test_area').html(running); } udp_req = run_udp(realm, user, token); if (data.totest && data.totest.length > 0) { dynamic_req = run_dynamic(realm, data.totest, token); } static_ready = 0; dynamic_ready = 0; if (udp_req) { global_level_stat = 0; udp_req.forEach(function(req) { req.done(function( data ) { if (wherefrom == 'diag') { global_level_stat = Math.max(global_level_stat, data.result[0].level); static_ready = static_ready + 1; if (static_ready == udp_req.length) { if (dynamic_req == null || (dynamic_req && dynamic_ready == dynamic_req.length*2)) { var level = global_level_stat; if (dynamic_req) { level = Math.max(global_level_dyn, level); } show_tests_result(token, level); } } } if (wherefrom == 'show') { static_ready = static_ready + 1; if (static_ready == udp_req.length) { if (dynamic_req == null || (dynamic_req && dynamic_ready == dynamic_req.length*2)) { $('#test_area').html(testresult); } } } }); }); } if (dynamic_req) { global_level_dyn = 0; dynamic_req.forEach(function(req) { req['capath'].done(function( msg ) { if (wherefrom == 'diag') { global_level_dyn = Math.max(global_level_dyn, msg.level); dynamic_ready = dynamic_ready + 1; var level = global_level_dyn; if (dynamic_ready == dynamic_req.length*2 && (static_ready == udp_req.length)) { level = Math.max(global_level_stat, level); show_tests_result(token, level); } } if (wherefrom == 'show') { dynamic_ready = dynamic_ready + 1; if (dynamic_ready == dynamic_req.length*2 && (static_ready == udp_req.length)) { $('#test_area').html(testresult); } } }); req['clients'].done(function( msg ) { if (wherefrom == 'diag') { global_level_dyn = Math.max(global_level_dyn, msg.result); dynamic_ready = dynamic_ready + 1; var level = global_level_dyn; if (dynamic_ready == dynamic_req.length*2 && (static_ready == udp_req.length)) { level = Math.max(global_level_stat, level); show_tests_result(token, level); } } if (wherefrom == 'show') { dynamic_ready = dynamic_ready + 1; if (dynamic_ready == dynamic_req.length*2 && (static_ready == udp_req.length)) { $('#test_area').html(testresult); } } }); }); } } function runRealmCheck(realm, user, lang) { var token = generateId(); $.ajax({ url: "findRealm.php", data: {realm: realm, outeruser: user, lang: lang, addtest: 1, token: token}, dataType: "json", success:function(data) { var realmFound = 0; if (data.status) { realmFound = 1; } runConnectionTests(data, realm, user, token, 'show'); }, error: function (error) { alert('Error'); } }); } function run_udp(realm, user, token) { var requests = Array(); requests[0] = $.ajax({ url: 'radius_tests.php', data: {test_type: 'udp', realm: realm, outer_user: user, src: 0, lang: 'en', hostindex: '0', token: token}, dataType: 'json'}); requests[1] = $.ajax({ url: 'radius_tests.php', data: {test_type: 'udp', realm: realm, outer_user: user, src: 1, lang: 'en', hostindex: '1', token: token}, dataType: 'json'}); return requests; } function run_dynamic(realm, dyn, token) { var requests = Array(); dyn.forEach(function(srv, index) { requests[index] = Array(); requests[index]['capath'] = $.ajax({url:'radius_tests.php', data:{test_type: 'capath', realm: realm, src: srv.host, lang: 'en', hostindex: index, expectedname: srv.name, ssltest: srv.ssltest, token: token}, dataType: 'json'}); requests[index]['clients'] = $.ajax({url:'radius_tests.php', data:{test_type: 'clients', realm: realm, src: srv.host, lang: 'en', hostindex: index, expectedname: srv.name, ssltest: srv.ssltest, token: token}, dataType: 'json'}); }); return requests; } function show_tests_result(token, level) { $('#tests_info_area').html(global_info[level] + ': ' + "<a target='_blank' href='show_realmcheck.php?norefresh=1&token=" + token + "'>" + "See details" + '</a>'); if (level > 0) { $('#tests_info_area').css('color', 'red'); $('#tests_result').val('1'); } else { $('#tests_info_area').css('color', 'black'); $('#tests_result').val('0'); } var info = global_info[level] + ': ' + "<a target='_blank' href='show_realmcheck.php?norefresh=1&token=" + token + "'>" + "See details" + '</a>'; if (level == 0) { info = info + '<br>' + 'If you want to report your problem, fill fields below.'; } $('#tests_info_area').html(info); } function activate_send () { if ($('#timestamp').val().length > 0 && $('#mac').val().length == 17 && $('#email').val().length > 0 && isEmail($('#email').val())) { if ($('#send_query_to_idp').length > 0) { $('#send_query_to_idp').removeClass('hidden_row').addClass('visible_row'); } else { if ($('#opname').val().length > 0 && $('#outer_id').val().length > 0) { if (isOperatorName($('#opname').val()) && isEmail($('#email').val(), true) && $('#send_query_to_sp').length > 0) { $('#send_query_to_sp').removeClass('hidden_row').addClass('visible_row'); } } else { $('#send_query_to_sp').removeClass('visible_row').addClass('hidden_row'); } } } else { if ($('#send_query_to_idp').length > 0) { $('#send_query_to_idp').removeClass('visible_row').addClass('hidden_row'); } if ($('#send_query_to_sp').length > 0) { $('#send_query_to_sp').removeClass('visible_row').addClass('hidden_row'); } } } function show_sp_block() { var t = $('input[name=problem_type]:checked').val(); var par = ''; if ($('#sp_abuse').html() === '') { $.get("adminQuery.php?type=sp&lang="+lang, function(data, status) { $('#sp_abuse').html(data); $('#sp_abuse').show(); if (t == 0) { $('#sp_problem_selector').hide(); } else { $('#sp_problem_selector').show(); } $('#idp_problem').html(''); reset_footer(); }); } else { if (t == 0) { $('#sp_problem_selector').hide(); } else { $('#sp_problem_selector').show(); } } } function clear_sp_question() { $('#sp_questions > tbody > tr').each(function() { if ($(this).attr('class') == 'visible_row') { $(this).removeClass('visible_row').addClass('hidden_row'); } if ($(this).attr('class') == 'error_row') { $(this).remove(); } $(this).children('td').each(function() { $(this).children('input').each(function() { if ($(this).prop('tagName').toLowerCase() === 'input' || $(this).prop('tagName').toLowerCase() === 'textarea') { if ($(this).attr('id') !== 'admin_realm') { $(this).val(''); } } }); $(this).children('textarea').each(function() { $(this).val(''); }); }); }); } </script> <div id="main_page"> <div id="loading_ico"> <span id='load_comment'></span><br><img src="/resources/images/icons/loading51.gif" alt="Loading stuff ..."/> </div> <div id="info_overlay"> <!-- device info --> <div id="info_window"></div> <img id="info_menu_close" class="close_button" src="/resources/images/icons/button_cancel.png" ALT="Close"/> </div> <div id="main_menu_info" style="display:none"> <!-- stuff triggered form main menu --> <img id="main_menu_close" class="close_button" src="/resources/images/icons/button_cancel.png" ALT="Close"/> <div id="main_menu_content"></div> </div> <div id="main_body"> <div id="user_page"> <div id='institution_name'> <span id='inst_name_span'>Diagnostics site (<span style='color:red'>beta</span>)</span> <div id='inst_extra_text'></div> </div> <div id="user_info" style='padding-top: 10px;'> <div id='diagnostic_choice'> The diagnostics system will do its best to identify and resolve your problems! Please help the system by answering the questions as precisely as possible.<br/>Are you an <input type='radio' name='diagnostic_usertype' value='0'>end user or <input type='radio' name='diagnostic_usertype' value='1' > eduroam administrator? </div> <div id='diagnostic_enduser' style='display: none;'> <h2>Tools for End Users</h2> <p> To resolve your problem a real-time diagnostics for your realm must be performed. </p> <div id="before_stage_1"><h3>The system needs some information on your home institution - issuer of your account</h3>What is the realm part of your user account (the part behind the @ of 'your.username@<strong>realm.tld</strong>'): <input type='text' name='user_realm' id='user_realm' value=''> <div id="realm_by_select"><br/>alternatively<br/>You can select your home institution from the following list<br/><div id="select_idp_country"><a href="" id="idp_countries_list"><span id="realmselect">Click to select your country/region and organisation</span></a></div> <div id="select_idp_area" style="display:none;"> </div> </div> <div id="position_info"> <h3>Optionally, to improve tests, you can provide information on your current location</h3><div id="select_sp_country"><a href="" id="sp_countries_list"><span id="spselect">Click to select a location in which you have an eduroam problem</span></a></div> <div id="select_sp_area" style="display:none;"> </div> </div> </div> <div id="after_stage_1" style="display:none;"> <h3>Testing realm <span id="realm_name"></span></h3> First stage completed. <br> </div> <div id="sociopath_query_area" style="margin-top:20px; display:none;"> <strong> To narrow down the problem, please answer the following few questions. </strong> <div id="sociopath_queries"></div> </div> <div id="start_test_area" style="padding-top: 10px; padding-bottom: 5px; display:none; text-align:center;"> <button id='realmtest' accesskey="T" class='diag_button' type='button'>Run tests </button> </div> </div> <div id='diagnostic_admin' style='display: none ;'> <h2>Tools for eduroam admins</h2> <input type="hidden" id="isadmin" value="0">This service is for authenticated admins only.<br><a href="diag.php?admin=1">eduroam庐 admin access is needed</a> <div id="realm_problem"> </div> </div> </div> <input type="hidden" name="lang" id="lang"/> </div> </div> </div> </form> <div id="vertical_fill">&nbsp;</div> <div class='footer' id='footer'> <table> <tr> <td>eduroam CAT<br>Release <a href='https://github.com/GEANT/CAT/tree/release_2_1/Changes.md'>CAT-2.1.3</a> </td><td>&copy; 2011-2022 G&Eacute;ANT Association<br/>on behalf of the G&Eacute;ANT Projects funded by EU; and others <a href='copyright.php'>Full Copyright and Licenses</a><br><span id='privacy_notice_cons'>eduroam庐</span> <a href='https://www.eduroam.org/privacy/'> Privacy Notice</a></td><td><span id='logos'><img src='/resources/images/dante.png' alt='GEANT' style='height:23px;width:47px'/> <img src='/resources/images/eu.png' alt='EU' style='height:23px;width:27px;border-width:0px;'/></span><span id='eu_text'><a href='http://ec.europa.eu/dgs/connect/index_en.htm'>European Commission Communications Networks, Content and Technology</a></span> </td> </tr> </table> </div></div> <script> $(document).ready(function () { if ($('input[name=problem_type]').prop('checked')) { show_sp_block(); } }); $(document).keypress( function(event){ if (event.which == '13') { event.preventDefault(); } }); $('input[name="diagnostic_usertype"]').click(function() { var t = $('input[name=diagnostic_usertype]:checked').val(); if (t > 0) { $('#diagnostic_enduser').hide(); $('input[name=problem_type]').each(function() { $(this).prop('checked', false); }); $('#user_realm').val(''); $('#select_idp_area').html(''); $('#select_idp_country').show(); $('#select_sp_area').html(''); $('#sociopath_queries').show(); $('#diagnostic_admin').show(); if ($('#isadmin').val() === "1") { $('#admin_test_area').show(); } } else { $('#diagnostic_admin').hide(); $('#idp_contact_area').html(''); $('#sp_abuse').html(''); $('#idp_problem').html(''); $('#diagnostic_enduser').show(); } reset_footer(); }); $('#user_realm').bind('change keyup blur input', function(e) { if (isDomain($('#user_realm').val())) { $('#start_test_area').show(); } else { $('#start_test_area').hide(); $('#select_idp_area').hide(); $('#select_idp_area').html(''); $('#select_idp_country').show(); } }); $('#idp_countries_list').click(function(event){ event.preventDefault(); $('#start_test_area').hide(); $('#user_realm').val(""); countrySelection("idp"); return false; }); $(document).on('click', '#sp_countries_list, #asp_countries_list' , function(event) { event.preventDefault(); var t = $(this).attr('id').substring(0, $(this).attr('id').indexOf('_')); countrySelection(t); return false; }); $(document).on('change', '#idp_country' , function() { var comment = "Fetching institutions list..."; var id = $(this).attr('id'); var k = id.indexOf('_'); var type = id.substr(0,k); co=$('#'+type+'_country').val(); if (co !== "") { inProgress(1, comment); $.ajax({ url: "findRealm.php", data: {type: 'inst', co: co, lang: lang}, dataType: "json", success:function(data) { if (data.status === 1) { inProgress(0); var institutions = data.institutions; var shtml = ''; var select = ''; if (type !== 'asp') { shtml = "<td>Select institution:</td><td>"; } select = '<select id="' + type + '_inst" name="' + type + '_inst" style="margin-left:0px; width:400px;"><option value=""></option>'; for (var i in institutions) { select = select + '<option value="' + institutions[i].ID + '">' + institutions[i].name + '</option>'; } select = select + '</select>'; if (type !== 'asp') { shtml = shtml + select + '</td>'; $('#row_' + type + '_institution').html(''); $('#row_' + type + '_institution').append(shtml); $('#row_' + type + '_realm').html(''); $('#row_' + type + '_institution').css('visibility', 'visible'); } else { $('#inst_' + type + '_area').html(select); $('#' + type + '_desc').show(); } reset_footer(); } else { if (data.status === 0) { inProgress(0); var msg = "The database does not contain the information needed to help you in realm selection for this country. You have to provide the realm you are interested in."; alert(msg); $('#select_idp_country').show(); $('#select_idp_area').hide(); } } }, error:function() { inProgress(0); var msg = "Can not search in database. You have to provide the realm you are interested in."; alert(msg); $('#select_idp_country').show(); $('#select_idp_area').hide(); } }); } else { $('#' + type + '_inst').remove(); $('#row_' + type + '_institution').css('visibility', 'collapse'); $('#start_test_area').hide(); $('#row_idp_realm').html(""); } return false; }); $(document).on('change', '#select_sp_problem' , function() { if ($('#select_sp_problem').val().substr(0,6) == 'abuse-') { $('#realm_in_db_admin').text("Check if this realm is registered"); } else { $('#realm_in_db_admin').text("Check this realm"); } $('#realm_in_db_admin').hide(); $('#admin_realm').val(''); $('#tests_info_area').html(''); clear_sp_question(); }); $(document).on('change', '#sp_country, #asp_country' , function() { var comment = "Fetching institutions list..."; var id = $(this).attr('id'); var k = id.indexOf('_'); var type = id.substr(0,k); co=$('#'+type+'_country').val(); if (co !== "") { inProgress(1, comment); $.ajax({ url: "findRealm.php", data: {type: 'hotspot', co: co, lang: lang}, dataType: "json", success:function(data) { if (data.status === 1) { inProgress(0); var hotspots = data.hotspots; var shtml = ''; var select = ''; if (type !== 'asp') { shtml = "<td>Select institution:</td><td>"; } select = '<select id="' + type + '_inst" name="' + type + '_inst" style="margin-left:0px; width:400px;"><option value=""></option>'; for (var i in hotspots) { select = select + '<option value="' + hotspots[i].ID + '">' + hotspots[i].name + '</option>'; } select = select + '</select>'; if (type !== 'asp') { shtml = shtml + select + '</td>'; $('#row_' + type + '_institution').html(''); $('#row_' + type + '_institution').append(shtml); $('#row_' + type + '_realm').html(''); $('#row_' + type + '_institution').css('visibility', 'visible'); } else { $('#inst_' + type + '_area').html(select); $('#' + type + '_desc').show(); } reset_footer(); } else { if (data.status === 0) { inProgress(0); var select = '<select id="' + type + '_inst" name="' + type + '_inst" style="margin-left:0px; width:400px;"><option value="">'; var shtml = '<td></td><td>'; select = select + "Other location" + '</option></select></td>'; if (type !== 'asp') { $('#row_' + type + '_institution').html(''); $('#row_' + type + '_institution').append(shtml + select); $('#row_' + type + '_realm').html(''); $('#row_' + type + '_institution').css('visibility', 'visible'); } else { $('#inst_' + type + '_area').html(select); $('#' + type + '_desc').show(); } reset_footer(); } } }, error:function() { inProgress(0); reset_footer(); } }); } else { $('#' + type + '_inst').remove(); $('#row_' + type + '_institution').css('visibility', 'collapse'); $('#start_test_area').hide(); $('#row_idp_realm').html(""); } return false; }); $(document).on('change', '#idp_inst' , function() { inst=$("#idp_inst").val(); if (inst === '') { $('#row_idp_realm').html(""); $('#start_test_area').hide(); return false; } var comment = "Fetching realms list..."; inProgress(1, comment); $.ajax({ url: "findRealm.php", data: {type: 'realm', ou: inst, lang: lang}, dataType: "json", success:function(data) { inProgress(0); if (data.status === 1) { var realms = data.realms; var realmselect = ''; if (realms.length > 1) { realmselect = "<td>Check realm(s):</td>"; realmselect = realmselect + '<td>' + "<span style='margin-left: 10px'>"; for (var i in realms) { realmselect = realmselect + '<input type="radio" name="realm" '; realmselect = realmselect + 'value="' + realms[i] + '"'; if (i === "0") { realmselect = realmselect + ' checked'; } realmselect = realmselect + '><label>' + realms[i] + '</label>'; } realmselect = realmselect + '</span></td>'; } else { realmselect = "<td>Realm:</td>"; realmselect = realmselect + '<td>' + "<span style='margin-left: 10px'>"; realmselect = realmselect + realms[0] + '</span>'; realmselect = realmselect + '<input type="hidden" name="realm" value="' + realms[0] + '">'; realmselect = realmselect + '</span></td>'; } $('#row_idp_realm').html(""); $('#row_idp_realm').append(realmselect); $('#start_test_area').show(); $("#user_realm").val(""); $("#realm_info+ok").hide(); reset_footer(); } }, error:function() { inProgress(0); alert('error'); } }); return false; }); $(document).on('click', '#realm_in_db, #realm_in_db_admin' , function() { var id = $(this).attr('id'); var addtest = 0; var token = ''; var user = ''; var realm = ''; if (id === 'realm_in_db') { $('#select_idp_area').hide(); $('#select_idp_area').html(''); $('#select_idp_country').show(); realm = trimRealm($("#user_realm").val()); } else { /* realm_in_db_admin click */ realmfield = trimRealm($("#admin_realm").val()); at = realmfield.indexOf("@"); if (at >=0) { user = realmfield.substring(0, at); realm = realmfield.substring(at+1); } else { user = ''; realm = realmfield; } if ($('#select_sp_problem').val() == 'technical') { token = generateId(); addtest = 1; } $('#tests_info_area').html(''); $('#idp_contact_area').html(''); clear_sp_question(); t = 1; } var comment = "Running realm tests..."; inProgress(1, comment); /*waiting(comment);*/ $.ajax({ url: "findRealm.php", data: {realm: realm, outeruser: user, lang: lang, addtest: addtest, token: token}, dataType: "json", success:function(data) { inProgress(0); var realmFound = 0; if (data.status) { realmFound = 1; } if ($('#token')) { $('#token').val(token); } if (id === 'realm_in_db') { $('#realm_info_ok').show(); $('#start_test_area').show(); $('#realm_info_fail').hide(); } if (id === 'realm_in_db_admin') { if ($('#select_sp_problem').val() == 'technical' || realmFound == 1) { $('#sp_questions > tbody > tr').each(function() { if ($(this).attr('class') == 'hidden_row' && $(this).attr('id') != 'send_query_to_idp') { $(this).removeClass('hidden_row').addClass('visible_row'); } }); $('#idp_contact_area').append('<input type="hidden" name="idp_contact" id="idp_contact" value="' + data.admins + '">'); } } if (addtest) { runConnectionTests(data, realm, user, token, 'diag'); } if (realmFound == 0) { $('#external_db_info').html('This realm is not registered with eduroam database, the report will be sent to eduroam OT group.'); $('#external_db_info').css('color', 'red'); } }, error: function (error) { inProgress(0); $('#realm_problem').html('This realm does not exist.'); $('#realm_problem').css('color', 'red'); } }); return false; }); $(document).on('click', '#answer_yes, #answer_no, #answer_noidea' , function(e) { e.preventDefault(); var answer = 1; /* No */ if ($(this).attr('id') === 'answer_yes') { answer = 2; /* Yes */ } if ($(this).attr('id') === 'answer_noidea') { answer = 3; /* No idea */ } testSociopath('', answer); }); $('#realmtest').click(function(event){ var comment = "<br><br>Running realm tests..."; inProgress(1, comment); $('#start_test_area').hide(); if ($('#select_sp_area').is(':hidden')) { $('#position_info').hide(); } if ($('#select_idp_area').is(':hidden')) { $('#realm_by_select').hide(); } var realm = ''; if ($('#user_realm').val()) { realm = trimRealm($('#user_realm').val()); } if ($('#idp_inst').val()) { if ($('input[name="realm"]').attr('type') === 'hidden') { realm = $('input[name="realm"]').val(); } else { $('input[name="realm"]').each(function() { if ($(this).is(':checked')) { realm = $(this).val(); } }); } } var nro = 0; if ($('#sp_country').val()) { nro = $('#sp_country').val(); } var visited = 0; if ($('#sp_inst').val()) { visited = $('#sp_inst').val(); } reset_footer(); if (realm !== '') { $.ajax({ url: "magicTelepath.php", data: {realm: realm, lang: lang, nro: nro, visited: visited}, dataType: "json", success:function(data) { inProgress(0); if (data.status === 1) { var realm = data.realm; $('#before_stage_1').hide(); $('#realm_name').text(realm); $('#after_stage_1').show(); reset_footer(); testSociopath(realm, 0); } else { var title = "Diagnostics results for selected realms"; result = '<div class="padding"><h3>' + "An unknown problem occurred"; result = result + '</h3>' if (r.length == 1) { result = result + "This test includes checking of the following realm"; } else { result = result + "This test includes checking of the following realms"; } result = result + ': ' for (var i=0; i < r.length; i++) { if (i > 0) { result = result + ', '; } result = result + r[i]; } result = result + '.<br>'; result = result + "You should report this to" + ' <a href="mailto:admin@eduroam.pl">admin@eduroam.pl</a>'; result = result + '</div>'; $('#after_stage_1').hide(); $('#before_stage_1').show(); $('#realm_by_select').show(); $('#position_info').show(); reset_footer(); showInfo(result, title); } }, error: function (error) { inProgress(0); if ($('#select_sp_area').is(':hidden')) { $('#position_info').show(); } if ($('#select_idp_area').is(':hidden')) { $('#realm_by_select').show(); } $('#user_realm').val(""); reset_footer(); alert('magicTelepath error'); } }); } }); $(document).on('click', 'ul#ul-menu-list.tab-links a', function(e) { e.preventDefault(); /*var activeEl = $('.tab-links > li.active > a > active');*/ var activeTab_a = $('.tab-links > li.active > a').attr('href'); $('.tab-links > li.active').removeClass('active'); var currentTab = $(this).attr('href'); $(activeTab_a).removeClass('active'); $(currentTab).addClass('active'); $(this).parent().addClass('active'); }); $(document).on('click', '#submit_idp_query, #submit_sp_query' , function() { var type; var o = new Object(); if ($(this).attr('id') === 'submit_idp_query') { o['realm'] = $('#admin_realm').val(); o['email'] = $('#email').val(); o['mac'] = $('#mac').val(); o['reason'] = $('#select_sp_problem').val(); o['timestamp'] = $('#timestamp').val(); o['freetext'] = $('#freetext').val(); o['idpcontact'] = $('#idp_contact').val(); o['token'] = $('#token').val(); o['tests_result'] = $('#tests_result').val(); type = 'idp_send'; } else { o['opname'] = $('#opname').val(); o['outerid'] = $('#outer_id').val(); o['email'] = $('#email').val(); o['mac'] = $('#mac').val(); o['reason'] = $('#select_idp_problem').val(); o['timestamp'] = $('#timestamp').val(); o['freetext'] = $('#freetext').val(); o['cdetails'] = $('#c_details').val(); type = 'sp_send'; } $.ajax({ url: "adminQuery.php", data: {type: type, data: JSON.stringify(o)}, dataType: "json", lang: lang, success:function(data) { if (data.status === 1) { var result = ''; var title = "eduroam admin report submission"; result = '<div class="padding">'; if (type == 'idp_send') { result = result + '<h3>'+ "SP contacting IdP due to technical problems or abuse" + '</h3>'; result = result + '<table>'; result = result + '<tr><td>' + "Reason" + '</td><td>' + data.reason + '</td></tr>'; result = result + '<tr><td>' + "Event's timestamp" + '</td><td>' + data.timestamp + '</td></tr>'; result = result + '<tr><td>' + "Calling-Station-Id" + '</td><td>' + data.mac + '</td></tr>'; result = result + '<tr><td>' + "Additional description" +'</td><td>' + data.freetext + '</td></tr>'; result = result + '<tr><td>' + "An email to contact the reporter" + '</td><td>' + data.email + '</td></tr>'; result = result + '<tr><td>' + "Test result" +'</td><td>'; if (data.tests_result == 1) { result = result + "failure"; } else { result = result + "success"; } result = result + '</td></tr>'; result = result + '<tr><td>' + "Test URL" +'</td><td><a href="' + data.testurl + '">' + data.testurl + '</a></td></tr>'; result = result + '<tr><td>' + "Email to IdP administrators " + ' '; if (data.emailsent == 1) { result = result + "send successfully"; } else { result = result + "not sent - failure while sending"; } result = result + '</td><td></td></tr>'; } if (type == 'sp_send') { result = result + '<h3>'+ "IdP contacting SP due to technical problems or abuse" + '</h3>'; result = result + '<table>'; result = result + '<tr><td>' + "Reason" + '</td><td>' + data.reason + '</td></tr>'; result = result + '<tr><td>' + "SP's Operator-Name" + '</td><td>' + data.opname + '</td></tr>'; result = result + '<tr><td>' + "User's outer ID" + '</td><td>' + data.outerid + '</td></tr>'; result = result + '<tr><td>' + "IdP email" + '</td><td>' + data.email + '</td></tr>'; result = result + '<tr><td>' + "Event's timestamp" + '</td><td>' + data.timestamp + '</td></tr>'; result = result + '<tr><td>' + "Calling-Station-Id" + '</td><td>' + data.mac + '</td></tr>'; result = result + '<tr><td>' + "Additional description" +'</td><td>' + data.freetext + '</td></tr>'; result = result + '<tr><td>' + "How to contact the user" +'</td><td>' + data.cdetails + '</td></tr>'; } result = result + '</div>'; showInfo(result, title); } }, error: function (error) { alert('adminQuery error'); } }); return false; }); $(document).on('keyup change', '#admin_realm' , function() { if ($('#admin_realm').val().length == 0 || (!isEmail($(this).val(), true) && !isDomain($(this).val()))) { $('#realm_problem').html(''); $('#admin_realm').addClass('error_input'); $('#realm_in_db_admin').hide(); $('#tests_info_area').html(''); $('#tests_info_area').css('color', 'black'); $('#external_db_info').html(''); $('#external_db_info').css('color', 'black'); $('#sp_questions > tbody > tr').each(function() { if ($(this).attr('class') == 'visible_row') { $(this).removeClass('visible_row').addClass('hidden_row'); } }); $('#admin_realm').attr('title', "Wrong format of realm"); } else { $('#admin_realm').removeClass('error_input'); $('#admin_realm').attr('title', ''); $('#realm_in_db_admin').show(); } }); $(document).on('keyup change', '#email' , function() { if ($(this).val().length == 0 || !isEmail($(this).val())) { $('#email').addClass('error_input'); $('#email').attr('title', "Wrong format of email"); } else { $('#email').removeClass('error_input'); $('#email').attr('title', ''); activate_send(); } }); $(document).on('blur', '#timestamp, #mac, #opname, #outer_id' , function() { $(this).val($.trim($(this).val())); if ($('#mac').val().length > 0) { if ($('#mac').val().length != 17) { $('#mac').addClass('error_input'); $('#mac').attr('title', "MAC address is incomplete"); } else { $('#mac').removeClass('error_input'); $('#mac').attr('title', ''); } } if ($(this).attr('id') == 'email' && $(this).val().length > 0) { if (!isEmail($(this).val())) { $('#email').addClass('error_input'); $('#email').attr('title', "Wrong format of email"); } else { $('#email').removeClass('error_input'); $('#email').attr('title', ''); } } if ($(this).attr('id') == 'outer_id' && $(this).val().length > 0) { if (!isEmail($(this).val(), true)) { $('#outer_id').addClass('error_input'); $('#outer_id').attr('title', "Wrong format of outer ID"); } else { $('#outer_id').removeClass('error_input'); $('#outer_id').attr('title', ''); } } if ($(this).attr('id') == 'opname' && $('#opname').val().length > 0) { if (!isOperatorName($(this).val())) { $('#opname').addClass('error_input'); $('#opname').attr('title', "Wrong string given as Operator-Name"); $('#spmanually').show(); } else { $('#opname').removeClass('error_input'); $('#opname').attr('title', ''); $('#spmanually').hide(); } } activate_send(); }); $('input[name="problem_type"]').click(function() { var t = $('input[name=problem_type]:checked').val(); if (t <= 1) { $('#sp_abuse').html(''); /* show SP problem block */ show_sp_block(); } else { /* show IdP problem block */ $('#sp_abuse').html(''); if ($('#idp_problem').html() === '') { $.get("adminQuery.php?type=idp&lang="+lang, function(data, status) { $('#idp_problem').html(data); $('#sp_abuse').hide(); $('#idp_problem').show(); reset_footer(); }); } } }); $(document).on('change', '#asp_inst' , function() { if ($('#asp_inst').val()) { $('#by_opname').hide(); $('#opname').val(''); $('#asp_desc').val(''); $('#asp_desc').hide(); } else { $('#by_opname').show(); $('#asp_desc').show(); } }); $(document).on('keypress', '#email', function(e) { if (e.keyCode == 13) { if ($('#timestamp').val().length > 0 && $('#mac').val().length == 17 && $('#email').val().length > 0 && isEmail($('#email').val())) { $('#send_query_to_idp').removeClass('hidden_row').addClass('visible_row'); } else { $('#send_query_to_idp').removeClass('visible_row').addClass('hidden_row'); } return false; } }); $(document).on('keypress', '#opname', function(e) { if (e.keyCode == 13 || e.keyCode == 9) { if ($('#opname').val() !== '') { $('#spmanually').hide(); } else { $('#spmanually').show(); } } }); $('#answer_yes, #answer_no').click(function(e) { e.preventDefault(); }); </script> </body>

Pages: 1 2 3 4 5 6 7 8 9 10