public void FillStandardUserFormBlock(AjaxFormFieldBlock block, SecurityProvider.User user, bool plainTextPassword, bool multilingual, bool requireFullName, bool allowUsernameEditing)
        {
            bool newUser = user == null;

            string labelUsername = multilingual ? "{?form-label-username?}" : "Username";
            string labelPassword = multilingual ? "{?form-label-password?}" : "Password";
            string labelFirstName = multilingual ? "{?form-label-firstname?}" : "FirstName";
            string labelSurname = multilingual ? "{?form-label-surname?}" : "Surname";
            string labelEmail = multilingual ? "{?form-label-email?}" : "Email";

            string errNoUsername = multilingual ? "{?form-error-require-username?}" : "Please enter a username";
            string errNoFirstName = multilingual ? "{?form-error-require-firstname?}" : "Please enter your first name";
            string errNoSurname = multilingual ? "{?form-error-require-surname?}" : "Please enter your surname";
            string errNoEmail = multilingual ? "{?form-error-require-email?}" : "Please enter your email address";
            string errNoPassword = multilingual ? "{?form-error-require-password?}" : "Please enter your email password";

            string fErr = "function(value){{if(value.length==0) return '{0}'; return null;}}";
            string pErr = !newUser ? null : string.Format(fErr, errNoPassword);
            string fnErr = !requireFullName ? null : string.Format(fErr, errNoFirstName);
            string snErr = !requireFullName ? null : string.Format(fErr, errNoSurname);

            if (newUser) user = new SecurityProvider.User();
            bool locked = user.Locked;
            if(allowUsernameEditing)
                block.Add(new AjaxFormInputField(labelUsername, "Username", 50, locked, null, "width:150px;", user.Username, null, string.Format(fErr, errNoUsername), true, 0));
            if (plainTextPassword)
                block.Add(new AjaxFormInputField(labelPassword, "Password", 50, false, null, "width:150px;", null, null, pErr, true, 1));
            else
                block.Add(new AjaxFormPasswordField(labelPassword, 50, null, "width:73px", 1, multilingual, newUser, !newUser));
            block.Add(new AjaxFormInputField(labelFirstName, "FirstName", 50, false, null, "width:150px;", user.FirstName, null, fnErr, true, 2));
            block.Add(new AjaxFormInputField(labelSurname, "Surname", 50, false, null, "width:150px;", user.Surname, null, snErr, true, 3));
            block.Add(new AjaxFormInputField(labelEmail, "Email", 100, false, null, "width:150px;", user.Email, null, string.Format(fErr, errNoEmail), true, 4));
        }
 public UserFilterResults(int matches, SecurityProvider.User[] users)
 {
     this.matches = matches;
     this.users = users;
 }
Beispiel #3
0
 void BeforeFirstClientDataInserted(SecurityProvider.InitialClient client)
 {
     client.ClientID = clientID;
 }