Allow changes of users phone and email contact info by the user
This commit is contained in:
parent
3e63b9ce46
commit
c8e634156b
@ -5507,9 +5507,10 @@ namespace BreCalClient.misc.Model
|
|||||||
/// <param name="lastName">lastName.</param>
|
/// <param name="lastName">lastName.</param>
|
||||||
/// <param name="userName">userName.</param>
|
/// <param name="userName">userName.</param>
|
||||||
/// <param name="userPhone">userPhone.</param>
|
/// <param name="userPhone">userPhone.</param>
|
||||||
|
/// <param name="userEmail">userEmail.</param>
|
||||||
/// <param name="exp">exp.</param>
|
/// <param name="exp">exp.</param>
|
||||||
/// <param name="token">token.</param>
|
/// <param name="token">token.</param>
|
||||||
public LoginResult(int id = default(int), int participantId = default(int), string firstName = default(string), string lastName = default(string), string userName = default(string), string userPhone = default(string), float exp = default(float), string token = default(string))
|
public LoginResult(int id = default(int), int participantId = default(int), string firstName = default(string), string lastName = default(string), string userName = default(string), string userPhone = default(string), string userEmail = default(string), float exp = default(float), string token = default(string))
|
||||||
{
|
{
|
||||||
this.Id = id;
|
this.Id = id;
|
||||||
this.ParticipantId = participantId;
|
this.ParticipantId = participantId;
|
||||||
@ -5517,6 +5518,7 @@ namespace BreCalClient.misc.Model
|
|||||||
this.LastName = lastName;
|
this.LastName = lastName;
|
||||||
this.UserName = userName;
|
this.UserName = userName;
|
||||||
this.UserPhone = userPhone;
|
this.UserPhone = userPhone;
|
||||||
|
this.UserEmail = userEmail;
|
||||||
this.Exp = exp;
|
this.Exp = exp;
|
||||||
this.Token = token;
|
this.Token = token;
|
||||||
}
|
}
|
||||||
@ -5551,6 +5553,11 @@ namespace BreCalClient.misc.Model
|
|||||||
[DataMember(Name = "user_phone", EmitDefaultValue = true)]
|
[DataMember(Name = "user_phone", EmitDefaultValue = true)]
|
||||||
public string UserPhone { get; set; }
|
public string UserPhone { get; set; }
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
/// Gets or Sets UserEmail
|
||||||
|
/// </summary>
|
||||||
|
[DataMember(Name = "user_email", EmitDefaultValue = true)]
|
||||||
|
public string UserEmail { get; set; }
|
||||||
|
/// <summary>
|
||||||
/// Gets or Sets Exp
|
/// Gets or Sets Exp
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[DataMember(Name = "exp", EmitDefaultValue = true)]
|
[DataMember(Name = "exp", EmitDefaultValue = true)]
|
||||||
@ -5574,6 +5581,7 @@ namespace BreCalClient.misc.Model
|
|||||||
sb.Append(" LastName: ").Append(LastName).Append("\n");
|
sb.Append(" LastName: ").Append(LastName).Append("\n");
|
||||||
sb.Append(" UserName: ").Append(UserName).Append("\n");
|
sb.Append(" UserName: ").Append(UserName).Append("\n");
|
||||||
sb.Append(" UserPhone: ").Append(UserPhone).Append("\n");
|
sb.Append(" UserPhone: ").Append(UserPhone).Append("\n");
|
||||||
|
sb.Append(" UserEmail: ").Append(UserEmail).Append("\n");
|
||||||
sb.Append(" Exp: ").Append(Exp).Append("\n");
|
sb.Append(" Exp: ").Append(Exp).Append("\n");
|
||||||
sb.Append(" Token: ").Append(Token).Append("\n");
|
sb.Append(" Token: ").Append(Token).Append("\n");
|
||||||
sb.Append("}\n");
|
sb.Append("}\n");
|
||||||
@ -5636,6 +5644,11 @@ namespace BreCalClient.misc.Model
|
|||||||
(this.UserPhone != null &&
|
(this.UserPhone != null &&
|
||||||
this.UserPhone.Equals(input.UserPhone))
|
this.UserPhone.Equals(input.UserPhone))
|
||||||
) &&
|
) &&
|
||||||
|
(
|
||||||
|
this.UserEmail == input.UserEmail ||
|
||||||
|
(this.UserEmail != null &&
|
||||||
|
this.UserEmail.Equals(input.UserEmail))
|
||||||
|
) &&
|
||||||
(
|
(
|
||||||
this.Exp == input.Exp ||
|
this.Exp == input.Exp ||
|
||||||
this.Exp.Equals(input.Exp)
|
this.Exp.Equals(input.Exp)
|
||||||
@ -5673,6 +5686,10 @@ namespace BreCalClient.misc.Model
|
|||||||
{
|
{
|
||||||
hashCode = (hashCode * 59) + this.UserPhone.GetHashCode();
|
hashCode = (hashCode * 59) + this.UserPhone.GetHashCode();
|
||||||
}
|
}
|
||||||
|
if (this.UserEmail != null)
|
||||||
|
{
|
||||||
|
hashCode = (hashCode * 59) + this.UserEmail.GetHashCode();
|
||||||
|
}
|
||||||
hashCode = (hashCode * 59) + this.Exp.GetHashCode();
|
hashCode = (hashCode * 59) + this.Exp.GetHashCode();
|
||||||
if (this.Token != null)
|
if (this.Token != null)
|
||||||
{
|
{
|
||||||
@ -7627,7 +7644,8 @@ namespace BreCalClient.misc.Model
|
|||||||
/// <param name="firstName">firstName.</param>
|
/// <param name="firstName">firstName.</param>
|
||||||
/// <param name="lastName">lastName.</param>
|
/// <param name="lastName">lastName.</param>
|
||||||
/// <param name="userPhone">userPhone.</param>
|
/// <param name="userPhone">userPhone.</param>
|
||||||
public UserDetails(int id = default(int), string oldPassword = default(string), string newPassword = default(string), string firstName = default(string), string lastName = default(string), string userPhone = default(string))
|
/// <param name="userEmail">userEmail.</param>
|
||||||
|
public UserDetails(int id = default(int), string oldPassword = default(string), string newPassword = default(string), string firstName = default(string), string lastName = default(string), string userPhone = default(string), string userEmail = default(string))
|
||||||
{
|
{
|
||||||
this.Id = id;
|
this.Id = id;
|
||||||
this.OldPassword = oldPassword;
|
this.OldPassword = oldPassword;
|
||||||
@ -7635,6 +7653,7 @@ namespace BreCalClient.misc.Model
|
|||||||
this.FirstName = firstName;
|
this.FirstName = firstName;
|
||||||
this.LastName = lastName;
|
this.LastName = lastName;
|
||||||
this.UserPhone = userPhone;
|
this.UserPhone = userPhone;
|
||||||
|
this.UserEmail = userEmail;
|
||||||
}
|
}
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Gets or Sets Id
|
/// Gets or Sets Id
|
||||||
@ -7667,6 +7686,11 @@ namespace BreCalClient.misc.Model
|
|||||||
[DataMember(Name = "user_phone", EmitDefaultValue = true)]
|
[DataMember(Name = "user_phone", EmitDefaultValue = true)]
|
||||||
public string UserPhone { get; set; }
|
public string UserPhone { get; set; }
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
/// Gets or Sets UserEmail
|
||||||
|
/// </summary>
|
||||||
|
[DataMember(Name = "user_email", EmitDefaultValue = true)]
|
||||||
|
public string UserEmail { get; set; }
|
||||||
|
/// <summary>
|
||||||
/// Returns the string presentation of the object
|
/// Returns the string presentation of the object
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <returns>String presentation of the object</returns>
|
/// <returns>String presentation of the object</returns>
|
||||||
@ -7680,6 +7704,7 @@ namespace BreCalClient.misc.Model
|
|||||||
sb.Append(" FirstName: ").Append(FirstName).Append("\n");
|
sb.Append(" FirstName: ").Append(FirstName).Append("\n");
|
||||||
sb.Append(" LastName: ").Append(LastName).Append("\n");
|
sb.Append(" LastName: ").Append(LastName).Append("\n");
|
||||||
sb.Append(" UserPhone: ").Append(UserPhone).Append("\n");
|
sb.Append(" UserPhone: ").Append(UserPhone).Append("\n");
|
||||||
|
sb.Append(" UserEmail: ").Append(UserEmail).Append("\n");
|
||||||
sb.Append("}\n");
|
sb.Append("}\n");
|
||||||
return sb.ToString();
|
return sb.ToString();
|
||||||
}
|
}
|
||||||
@ -7740,6 +7765,11 @@ namespace BreCalClient.misc.Model
|
|||||||
this.UserPhone == input.UserPhone ||
|
this.UserPhone == input.UserPhone ||
|
||||||
(this.UserPhone != null &&
|
(this.UserPhone != null &&
|
||||||
this.UserPhone.Equals(input.UserPhone))
|
this.UserPhone.Equals(input.UserPhone))
|
||||||
|
) &&
|
||||||
|
(
|
||||||
|
this.UserEmail == input.UserEmail ||
|
||||||
|
(this.UserEmail != null &&
|
||||||
|
this.UserEmail.Equals(input.UserEmail))
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@ -7772,6 +7802,10 @@ namespace BreCalClient.misc.Model
|
|||||||
{
|
{
|
||||||
hashCode = (hashCode * 59) + this.UserPhone.GetHashCode();
|
hashCode = (hashCode * 59) + this.UserPhone.GetHashCode();
|
||||||
}
|
}
|
||||||
|
if (this.UserEmail != null)
|
||||||
|
{
|
||||||
|
hashCode = (hashCode * 59) + this.UserEmail.GetHashCode();
|
||||||
|
}
|
||||||
return hashCode;
|
return hashCode;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -696,6 +696,8 @@ components:
|
|||||||
type: string
|
type: string
|
||||||
user_phone:
|
user_phone:
|
||||||
type: string
|
type: string
|
||||||
|
user_email:
|
||||||
|
type: string
|
||||||
exp:
|
exp:
|
||||||
type: number
|
type: number
|
||||||
format: float
|
format: float
|
||||||
@ -723,6 +725,9 @@ components:
|
|||||||
user_phone:
|
user_phone:
|
||||||
type: string
|
type: string
|
||||||
nullable: true
|
nullable: true
|
||||||
|
user_email:
|
||||||
|
type: string
|
||||||
|
nullable: true
|
||||||
Id:
|
Id:
|
||||||
type: object
|
type: object
|
||||||
description: A unique identifier for an entity
|
description: A unique identifier for an entity
|
||||||
|
|||||||
@ -7,7 +7,7 @@
|
|||||||
xmlns:xctk="http://schemas.xceed.com/wpf/xaml/toolkit"
|
xmlns:xctk="http://schemas.xceed.com/wpf/xaml/toolkit"
|
||||||
xmlns:p = "clr-namespace:BreCalClient.Resources"
|
xmlns:p = "clr-namespace:BreCalClient.Resources"
|
||||||
mc:Ignorable="d"
|
mc:Ignorable="d"
|
||||||
Title="Help" Height="280" Width="500">
|
Title="Help" Height="374" Width="500" Loaded="Window_Loaded">
|
||||||
<Grid>
|
<Grid>
|
||||||
<Grid.ColumnDefinitions>
|
<Grid.ColumnDefinitions>
|
||||||
<ColumnDefinition Width="180" />
|
<ColumnDefinition Width="180" />
|
||||||
@ -20,6 +20,10 @@
|
|||||||
<RowDefinition Height="28" />
|
<RowDefinition Height="28" />
|
||||||
<RowDefinition Height="28" />
|
<RowDefinition Height="28" />
|
||||||
<RowDefinition Height="28" />
|
<RowDefinition Height="28" />
|
||||||
|
<RowDefinition Height="10" />
|
||||||
|
<RowDefinition Height="28" />
|
||||||
|
<RowDefinition Height="28" />
|
||||||
|
<RowDefinition Height="28" />
|
||||||
<RowDefinition Height="28" />
|
<RowDefinition Height="28" />
|
||||||
<RowDefinition Height="28" />
|
<RowDefinition Height="28" />
|
||||||
<RowDefinition Height="28" />
|
<RowDefinition Height="28" />
|
||||||
@ -39,14 +43,20 @@
|
|||||||
</Hyperlink>
|
</Hyperlink>
|
||||||
</TextBlock>
|
</TextBlock>
|
||||||
|
|
||||||
<Label FontWeight="DemiBold" Grid.Row="3" Grid.Column="0" Content="{x:Static p:Resources.textChangePassword}" HorizontalContentAlignment="Right"/>
|
<Label FontWeight="DemiBold" Grid.Row="3" Grid.Column="0" Content="{x:Static p:Resources.textChangeContactInfo}" HorizontalContentAlignment="Right"/>
|
||||||
|
<Label Grid.Row="4" Grid.Column="0" Content="{x:Static p:Resources.textEmail}" HorizontalContentAlignment="Right" />
|
||||||
|
<Label Grid.Row="5" Grid.Column="0" Content="{x:Static p:Resources.textPhone}" HorizontalContentAlignment="Right" />
|
||||||
|
<TextBox Name="textBoxUserEmail" Grid.Column="1" Grid.Row="4" Margin="2" VerticalContentAlignment="Center" />
|
||||||
|
<TextBox Name="textBoxUserPhone" Grid.Column="1" Grid.Row="5" Margin="2" VerticalContentAlignment="Center" />
|
||||||
|
|
||||||
<xctk:WatermarkPasswordBox Watermark="{x:Static p:Resources.textOldPassword}" Grid.Column="1" Grid.Row="3" Margin="2" x:Name="wpBoxOldPassword" TextChanged="wpBoxOldPassword_TextChanged"/>
|
<Label FontWeight="DemiBold" Grid.Row="7" Grid.Column="0" Content="{x:Static p:Resources.textChangePassword}" HorizontalContentAlignment="Right"/>
|
||||||
<xctk:WatermarkPasswordBox Watermark="{x:Static p:Resources.textNewPassword}" Grid.Column="1" Grid.Row="4" Margin="2" x:Name="wpBoxNewPassword" TextChanged="wpBoxOldPassword_TextChanged"/>
|
|
||||||
<xctk:WatermarkPasswordBox Watermark="{x:Static p:Resources.textRepeatNewPassword}" Grid.Column="1" Grid.Row="5" Margin="2" x:Name="wpBoxNewPasswordRepeat" TextChanged="wpBoxOldPassword_TextChanged"/>
|
|
||||||
<Button x:Name="buttonChangePassword" Click="buttonChangePassword_Click" Grid.Column="1" Grid.Row="6" Margin="2" Content="{x:Static p:Resources.textChange}" Width="80" HorizontalAlignment="Left" IsEnabled="False" />
|
|
||||||
|
|
||||||
<Button x:Name="buttonClose" Click="buttonClose_Click" Content="{x:Static p:Resources.textClose}" Width="80" Margin="2" Grid.Column="1" Grid.Row="8" HorizontalAlignment="Right" />
|
<xctk:WatermarkPasswordBox Watermark="{x:Static p:Resources.textOldPassword}" Grid.Column="1" Grid.Row="7" Margin="2" x:Name="wpBoxOldPassword" TextChanged="wpBoxOldPassword_TextChanged"/>
|
||||||
|
<xctk:WatermarkPasswordBox Watermark="{x:Static p:Resources.textNewPassword}" Grid.Column="1" Grid.Row="8" Margin="2" x:Name="wpBoxNewPassword" TextChanged="wpBoxOldPassword_TextChanged"/>
|
||||||
|
<xctk:WatermarkPasswordBox Watermark="{x:Static p:Resources.textRepeatNewPassword}" Grid.Column="1" Grid.Row="9" Margin="2" x:Name="wpBoxNewPasswordRepeat" TextChanged="wpBoxOldPassword_TextChanged"/>
|
||||||
|
<Button x:Name="buttonChangePassword" Click="buttonChangePassword_Click" Grid.Column="1" Grid.Row="10" Margin="2" Content="{x:Static p:Resources.textChange}" Width="80" HorizontalAlignment="Left" IsEnabled="False" />
|
||||||
|
|
||||||
|
<Button x:Name="buttonClose" Click="buttonClose_Click" Content="{x:Static p:Resources.textClose}" Width="80" Margin="2" Grid.Column="1" Grid.Row="12" HorizontalAlignment="Right" />
|
||||||
|
|
||||||
</Grid>
|
</Grid>
|
||||||
</Window>
|
</Window>
|
||||||
|
|||||||
@ -2,6 +2,7 @@
|
|||||||
// Description: Show about info and allow user detail editing
|
// Description: Show about info and allow user detail editing
|
||||||
//
|
//
|
||||||
|
|
||||||
|
using BreCalClient.misc.Model;
|
||||||
using System;
|
using System;
|
||||||
using System.Diagnostics;
|
using System.Diagnostics;
|
||||||
using System.Windows;
|
using System.Windows;
|
||||||
@ -24,6 +25,12 @@ namespace BreCalClient
|
|||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
|
#region Properties
|
||||||
|
|
||||||
|
public LoginResult? LoginResult { get; set; }
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
#region events
|
#region events
|
||||||
|
|
||||||
public event Action<string, string>? ChangePasswordRequested;
|
public event Action<string, string>? ChangePasswordRequested;
|
||||||
@ -39,6 +46,12 @@ namespace BreCalClient
|
|||||||
|
|
||||||
private void buttonChangePassword_Click(object sender, RoutedEventArgs e)
|
private void buttonChangePassword_Click(object sender, RoutedEventArgs e)
|
||||||
{
|
{
|
||||||
|
if (this.LoginResult != null)
|
||||||
|
{
|
||||||
|
this.LoginResult.UserPhone = this.textBoxUserPhone.Text.Trim();
|
||||||
|
this.LoginResult.UserEmail = this.textBoxUserEmail.Text.Trim();
|
||||||
|
}
|
||||||
|
|
||||||
this.ChangePasswordRequested?.Invoke(this.wpBoxOldPassword.Password, this.wpBoxNewPassword.Password);
|
this.ChangePasswordRequested?.Invoke(this.wpBoxOldPassword.Password, this.wpBoxNewPassword.Password);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -58,7 +71,15 @@ namespace BreCalClient
|
|||||||
(!this.wpBoxNewPassword.Password.Equals(this.wpBoxOldPassword.Password));
|
(!this.wpBoxNewPassword.Password.Equals(this.wpBoxOldPassword.Password));
|
||||||
}
|
}
|
||||||
|
|
||||||
#endregion
|
private void Window_Loaded(object sender, RoutedEventArgs e)
|
||||||
|
{
|
||||||
|
if(LoginResult != null)
|
||||||
|
{
|
||||||
|
this.textBoxUserEmail.Text = LoginResult.UserEmail;
|
||||||
|
this.textBoxUserPhone.Text = LoginResult.UserPhone;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -192,6 +192,7 @@ namespace BreCalClient
|
|||||||
private void buttonInfo_Click(object sender, RoutedEventArgs e)
|
private void buttonInfo_Click(object sender, RoutedEventArgs e)
|
||||||
{
|
{
|
||||||
AboutDialog ad = new();
|
AboutDialog ad = new();
|
||||||
|
ad.LoginResult = this._loginResult;
|
||||||
ad.ChangePasswordRequested += async (oldPw, newPw) =>
|
ad.ChangePasswordRequested += async (oldPw, newPw) =>
|
||||||
{
|
{
|
||||||
if (_loginResult != null)
|
if (_loginResult != null)
|
||||||
@ -202,6 +203,7 @@ namespace BreCalClient
|
|||||||
FirstName = _loginResult.FirstName,
|
FirstName = _loginResult.FirstName,
|
||||||
LastName = _loginResult.LastName,
|
LastName = _loginResult.LastName,
|
||||||
UserPhone = _loginResult.UserPhone,
|
UserPhone = _loginResult.UserPhone,
|
||||||
|
UserEmail = _loginResult.UserEmail,
|
||||||
OldPassword = oldPw,
|
OldPassword = oldPw,
|
||||||
NewPassword = newPw
|
NewPassword = newPw
|
||||||
};
|
};
|
||||||
|
|||||||
27
src/BreCalClient/Resources/Resources.Designer.cs
generated
27
src/BreCalClient/Resources/Resources.Designer.cs
generated
@ -346,6 +346,15 @@ namespace BreCalClient.Resources {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Looks up a localized string similar to Update contact info.
|
||||||
|
/// </summary>
|
||||||
|
public static string textChangeContactInfo {
|
||||||
|
get {
|
||||||
|
return ResourceManager.GetString("textChangeContactInfo", resourceCulture);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Looks up a localized string similar to Change password.
|
/// Looks up a localized string similar to Change password.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@ -436,6 +445,15 @@ namespace BreCalClient.Resources {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Looks up a localized string similar to E-mail.
|
||||||
|
/// </summary>
|
||||||
|
public static string textEmail {
|
||||||
|
get {
|
||||||
|
return ResourceManager.GetString("textEmail", resourceCulture);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Looks up a localized string similar to Enter keyword.
|
/// Looks up a localized string similar to Enter keyword.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@ -661,6 +679,15 @@ namespace BreCalClient.Resources {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Looks up a localized string similar to Phone.
|
||||||
|
/// </summary>
|
||||||
|
public static string textPhone {
|
||||||
|
get {
|
||||||
|
return ResourceManager.GetString("textPhone", resourceCulture);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Looks up a localized string similar to Pier side.
|
/// Looks up a localized string similar to Pier side.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|||||||
@ -406,4 +406,13 @@
|
|||||||
<data name="textWidth" xml:space="preserve">
|
<data name="textWidth" xml:space="preserve">
|
||||||
<value>Breite</value>
|
<value>Breite</value>
|
||||||
</data>
|
</data>
|
||||||
|
<data name="textChangeContactInfo" xml:space="preserve">
|
||||||
|
<value>Kontaktdaten bearbeiten</value>
|
||||||
|
</data>
|
||||||
|
<data name="textEmail" xml:space="preserve">
|
||||||
|
<value>E-Mail</value>
|
||||||
|
</data>
|
||||||
|
<data name="textPhone" xml:space="preserve">
|
||||||
|
<value>Telefon</value>
|
||||||
|
</data>
|
||||||
</root>
|
</root>
|
||||||
@ -208,6 +208,9 @@
|
|||||||
<data name="textChange" xml:space="preserve">
|
<data name="textChange" xml:space="preserve">
|
||||||
<value>Change</value>
|
<value>Change</value>
|
||||||
</data>
|
</data>
|
||||||
|
<data name="textChangeContactInfo" xml:space="preserve">
|
||||||
|
<value>Update contact info</value>
|
||||||
|
</data>
|
||||||
<data name="textChangePassword" xml:space="preserve">
|
<data name="textChangePassword" xml:space="preserve">
|
||||||
<value>Change password</value>
|
<value>Change password</value>
|
||||||
</data>
|
</data>
|
||||||
@ -238,6 +241,9 @@
|
|||||||
<data name="textEditTimes" xml:space="preserve">
|
<data name="textEditTimes" xml:space="preserve">
|
||||||
<value>Edit times</value>
|
<value>Edit times</value>
|
||||||
</data>
|
</data>
|
||||||
|
<data name="textEmail" xml:space="preserve">
|
||||||
|
<value>E-mail</value>
|
||||||
|
</data>
|
||||||
<data name="textEnterKeyword" xml:space="preserve">
|
<data name="textEnterKeyword" xml:space="preserve">
|
||||||
<value>Enter keyword</value>
|
<value>Enter keyword</value>
|
||||||
</data>
|
</data>
|
||||||
@ -313,6 +319,9 @@
|
|||||||
<data name="textPasswordChanged" xml:space="preserve">
|
<data name="textPasswordChanged" xml:space="preserve">
|
||||||
<value>Password changed.</value>
|
<value>Password changed.</value>
|
||||||
</data>
|
</data>
|
||||||
|
<data name="textPhone" xml:space="preserve">
|
||||||
|
<value>Phone</value>
|
||||||
|
</data>
|
||||||
<data name="textPierside" xml:space="preserve">
|
<data name="textPierside" xml:space="preserve">
|
||||||
<value>Pier side</value>
|
<value>Pier side</value>
|
||||||
</data>
|
</data>
|
||||||
|
|||||||
@ -26,7 +26,8 @@ def GetUser(options):
|
|||||||
"first_name": data[0].first_name,
|
"first_name": data[0].first_name,
|
||||||
"last_name": data[0].last_name,
|
"last_name": data[0].last_name,
|
||||||
"user_name": data[0].user_name,
|
"user_name": data[0].user_name,
|
||||||
"user_phone": data[0].user_phone
|
"user_phone": data[0].user_phone,
|
||||||
|
"user_email": data[0].user_email
|
||||||
}
|
}
|
||||||
token = jwt_handler.generate_jwt(payload=result, lifetime=120) # generate token valid 60 mins
|
token = jwt_handler.generate_jwt(payload=result, lifetime=120) # generate token valid 60 mins
|
||||||
result["token"] = token # add token to user data
|
result["token"] = token # add token to user data
|
||||||
|
|||||||
@ -27,7 +27,7 @@ def PutUser(schemaModel):
|
|||||||
return json.dumps("no such record"), 404, {'Content-Type': 'application/json; charset=utf-8'}
|
return json.dumps("no such record"), 404, {'Content-Type': 'application/json; charset=utf-8'}
|
||||||
|
|
||||||
# see if we need to update public fields
|
# see if we need to update public fields
|
||||||
if "first_name" in schemaModel or "last_name" in schemaModel or "user_phone" in schemaModel:
|
if "first_name" in schemaModel or "last_name" in schemaModel or "user_phone" in schemaModel or "user_email" in schemaModel:
|
||||||
query = "UPDATE user SET "
|
query = "UPDATE user SET "
|
||||||
isNotFirst = False
|
isNotFirst = False
|
||||||
for key in schemaModel.keys():
|
for key in schemaModel.keys():
|
||||||
|
|||||||
@ -180,6 +180,7 @@ class UserSchema(Schema):
|
|||||||
first_name = fields.Str(Required=False, allow_none=True)
|
first_name = fields.Str(Required=False, allow_none=True)
|
||||||
last_name = fields.Str(required=False, allow_none=True)
|
last_name = fields.Str(required=False, allow_none=True)
|
||||||
user_phone = fields.Str(required=False, allow_none=True)
|
user_phone = fields.Str(required=False, allow_none=True)
|
||||||
|
user_email = fields.Str(required=False, allow_none=True)
|
||||||
old_password = fields.Str(required=False, allow_none=True)
|
old_password = fields.Str(required=False, allow_none=True)
|
||||||
new_password = fields.Str(required=False, allow_none=True)
|
new_password = fields.Str(required=False, allow_none=True)
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user