Aktuallisierungen und bcrypt für clienten chat passwort zusätzliche erweiterungen für den ChatController Bewomobil

This commit is contained in:
Waldi
2017-10-13 14:07:44 +02:00
parent 0739d5ca40
commit 4b5e23cbd8
9 changed files with 73 additions and 20 deletions

View File

@@ -41,7 +41,10 @@
<TextBox Grid.Column="1" Grid.Row="0" Margin="3" Height="23" MinWidth="120" x:Name="GeneratetTexfield" IsReadOnly="True"/>
<Button Content="Chat-Code Entfernen" Grid.Row="0" Grid.Column="2" Height="23" Click="RemoveCode_OnClick"/>
<Button Grid.Row="0" Grid.Column="2" Margin="3" Height="23" Click="RemoveCode_OnClick" ToolTip="Aktuellen Chat-Code löschen.">
<Image Height="15" Width="15" Source='/Ressources/Icons/Symbol Delete.png' Margin="3" RenderOptions.BitmapScalingMode="HighQuality" HorizontalAlignment="Center" />
</Button>
<!-- <Label x:Name="lblIsChatAktive" Grid.Column="0" Grid.Row="1" Margin="3" Content="Chat Aktivieren" />-->
@@ -54,10 +57,13 @@
<Label Grid.Row="3" Grid.Column="0" Content="Passwort" Margin="3" />
<TextBox Grid.Row="3" Grid.Column="1" Margin="3" x:Name="TXTPasswort" />
<Button Content="Speichern" Click="SpeicherButton_OnClick" Grid.Row="4" Grid.Column="0" Grid.ColumnSpan="2" Margin="3" HorizontalAlignment="Right"/>
<Button Content="Speichern" Click="SpeicherButton_OnClick" Grid.Row="4" Grid.Column="0" Grid.ColumnSpan="2" Margin="3" HorizontalAlignment="Right" />
<Button Grid.Column="0" Grid.Row="4" Content="Handout PDF Anzeigen" Click="ZeigeHandoutPDF_OnClick " Margin="3" VerticalAlignment="Center" HorizontalAlignment="Left" Height="21"/>
<Button Grid.Column="3" Grid.Row="0" Click="ZeigeHandoutPDF_OnClick " Margin="3" VerticalAlignment="Center" HorizontalAlignment="Left" Height="23" ToolTip="ownChat Kurzanleitung für Klient herunterladen.">
<Image Height="15" Width="15" Source='/Ressources/Icons/ClipboardDisabled.png' Margin="3" RenderOptions.BitmapScalingMode="HighQuality" HorizontalAlignment="Center" />
</Button>

View File

@@ -272,7 +272,21 @@ namespace BeWo.View
private void SpeicherButton_OnClick(object sender, RoutedEventArgs e)
{
ServiceFacade.DoCustomerServiceSync(s => s.SetBenutzerPasswortChatAppCode(customerOid.Value, TXTBenutzerName.Text, TXTPasswort.Text));
if (BeWoApp.AppSettings.IsPasswordSecurityActiv)
{
if (TXTPasswort.Text.Length >= 8)
{
ServiceFacade.DoCustomerServiceSync(s => s.SetBenutzerPasswortChatAppCode(customerOid.Value, TXTBenutzerName.Text, TXTPasswort.Text));
}
else
{
MessageBox.Show("Das Passwort ist zu schwach.");
}
}
else
{
ServiceFacade.DoCustomerServiceSync(s => s.SetBenutzerPasswortChatAppCode(customerOid.Value, TXTBenutzerName.Text, TXTPasswort.Text));
}
}
private void RemoveCode_OnClick(object sender, RoutedEventArgs e)

View File

@@ -41,7 +41,9 @@
<TextBox Grid.Column="1" Grid.Row="0" Margin="3" Height="23" MinWidth="120" x:Name="GeneratetTexfield" IsReadOnly="True" />
<Button Content="Chat-Code Entfernen" Grid.Row="0" Grid.Column="2" Height="23" Click="RemoveCode_OnClick"/>
<Button Grid.Row="0" Grid.Column="2" Height="23" Click="RemoveCode_OnClick" ToolTip="Aktuellen Chat-Code löschen.">
<Image Height="15" Width="15" Source='/Ressources/Icons/Symbol Delete.png' Margin="3" RenderOptions.BitmapScalingMode="HighQuality" HorizontalAlignment="Center" />
</Button>
<!--<Label x:Name="lblIsChatAktive" Grid.Column="0" Grid.Row="1" Content="Chat Aktivieren" />
@@ -55,8 +57,9 @@
<Button Grid.Column="0" Grid.Row="3" Content="Save Notfall Message" Click="Creat_NotfallMessage" Margin="3" VerticalAlignment="Center" HorizontalAlignment="Left"
Height="21" x:Name="SaveMSButon" />-->
<Button Grid.Column="0" Grid.Row="4" Content="Handout PDF Anzeigen" Click="ZeigePDF_OnClick" Margin="3" VerticalAlignment="Center" HorizontalAlignment="Left" Height="21"/>
<Button Grid.Column="3" Grid.Row="0" Click="ZeigePDF_OnClick" Margin="3" VerticalAlignment="Center" HorizontalAlignment="Left" Height="23" ToolTip="ownChat Kurzanleitung für Mitarbeiter herunterladen.">
<Image Height="15" Width="15" Source='/Ressources/Icons/ClipboardDisabled.png' Margin="3" RenderOptions.BitmapScalingMode="HighQuality" HorizontalAlignment="Center" />
</Button>
</Grid>
</GroupBox>

View File

@@ -108,26 +108,27 @@ namespace BeWo.View
MessageBox.Show("Verbindung geglückt.", "Info", MessageBoxButton.OK,MessageBoxImage.Information);
});*/
//var berechtigung = ServiceFacade.DoEmployeeServiceSync(s => s.GetAllChatActiveEmployeesCompact());
//foreach (var list in berechtigung)
//{
// if (list.PersonOid == BeWoApp.LoggedOnUser.Employee.PersonOid)
// {
// berechtigt = true;
// }
//}
var berechtigung = ServiceFacade.DoEmployeeServiceSync(s => s.GetAllChatActiveEmployeesCompact());
foreach (var list in berechtigung)
{
if (list.PersonOid == BeWoApp.LoggedOnUser.Employee.PersonOid)
{
berechtigt = true;
}
}
if (berechtigt)
{
{
//asx = new Thread(ConnectWithServer);
//asx.Start();
BewoChat.Visibility = Visibility.Visible;//Hidden
}
else
{
// BewoChat.Visibility = Visibility.Visible;//Hidden
BewoChat.Visibility = Visibility.Hidden;//Hidden
}
PruefePasswortStaerke();

View File

@@ -161,7 +161,7 @@ namespace BeWoPlanerMobil.Controllers
}
JsonInputKlient1 input = new JsonInputKlient1(daten.Oid.ToString(),"1",
daten.Person.FirstName, daten.Person.LastName, daten.CustomerAlias, mobilnummer, chatcode.CustomerCode, inputList);
daten.Person.FirstName, daten.Person.LastName, daten.CustomerAlias, mobilnummer, chatcode.CustomerCode,chatcode.BenutzerName,chatcode.BCryptPassword, inputList);
if (daten.IsActive == ActivationTypeId.Deleted)
@@ -422,10 +422,12 @@ namespace BeWoPlanerMobil.Controllers
public string Alias { get; set; }
public string Mobile { get; set; }
public string ChatCode { get; set; }
public string Login { get; set; }
public string Password { get; set; }
public List<JsonInputKlient2> Guardians { get; set; }
public JsonInputKlient1(string oid,string status, string firstname, string lastname, string alias,string mobile,string chatCode, List<JsonInputKlient2> guardians)
public JsonInputKlient1(string oid,string status, string firstname, string lastname, string alias,string mobile,string chatCode,string login,string password, List<JsonInputKlient2> guardians)
{
Oid = "C"+oid;
Status = status;
@@ -434,6 +436,8 @@ namespace BeWoPlanerMobil.Controllers
Alias = alias;
Mobile = mobile;
ChatCode = chatCode;
Login = login;
Password = password;
Guardians = guardians;
}
}

View File

@@ -18,6 +18,8 @@ namespace BeWo.Data.Entities
public static string PropertyName_Passwort = "Passwort";
public static string PropertyName_BCryptPassword = "BCryptPassword";
private string _CustomerCode;
private DateTime _CustomerCodeGenDate;
@@ -30,6 +32,8 @@ namespace BeWo.Data.Entities
private string _Passwort;
private string _BCryptPassword;
public virtual string CustomerCode
{
get
@@ -126,5 +130,18 @@ namespace BeWo.Data.Entities
}
}
public virtual string BCryptPassword
{
get { return _BCryptPassword; }
set
{
if (AreDifferent(_BCryptPassword, value))
{
_BCryptPassword = value;
}
}
}
}
}

View File

@@ -19,5 +19,6 @@
<property name="IsChatAktiv" column="IsChatActive" />
<property name="BenutzerName" column="BenutzerName" />
<property name="Passwort" column="Passwort" />
<property name="BCryptPassword" column="PasswordHash" />
</class>
</hibernate-mapping>

View File

@@ -0,0 +1,3 @@
ALTER TABLE `CustomerAppCode`
ADD COLUMN `PasswordHash` VARCHAR(1024) NULL DEFAULT NULL COMMENT '';

View File

@@ -5,6 +5,7 @@ using System.ServiceModel;
using BeWo.Data.Access;
using BeWo.Data.Entities;
using BeWo.Data.Security;
using BeWo.Service.Core;
using BeWo.Service.DCEntityMapper;
using BeWo.Service.Plugins;
@@ -3700,6 +3701,9 @@ namespace BeWo.Service.ServiceImplementations
if (!passwort.Equals("") && appcode.Passwort != null && !appcode.Passwort.Equals(passwort))
{
appcode.Passwort = passwort;
string salt = BCrypt.GenerateSalt();
appcode.BCryptPassword = BCrypt.HashPassword(passwort, salt);
}
}