Пример #1
0
 private void ApplicationOnLastLogonParametersWriting(object sender, LastLogonParametersWritingEventArgs e){
     var windowsCredentialStorage = e.SettingsStorage as EncryptedSettingsStorage;
     if (windowsCredentialStorage != null){
         ObjectSerializer.WriteObjectPropertyValues(e.DetailView, e.SettingsStorage, e.LogonObject);
         var contents = windowsCredentialStorage.GetContent();
         File.WriteAllBytes(Path.Combine(_logonParametersFilePath, "LogonParameters.bin"), contents);
     }
 }
Пример #2
0
        private void ApplicationOnLastLogonParametersWriting(object sender, LastLogonParametersWritingEventArgs e)
        {
            var windowsCredentialStorage = e.SettingsStorage as EncryptedSettingsStorage;

            if (windowsCredentialStorage != null)
            {
                ObjectSerializer.WriteObjectPropertyValues(e.DetailView, e.SettingsStorage, e.LogonObject);
                var contents = windowsCredentialStorage.GetContent();
                File.WriteAllBytes(Path.Combine(_logonParametersFilePath, "LogonParameters.bin"), contents);
            }
        }
Пример #3
0
 private void ApplicationOnLastLogonParametersWriting(object sender, LastLogonParametersWritingEventArgs e)
 {
     if (((IModelOptionsAuthentication)Application.Model.Options).Athentication.AutoAthentication.Enabled)
     {
         if (e.SettingsStorage is EncryptedSettingsStorage windowsCredentialStorage)
         {
             var path = Path.Combine(_logonParametersFilePath, LogonParametersFile);
             if (((XpandLogonParameters)e.LogonObject).RememberMe)
             {
                 ObjectSerializer.WriteObjectPropertyValues(e.DetailView, e.SettingsStorage, e.LogonObject);
                 var contents = windowsCredentialStorage.GetContent();
                 File.WriteAllBytes(path, contents);
             }
             else
             {
                 File.Delete(path);
             }
         }
     }
 }
Пример #4
0
 void ApplicationOnLastLogonParametersWriting(object sender, LastLogonParametersWritingEventArgs lastLogonParametersWritingEventArgs) {
     ((WebApplication) sender).LastLogonParametersWriting-=ApplicationOnLastLogonParametersWriting;
     lastLogonParametersWritingEventArgs.Handled = lastLogonParametersWritingEventArgs.SettingsStorage is SettingsStorageOnCookies;
 }
Пример #5
0
 void ApplicationOnLastLogonParametersWriting(object sender, LastLogonParametersWritingEventArgs lastLogonParametersWritingEventArgs)
 {
     ((WebApplication)sender).LastLogonParametersWriting -= ApplicationOnLastLogonParametersWriting;
     lastLogonParametersWritingEventArgs.Handled          = lastLogonParametersWritingEventArgs.SettingsStorage is SettingsStorageOnCookies;
 }
Пример #6
0
 private void Application_LastLogonParametersWriting(object sender, LastLogonParametersWritingEventArgs e)
 {
     CustomLogonParameters parameters = e.LogonObject as CustomLogonParameters;
     if (parameters != null)
     {
         Employee lastEmployee = parameters.Employee;
         if (lastEmployee != null)
         {// записываем вы конфиг id последнего входившего пользователя
             e.SettingsStorage.SaveOption("", "Employee", lastEmployee.Oid.ToString());
             e.Handled = true;
         }
     }
 }