Is there a way to hide user details in the portal?
IsUser | |
ApprovalRequired | |
Asset Status | |
Business Phone Business Phone2 City CommonName Company Country Department Display Name | |
We are wanting to remove (not hide with css or javascript) a lot of this information.
Is there a way to do this?
Thanks
Best Answer
-
Ryan_Kennedy Customer IT Monkey ✭
Sorry about the delay .. I was wanting to do this so that I can have an update contact details service request that can also update personal email address / personal mobile numbers (for the Cireson password reset tool).
All updateable fields display the currently stored information to the logged in user.
For privacy I don't want these details displayed.
I have no need for this now though as I have written a script that updates AD with the correct email / mobile number but in the User CI stores it like k******5@hotmail.com / 04XXXXX319
0
Answers
The data that is provided is in a table which unfortunately doesn't have any classes to be able to identify and remove the information with CSS
Not able to answer your question there, however maybe someone else has worked out some code in this section.
Can I ask as to why you want to do this? For us it will become a problem when the 'General Data Protection Regulation' from the European Parliament enters into application in 2018 but even now it's an inconvenience at the least as we store A LOT of information in the AD user object.
The best would be if we could decide if and what attributes should be visible/retrievable for the end user and make both session and pageForm objects non global (bye bye some custom solutions sadly..).
Sorry about the delay .. I was wanting to do this so that I can have an update contact details service request that can also update personal email address / personal mobile numbers (for the Cireson password reset tool).
All updateable fields display the currently stored information to the logged in user.
For privacy I don't want these details displayed.
I have no need for this now though as I have written a script that updates AD with the correct email / mobile number but in the User CI stores it like k******5@hotmail.com / 04XXXXX319
This is the powershell I've used to hide the email address / phone number
$PersonalEmail = "emailaddress@domain.com"
#SET AD WITH THE ACTUAL EMAIL ADDRESS
Set-QADUser $AffectedUserUserName -objectAttributes @{otherMailbox=@($PersonalEmail)}
$PersonalEmailLength = $PersonalEmail.Length
$EmailFirstLetter = $PersonalEmail.Substring(0,1)
$EmailDomainPosition = $PersonalEmail.IndexOf("@)
$EmailDomain = $PersonalEmail.Substring($EmailDomainPosition)
$EmailLastLetter = $PersonalEmail.Substring($EmailDomainPosition-1,1)
$Chopped = $PersonalEmailLength - $EmailDomain.Length -2
$stars = "*" * $Chopped
$EncryptedEmail = $EmailFirstLetter + $stars + $EmailLastLetter + $EmailDomain
#SET THE USER CI WITH THE ENCRYPTED EMAIL ADDRESS
$SCSMUser | Set-SCSMObject -Property PersonalEmail -Value $EncryptedEmail
$PersonalMobile = "0412345678"
#SET AD WITH THE ACTUAL MOBILE NUMBER
Set-QADUser $AffectedUserUserName -objectAttributes @{otherMobile=@($PersonalMobile)}
$PersonalMobileLength = $PersonalMobile.length
$MobileLastLetter = $PersonalMobile.Substring($PersonalMobileLength-3 ,3)
$EncryptedMobile = "04*****" + $MobileLastLetter
#SET THE USER CI WITH THE ENCRYPTED
$SCSMUser | Set-SCSMObject -Property PersonalPhone -Value $EncryptedMobile
And the custom.js used to populate fields with current information.
Everytime the portal is upgraded / something is changed all the textareadids have to be updated though ..
$(document).ready(function (){
//Add current users details to fields automagically
if(window.location.href.indexOf("9a9d85de-c105-60ff-5d95-19805e864114") > -1){
console.log("I'm on the Update Contact Details page!");
jQuery("#textArea06e8e269-ea3b-4e73-ba9b-a5ebf0d973dc").val("loading...").prop("disabled", true);
jQuery("#textAreaf79a52b5-2cb0-4ae1-a241-8238231ece81").val("loading...").prop("disabled", true);
jQuery("#textArea7b360359-f5ed-4817-89e2-7db9a8d308b8").val("loading...").prop("disabled", true);
jQuery("#textArea3baae675-4542-4b85-889f-d8ed8a310d3f").val("loading...").prop("disabled", true);
jQuery("#textArea6637b2bd-fc0f-4323-a8ae-8b1c611095ad").val("loading...").prop("disabled", true);
jQuery('label.control-label:contains("Primary Site")').parent().find("input[placeholder^=Filter]").val("loading...").prop("disabled", true);
jQuery('label.control-label:contains("Manager")').parent().find("input[placeholder^=Filter]").val("loading...").prop("disabled", true);
jQuery('label.control-label:contains("Organization")').parent().find("input[placeholder^=Filter]").val("loading...").prop("disabled", true);
$.getJSON('/api/V3/User/GetUserRelatedInfoByUserId',
{ "userId": session.user.Id },
function (data) {
//console.log(data);
var jsondata = JSON.parse(data);
jQuery("#textArea06e8e269-ea3b-4e73-ba9b-a5ebf0d973dc").prop("disabled", false).val("");
jQuery("#textAreaf79a52b5-2cb0-4ae1-a241-8238231ece81").prop("disabled", false).val("");
jQuery("#textArea7b360359-f5ed-4817-89e2-7db9a8d308b8").prop("disabled", false).val("");
jQuery("#textArea3baae675-4542-4b85-889f-d8ed8a310d3f").prop("disabled", false).val("");
jQuery("#textArea6637b2bd-fc0f-4323-a8ae-8b1c611095ad").prop("disabled", false).val("");
if(jsondata.Title != null)
jQuery("#textArea06e8e269-ea3b-4e73-ba9b-a5ebf0d973dc").val(jsondata.Title).trigger("keyup");
if(jsondata.BusinessPhone != null)
jQuery("#textArea3baae675-4542-4b85-889f-d8ed8a310d3f").val(jsondata.BusinessPhone).trigger("keyup");
if(jsondata.PersonalEmail != null)
jQuery("#textAreaf79a52b5-2cb0-4ae1-a241-8238231ece81").val(jsondata.PersonalEmail).trigger("keyup");
if(jsondata.Mobile != null)
jQuery("#textArea6637b2bd-fc0f-4323-a8ae-8b1c611095ad").val(jsondata.Mobile).trigger("keyup");
if(jsondata.PersonalPhone != null)
jQuery("#textArea7b360359-f5ed-4817-89e2-7db9a8d308b8").val(jsondata.PersonalPhone).trigger("keyup");
setTimeout(function (){
jQuery('label.control-label:contains("Primary Site")').parent().find("input[placeholder^=Filter]").prop("disabled", false).val(jsondata.Office).trigger("keyup");
jQuery('label.control-label:contains("Manager")').parent().find("input[placeholder^=Filter]").prop("disabled", false).val(jsondata.UsersManager).trigger("keyup");
jQuery('label.control-label:contains("Organization")').parent().find("input[placeholder^=Filter]").prop("disabled", false).val(jsondata.Department).trigger("keyup");
}, 6000);
setTimeout(function (){
var trOrgainsationlist = $('div[data-control-valuetargetid="4f8ffe5c-4abd-4249-8bd4-83b6a5e178bd"]').find("table.k-selectable").find("tr");
if(trOrgainsationlist.length == 1)
{
trOrgainsationlist.trigger("click");
}
var trManagerlist = $('div[data-control-valuetargetid="cc5a7175-e9f5-4b12-9c5b-da530fbc2abc"]').find("table.k-selectable").find("tr");
if(trManagerlist.length == 1)
{
trManagerlist.trigger("click");
}
var trSitelist = $('div[data-control-valuetargetid="eeb73079-5a93-4a2d-95cc-6ea173384220"]').find("table.k-selectable").find("tr");
if(trSitelist.length == 1)
{
trSitelist.trigger("click");
}
}, 6500);
});
};
});