|
Server : Apache/2.4.58 (Win64) OpenSSL/3.1.3 PHP/8.2.12 System : Windows NT SERVER-PC 10.0 build 26200 (Windows 11) AMD64 User : ServerPC ( 0) PHP Version : 8.2.12 Disable Function : NONE Directory : C:/Windows/SystemApps/Microsoft.Windows.CloudExperienceHost_cw5n1h2txyewy/js/ |
Upload File : |
"use strict";
var CloudExperienceHost;
(function (CloudExperienceHost) {
var LocalAccount;
(function (LocalAccount) {
function getShouldSkipAsync() {
return new WinJS.Promise(function (completeDispatch, errorDispatch) {
try {
let localDisallowed = (CloudExperienceHost.getAllowedIdentityProviders().indexOf(CloudExperienceHost.SignInIdentityProviders.Local) == -1);
const forcedEnrollmentPromise = EnterpriseDeviceManagement.Service.AutoPilot.AutoPilotUtilStatics.getDwordPolicyAsync("CloudAssignedForcedEnrollment");
forcedEnrollmentPromise.then((result) => {
let isForcedEnrollmentEnabled = (result === 1);
if (isForcedEnrollmentEnabled) {
CloudExperienceHost.Telemetry.logEvent("CommercialOOBE_LocalAccount_BlockedByForcedEnrollmentPolicy");
CloudExperienceHost.Storage.VolatileSharableData.addItem("AutopilotValues", "LocalAccountCreationBlockedByForcedEnrollmentPolicy", true);
}
if (localDisallowed) {
CloudExperienceHost.Telemetry.logEvent("CommercialOOBE_LocalAccount_BlockedByWinSEPolicy");
}
completeDispatch(localDisallowed || isForcedEnrollmentEnabled);
});
} catch (err) {
CloudExperienceHost.Telemetry.logEvent("CloudExperienceHost_LocalAccount_GetShouldSkipAsyncFailed", JSON.stringify({ error: err }));
completeDispatch(false);
}
});
}
LocalAccount.getShouldSkipAsync = getShouldSkipAsync;
function createLocalAccount(username, password, recoveryData) {
return new WinJS.Promise(function (completeDispatch, errorDispatch, progressDispatch) {
if ((password == null) || (password === "")) {
var localAccountManager = new CloudExperienceHostBroker.Account.LocalAccountManager();
localAccountManager.createLocalAccountAsync(username, null, null)
.done(function () {
CloudExperienceHost.IUserManager.getInstance().setSignInIdentityProvider(CloudExperienceHostAPI.SignInIdentityProviders.local);
completeDispatch();
}, function (err) { errorDispatch(err); }, function (progress) { progressDispatch(progress); });
}
else {
var provider = new Windows.Security.Cryptography.DataProtection.DataProtectionProvider("local=user");
var binary = Windows.Security.Cryptography.CryptographicBuffer.convertStringToBinary(password, Windows.Security.Cryptography.BinaryStringEncoding.utf8);
provider.protectAsync(binary).then(function (protectedData) {
var localAccountManager = new CloudExperienceHostBroker.Account.LocalAccountManager();
var recoveryKind = localAccountManager.isLocalSecurityQuestionResetAllowed ? CloudExperienceHostBroker.Account.RecoveryKind.questions : CloudExperienceHostBroker.Account.RecoveryKind.hint;
return localAccountManager.createLocalAccountAsync(username, protectedData, recoveryData, recoveryKind); })
.done(function () {
CloudExperienceHost.IUserManager.getInstance().setSignInIdentityProvider(CloudExperienceHostAPI.SignInIdentityProviders.local);
completeDispatch();
}, function (err) { errorDispatch(err); }, function (progress) { progressDispatch(progress); });
}
});
}
LocalAccount.createLocalAccount = createLocalAccount;
function createRetailAccount(password, isAdmin) {
return new WinJS.Promise(function (completeDispatch, errorDispatch) {
var localAccountManager = new CloudExperienceHostBroker.Account.LocalAccountManager();
if ((password == null) || (password === "")) {
localAccountManager.createRetailAccountAsync(null, isAdmin).done(completeDispatch, errorDispatch);
} else {
var provider = new Windows.Security.Cryptography.DataProtection.DataProtectionProvider("local=user");
var binary = Windows.Security.Cryptography.CryptographicBuffer.convertStringToBinary(password, Windows.Security.Cryptography.BinaryStringEncoding.utf8);
provider.protectAsync(binary).then(function (protectedData) {
return localAccountManager.createRetailAccountAsync(protectedData, isAdmin);
}).done(completeDispatch, errorDispatch);
}
});
}
LocalAccount.createRetailAccount = createRetailAccount;
function verifyLocalAccountCredentials() {
return new WinJS.Promise(function (completeDispatch, errorDispatch) {
let localAccountManager = new CloudExperienceHostBroker.Account.LocalAccountManager();
return localAccountManager.verifyLocalAccountCreds(WinJS.Resources.getString('/localAccount/UpdateSQSATitle').value,
WinJS.Resources.getString('/localAccount/CredMessageText').value).done(completeDispatch, errorDispatch);
});
}
LocalAccount.verifyLocalAccountCredentials = verifyLocalAccountCredentials;
function updateSQSA(recoveryData) {
return new WinJS.Promise(function (completeDispatch, errorDispatch) {
let localAccountManager = new CloudExperienceHostBroker.Account.LocalAccountManager();
return localAccountManager.updateSecurityQuestionsForUserAsync(null, recoveryData)
.done(completeDispatch, errorDispatch);
});
}
LocalAccount.updateSQSA = updateSQSA;
function localizedStrings() {
let localAccountResources = {};
const keyList = ['Title', 'LeadText1', 'LeadText', 'UserNameLegend', 'UserPlaceholder', 'PasswordLegend', 'SQSALegend',
'PasswordPlaceholder', 'ReenterPlaceholder', 'HintPlaceholder', 'SecurityQuestion1Placeholder',
'SecurityQuestion2Placeholder', 'SecurityQuestion3Placeholder', 'SecurityQuestion1', 'SecurityQuestion2',
'SecurityQuestion3', 'SecurityQuestion4', 'SecurityQuestion5', 'SecurityQuestion6', 'SecurityAnswerPlaceholder',
'LocalUser_NoUsername_Error', 'Username_Too_Long', 'UserEmpty_Error_Title', 'Username_Error', 'UsernameContainsAt_Error',
'UserExists_Error', 'UserReserved_Error', 'UserIsComputer_Error_Title', 'PasswordConfirm_Error',
'PasswordHint_Empty_Error', 'PasswordHint_Invalid_Error', 'PasswordPolicy_Error', 'Error_Creating_Account_Warning',
'SQSA_Error', 'BackButton', 'NextButton', 'VoiceOver'];
for (let i = 0; i < keyList.length; i++) {
let resourceId = '/localAccount/' + keyList[i];
localAccountResources[keyList[i]] = WinJS.Resources.getString(resourceId).value;
}
return JSON.stringify(localAccountResources);
}
LocalAccount.localizedStrings = localizedStrings;
function localizedStringsSetupSQSA() {
let localAccountResources = {};
const keyList = ['UpdateSQSATitle', 'SQSALegend', 'SecurityQuestion1Placeholder', 'SecurityQuestion2Placeholder',
'SecurityQuestion3Placeholder', 'SecurityQuestion1', 'SecurityQuestion2', 'SecurityQuestion3',
'SecurityQuestion4', 'SecurityQuestion5', 'SecurityQuestion6', 'SecurityAnswerPlaceholder',
'Error_Creating_Account_Warning', 'SQSA_Error', 'CancelButton', 'FinishButton'];
for (let i = 0; i < keyList.length; i++) {
let resourceId = '/localAccount/' + keyList[i];
localAccountResources[keyList[i]] = WinJS.Resources.getString(resourceId).value;
}
return JSON.stringify(localAccountResources);
}
LocalAccount.localizedStringsSetupSQSA = localizedStringsSetupSQSA;
function isSQSAAllowed() {
var localAccountManager = new CloudExperienceHostBroker.Account.LocalAccountManager();
return localAccountManager.isLocalSecurityQuestionResetAllowed;
}
LocalAccount.isSQSAAllowed = isSQSAAllowed;
})(CloudExperienceHost.LocalAccount || (CloudExperienceHost.LocalAccount = {}));
})(CloudExperienceHost || (CloudExperienceHost = {}));