diff --git a/client/administration/UdsAdmin/Properties/AssemblyInfo.cs b/client/administration/UdsAdmin/Properties/AssemblyInfo.cs index cc5a1df6e..83199d42f 100644 --- a/client/administration/UdsAdmin/Properties/AssemblyInfo.cs +++ b/client/administration/UdsAdmin/Properties/AssemblyInfo.cs @@ -33,6 +33,6 @@ using System.Resources; // Puede especificar todos los valores o establecer como predeterminados los números de versión de compilación y de revisión // mediante el asterisco ('*'), como se muestra a continuación: // [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("1.1.0.0")] -[assembly: AssemblyFileVersion("1.1.0.0")] +[assembly: AssemblyVersion("1.1.1.0")] +[assembly: AssemblyFileVersion("1.1.1.0")] [assembly: NeutralResourcesLanguageAttribute("en")] diff --git a/client/administration/UdsAdmin/Strings.Designer.cs b/client/administration/UdsAdmin/Strings.Designer.cs index c9c42f64d..036e61ef2 100644 --- a/client/administration/UdsAdmin/Strings.Designer.cs +++ b/client/administration/UdsAdmin/Strings.Designer.cs @@ -843,6 +843,15 @@ namespace UdsAdmin { } } + /// + /// Busca una cadena traducida similar a An small name with at most 8 chars and using A-Z,a-z,0-9 -_ chars is required. + /// + internal static string smallNameRequired { + get { + return ResourceManager.GetString("smallNameRequired", resourceCulture); + } + } + /// /// Busca una cadena traducida similar a Src Host. /// diff --git a/client/administration/UdsAdmin/Strings.resx b/client/administration/UdsAdmin/Strings.resx index 274088747..a828ec32c 100644 --- a/client/administration/UdsAdmin/Strings.resx +++ b/client/administration/UdsAdmin/Strings.resx @@ -510,4 +510,7 @@ Legend + + An small name with at most 8 chars and using A-Z,a-z,0-9 -_ chars is required + \ No newline at end of file diff --git a/client/administration/UdsAdmin/forms/AuthenticatorForm.Designer.cs b/client/administration/UdsAdmin/forms/AuthenticatorForm.Designer.cs index a04619535..46f3e39d6 100644 --- a/client/administration/UdsAdmin/forms/AuthenticatorForm.Designer.cs +++ b/client/administration/UdsAdmin/forms/AuthenticatorForm.Designer.cs @@ -33,12 +33,14 @@ this.dataPanel = new System.Windows.Forms.TableLayoutPanel(); this.groupBox1 = new System.Windows.Forms.GroupBox(); this.tableLayoutPanel2 = new System.Windows.Forms.TableLayoutPanel(); + this.label4 = new System.Windows.Forms.Label(); this.label3 = new System.Windows.Forms.Label(); this.comments = new System.Windows.Forms.TextBox(); this.label2 = new System.Windows.Forms.Label(); this.name = new System.Windows.Forms.TextBox(); this.label1 = new System.Windows.Forms.Label(); this.priority = new System.Windows.Forms.NumericUpDown(); + this.smallName = new System.Windows.Forms.TextBox(); this.tableLayoutPanel1 = new System.Windows.Forms.TableLayoutPanel(); this.accept = new System.Windows.Forms.Button(); this.cancel = new System.Windows.Forms.Button(); @@ -74,14 +76,21 @@ // tableLayoutPanel2 // resources.ApplyResources(this.tableLayoutPanel2, "tableLayoutPanel2"); + this.tableLayoutPanel2.Controls.Add(this.label4, 0, 3); this.tableLayoutPanel2.Controls.Add(this.label3, 0, 2); this.tableLayoutPanel2.Controls.Add(this.comments, 1, 1); this.tableLayoutPanel2.Controls.Add(this.label2, 0, 1); this.tableLayoutPanel2.Controls.Add(this.name, 1, 0); this.tableLayoutPanel2.Controls.Add(this.label1, 0, 0); this.tableLayoutPanel2.Controls.Add(this.priority, 1, 2); + this.tableLayoutPanel2.Controls.Add(this.smallName, 1, 3); this.tableLayoutPanel2.Name = "tableLayoutPanel2"; // + // label4 + // + resources.ApplyResources(this.label4, "label4"); + this.label4.Name = "label4"; + // // label3 // resources.ApplyResources(this.label3, "label3"); @@ -127,6 +136,11 @@ 0, 0}); // + // smallName + // + resources.ApplyResources(this.smallName, "smallName"); + this.smallName.Name = "smallName"; + // // tableLayoutPanel1 // resources.ApplyResources(this.tableLayoutPanel1, "tableLayoutPanel1"); @@ -202,6 +216,8 @@ private System.Windows.Forms.Button test; private System.Windows.Forms.Label label3; private System.Windows.Forms.NumericUpDown priority; + private System.Windows.Forms.Label label4; + private System.Windows.Forms.TextBox smallName; } } \ No newline at end of file diff --git a/client/administration/UdsAdmin/forms/AuthenticatorForm.cs b/client/administration/UdsAdmin/forms/AuthenticatorForm.cs index 0d49fb914..5d46b1061 100644 --- a/client/administration/UdsAdmin/forms/AuthenticatorForm.cs +++ b/client/administration/UdsAdmin/forms/AuthenticatorForm.cs @@ -45,6 +45,7 @@ namespace UdsAdmin.forms xmlrpc.GuiFieldValue[] _fldValues; string _authenticatorName; string _authenticatorType; + System.Text.RegularExpressions.Regex smallNameRe; public AuthenticatorForm(string providerName, string providerType, Icon icon) { @@ -56,12 +57,14 @@ namespace UdsAdmin.forms _authenticatorType = providerType; Icon = icon; Text = Strings.titleAuthenticator; + smallNameRe = new System.Text.RegularExpressions.Regex("^[A-Za-z0-9_:.-]+$"); } - public void setData(string name, string comments, string id, xmlrpc.GuiFieldValue[] data) + public void setData(string name, string comments, string id, string smallName, xmlrpc.GuiFieldValue[] data) { this.name.Text = name; this.comments.Text = comments; + this.smallName.Text = smallName; this._id = id; this.priority.Value = Convert.ToInt32(xmlrpc.GuiFieldValue.getData(data, "priority")); _fldValues = data; @@ -71,6 +74,8 @@ namespace UdsAdmin.forms { _flds = xmlrpc.UdsAdminService.GetAuthenticatorGui(_authenticatorType); Size sz = gui.DinamycFieldsManager.PutFields(dataPanel, _flds, _fldValues); + if (sz.Width < groupData.Size.Width) + sz.Width = groupData.Size.Width; groupData.Size = new Size(sz.Width, 32 + sz.Height); Size wSize = new Size(); wSize.Width = Size.Width; @@ -95,6 +100,22 @@ namespace UdsAdmin.forms gui.UserNotifier.notifyError(Strings.nameRequired); return; } + + if (smallName.Text.Trim().Length == 0) + { + Random rnd = new Random(); + string str = ""; + for (int i = 0; i < 8; i++) + str += (char)('A' + rnd.Next(0, 26)); + smallName.Text = str; + } + + if (smallNameRe.IsMatch(smallName.Text) == false) + { + gui.UserNotifier.notifyError(Strings.smallNameRequired); + return; + } + xmlrpc.GuiFieldValue[] data; try { data = gui.DinamycFieldsManager.ReadFields(dataPanel, _flds); @@ -107,10 +128,10 @@ namespace UdsAdmin.forms try { if (_id == null) - xmlrpc.UdsAdminService.CreateAuthenticator(name.Text, comments.Text, _authenticatorType, Convert.ToInt32(priority.Value), data); + xmlrpc.UdsAdminService.CreateAuthenticator(name.Text, comments.Text, _authenticatorType, Convert.ToInt32(priority.Value), smallName.Text, data); else { - xmlrpc.UdsAdminService.ModifyAuthenticator(name.Text, comments.Text, Convert.ToInt32(priority.Value), _id, data); + xmlrpc.UdsAdminService.ModifyAuthenticator(name.Text, comments.Text, Convert.ToInt32(priority.Value), _id, smallName.Text, data); } DialogResult = System.Windows.Forms.DialogResult.OK; } diff --git a/client/administration/UdsAdmin/forms/AuthenticatorForm.resx b/client/administration/UdsAdmin/forms/AuthenticatorForm.resx index 5fb39c687..8692b46d2 100644 --- a/client/administration/UdsAdmin/forms/AuthenticatorForm.resx +++ b/client/administration/UdsAdmin/forms/AuthenticatorForm.resx @@ -130,13 +130,13 @@ - 3, 16 + 8, 21 2 - 443, 157 + 433, 120 0 @@ -157,10 +157,13 @@ <?xml version="1.0" encoding="utf-16"?><TableLayoutSettings><Controls /><Columns Styles="Percent,50,Percent,50" /><Rows Styles="Percent,50,Percent,50" /></TableLayoutSettings> - 12, 125 + 12, 152 + + + 8, 8, 8, 8 - 449, 176 + 449, 149 7 @@ -186,6 +189,39 @@ 2 + + Left + + + True + + + NoControl + + + 3, 92 + + + 63, 13 + + + 6 + + + Small Name + + + label4 + + + System.Windows.Forms.Label, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tableLayoutPanel2 + + + 0 + Left @@ -196,7 +232,7 @@ NoControl - 3, 57 + 3, 63 38, 13 @@ -217,10 +253,10 @@ tableLayoutPanel2 - 0 + 1 - 82, 28 + 82, 31 320, 20 @@ -238,7 +274,7 @@ tableLayoutPanel2 - 1 + 2 Left @@ -247,7 +283,7 @@ True - 3, 31 + 3, 35 56, 13 @@ -268,7 +304,7 @@ tableLayoutPanel2 - 2 + 3 82, 3 @@ -289,7 +325,7 @@ tableLayoutPanel2 - 3 + 4 Left @@ -298,7 +334,7 @@ True - 3, 6 + 3, 7 35, 13 @@ -319,10 +355,10 @@ tableLayoutPanel2 - 4 + 5 - 82, 53 + 82, 59 63, 20 @@ -340,16 +376,40 @@ tableLayoutPanel2 - 5 + 6 + + + 82, 87 + + + 32 + + + 132, 20 + + + 7 + + + smallName + + + System.Windows.Forms.TextBox, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tableLayoutPanel2 + + + 7 12, 19 - 3 + 4 - 414, 77 + 414, 114 2 @@ -367,13 +427,13 @@ 0 - <?xml version="1.0" encoding="utf-16"?><TableLayoutSettings><Controls><Control Name="label3" Row="2" RowSpan="1" Column="0" ColumnSpan="1" /><Control Name="comments" Row="1" RowSpan="1" Column="1" ColumnSpan="1" /><Control Name="label2" Row="1" RowSpan="1" Column="0" ColumnSpan="1" /><Control Name="name" Row="0" RowSpan="1" Column="1" ColumnSpan="1" /><Control Name="label1" Row="0" RowSpan="1" Column="0" ColumnSpan="1" /><Control Name="priority" Row="2" RowSpan="1" Column="1" ColumnSpan="1" /></Controls><Columns Styles="Percent,19,29825,Percent,80,70175" /><Rows Styles="Percent,33,Percent,33,Percent,34" /></TableLayoutSettings> + <?xml version="1.0" encoding="utf-16"?><TableLayoutSettings><Controls><Control Name="label4" Row="3" RowSpan="1" Column="0" ColumnSpan="1" /><Control Name="label3" Row="2" RowSpan="1" Column="0" ColumnSpan="1" /><Control Name="comments" Row="1" RowSpan="1" Column="1" ColumnSpan="1" /><Control Name="label2" Row="1" RowSpan="1" Column="0" ColumnSpan="1" /><Control Name="name" Row="0" RowSpan="1" Column="1" ColumnSpan="1" /><Control Name="label1" Row="0" RowSpan="1" Column="0" ColumnSpan="1" /><Control Name="priority" Row="2" RowSpan="1" Column="1" ColumnSpan="1" /><Control Name="smallName" Row="3" RowSpan="1" Column="1" ColumnSpan="1" /></Controls><Columns Styles="Percent,19,29825,Percent,80,70175" /><Rows Styles="Percent,25,Percent,25,Percent,25,Percent,25" /></TableLayoutSettings> 12, 7 - 449, 112 + 449, 139 6 diff --git a/client/administration/UdsAdmin/forms/MainForm.cs b/client/administration/UdsAdmin/forms/MainForm.cs index d98cc871b..2527ea0e3 100644 --- a/client/administration/UdsAdmin/forms/MainForm.cs +++ b/client/administration/UdsAdmin/forms/MainForm.cs @@ -330,7 +330,7 @@ namespace UdsAdmin.forms { xmlrpc.Authenticator auth = (xmlrpc.Authenticator)treeActions.SelectedNode.Tag; AuthenticatorForm dlg = new AuthenticatorForm(auth.typeName, auth.type, getIcon(_authenticatorsTypes, auth.type)); - dlg.setData(auth.name, auth.comments, auth.id, xmlrpc.UdsAdminService.GetAuthenticator(auth.id)); + dlg.setData(auth.name, auth.comments, auth.id, auth.smallName, xmlrpc.UdsAdminService.GetAuthenticator(auth.id)); if (dlg.ShowDialog() == System.Windows.Forms.DialogResult.OK) updateAuthenticatorsTree(); break; diff --git a/client/administration/UdsAdmin/forms/MainForm.resx b/client/administration/UdsAdmin/forms/MainForm.resx index a1cb52732..271e299ae 100644 --- a/client/administration/UdsAdmin/forms/MainForm.resx +++ b/client/administration/UdsAdmin/forms/MainForm.resx @@ -199,7 +199,7 @@ splitContainer1 - UdsAdmin.controls.SplitContainerEx, UdsAdmin, Version=1.1.0.0, Culture=neutral, PublicKeyToken=null + UdsAdmin.controls.SplitContainerEx, UdsAdmin, Version=1.1.1.0, Culture=neutral, PublicKeyToken=null $this diff --git a/client/administration/UdsAdmin/xmlrpc/UDSAdminService.cs b/client/administration/UdsAdmin/xmlrpc/UDSAdminService.cs index 419959c70..119b06e93 100644 --- a/client/administration/UdsAdmin/xmlrpc/UDSAdminService.cs +++ b/client/administration/UdsAdmin/xmlrpc/UDSAdminService.cs @@ -66,6 +66,17 @@ namespace UdsAdmin.xmlrpc data[len + 2] = new GuiFieldValue("priority", priority.ToString()); } + private static void insertNameCommentsPrioritySmallName(string name, string comments, int priority, string smallName, ref GuiFieldValue[] data) + { + int len = data.Length; + Array.Resize(ref data, len + 4); + data[len] = new GuiFieldValue("name", name); + data[len + 1] = new GuiFieldValue("comments", comments); + data[len + 2] = new GuiFieldValue("priority", priority.ToString()); + data[len + 3] = new GuiFieldValue("smallName", smallName); + } + + private static void insertNameComments(string name, string comments, ref GuiFieldValue[] data) { int len = data.Length; @@ -304,16 +315,16 @@ namespace UdsAdmin.xmlrpc return s.GetAuthenticatorGroups(credentials, id); } - public static bool CreateAuthenticator(string name, string comments, string type, int priority, GuiFieldValue[] data) + public static bool CreateAuthenticator(string name, string comments, string type, int priority, string smallName, GuiFieldValue[] data) { - insertNameCommentsPriority(name, comments, priority, ref data); + insertNameCommentsPrioritySmallName(name, comments, priority, smallName, ref data); return s.CreateAuthenticator(credentials, type, data); } - public static bool ModifyAuthenticator(string name, string comments, int priority, string id, GuiFieldValue[] data) + public static bool ModifyAuthenticator(string name, string comments, int priority, string id, string smallName, GuiFieldValue[] data) { - insertNameCommentsPriority(name, comments, priority, ref data); + insertNameCommentsPrioritySmallName(name, comments, priority, smallName, ref data); return s.ModifyAuthenticator(credentials, id, data); } diff --git a/client/administration/UdsAdmin/xmlrpc/structs.cs b/client/administration/UdsAdmin/xmlrpc/structs.cs index 904432632..2433ed05b 100644 --- a/client/administration/UdsAdmin/xmlrpc/structs.cs +++ b/client/administration/UdsAdmin/xmlrpc/structs.cs @@ -225,6 +225,7 @@ namespace UdsAdmin.xmlrpc public class Authenticator : BaseItemData { public string priority; + public string smallName; } public class Group