Changeset 7982
- Timestamp:
- 06/11/12 14:29:26 (12 years ago)
- Location:
- branches/ClientUserManagement
- Files:
-
- 10 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/ClientUserManagement/HeuristicLab.Clients.Access.Views/3.3/UserViews/LightweightUserInformationView.Designer.cs
r7942 r7982 33 33 this.userNameTextBox = new System.Windows.Forms.TextBox(); 34 34 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); 35 38 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()));39 39 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(); 40 42 ((System.ComponentModel.ISupportInitialize)(this.splitContainer)).BeginInit(); 41 43 this.splitContainer.Panel1.SuspendLayout(); … … 47 49 // 48 50 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, 2 09);51 this.changePasswordButton.Location = new System.Drawing.Point(316, 231); 50 52 this.changePasswordButton.Name = "changePasswordButton"; 51 53 this.changePasswordButton.Size = new System.Drawing.Size(112, 23); … … 72 74 this.fullNameTextBox.Size = new System.Drawing.Size(359, 20); 73 75 this.fullNameTextBox.TabIndex = 16; 76 this.fullNameTextBox.TextChanged += new System.EventHandler(this.fullNameTextBox_TextChanged); 74 77 // 75 78 // label4 … … 106 109 this.userNameTextBox.Location = new System.Drawing.Point(69, 3); 107 110 this.userNameTextBox.Name = "userNameTextBox"; 111 this.userNameTextBox.ReadOnly = true; 108 112 this.userNameTextBox.Size = new System.Drawing.Size(359, 20); 109 113 this.userNameTextBox.TabIndex = 15; … … 114 118 | System.Windows.Forms.AnchorStyles.Left) 115 119 | 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); 117 121 this.splitContainer.Name = "splitContainer"; 118 122 // … … 126 130 this.splitContainer.Panel2.Controls.Add(this.groupsListView); 127 131 this.splitContainer.Panel2.Controls.Add(this.label4); 128 this.splitContainer.Size = new System.Drawing.Size(425, 14 8);132 this.splitContainer.Size = new System.Drawing.Size(425, 144); 129 133 this.splitContainer.SplitterDistance = 211; 130 134 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; 131 162 // 132 163 // groupsListView … … 141 172 this.groupsListView.Location = new System.Drawing.Point(3, 16); 142 173 this.groupsListView.Name = "groupsListView"; 143 this.groupsListView.Size = new System.Drawing.Size(204, 12 9);174 this.groupsListView.Size = new System.Drawing.Size(204, 125); 144 175 this.groupsListView.SmallImageList = this.imageList; 145 176 this.groupsListView.TabIndex = 19; … … 147 178 this.groupsListView.View = System.Windows.Forms.View.Details; 148 179 // 149 // rolesListView150 //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 // imageList167 //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 // columnHeader173 //174 this.columnHeader.Width = 100;175 //176 180 // groupsColumnHeader 177 181 // 178 182 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); 179 202 // 180 203 // LightweightUserInformationView … … 182 205 this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); 183 206 this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; 207 this.Controls.Add(this.emailTextBox); 208 this.Controls.Add(this.label5); 184 209 this.Controls.Add(this.splitContainer); 185 210 this.Controls.Add(this.changePasswordButton); … … 189 214 this.Controls.Add(this.userNameTextBox); 190 215 this.Name = "LightweightUserInformationView"; 191 this.Size = new System.Drawing.Size(431, 2 35);216 this.Size = new System.Drawing.Size(431, 257); 192 217 this.splitContainer.Panel1.ResumeLayout(false); 193 218 this.splitContainer.Panel1.PerformLayout(); … … 216 241 private System.Windows.Forms.ColumnHeader columnHeader; 217 242 private System.Windows.Forms.ColumnHeader groupsColumnHeader; 243 private System.Windows.Forms.Label label5; 244 private System.Windows.Forms.TextBox emailTextBox; 218 245 } 219 246 } -
branches/ClientUserManagement/HeuristicLab.Clients.Access.Views/3.3/UserViews/LightweightUserInformationView.cs
r7942 r7982 20 20 #endregion 21 21 22 using System; 22 23 using System.Windows.Forms; 23 24 using HeuristicLab.MainForm; … … 47 48 userNameTextBox.Clear(); 48 49 fullNameTextBox.Clear(); 50 emailTextBox.Clear(); 49 51 } else { 50 52 userNameTextBox.Text = Content.UserName; 51 53 fullNameTextBox.Text = Content.FullName; 54 emailTextBox.Text = Content.EMail; 52 55 53 56 foreach (Role r in Content.Roles) … … 89 92 return listViewItem; 90 93 } 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 91 116 } 92 117 } -
branches/ClientUserManagement/HeuristicLab.Clients.Access.Views/3.3/UserViews/RefreshableLightweightUserInformationView.Designer.cs
r7611 r7982 1 namespace HeuristicLab.Clients.Access.Views { 1 using System; 2 namespace HeuristicLab.Clients.Access.Views { 2 3 partial class RefreshableLightweightUserInformationView { 3 4 /// <summary> … … 12 13 protected override void Dispose(bool disposing) { 13 14 if (disposing && (components != null)) { 15 lightweightUserInformationView.UserInformationChanged -= new EventHandler(lightweightUserInformationView_Changed); 14 16 components.Dispose(); 15 17 } … … 24 26 /// </summary> 25 27 private void InitializeComponent() { 28 System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(RefreshableLightweightUserInformationView)); 26 29 this.lightweightUserInformationView = new HeuristicLab.Clients.Access.Views.LightweightUserInformationView(); 30 this.storeButton = new System.Windows.Forms.Button(); 27 31 this.SuspendLayout(); 28 32 // … … 44 48 this.lightweightUserInformationView.TabIndex = 2; 45 49 // 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 // 46 61 // RefreshableLightweightUserInformationView 47 62 // … … 49 64 this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; 50 65 this.Controls.Add(this.lightweightUserInformationView); 66 this.Controls.Add(this.storeButton); 51 67 this.Name = "RefreshableLightweightUserInformationView"; 52 68 this.Size = new System.Drawing.Size(384, 281); 69 this.Controls.SetChildIndex(this.storeButton, 0); 53 70 this.Controls.SetChildIndex(this.lightweightUserInformationView, 0); 54 71 this.Controls.SetChildIndex(this.refreshButton, 0); … … 60 77 61 78 private LightweightUserInformationView lightweightUserInformationView; 79 private System.Windows.Forms.Button storeButton; 62 80 63 81 } -
branches/ClientUserManagement/HeuristicLab.Clients.Access.Views/3.3/UserViews/RefreshableLightweightUserInformationView.cs
r7635 r7982 32 32 private void RefreshUserData() { 33 33 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; 34 39 } 35 40 … … 44 49 base.Content_Refreshing(sender, e); 45 50 lightweightUserInformationView.Enabled = false; 51 storeButton.Enabled = false; 46 52 } 47 53 } … … 61 67 } 62 68 } 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 } 63 75 } 64 76 } -
branches/ClientUserManagement/HeuristicLab.Clients.Access/3.3/ClientInformation.cs
r7945 r7982 78 78 if (clientInfo != null) { 79 79 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)); 84 82 } 85 83 errorOccured = false; -
branches/ClientUserManagement/HeuristicLab.Clients.Access/3.3/ServiceClients/AccessServiceClient.cs
r7639 r7982 2 2 // <auto-generated> 3 3 // This code was generated by a tool. 4 // Runtime Version:4.0.30319.5 304 // Runtime Version:4.0.30319.544 5 5 // 6 6 // Changes to this file may cause incorrect behavior and will be lost if … … 28 28 [System.Runtime.Serialization.KnownTypeAttribute(typeof(HeuristicLab.Clients.Access.ClientLog))] 29 29 [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))] 30 32 [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))]33 33 public partial class AccessItem : object, System.Runtime.Serialization.IExtensibleDataObject, System.ComponentModel.INotifyPropertyChanged { 34 34 … … 663 663 "")] 664 664 [System.SerializableAttribute()] 665 [System.Runtime.Serialization.KnownTypeAttribute(typeof(HeuristicLab.Clients.Access.User))] 666 [System.Runtime.Serialization.KnownTypeAttribute(typeof(HeuristicLab.Clients.Access.UserGroup))] 665 667 [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))]668 668 public partial class UserGroupBase : HeuristicLab.Clients.Access.AccessItem { 669 669 … … 687 687 [System.Diagnostics.DebuggerStepThroughAttribute()] 688 688 [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; 693 702 694 703 [System.Runtime.Serialization.OptionalFieldAttribute()] … … 696 705 697 706 [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; 702 717 703 718 [System.Runtime.Serialization.OptionalFieldAttribute()] 704 719 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 } 705 759 706 760 [System.Runtime.Serialization.DataMemberAttribute()] … … 718 772 719 773 [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()] 720 912 public System.Collections.Generic.List<HeuristicLab.Clients.Access.UserGroup> Groups { 721 913 get { … … 739 931 this.RolesField = value; 740 932 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");917 933 } 918 934 } … … 1059 1075 public interface IAccessService { 1060 1076 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 1061 1080 [System.ServiceModel.OperationContractAttribute(Action = "http://tempuri.org/IAccessService/RemoveUserGroupBaseFromGroup", ReplyAction = "http://tempuri.org/IAccessService/RemoveUserGroupBaseFromGroupResponse")] 1062 1081 void RemoveUserGroupBaseFromGroup(HeuristicLab.Clients.Access.UserGroupBase resource, HeuristicLab.Clients.Access.UserGroup group); … … 1185 1204 System.Collections.Generic.List<HeuristicLab.Clients.Access.LightweightUser> GetLightweightUsers(System.Collections.Generic.List<System.Guid> ids); 1186 1205 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 1187 1209 [System.ServiceModel.OperationContractAttribute(Action = "http://tempuri.org/IAccessService/GetAllUsers", ReplyAction = "http://tempuri.org/IAccessService/GetAllUsersResponse")] 1188 1210 System.Collections.Generic.List<HeuristicLab.Clients.Access.User> GetAllUsers(); … … 1229 1251 [System.ServiceModel.OperationContractAttribute(Action = "http://tempuri.org/IAccessService/DeleteUserGroup", ReplyAction = "http://tempuri.org/IAccessService/DeleteUserGroupResponse")] 1230 1252 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);1234 1253 } 1235 1254 … … 1261 1280 } 1262 1281 1282 public void AddUserGroupBaseToGroup(HeuristicLab.Clients.Access.UserGroupBase resource, HeuristicLab.Clients.Access.UserGroup group) { 1283 base.Channel.AddUserGroupBaseToGroup(resource, group); 1284 } 1285 1263 1286 public void RemoveUserGroupBaseFromGroup(HeuristicLab.Clients.Access.UserGroupBase resource, HeuristicLab.Clients.Access.UserGroup group) { 1264 1287 base.Channel.RemoveUserGroupBaseFromGroup(resource, group); … … 1429 1452 } 1430 1453 1454 public void UpdateLightweightUser(HeuristicLab.Clients.Access.LightweightUser user) { 1455 base.Channel.UpdateLightweightUser(user); 1456 } 1457 1431 1458 public System.Collections.Generic.List<HeuristicLab.Clients.Access.User> GetAllUsers() { 1432 1459 return base.Channel.GetAllUsers(); … … 1488 1515 base.Channel.DeleteUserGroup(group); 1489 1516 } 1490 1491 public void AddUserGroupBaseToGroup(HeuristicLab.Clients.Access.UserGroupBase resource, HeuristicLab.Clients.Access.UserGroup group) {1492 base.Channel.AddUserGroupBaseToGroup(resource, group);1493 }1494 1517 } 1495 1518 } -
branches/ClientUserManagement/HeuristicLab.Services.Access/3.3/AccessService.cs
r7946 r7982 398 398 private DT.LightweightUser BuildLightweightUserDto(Guid userId) { 399 399 DA.aspnet_User aspUser = null; 400 DA.aspnet_Membership aspMembership = null; 400 401 DA.User accessUser = null; 401 402 List<DA.aspnet_Role> roles = new List<DA.aspnet_Role>(); … … 407 408 where u.UserId == userId 408 409 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 409 418 if (userQuery.Count() == 1) { 410 419 aspUser = userQuery.First(); … … 416 425 } 417 426 418 if (aspUser != null ) {427 if (aspUser != null || aspMembership != null) { 419 428 using (DA.AccessServiceDataContext context = new DA.AccessServiceDataContext()) { 420 429 var query = from u in context.UserGroupBases.OfType<DA.User>() … … 439 448 } 440 449 441 if (aspUser == null || accessUser == null ) {450 if (aspUser == null || accessUser == null || aspMembership == null) { 442 451 throw new Exception("User with id " + userId + " not found."); 443 452 } else { 444 return Convert.ToDto(accessUser, aspUser, roles, groups);453 return Convert.ToDto(accessUser, aspUser, aspMembership, roles, groups); 445 454 } 446 455 } … … 449 458 Guid userId = UserManager.CurrentUserId; 450 459 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); 451 469 } 452 470 … … 611 629 612 630 public void UpdateUser(DT.User user) { 613 RoleVerifier.AuthenticateForAllRoles(AccessServiceRoles.Administrator); 631 if (user.Id != UserManager.CurrentUserId) { 632 RoleVerifier.AuthenticateForAllRoles(AccessServiceRoles.Administrator); 633 } 614 634 615 635 MembershipUser membershipUser = Membership.GetUser((object)user.Id); -
branches/ClientUserManagement/HeuristicLab.Services.Access/3.3/Convert.cs
r7637 r7982 291 291 #region User 292 292 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) { 294 294 return new DT.LightweightUser() { 295 295 Id = source.Id, 296 296 FullName = source.FullName, 297 297 UserName = aspUserSource.UserName, 298 EMail = aspMembershipSource.Email, 298 299 //TODO: check if the roles and groups are include in source 299 300 Roles = roles.Select(x => Convert.ToDto(x)).ToArray(), -
branches/ClientUserManagement/HeuristicLab.Services.Access/3.3/DataTransfer/LightweightUser.cs
r7599 r7982 31 31 public string FullName { get; set; } 32 32 [DataMember] 33 public string EMail { get; set; } 34 [DataMember] 33 35 public IEnumerable<DataTransfer.Role> Roles { get; set; } 34 36 [DataMember] -
branches/ClientUserManagement/HeuristicLab.Services.Access/3.3/IAccessService.cs
r7639 r7982 120 120 121 121 [OperationContract] 122 void UpdateLightweightUser(LightweightUser user); 123 124 [OperationContract] 122 125 IEnumerable<User> GetAllUsers(); 123 126
Note: See TracChangeset
for help on using the changeset viewer.