Changeset 7982


Ignore:
Timestamp:
06/11/12 14:29:26 (7 years ago)
Author:
ascheibe
Message:

#1648

  • always update the client information
  • allow a normal user to change the FullName and E-Mail
Location:
branches/ClientUserManagement
Files:
10 edited

Legend:

Unmodified
Added
Removed
  • branches/ClientUserManagement/HeuristicLab.Clients.Access.Views/3.3/UserViews/LightweightUserInformationView.Designer.cs

    r7942 r7982  
    3333      this.userNameTextBox = new System.Windows.Forms.TextBox();
    3434      this.splitContainer = new System.Windows.Forms.SplitContainer();
     35      this.rolesListView = new System.Windows.Forms.ListView();
     36      this.columnHeader = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader()));
     37      this.imageList = new System.Windows.Forms.ImageList(this.components);
    3538      this.groupsListView = new System.Windows.Forms.ListView();
    36       this.rolesListView = new System.Windows.Forms.ListView();
    37       this.imageList = new System.Windows.Forms.ImageList(this.components);
    38       this.columnHeader = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader()));
    3939      this.groupsColumnHeader = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader()));
     40      this.label5 = new System.Windows.Forms.Label();
     41      this.emailTextBox = new System.Windows.Forms.TextBox();
    4042      ((System.ComponentModel.ISupportInitialize)(this.splitContainer)).BeginInit();
    4143      this.splitContainer.Panel1.SuspendLayout();
     
    4749      //
    4850      this.changePasswordButton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
    49       this.changePasswordButton.Location = new System.Drawing.Point(316, 209);
     51      this.changePasswordButton.Location = new System.Drawing.Point(316, 231);
    5052      this.changePasswordButton.Name = "changePasswordButton";
    5153      this.changePasswordButton.Size = new System.Drawing.Size(112, 23);
     
    7274      this.fullNameTextBox.Size = new System.Drawing.Size(359, 20);
    7375      this.fullNameTextBox.TabIndex = 16;
     76      this.fullNameTextBox.TextChanged += new System.EventHandler(this.fullNameTextBox_TextChanged);
    7477      //
    7578      // label4
     
    106109      this.userNameTextBox.Location = new System.Drawing.Point(69, 3);
    107110      this.userNameTextBox.Name = "userNameTextBox";
     111      this.userNameTextBox.ReadOnly = true;
    108112      this.userNameTextBox.Size = new System.Drawing.Size(359, 20);
    109113      this.userNameTextBox.TabIndex = 15;
     
    114118                  | System.Windows.Forms.AnchorStyles.Left)
    115119                  | System.Windows.Forms.AnchorStyles.Right)));
    116       this.splitContainer.Location = new System.Drawing.Point(3, 55);
     120      this.splitContainer.Location = new System.Drawing.Point(3, 81);
    117121      this.splitContainer.Name = "splitContainer";
    118122      //
     
    126130      this.splitContainer.Panel2.Controls.Add(this.groupsListView);
    127131      this.splitContainer.Panel2.Controls.Add(this.label4);
    128       this.splitContainer.Size = new System.Drawing.Size(425, 148);
     132      this.splitContainer.Size = new System.Drawing.Size(425, 144);
    129133      this.splitContainer.SplitterDistance = 211;
    130134      this.splitContainer.TabIndex = 20;
     135      //
     136      // rolesListView
     137      //
     138      this.rolesListView.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
     139                  | System.Windows.Forms.AnchorStyles.Left)
     140                  | System.Windows.Forms.AnchorStyles.Right)));
     141      this.rolesListView.Columns.AddRange(new System.Windows.Forms.ColumnHeader[] {
     142            this.columnHeader});
     143      this.rolesListView.HeaderStyle = System.Windows.Forms.ColumnHeaderStyle.None;
     144      this.rolesListView.HideSelection = false;
     145      this.rolesListView.Location = new System.Drawing.Point(3, 16);
     146      this.rolesListView.Name = "rolesListView";
     147      this.rolesListView.Size = new System.Drawing.Size(205, 125);
     148      this.rolesListView.SmallImageList = this.imageList;
     149      this.rolesListView.TabIndex = 18;
     150      this.rolesListView.UseCompatibleStateImageBehavior = false;
     151      this.rolesListView.View = System.Windows.Forms.View.Details;
     152      //
     153      // columnHeader
     154      //
     155      this.columnHeader.Width = 100;
     156      //
     157      // imageList
     158      //
     159      this.imageList.ColorDepth = System.Windows.Forms.ColorDepth.Depth8Bit;
     160      this.imageList.ImageSize = new System.Drawing.Size(16, 16);
     161      this.imageList.TransparentColor = System.Drawing.Color.Transparent;
    131162      //
    132163      // groupsListView
     
    141172      this.groupsListView.Location = new System.Drawing.Point(3, 16);
    142173      this.groupsListView.Name = "groupsListView";
    143       this.groupsListView.Size = new System.Drawing.Size(204, 129);
     174      this.groupsListView.Size = new System.Drawing.Size(204, 125);
    144175      this.groupsListView.SmallImageList = this.imageList;
    145176      this.groupsListView.TabIndex = 19;
     
    147178      this.groupsListView.View = System.Windows.Forms.View.Details;
    148179      //
    149       // rolesListView
    150       //
    151       this.rolesListView.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
    152                   | System.Windows.Forms.AnchorStyles.Left)
    153                   | System.Windows.Forms.AnchorStyles.Right)));
    154       this.rolesListView.Columns.AddRange(new System.Windows.Forms.ColumnHeader[] {
    155             this.columnHeader});
    156       this.rolesListView.HeaderStyle = System.Windows.Forms.ColumnHeaderStyle.None;
    157       this.rolesListView.HideSelection = false;
    158       this.rolesListView.Location = new System.Drawing.Point(3, 16);
    159       this.rolesListView.Name = "rolesListView";
    160       this.rolesListView.Size = new System.Drawing.Size(205, 129);
    161       this.rolesListView.SmallImageList = this.imageList;
    162       this.rolesListView.TabIndex = 18;
    163       this.rolesListView.UseCompatibleStateImageBehavior = false;
    164       this.rolesListView.View = System.Windows.Forms.View.Details;
    165       //
    166       // imageList
    167       //
    168       this.imageList.ColorDepth = System.Windows.Forms.ColorDepth.Depth8Bit;
    169       this.imageList.ImageSize = new System.Drawing.Size(16, 16);
    170       this.imageList.TransparentColor = System.Drawing.Color.Transparent;
    171       //
    172       // columnHeader
    173       //
    174       this.columnHeader.Width = 100;
    175       //
    176180      // groupsColumnHeader
    177181      //
    178182      this.groupsColumnHeader.Width = 100;
     183      //
     184      // label5
     185      //
     186      this.label5.AutoSize = true;
     187      this.label5.Location = new System.Drawing.Point(0, 58);
     188      this.label5.Name = "label5";
     189      this.label5.Size = new System.Drawing.Size(39, 13);
     190      this.label5.TabIndex = 21;
     191      this.label5.Text = "E-Mail:";
     192      //
     193      // emailTextBox
     194      //
     195      this.emailTextBox.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
     196                  | System.Windows.Forms.AnchorStyles.Right)));
     197      this.emailTextBox.Location = new System.Drawing.Point(69, 55);
     198      this.emailTextBox.Name = "emailTextBox";
     199      this.emailTextBox.Size = new System.Drawing.Size(359, 20);
     200      this.emailTextBox.TabIndex = 22;
     201      this.emailTextBox.TextChanged += new System.EventHandler(this.emailTextBox_TextChanged);
    179202      //
    180203      // LightweightUserInformationView
     
    182205      this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
    183206      this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
     207      this.Controls.Add(this.emailTextBox);
     208      this.Controls.Add(this.label5);
    184209      this.Controls.Add(this.splitContainer);
    185210      this.Controls.Add(this.changePasswordButton);
     
    189214      this.Controls.Add(this.userNameTextBox);
    190215      this.Name = "LightweightUserInformationView";
    191       this.Size = new System.Drawing.Size(431, 235);
     216      this.Size = new System.Drawing.Size(431, 257);
    192217      this.splitContainer.Panel1.ResumeLayout(false);
    193218      this.splitContainer.Panel1.PerformLayout();
     
    216241    private System.Windows.Forms.ColumnHeader columnHeader;
    217242    private System.Windows.Forms.ColumnHeader groupsColumnHeader;
     243    private System.Windows.Forms.Label label5;
     244    private System.Windows.Forms.TextBox emailTextBox;
    218245  }
    219246}
  • branches/ClientUserManagement/HeuristicLab.Clients.Access.Views/3.3/UserViews/LightweightUserInformationView.cs

    r7942 r7982  
    2020#endregion
    2121
     22using System;
    2223using System.Windows.Forms;
    2324using HeuristicLab.MainForm;
     
    4748        userNameTextBox.Clear();
    4849        fullNameTextBox.Clear();
     50        emailTextBox.Clear();
    4951      } else {
    5052        userNameTextBox.Text = Content.UserName;
    5153        fullNameTextBox.Text = Content.FullName;
     54        emailTextBox.Text = Content.EMail;
    5255
    5356        foreach (Role r in Content.Roles)
     
    8992      return listViewItem;
    9093    }
     94
     95    private void fullNameTextBox_TextChanged(object sender, System.EventArgs e) {
     96      if (UserInformation.Instance.User.FullName != fullNameTextBox.Text) {
     97        UserInformation.Instance.User.FullName = fullNameTextBox.Text;
     98        OnUserInformationChanged();
     99      }
     100    }
     101
     102    private void emailTextBox_TextChanged(object sender, System.EventArgs e) {
     103      if (UserInformation.Instance.User.EMail != emailTextBox.Text) {
     104        UserInformation.Instance.User.EMail = emailTextBox.Text;
     105        OnUserInformationChanged();
     106      }
     107    }
     108
     109    #region Events
     110    public event EventHandler UserInformationChanged;
     111    private void OnUserInformationChanged() {
     112      EventHandler handler = UserInformationChanged;
     113      if (handler != null) handler(this, EventArgs.Empty);
     114    }
     115    #endregion
    91116  }
    92117}
  • branches/ClientUserManagement/HeuristicLab.Clients.Access.Views/3.3/UserViews/RefreshableLightweightUserInformationView.Designer.cs

    r7611 r7982  
    1 namespace HeuristicLab.Clients.Access.Views {
     1using System;
     2namespace HeuristicLab.Clients.Access.Views {
    23  partial class RefreshableLightweightUserInformationView {
    34    /// <summary>
     
    1213    protected override void Dispose(bool disposing) {
    1314      if (disposing && (components != null)) {
     15        lightweightUserInformationView.UserInformationChanged -= new EventHandler(lightweightUserInformationView_Changed);
    1416        components.Dispose();
    1517      }
     
    2426    /// </summary>
    2527    private void InitializeComponent() {
     28      System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(RefreshableLightweightUserInformationView));
    2629      this.lightweightUserInformationView = new HeuristicLab.Clients.Access.Views.LightweightUserInformationView();
     30      this.storeButton = new System.Windows.Forms.Button();
    2731      this.SuspendLayout();
    2832      //
     
    4448      this.lightweightUserInformationView.TabIndex = 2;
    4549      //
     50      // storeButton
     51      //
     52      this.storeButton.Enabled = false;
     53      this.storeButton.Image = HeuristicLab.Common.Resources.VSImageLibrary.PublishToWeb;
     54      this.storeButton.Location = new System.Drawing.Point(34, 3);
     55      this.storeButton.Name = "storeButton";
     56      this.storeButton.Size = new System.Drawing.Size(24, 24);
     57      this.storeButton.TabIndex = 3;
     58      this.storeButton.UseVisualStyleBackColor = true;
     59      this.storeButton.Click += new System.EventHandler(this.storeButton_Click);
     60      //
    4661      // RefreshableLightweightUserInformationView
    4762      //
     
    4964      this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
    5065      this.Controls.Add(this.lightweightUserInformationView);
     66      this.Controls.Add(this.storeButton);
    5167      this.Name = "RefreshableLightweightUserInformationView";
    5268      this.Size = new System.Drawing.Size(384, 281);
     69      this.Controls.SetChildIndex(this.storeButton, 0);
    5370      this.Controls.SetChildIndex(this.lightweightUserInformationView, 0);
    5471      this.Controls.SetChildIndex(this.refreshButton, 0);
     
    6077
    6178    private LightweightUserInformationView lightweightUserInformationView;
     79    private System.Windows.Forms.Button storeButton;
    6280
    6381  }
  • branches/ClientUserManagement/HeuristicLab.Clients.Access.Views/3.3/UserViews/RefreshableLightweightUserInformationView.cs

    r7635 r7982  
    3232    private void RefreshUserData() {
    3333      UserInformation.Instance.Refresh();
     34      lightweightUserInformationView.UserInformationChanged += new EventHandler(lightweightUserInformationView_Changed);
     35    }
     36
     37    void lightweightUserInformationView_Changed(object sender, EventArgs e) {
     38      if (!storeButton.Enabled) storeButton.Enabled = true;
    3439    }
    3540
     
    4449        base.Content_Refreshing(sender, e);
    4550        lightweightUserInformationView.Enabled = false;
     51        storeButton.Enabled = false;
    4652      }
    4753    }
     
    6167      }
    6268    }
     69
     70    private void storeButton_Click(object sender, EventArgs e) {
     71      AccessClient.Instance.ExecuteActionAsync(new Action(delegate {
     72        AccessClient.CallAccessService(x => x.UpdateLightweightUser(UserInformation.Instance.User));
     73      }), HeuristicLab.PluginInfrastructure.ErrorHandling.ShowErrorDialog);
     74    }
    6375  }
    6476}
  • branches/ClientUserManagement/HeuristicLab.Clients.Access/3.3/ClientInformation.cs

    r7945 r7982  
    7878        if (clientInfo != null) {
    7979          clientExists = true;
    80           if (clientInfo.HeuristicLabVersion != ClientInformationUtils.GetHLVersion()) {
    81             clientInfo.HeuristicLabVersion = ClientInformationUtils.GetHLVersion();
    82             AccessClient.CallAccessService(x => x.UpdateClient(clientInfo));
    83           }
     80          clientInfo.HeuristicLabVersion = ClientInformationUtils.GetHLVersion();
     81          AccessClient.CallAccessService(x => x.UpdateClient(clientInfo));
    8482        }
    8583        errorOccured = false;
  • branches/ClientUserManagement/HeuristicLab.Clients.Access/3.3/ServiceClients/AccessServiceClient.cs

    r7639 r7982  
    22// <auto-generated>
    33//     This code was generated by a tool.
    4 //     Runtime Version:4.0.30319.530
     4//     Runtime Version:4.0.30319.544
    55//
    66//     Changes to this file may cause incorrect behavior and will be lost if
     
    2828  [System.Runtime.Serialization.KnownTypeAttribute(typeof(HeuristicLab.Clients.Access.ClientLog))]
    2929  [System.Runtime.Serialization.KnownTypeAttribute(typeof(HeuristicLab.Clients.Access.UserGroupBase))]
     30  [System.Runtime.Serialization.KnownTypeAttribute(typeof(HeuristicLab.Clients.Access.User))]
     31  [System.Runtime.Serialization.KnownTypeAttribute(typeof(HeuristicLab.Clients.Access.UserGroup))]
    3032  [System.Runtime.Serialization.KnownTypeAttribute(typeof(HeuristicLab.Clients.Access.LightweightUser))]
    31   [System.Runtime.Serialization.KnownTypeAttribute(typeof(HeuristicLab.Clients.Access.UserGroup))]
    32   [System.Runtime.Serialization.KnownTypeAttribute(typeof(HeuristicLab.Clients.Access.User))]
    3333  public partial class AccessItem : object, System.Runtime.Serialization.IExtensibleDataObject, System.ComponentModel.INotifyPropertyChanged {
    3434
     
    663663      "")]
    664664  [System.SerializableAttribute()]
     665  [System.Runtime.Serialization.KnownTypeAttribute(typeof(HeuristicLab.Clients.Access.User))]
     666  [System.Runtime.Serialization.KnownTypeAttribute(typeof(HeuristicLab.Clients.Access.UserGroup))]
    665667  [System.Runtime.Serialization.KnownTypeAttribute(typeof(HeuristicLab.Clients.Access.LightweightUser))]
    666   [System.Runtime.Serialization.KnownTypeAttribute(typeof(HeuristicLab.Clients.Access.UserGroup))]
    667   [System.Runtime.Serialization.KnownTypeAttribute(typeof(HeuristicLab.Clients.Access.User))]
    668668  public partial class UserGroupBase : HeuristicLab.Clients.Access.AccessItem {
    669669
     
    687687  [System.Diagnostics.DebuggerStepThroughAttribute()]
    688688  [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Runtime.Serialization", "4.0.0.0")]
    689   [System.Runtime.Serialization.DataContractAttribute(Name = "LightweightUser", Namespace = "http://schemas.datacontract.org/2004/07/HeuristicLab.Services.Access.DataTransfer" +
    690       "")]
    691   [System.SerializableAttribute()]
    692   public partial class LightweightUser : HeuristicLab.Clients.Access.UserGroupBase {
     689  [System.Runtime.Serialization.DataContractAttribute(Name = "User", Namespace = "http://schemas.datacontract.org/2004/07/HeuristicLab.Services.Access.DataTransfer" +
     690      "")]
     691  [System.SerializableAttribute()]
     692  public partial class User : HeuristicLab.Clients.Access.UserGroupBase {
     693
     694    [System.Runtime.Serialization.OptionalFieldAttribute()]
     695    private string CommentField;
     696
     697    [System.Runtime.Serialization.OptionalFieldAttribute()]
     698    private System.DateTime CreationDateField;
     699
     700    [System.Runtime.Serialization.OptionalFieldAttribute()]
     701    private string EmailField;
    693702
    694703    [System.Runtime.Serialization.OptionalFieldAttribute()]
     
    696705
    697706    [System.Runtime.Serialization.OptionalFieldAttribute()]
    698     private System.Collections.Generic.List<HeuristicLab.Clients.Access.UserGroup> GroupsField;
    699 
    700     [System.Runtime.Serialization.OptionalFieldAttribute()]
    701     private System.Collections.Generic.List<HeuristicLab.Clients.Access.Role> RolesField;
     707    private bool IsApprovedField;
     708
     709    [System.Runtime.Serialization.OptionalFieldAttribute()]
     710    private System.DateTime LastActivityDateField;
     711
     712    [System.Runtime.Serialization.OptionalFieldAttribute()]
     713    private System.DateTime LastLoginDateField;
     714
     715    [System.Runtime.Serialization.OptionalFieldAttribute()]
     716    private System.DateTime LastPasswordChangedDateField;
    702717
    703718    [System.Runtime.Serialization.OptionalFieldAttribute()]
    704719    private string UserNameField;
     720
     721    [System.Runtime.Serialization.DataMemberAttribute()]
     722    public string Comment {
     723      get {
     724        return this.CommentField;
     725      }
     726      set {
     727        if ((object.ReferenceEquals(this.CommentField, value) != true)) {
     728          this.CommentField = value;
     729          this.RaisePropertyChanged("Comment");
     730        }
     731      }
     732    }
     733
     734    [System.Runtime.Serialization.DataMemberAttribute()]
     735    public System.DateTime CreationDate {
     736      get {
     737        return this.CreationDateField;
     738      }
     739      set {
     740        if ((this.CreationDateField.Equals(value) != true)) {
     741          this.CreationDateField = value;
     742          this.RaisePropertyChanged("CreationDate");
     743        }
     744      }
     745    }
     746
     747    [System.Runtime.Serialization.DataMemberAttribute()]
     748    public string Email {
     749      get {
     750        return this.EmailField;
     751      }
     752      set {
     753        if ((object.ReferenceEquals(this.EmailField, value) != true)) {
     754          this.EmailField = value;
     755          this.RaisePropertyChanged("Email");
     756        }
     757      }
     758    }
    705759
    706760    [System.Runtime.Serialization.DataMemberAttribute()]
     
    718772
    719773    [System.Runtime.Serialization.DataMemberAttribute()]
     774    public bool IsApproved {
     775      get {
     776        return this.IsApprovedField;
     777      }
     778      set {
     779        if ((this.IsApprovedField.Equals(value) != true)) {
     780          this.IsApprovedField = value;
     781          this.RaisePropertyChanged("IsApproved");
     782        }
     783      }
     784    }
     785
     786    [System.Runtime.Serialization.DataMemberAttribute()]
     787    public System.DateTime LastActivityDate {
     788      get {
     789        return this.LastActivityDateField;
     790      }
     791      set {
     792        if ((this.LastActivityDateField.Equals(value) != true)) {
     793          this.LastActivityDateField = value;
     794          this.RaisePropertyChanged("LastActivityDate");
     795        }
     796      }
     797    }
     798
     799    [System.Runtime.Serialization.DataMemberAttribute()]
     800    public System.DateTime LastLoginDate {
     801      get {
     802        return this.LastLoginDateField;
     803      }
     804      set {
     805        if ((this.LastLoginDateField.Equals(value) != true)) {
     806          this.LastLoginDateField = value;
     807          this.RaisePropertyChanged("LastLoginDate");
     808        }
     809      }
     810    }
     811
     812    [System.Runtime.Serialization.DataMemberAttribute()]
     813    public System.DateTime LastPasswordChangedDate {
     814      get {
     815        return this.LastPasswordChangedDateField;
     816      }
     817      set {
     818        if ((this.LastPasswordChangedDateField.Equals(value) != true)) {
     819          this.LastPasswordChangedDateField = value;
     820          this.RaisePropertyChanged("LastPasswordChangedDate");
     821        }
     822      }
     823    }
     824
     825    [System.Runtime.Serialization.DataMemberAttribute()]
     826    public string UserName {
     827      get {
     828        return this.UserNameField;
     829      }
     830      set {
     831        if ((object.ReferenceEquals(this.UserNameField, value) != true)) {
     832          this.UserNameField = value;
     833          this.RaisePropertyChanged("UserName");
     834        }
     835      }
     836    }
     837  }
     838
     839  [System.Diagnostics.DebuggerStepThroughAttribute()]
     840  [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Runtime.Serialization", "4.0.0.0")]
     841  [System.Runtime.Serialization.DataContractAttribute(Name = "UserGroup", Namespace = "http://schemas.datacontract.org/2004/07/HeuristicLab.Services.Access.DataTransfer" +
     842      "")]
     843  [System.SerializableAttribute()]
     844  public partial class UserGroup : HeuristicLab.Clients.Access.UserGroupBase {
     845
     846    [System.Runtime.Serialization.OptionalFieldAttribute()]
     847    private string NameField;
     848
     849    [System.Runtime.Serialization.DataMemberAttribute()]
     850    public string Name {
     851      get {
     852        return this.NameField;
     853      }
     854      set {
     855        if ((object.ReferenceEquals(this.NameField, value) != true)) {
     856          this.NameField = value;
     857          this.RaisePropertyChanged("Name");
     858        }
     859      }
     860    }
     861  }
     862
     863  [System.Diagnostics.DebuggerStepThroughAttribute()]
     864  [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Runtime.Serialization", "4.0.0.0")]
     865  [System.Runtime.Serialization.DataContractAttribute(Name = "LightweightUser", Namespace = "http://schemas.datacontract.org/2004/07/HeuristicLab.Services.Access.DataTransfer" +
     866      "")]
     867  [System.SerializableAttribute()]
     868  public partial class LightweightUser : HeuristicLab.Clients.Access.UserGroupBase {
     869
     870    [System.Runtime.Serialization.OptionalFieldAttribute()]
     871    private string EMailField;
     872
     873    [System.Runtime.Serialization.OptionalFieldAttribute()]
     874    private string FullNameField;
     875
     876    [System.Runtime.Serialization.OptionalFieldAttribute()]
     877    private System.Collections.Generic.List<HeuristicLab.Clients.Access.UserGroup> GroupsField;
     878
     879    [System.Runtime.Serialization.OptionalFieldAttribute()]
     880    private System.Collections.Generic.List<HeuristicLab.Clients.Access.Role> RolesField;
     881
     882    [System.Runtime.Serialization.OptionalFieldAttribute()]
     883    private string UserNameField;
     884
     885    [System.Runtime.Serialization.DataMemberAttribute()]
     886    public string EMail {
     887      get {
     888        return this.EMailField;
     889      }
     890      set {
     891        if ((object.ReferenceEquals(this.EMailField, value) != true)) {
     892          this.EMailField = value;
     893          this.RaisePropertyChanged("EMail");
     894        }
     895      }
     896    }
     897
     898    [System.Runtime.Serialization.DataMemberAttribute()]
     899    public string FullName {
     900      get {
     901        return this.FullNameField;
     902      }
     903      set {
     904        if ((object.ReferenceEquals(this.FullNameField, value) != true)) {
     905          this.FullNameField = value;
     906          this.RaisePropertyChanged("FullName");
     907        }
     908      }
     909    }
     910
     911    [System.Runtime.Serialization.DataMemberAttribute()]
    720912    public System.Collections.Generic.List<HeuristicLab.Clients.Access.UserGroup> Groups {
    721913      get {
     
    739931          this.RolesField = value;
    740932          this.RaisePropertyChanged("Roles");
    741         }
    742       }
    743     }
    744 
    745     [System.Runtime.Serialization.DataMemberAttribute()]
    746     public string UserName {
    747       get {
    748         return this.UserNameField;
    749       }
    750       set {
    751         if ((object.ReferenceEquals(this.UserNameField, value) != true)) {
    752           this.UserNameField = value;
    753           this.RaisePropertyChanged("UserName");
    754         }
    755       }
    756     }
    757   }
    758 
    759   [System.Diagnostics.DebuggerStepThroughAttribute()]
    760   [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Runtime.Serialization", "4.0.0.0")]
    761   [System.Runtime.Serialization.DataContractAttribute(Name = "UserGroup", Namespace = "http://schemas.datacontract.org/2004/07/HeuristicLab.Services.Access.DataTransfer" +
    762       "")]
    763   [System.SerializableAttribute()]
    764   public partial class UserGroup : HeuristicLab.Clients.Access.UserGroupBase {
    765 
    766     [System.Runtime.Serialization.OptionalFieldAttribute()]
    767     private string NameField;
    768 
    769     [System.Runtime.Serialization.DataMemberAttribute()]
    770     public string Name {
    771       get {
    772         return this.NameField;
    773       }
    774       set {
    775         if ((object.ReferenceEquals(this.NameField, value) != true)) {
    776           this.NameField = value;
    777           this.RaisePropertyChanged("Name");
    778         }
    779       }
    780     }
    781   }
    782 
    783   [System.Diagnostics.DebuggerStepThroughAttribute()]
    784   [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Runtime.Serialization", "4.0.0.0")]
    785   [System.Runtime.Serialization.DataContractAttribute(Name = "User", Namespace = "http://schemas.datacontract.org/2004/07/HeuristicLab.Services.Access.DataTransfer" +
    786       "")]
    787   [System.SerializableAttribute()]
    788   public partial class User : HeuristicLab.Clients.Access.UserGroupBase {
    789 
    790     [System.Runtime.Serialization.OptionalFieldAttribute()]
    791     private string CommentField;
    792 
    793     [System.Runtime.Serialization.OptionalFieldAttribute()]
    794     private System.DateTime CreationDateField;
    795 
    796     [System.Runtime.Serialization.OptionalFieldAttribute()]
    797     private string EmailField;
    798 
    799     [System.Runtime.Serialization.OptionalFieldAttribute()]
    800     private string FullNameField;
    801 
    802     [System.Runtime.Serialization.OptionalFieldAttribute()]
    803     private bool IsApprovedField;
    804 
    805     [System.Runtime.Serialization.OptionalFieldAttribute()]
    806     private System.DateTime LastActivityDateField;
    807 
    808     [System.Runtime.Serialization.OptionalFieldAttribute()]
    809     private System.DateTime LastLoginDateField;
    810 
    811     [System.Runtime.Serialization.OptionalFieldAttribute()]
    812     private System.DateTime LastPasswordChangedDateField;
    813 
    814     [System.Runtime.Serialization.OptionalFieldAttribute()]
    815     private string UserNameField;
    816 
    817     [System.Runtime.Serialization.DataMemberAttribute()]
    818     public string Comment {
    819       get {
    820         return this.CommentField;
    821       }
    822       set {
    823         if ((object.ReferenceEquals(this.CommentField, value) != true)) {
    824           this.CommentField = value;
    825           this.RaisePropertyChanged("Comment");
    826         }
    827       }
    828     }
    829 
    830     [System.Runtime.Serialization.DataMemberAttribute()]
    831     public System.DateTime CreationDate {
    832       get {
    833         return this.CreationDateField;
    834       }
    835       set {
    836         if ((this.CreationDateField.Equals(value) != true)) {
    837           this.CreationDateField = value;
    838           this.RaisePropertyChanged("CreationDate");
    839         }
    840       }
    841     }
    842 
    843     [System.Runtime.Serialization.DataMemberAttribute()]
    844     public string Email {
    845       get {
    846         return this.EmailField;
    847       }
    848       set {
    849         if ((object.ReferenceEquals(this.EmailField, value) != true)) {
    850           this.EmailField = value;
    851           this.RaisePropertyChanged("Email");
    852         }
    853       }
    854     }
    855 
    856     [System.Runtime.Serialization.DataMemberAttribute()]
    857     public string FullName {
    858       get {
    859         return this.FullNameField;
    860       }
    861       set {
    862         if ((object.ReferenceEquals(this.FullNameField, value) != true)) {
    863           this.FullNameField = value;
    864           this.RaisePropertyChanged("FullName");
    865         }
    866       }
    867     }
    868 
    869     [System.Runtime.Serialization.DataMemberAttribute()]
    870     public bool IsApproved {
    871       get {
    872         return this.IsApprovedField;
    873       }
    874       set {
    875         if ((this.IsApprovedField.Equals(value) != true)) {
    876           this.IsApprovedField = value;
    877           this.RaisePropertyChanged("IsApproved");
    878         }
    879       }
    880     }
    881 
    882     [System.Runtime.Serialization.DataMemberAttribute()]
    883     public System.DateTime LastActivityDate {
    884       get {
    885         return this.LastActivityDateField;
    886       }
    887       set {
    888         if ((this.LastActivityDateField.Equals(value) != true)) {
    889           this.LastActivityDateField = value;
    890           this.RaisePropertyChanged("LastActivityDate");
    891         }
    892       }
    893     }
    894 
    895     [System.Runtime.Serialization.DataMemberAttribute()]
    896     public System.DateTime LastLoginDate {
    897       get {
    898         return this.LastLoginDateField;
    899       }
    900       set {
    901         if ((this.LastLoginDateField.Equals(value) != true)) {
    902           this.LastLoginDateField = value;
    903           this.RaisePropertyChanged("LastLoginDate");
    904         }
    905       }
    906     }
    907 
    908     [System.Runtime.Serialization.DataMemberAttribute()]
    909     public System.DateTime LastPasswordChangedDate {
    910       get {
    911         return this.LastPasswordChangedDateField;
    912       }
    913       set {
    914         if ((this.LastPasswordChangedDateField.Equals(value) != true)) {
    915           this.LastPasswordChangedDateField = value;
    916           this.RaisePropertyChanged("LastPasswordChangedDate");
    917933        }
    918934      }
     
    10591075  public interface IAccessService {
    10601076
     1077    [System.ServiceModel.OperationContractAttribute(Action = "http://tempuri.org/IAccessService/AddUserGroupBaseToGroup", ReplyAction = "http://tempuri.org/IAccessService/AddUserGroupBaseToGroupResponse")]
     1078    void AddUserGroupBaseToGroup(HeuristicLab.Clients.Access.UserGroupBase resource, HeuristicLab.Clients.Access.UserGroup group);
     1079
    10611080    [System.ServiceModel.OperationContractAttribute(Action = "http://tempuri.org/IAccessService/RemoveUserGroupBaseFromGroup", ReplyAction = "http://tempuri.org/IAccessService/RemoveUserGroupBaseFromGroupResponse")]
    10621081    void RemoveUserGroupBaseFromGroup(HeuristicLab.Clients.Access.UserGroupBase resource, HeuristicLab.Clients.Access.UserGroup group);
     
    11851204    System.Collections.Generic.List<HeuristicLab.Clients.Access.LightweightUser> GetLightweightUsers(System.Collections.Generic.List<System.Guid> ids);
    11861205
     1206    [System.ServiceModel.OperationContractAttribute(Action = "http://tempuri.org/IAccessService/UpdateLightweightUser", ReplyAction = "http://tempuri.org/IAccessService/UpdateLightweightUserResponse")]
     1207    void UpdateLightweightUser(HeuristicLab.Clients.Access.LightweightUser user);
     1208
    11871209    [System.ServiceModel.OperationContractAttribute(Action = "http://tempuri.org/IAccessService/GetAllUsers", ReplyAction = "http://tempuri.org/IAccessService/GetAllUsersResponse")]
    11881210    System.Collections.Generic.List<HeuristicLab.Clients.Access.User> GetAllUsers();
     
    12291251    [System.ServiceModel.OperationContractAttribute(Action = "http://tempuri.org/IAccessService/DeleteUserGroup", ReplyAction = "http://tempuri.org/IAccessService/DeleteUserGroupResponse")]
    12301252    void DeleteUserGroup(HeuristicLab.Clients.Access.UserGroup group);
    1231 
    1232     [System.ServiceModel.OperationContractAttribute(Action = "http://tempuri.org/IAccessService/AddUserGroupBaseToGroup", ReplyAction = "http://tempuri.org/IAccessService/AddUserGroupBaseToGroupResponse")]
    1233     void AddUserGroupBaseToGroup(HeuristicLab.Clients.Access.UserGroupBase resource, HeuristicLab.Clients.Access.UserGroup group);
    12341253  }
    12351254
     
    12611280    }
    12621281
     1282    public void AddUserGroupBaseToGroup(HeuristicLab.Clients.Access.UserGroupBase resource, HeuristicLab.Clients.Access.UserGroup group) {
     1283      base.Channel.AddUserGroupBaseToGroup(resource, group);
     1284    }
     1285
    12631286    public void RemoveUserGroupBaseFromGroup(HeuristicLab.Clients.Access.UserGroupBase resource, HeuristicLab.Clients.Access.UserGroup group) {
    12641287      base.Channel.RemoveUserGroupBaseFromGroup(resource, group);
     
    14291452    }
    14301453
     1454    public void UpdateLightweightUser(HeuristicLab.Clients.Access.LightweightUser user) {
     1455      base.Channel.UpdateLightweightUser(user);
     1456    }
     1457
    14311458    public System.Collections.Generic.List<HeuristicLab.Clients.Access.User> GetAllUsers() {
    14321459      return base.Channel.GetAllUsers();
     
    14881515      base.Channel.DeleteUserGroup(group);
    14891516    }
    1490 
    1491     public void AddUserGroupBaseToGroup(HeuristicLab.Clients.Access.UserGroupBase resource, HeuristicLab.Clients.Access.UserGroup group) {
    1492       base.Channel.AddUserGroupBaseToGroup(resource, group);
    1493     }
    14941517  }
    14951518}
  • branches/ClientUserManagement/HeuristicLab.Services.Access/3.3/AccessService.cs

    r7946 r7982  
    398398    private DT.LightweightUser BuildLightweightUserDto(Guid userId) {
    399399      DA.aspnet_User aspUser = null;
     400      DA.aspnet_Membership aspMembership = null;
    400401      DA.User accessUser = null;
    401402      List<DA.aspnet_Role> roles = new List<DA.aspnet_Role>();
     
    407408                        where u.UserId == userId
    408409                        select u;
     410
     411        var memQuery = from u in context.aspnet_Memberships
     412                       where u.UserId == userId
     413                       select u;
     414        if (memQuery.Count() == 1) {
     415          aspMembership = memQuery.First();
     416        }
     417
    409418        if (userQuery.Count() == 1) {
    410419          aspUser = userQuery.First();
     
    416425      }
    417426
    418       if (aspUser != null) {
     427      if (aspUser != null || aspMembership != null) {
    419428        using (DA.AccessServiceDataContext context = new DA.AccessServiceDataContext()) {
    420429          var query = from u in context.UserGroupBases.OfType<DA.User>()
     
    439448      }
    440449
    441       if (aspUser == null || accessUser == null) {
     450      if (aspUser == null || accessUser == null || aspMembership == null) {
    442451        throw new Exception("User with id " + userId + " not found.");
    443452      } else {
    444         return Convert.ToDto(accessUser, aspUser, roles, groups);
     453        return Convert.ToDto(accessUser, aspUser, aspMembership, roles, groups);
    445454      }
    446455    }
     
    449458      Guid userId = UserManager.CurrentUserId;
    450459      return BuildLightweightUserDto(userId);
     460    }
     461
     462    public void UpdateLightweightUser(DT.LightweightUser user) {
     463      DT.User u = BuildUserDto(user.Id);
     464
     465      u.Email = user.EMail;
     466      u.FullName = user.FullName;
     467
     468      UpdateUser(u);
    451469    }
    452470
     
    611629
    612630    public void UpdateUser(DT.User user) {
    613       RoleVerifier.AuthenticateForAllRoles(AccessServiceRoles.Administrator);
     631      if (user.Id != UserManager.CurrentUserId) {
     632        RoleVerifier.AuthenticateForAllRoles(AccessServiceRoles.Administrator);
     633      }
    614634
    615635      MembershipUser membershipUser = Membership.GetUser((object)user.Id);
  • branches/ClientUserManagement/HeuristicLab.Services.Access/3.3/Convert.cs

    r7637 r7982  
    291291    #region User
    292292
    293     public static DT.LightweightUser ToDto(DA.User source, DA.aspnet_User aspUserSource, List<DA.aspnet_Role> roles, List<DA.UserGroup> groups) {
     293    public static DT.LightweightUser ToDto(DA.User source, DA.aspnet_User aspUserSource, DA.aspnet_Membership aspMembershipSource, List<DA.aspnet_Role> roles, List<DA.UserGroup> groups) {
    294294      return new DT.LightweightUser() {
    295295        Id = source.Id,
    296296        FullName = source.FullName,
    297297        UserName = aspUserSource.UserName,
     298        EMail = aspMembershipSource.Email,
    298299        //TODO: check if the roles and groups are include in source
    299300        Roles = roles.Select(x => Convert.ToDto(x)).ToArray(),
  • branches/ClientUserManagement/HeuristicLab.Services.Access/3.3/DataTransfer/LightweightUser.cs

    r7599 r7982  
    3131    public string FullName { get; set; }
    3232    [DataMember]
     33    public string EMail { get; set; }
     34    [DataMember]
    3335    public IEnumerable<DataTransfer.Role> Roles { get; set; }
    3436    [DataMember]
  • branches/ClientUserManagement/HeuristicLab.Services.Access/3.3/IAccessService.cs

    r7639 r7982  
    120120
    121121    [OperationContract]
     122    void UpdateLightweightUser(LightweightUser user);
     123
     124    [OperationContract]
    122125    IEnumerable<User> GetAllUsers();
    123126
Note: See TracChangeset for help on using the changeset viewer.