2010 November, 19 (Guerric) (1)

    Table of contents
    No headers
    
            
    
    Index: Controllers/SiteController.cs
    ===================================================================
    --- Controllers/SiteController.cs(revision 23857)
    +++ Controllers/SiteController.cs(working copy)
    @@ -274,6 +274,10 @@
                     ModelState.AddModelError("Hostname", "You must provide a hostname");
                     valid = false;
                 }
    +            if(site.AdminPassword == null) {
    +                ModelState.AddModelError("AdminPassword", "You must provide an admin password");
    +                valid = false;
    +            }
                 return valid;
             }
         }
    Index: Models/SiteCreationModel.cs
    ===================================================================
    --- Models/SiteCreationModel.cs(revision 23855)
    +++ Models/SiteCreationModel.cs(working copy)
    @@ -36,6 +36,11 @@
             //--- Constants ---
             public const int DEFAULT_TRIAL_DURATION = 15;
     
    +        // -- Class Constructor
    +        public SiteCreationModel() {
    +            AdminPassword = StringUtil.CreateAlphaNumericKey(9);
    +        }
    +
             //--- Properties ---
             public int Id { get; set; }
             
    Index: Views/Site/Create.aspx
    ===================================================================
    --- Views/Site/Create.aspx(revision 23855)
    +++ Views/Site/Create.aspx(working copy)
    @@ -47,6 +47,14 @@
                     <%= Html.TextBoxFor(model => model.AdminEmail) %>
                     <%= Html.ValidationMessageFor(model => model.AdminEmail) %>
                 </div>
    +
    +            <div class="editor-label">
    +                <%= Html.LabelFor(model => model.AdminPassword) %>
    +            </div>
    +            <div class="editor-field">
    +                <%= Html.TextBoxFor(model => model.AdminPassword) %>
    +                <%= Html.ValidationMessageFor(model => model.AdminPassword) %>
    +            </div>
                 
                 <div class="newuser">
                     <div class="editor-label">
    @@ -64,14 +72,6 @@
                         <%= Html.TextBoxFor(model => model.AdminLastName) %>
                         <%= Html.ValidationMessageFor(model => model.AdminLastName) %>
                     </div>
    -                
    -                <div class="editor-label">
    -                    <%= Html.LabelFor(model => model.AdminPassword) %>
    -                </div>
    -                <div class="editor-field">
    -                    <%= Html.TextBoxFor(model => model.AdminPassword) %>
    -                    <%= Html.ValidationMessageFor(model => model.AdminPassword) %>
    -                </div>
                 </div>
             </fieldset>
             
     
    Tag page
    You must login to post a comment.

    Copyright © 2011 MindTouch, Inc. Powered by