diff --git a/BeWo/View/ChatServiceCustomer.xaml b/BeWo/View/ChatServiceCustomer.xaml
index 23260b612..bea5ef48a 100644
--- a/BeWo/View/ChatServiceCustomer.xaml
+++ b/BeWo/View/ChatServiceCustomer.xaml
@@ -41,7 +41,10 @@
-
+
+
@@ -54,10 +57,13 @@
-
+
+
-
+
diff --git a/BeWo/View/ChatServiceCustomer.xaml.cs b/BeWo/View/ChatServiceCustomer.xaml.cs
index b5a646a60..e23870132 100644
--- a/BeWo/View/ChatServiceCustomer.xaml.cs
+++ b/BeWo/View/ChatServiceCustomer.xaml.cs
@@ -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)
diff --git a/BeWo/View/ChatServiceEmployee.xaml b/BeWo/View/ChatServiceEmployee.xaml
index df82d57aa..c2a2a476b 100644
--- a/BeWo/View/ChatServiceEmployee.xaml
+++ b/BeWo/View/ChatServiceEmployee.xaml
@@ -41,7 +41,9 @@
-
+
-
-
+
diff --git a/BeWo/View/HomeDragPanelView.xaml.cs b/BeWo/View/HomeDragPanelView.xaml.cs
index c5dc8e3ba..2fe52ed2a 100644
--- a/BeWo/View/HomeDragPanelView.xaml.cs
+++ b/BeWo/View/HomeDragPanelView.xaml.cs
@@ -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();
diff --git a/BeWoPlanerMobil/Controllers/ChatController.cs b/BeWoPlanerMobil/Controllers/ChatController.cs
index 7b764e275..6b48c89d1 100644
--- a/BeWoPlanerMobil/Controllers/ChatController.cs
+++ b/BeWoPlanerMobil/Controllers/ChatController.cs
@@ -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 Guardians { get; set; }
- public JsonInputKlient1(string oid,string status, string firstname, string lastname, string alias,string mobile,string chatCode, List guardians)
+ public JsonInputKlient1(string oid,string status, string firstname, string lastname, string alias,string mobile,string chatCode,string login,string password, List 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;
}
}
diff --git a/Data/Entities/CustomerAPPCode.cs b/Data/Entities/CustomerAPPCode.cs
index 8c2af6a1c..d4dc065a5 100644
--- a/Data/Entities/CustomerAPPCode.cs
+++ b/Data/Entities/CustomerAPPCode.cs
@@ -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;
+ }
+ }
+ }
+
}
}
\ No newline at end of file
diff --git a/Data/Mappings/CustomerAPPCode.hbm.xml b/Data/Mappings/CustomerAPPCode.hbm.xml
index 2577b5f20..423715a33 100644
--- a/Data/Mappings/CustomerAPPCode.hbm.xml
+++ b/Data/Mappings/CustomerAPPCode.hbm.xml
@@ -19,5 +19,6 @@
+
\ No newline at end of file
diff --git a/Model/Changes_2017_10_13.txt b/Model/Changes_2017_10_13.txt
new file mode 100644
index 000000000..b29ea2d1b
--- /dev/null
+++ b/Model/Changes_2017_10_13.txt
@@ -0,0 +1,3 @@
+
+ALTER TABLE `CustomerAppCode`
+ADD COLUMN `PasswordHash` VARCHAR(1024) NULL DEFAULT NULL COMMENT '';
\ No newline at end of file
diff --git a/Service/ServiceImplementations/CustomerServiceImp.cs b/Service/ServiceImplementations/CustomerServiceImp.cs
index 86c524d54..6fca40dc6 100644
--- a/Service/ServiceImplementations/CustomerServiceImp.cs
+++ b/Service/ServiceImplementations/CustomerServiceImp.cs
@@ -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);
}
}