Esempio n. 1
0
    def user_delete(username):
        title = "Delete user"

        if not ldap_user_exists(username=username):
            abort(404)

        form = Form(request.form)

        if form.validate_on_submit():
            try:
                user = ldap_get_user(username=username)
                ldap_delete_entry(user['distinguishedName'])
                flash("User successfuly deleted.", "success")
                return redirect(url_for('core_index'))
            except ldap.LDAPError as e:
                error = e.message['info'].split(":", 2)[-1].strip()
                error = str(error[0].upper() + error[1:])
                flash(error, "error")
        elif form.errors:
            flash("Some fields failed validation.", "error")

        return render_template("pages/user_delete.html",
                               title=title,
                               action="Delete user",
                               form=form,
                               username=username,
                               parent=url_for('user_overview',
                                              username=username))
Esempio n. 2
0
    def user_edit_ssh(username):
        title = "Edit SSH keys"

        if not ldap_user_exists(username=username):
            abort(404)

        user = ldap_get_user(username=username)

        form = UserSSHEdit(request.form)
        form.visible_fields = [form.ssh_keys]

        if form.validate_on_submit():
            new_entries = [entry.strip() for entry in
                           form.ssh_keys.data.split("\n")]
            try:
                ldap_update_attribute(user['distinguishedName'],
                                      'sshPublicKey', new_entries,
                                      'ldapPublicKey')
                flash("SSH keys successfuly updated.", "success")
                return redirect(url_for('user_overview', username=username))
            except ldap.LDAPError as e:
                error = e.message['info'].split(":", 2)[-1].strip()
                error = str(error[0].upper() + error[1:])
                flash(error, "error")
        elif form.errors:
            flash("Some fields failed validation.", "error")

        if not form.is_submitted():
            if 'sshPublicKey' in user:
                form.ssh_keys.data = "\n".join(user['sshPublicKey'])

        return render_template("forms/basicform.html", form=form, title=title,
                               action="Save changes",
                               parent=url_for('user_overview',
                                              username=username))
Esempio n. 3
0
    def user_delete(username):
        title = "Delete user"

        if not ldap_user_exists(username=username):
            abort(404)

        form = Form(request.form)

        if form.validate_on_submit():
            try:
                user = ldap_get_user(username=username)
                ldap_delete_entry(user['distinguishedName'])
                flash("User successfuly deleted.", "success")
                return redirect(url_for('core_index'))
            except ldap.LDAPError as e:
                error = e.message['info'].split(":", 2)[-1].strip()
                error = str(error[0].upper() + error[1:])
                flash(error, "error")
        elif form.errors:
                flash("Some fields failed validation.", "error")

        return render_template("pages/user_delete.html", title=title,
                               action="Delete user", form=form,
                               username=username,
                               parent=url_for('user_overview',
                                              username=username))
Esempio n. 4
0
    def user_overview(username):
        title = "User details - %s" % username

        if not ldap_user_exists(username=username):
            abort(404)

        identity_fields = [('givenName', "First name"),
                           ('sn', "Last name"),
                           ('displayName', "Display name"),
                           ('sAMAccountName', "User name"),
                           ('mail', "E-mail address"),
                           ('___primary_group', "Primary group")]
        group_fields = [('sAMAccountName', "Name"),
                        ('description', "Description")]

        admin = ldap_in_group("Domain Admins")
        user = ldap_get_user(username=username)
        group_details = [ldap_get_group(group, 'distinguishedName')
                         for group in ldap_get_membership(username)]
        user['___primary_group'] = group_details[0]['sAMAccountName']

        groups = sorted(group_details, key=lambda entry:
                        entry['sAMAccountName'])

        return render_template("pages/user_overview.html", g=g, title=title,
                               user=user, identity_fields=identity_fields,
                               group_fields=group_fields,
                               admin=admin, groups=groups,
                               uac_values=LDAP_AD_USERACCOUNTCONTROL_VALUES)
Esempio n. 5
0
    def user_overview(username):
        title = "User details - %s" % username

        if not ldap_user_exists(username=username):
            abort(404)

        identity_fields = [('givenName', "First name"), ('sn', "Last name"),
                           ('displayName', "Display name"),
                           ('sAMAccountName', "User name"),
                           ('mail', "E-mail address"),
                           ('___primary_group', "Primary group")]
        group_fields = [('sAMAccountName', "Name"),
                        ('description', "Description")]

        admin = ldap_in_group("Domain Admins")
        user = ldap_get_user(username=username)
        group_details = [
            ldap_get_group(group, 'distinguishedName')
            for group in ldap_get_membership(username)
        ]
        user['___primary_group'] = group_details[0]['sAMAccountName']

        groups = sorted(group_details,
                        key=lambda entry: entry['sAMAccountName'])

        return render_template("pages/user_overview.html",
                               g=g,
                               title=title,
                               user=user,
                               identity_fields=identity_fields,
                               group_fields=group_fields,
                               admin=admin,
                               groups=groups,
                               uac_values=LDAP_AD_USERACCOUNTCONTROL_VALUES)
    def user_delete(username):
        title = "Delete User"

        if not ldap_user_exists(username=username):
            abort(404)

        form = FlaskForm(request.form)

        if form.validate_on_submit():
            try:
                user = ldap_get_user(username=username)
                ldap_delete_entry(user['distinguishedName'])
                flash(u"User deleted successfully.", "success")
                return redirect(url_for('core_index'))
            except ldap.LDAPError as e:
                e = dict(e.args[0])
                flash(e['info'], "error")
        elif form.errors:
            flash(u"Data validation failed.", "error")

        return render_template("pages/user_delete_es.html",
                               title=title,
                               action="Delete User",
                               form=form,
                               username=username,
                               parent=url_for('user_overview',
                                              username=username))
    def user_edit_siccip(username):
        title = u"Edit SICC-IP Configuration"

        if not ldap_user_exists(username=username):
            abort(404)

        user = ldap_get_user(username=username)
        pager = user['pager'][0] if 'pager' in user else None
        form = SICCIPEdit(request.form)
        field_mapping = [  #('internet_type', form.internet_type),
            ('internet_quota', form.internet_quota),
            ('socialnetwork_quota', form.socialnetwork_quota),
            ('dansguardian_filter', form.dansguardian_filter),
            ('email_type', form.email_type), ('email_quota', form.email_quota)
        ]

        form.visible_fields = [field[1] for field in field_mapping]

        if form.validate_on_submit():
            try:
                internet_type = 'F'
                new_pager = 'I%s%f_%f|E%s%f|D%d' % (
                    internet_type, form.internet_quota.data,
                    form.socialnetwork_quota.data, form.email_type.data,
                    form.email_quota.data, form.dansguardian_filter.data)
                if pager != new_pager:
                    ldap_update_attribute(user['distinguishedName'], "pager",
                                          new_pager)
                    print(new_pager)

                flash(u"Profile updated successfully.", "success")
                return redirect(url_for('user_overview', username=username))
            except ldap.LDAPError as e:
                error = e.message['info'].split(":", 2)[-1].strip()
                error = str(error[0].upper() + error[1:])
                flash(error, "error")
        elif form.errors:
            flash(u"Data validation failed.", "error")

        if not form.is_submitted():
            if pager:
                siccip_data = get_parsed_pager_attribute(pager)
                if siccip_data is not None:
                    form.internet_type.data = siccip_data['internet_type']
                    form.internet_quota.data = siccip_data['internet_quota']
                    form.socialnetwork_quota.data = siccip_data[
                        'socialnetwork_quota']
                    form.email_type.data = siccip_data['email_type']
                    form.email_quota.data = siccip_data['email_quota']
                    form.dansguardian_filter.data = siccip_data[
                        'dansguardian_filter']

        return render_template("forms/basicform.html",
                               form=form,
                               title=title,
                               action="Salvar los cambios",
                               parent=url_for('user_overview',
                                              username=username))
Esempio n. 8
0
    def user_changepw(username):
        title = "Change password"

        if not ldap_user_exists(username=username):
            abort(404)

        admin = ldap_in_group("Domain Admins")
        if username != g.ldap['username'] and admin:
            form = PasswordChange(request.form)
            form.visible_fields = []
        else:
            form = PasswordChangeUser(request.form)
            form.visible_fields = [form.oldpassword]

        form.visible_fields += [form.password, form.password_confirm]

        if form.validate_on_submit():
            try:
                if username != g.ldap['username'] and admin:
                    ldap_change_password(None,
                                         form.password.data,
                                         username=username)
                else:
                    ldap_change_password(form.oldpassword.data,
                                         form.password.data,
                                         username=username)
                flash("Password changed successfuly.", "success")
                return redirect(url_for('user_overview', username=username))
            except ldap.LDAPError as e:
                error = e.message['info'].split(":", 2)[-1].strip()
                error = str(error[0].upper() + error[1:])
                flash(error, "error")
        elif form.errors:
            flash("Some fields failed validation.", "error")

        return render_template("forms/basicform.html",
                               form=form,
                               title=title,
                               action="Change password",
                               parent=url_for('user_overview',
                                              username=username))
    def user_changepw(username):
        title = u"Change Password"

        if not ldap_user_exists(username=username):
            abort(404)

        admin = ldap_in_group(Settings.ADMIN_GROUP)

        if username != g.ldap['username'] and admin:
            form = PasswordChange(request.form)
            form.visible_fields = []
        else:
            form = PasswordChangeUser(request.form)
            form.visible_fields = [form.oldpassword]

        form.visible_fields += [form.password, form.password_confirm]

        if form.validate_on_submit():
            try:
                if username != g.ldap['username'] and admin:
                    ldap_change_password(None,
                                         form.password.data,
                                         username=username)
                else:
                    ldap_change_password(form.oldpassword.data,
                                         form.password.data,
                                         username=username)
                flash(u"The password was changed successfully.", "success")
                return redirect(url_for('user_overview', username=username))
            except ldap.LDAPError as e:
                e = dict(e.args[0])
                flash(e['info'], "error")
        elif form.errors:
            flash(u"Data validation failed.", "error")

        return render_template("forms/basicform.html",
                               form=form,
                               title=title,
                               action=u"Change Password",
                               parent=url_for('user_overview',
                                              username=username))
Esempio n. 10
0
    def user_changepw(username):
        title = "Change password"

        if not ldap_user_exists(username=username):
            abort(404)

        admin = ldap_in_group("Domain Admins")
        if username != g.ldap['username'] and admin:
            form = PasswordChange(request.form)
            form.visible_fields = []
        else:
            form = PasswordChangeUser(request.form)
            form.visible_fields = [form.oldpassword]

        form.visible_fields += [form.password, form.password_confirm]

        if form.validate_on_submit():
            try:
                if username != g.ldap['username'] and admin:
                    ldap_change_password(None,
                                         form.password.data,
                                         username=username)
                else:
                    ldap_change_password(form.oldpassword.data,
                                         form.password.data,
                                         username=username)
                flash("Password changed successfuly.", "success")
                return redirect(url_for('user_overview', username=username))
            except ldap.LDAPError as e:
                error = e.message['info'].split(":", 2)[-1].strip()
                error = str(error[0].upper() + error[1:])
                flash(error, "error")
        elif form.errors:
                flash("Some fields failed validation.", "error")

        return render_template("forms/basicform.html", form=form, title=title,
                               action="Change password",
                               parent=url_for('user_overview',
                                              username=username))
Esempio n. 11
0
    def user_edit_ssh(username):
        title = "Edit SSH keys"

        if not ldap_user_exists(username=username):
            abort(404)

        user = ldap_get_user(username=username)

        form = UserSSHEdit(request.form)
        form.visible_fields = [form.ssh_keys]

        if form.validate_on_submit():
            new_entries = [
                entry.strip() for entry in form.ssh_keys.data.split("\n")
            ]
            try:
                ldap_update_attribute(user['distinguishedName'],
                                      'sshPublicKey', new_entries,
                                      'ldapPublicKey')
                flash("SSH keys successfuly updated.", "success")
                return redirect(url_for('user_overview', username=username))
            except ldap.LDAPError as e:
                error = e.message['info'].split(":", 2)[-1].strip()
                error = str(error[0].upper() + error[1:])
                flash(error, "error")
        elif form.errors:
            flash("Some fields failed validation.", "error")

        if not form.is_submitted():
            if 'sshPublicKey' in user:
                form.ssh_keys.data = "\n".join(user['sshPublicKey'])

        return render_template("forms/basicform.html",
                               form=form,
                               title=title,
                               action="Save changes",
                               parent=url_for('user_overview',
                                              username=username))
Esempio n. 12
0
    def user_edit_profile(username):
        title = "Edit user"

        if not ldap_user_exists(username=username):
            abort(404)

        user = ldap_get_user(username=username)
        form = UserProfileEdit(request.form)
        field_mapping = [('givenName', form.first_name),
                         ('sn', form.last_name),
                         ('displayName', form.display_name),
                         ('sAMAccountName', form.user_name),
                         ('mail', form.mail),
                         ('userAccountControl', form.uac_flags)]

        form.uac_flags.choices = [(key, value[0]) for key, value in
                                  LDAP_AD_USERACCOUNTCONTROL_VALUES.items()
                                  if value[1]]

        form.visible_fields = [field[1] for field in field_mapping]

        if form.validate_on_submit():
            try:
                for attribute, field in field_mapping:
                    value = field.data
                    if value != user.get(attribute):
                        if attribute == 'sAMAccountName':
                            # Rename the account
                            ldap_update_attribute(user['distinguishedName'],
                                                  "sAMAccountName", value)
                            ldap_update_attribute(user['distinguishedName'],
                                                  "userPrincipalName",
                                                  "%s@%s" % (value,
                                                             g.ldap['domain']))
                            # Finish by renaming the whole record
                            ldap_update_attribute(user['distinguishedName'],
                                                  "cn", value)
                            user = ldap_get_user(value)
                        elif attribute == 'userAccountControl':
                            current_uac = user['userAccountControl']
                            for key, flag in (LDAP_AD_USERACCOUNTCONTROL_VALUES
                                              .items()):
                                if not flag[1]:
                                    continue

                                if key in value:
                                    if not current_uac & key:
                                        current_uac += key
                                else:
                                    if current_uac & key:
                                        current_uac -= key
                            ldap_update_attribute(user['distinguishedName'],
                                                  attribute, str(current_uac))
                        else:
                            ldap_update_attribute(user['distinguishedName'],
                                                  attribute, value)

                flash("Profile successfully updated.", "success")
                return redirect(url_for('user_overview',
                                        username=form.user_name.data))
            except ldap.LDAPError as e:
                error = e.message['info'].split(":", 2)[-1].strip()
                error = str(error[0].upper() + error[1:])
                flash(error, "error")
        elif form.errors:
            flash("Some fields failed validation.", "error")

        if not form.is_submitted():
            form.first_name.data = user.get('givenName')
            form.last_name.data = user.get('sn')
            form.display_name.data = user.get('displayName')
            form.user_name.data = user.get('sAMAccountName')
            form.mail.data = user.get('mail')
            form.uac_flags.data = [key for key, flag in
                                   LDAP_AD_USERACCOUNTCONTROL_VALUES.items()
                                   if (flag[1] and
                                       user['userAccountControl'] & key)]

        return render_template("forms/basicform.html", form=form, title=title,
                               action="Save changes",
                               parent=url_for('user_overview',
                                              username=username))
Esempio n. 13
0
    def user_edit_profile(username):
        title = "Edit user"

        if not ldap_user_exists(username=username):
            abort(404)

        user = ldap_get_user(username=username)
        form = UserProfileEdit(request.form)
        field_mapping = [('givenName', form.first_name),
                         ('sn', form.last_name),
                         ('displayName', form.display_name),
                         ('sAMAccountName', form.user_name),
                         ('mail', form.mail),
                         ('userAccountControl', form.uac_flags)]

        form.uac_flags.choices = [
            (key, value[0])
            for key, value in LDAP_AD_USERACCOUNTCONTROL_VALUES.items()
            if value[1]
        ]

        form.visible_fields = [field[1] for field in field_mapping]

        if form.validate_on_submit():
            try:
                for attribute, field in field_mapping:
                    value = field.data
                    if value != user.get(attribute):
                        if attribute == 'sAMAccountName':
                            # Rename the account
                            ldap_update_attribute(user['distinguishedName'],
                                                  "sAMAccountName", value)
                            ldap_update_attribute(
                                user['distinguishedName'], "userPrincipalName",
                                "%s@%s" % (value, g.ldap['domain']))
                            # Finish by renaming the whole record
                            ldap_update_attribute(user['distinguishedName'],
                                                  "cn", value)
                            user = ldap_get_user(value)
                        elif attribute == 'userAccountControl':
                            current_uac = user['userAccountControl']
                            for key, flag in (
                                    LDAP_AD_USERACCOUNTCONTROL_VALUES.items()):
                                if not flag[1]:
                                    continue

                                if key in value:
                                    if not current_uac & key:
                                        current_uac += key
                                else:
                                    if current_uac & key:
                                        current_uac -= key
                            ldap_update_attribute(user['distinguishedName'],
                                                  attribute, str(current_uac))
                        else:
                            ldap_update_attribute(user['distinguishedName'],
                                                  attribute, value)

                flash("Profile successfully updated.", "success")
                return redirect(
                    url_for('user_overview', username=form.user_name.data))
            except ldap.LDAPError as e:
                error = e.message['info'].split(":", 2)[-1].strip()
                error = str(error[0].upper() + error[1:])
                flash(error, "error")
        elif form.errors:
            flash("Some fields failed validation.", "error")

        if not form.is_submitted():
            form.first_name.data = user.get('givenName')
            form.last_name.data = user.get('sn')
            form.display_name.data = user.get('displayName')
            form.user_name.data = user.get('sAMAccountName')
            form.mail.data = user.get('mail')
            form.uac_flags.data = [
                key for key, flag in LDAP_AD_USERACCOUNTCONTROL_VALUES.items()
                if (flag[1] and user['userAccountControl'] & key)
            ]

        return render_template("forms/basicform.html",
                               form=form,
                               title=title,
                               action="Save changes",
                               parent=url_for('user_overview',
                                              username=username))
    def user_edit_profile(username):
        title = "Edit user"

        if not ldap_user_exists(username=username):
            abort(404)

        user = ldap_get_user(username=username)
        form = UserProfileEdit(request.form)
        field_mapping = [('givenName', form.first_name),
                         ('sn', form.last_name),
                         ('sAMAccountName', form.user_name),
                         ('mail', form.mail),
                         ('userAccountControl', form.uac_flags)]

        form.uac_flags.choices = [
            (key, value[0])
            for key, value in LDAP_AD_USERACCOUNTCONTROL_VALUES.items()
        ]

        form.visible_fields = [field[1] for field in field_mapping]

        if form.validate_on_submit():
            try:
                for attribute, field in field_mapping:
                    value = field.data
                    given_name = user.get('givenName')
                    last_name = user.get('lastName')
                    if value != user.get(attribute):
                        if attribute == 'sAMAccountName':
                            # Rename the account
                            ldap_update_attribute(user['distinguishedName'],
                                                  "sAMAccountName", value)
                            ldap_update_attribute(
                                user['distinguishedName'], "userPrincipalName",
                                "%s@%s" % (value, g.ldap['domain']))
                            # Finish by renaming the whole record
                            # TODO: refactor this to use rename_s instead of update
                            # ldap_update_attribute(user['distinguishedName'], "cn", value)
                            user = ldap_get_user(value)
                        elif attribute == 'userAccountControl':
                            current_uac = 512
                            for key, flag in (
                                    LDAP_AD_USERACCOUNTCONTROL_VALUES.items()):
                                if flag[1] and key in field.data:
                                    current_uac += key
                            ldap_update_attribute(user['distinguishedName'],
                                                  attribute, str(current_uac))
                        elif attribute == 'givenName':
                            given_name = value
                            ldap_update_attribute(user['distinguishedName'],
                                                  attribute, value)
                            displayName = given_name + ' ' + last_name
                            ldap_update_attribute(user['distinguishedName'],
                                                  'displayName', displayName)
                        elif attribute == 'sn':
                            last_name = value
                            ldap_update_attribute(user['distinguishedName'],
                                                  attribute, value)
                            displayName = given_name + ' ' + last_name
                            ldap_update_attribute(user['distinguishedName'],
                                                  'displayName', displayName)
                        else:
                            ldap_update_attribute(user['distinguishedName'],
                                                  attribute, value)

                flash(u"Profile updated successfully.", "success")
                return redirect(
                    url_for('user_overview', username=form.user_name.data))
            except ldap.LDAPError as e:
                e = dict(e.args[0])
                flash(e['info'], "error")
        elif form.errors:
            flash(u"Data validation failed.", "error")

        if not form.is_submitted():
            form.first_name.data = user.get('givenName')
            form.last_name.data = user.get('sn')
            form.user_name.data = user.get('sAMAccountName')
            form.mail.data = user.get('mail')
            form.uac_flags.data = [
                key for key, flag in LDAP_AD_USERACCOUNTCONTROL_VALUES.items()
                if (flag[1] and user['userAccountControl'] & key)
            ]

        return render_template("forms/basicform.html",
                               form=form,
                               title=title,
                               action="Save changes",
                               parent=url_for('user_overview',
                                              username=username))
    def user_overview(username):
        title = "User details - %s" % username

        if not ldap_user_exists(username=username):
            abort(404)

        user = ldap_get_user(username=username)
        admin = ldap_in_group(Settings.ADMIN_GROUP)
        logged_user = g.ldap['username']

        if logged_user == user['sAMAccountName'] or admin:

            identity_fields = [('givenName', "Name"), ('sn', "Last Name"),
                               ('displayName', "Full Name"),
                               ('name', "Registry Name"),
                               ('sAMAccountName', "Username"),
                               ('mail', u"Email address")]

            if 'title' in user:
                identity_fields.append(('title', "Occupation"))
            if 'telephoneNumber' in user:
                identity_fields.append(('telephoneNumber', "Telephone"))

            if Settings.USER_ATTRIBUTES:
                for item in Settings.USER_ATTRIBUTES:
                    if item[0] in user:
                        if len(item) == 3 and item[2] == 'time':
                            datetime_field = (user[item[0]][6:8] + '/' +
                                              user[item[0]][4:6] + '/' +
                                              user[item[0]][0:4] + ' ' +
                                              user[item[0]][8:10] + ':' +
                                              user[item[0]][10:12] + ':' +
                                              user[item[0]][12:14])
                            datetime_field = datetime.strptime(
                                datetime_field, '%d/%m/%Y %H:%M:%S')
                            user[item[0]] = datetime_field.astimezone(
                                timezone(Settings.TIMEZONE))
                        if item[0] == 'jpegPhoto':
                            imgbase64 = base64.b64encode(
                                user[item[0]]).decode()
                            user[item[
                                0]] = 'data:image/jpeg;base64,' + imgbase64
                        identity_fields.append((item[0], item[1]))

            group_fields = [('sAMAccountName', "Name"),
                            ('description', u"Description")]

            user = ldap_get_user(username=username)
            group_details = []
            for group in ldap_get_membership(username):
                group_details.append(ldap_get_group(group,
                                                    'distinguishedName'))
            # group_details = [ldap_get_group(group, 'distinguishedName') for group in ldap_get_membership(username)]

            group_details = list(filter(None, group_details))

            groups = sorted(group_details,
                            key=lambda entry: entry['sAMAccountName'])

            siccip_data = None
            if 'pager' in user:
                siccip_data = get_parsed_pager_attribute(user['pager'])
                print(siccip_data)

            available_groups = ldap_get_entries(
                ldap_filter="(objectclass=group)", scope="subtree")
            group_choices = [("_", "Select a Group")]
            for group_entry in available_groups:
                if not ldap_in_group(group_entry['sAMAccountName'], username):
                    group_choices += [(group_entry['distinguishedName'],
                                       group_entry['sAMAccountName'])]

            form = UserAddGroup(request.form)
            form.available_groups.choices = group_choices

            if not form.is_submitted():
                form.available_groups.data = "_"

            if form.validate_on_submit():
                try:
                    group_to_add = form.available_groups.data
                    if group_to_add == "_":
                        flash(
                            u"You must choose a group from the drop-down list.",
                            "error")
                    else:
                        group = ldap_get_entry_simple({
                            'objectClass':
                            'group',
                            'distinguishedName':
                            group_to_add
                        })
                        if 'member' in group:
                            entries = set(group['member'])
                        else:
                            entries = set()
                        entries.add(user['distinguishedName'])
                        ldap_update_attribute(group_to_add, "member",
                                              list(entries))
                        flash(u"User successfully added to group.", "success")
                    return redirect(url_for('user_overview',
                                            username=username))
                except ldap.LDAPError as e:
                    e = dict(e.args[0])
                    flash(e['info'], "error")
            elif form.errors:
                flash(u"Data validation failed.", "error")

            parent = ",".join(user['distinguishedName'].split(',')[1:])

        else:
            abort(401)

        return render_template("pages/user_overview_es.html",
                               g=g,
                               title=title,
                               form=form,
                               user=user,
                               identity_fields=identity_fields,
                               group_fields=group_fields,
                               admin=admin,
                               groups=groups,
                               siccip_data=siccip_data,
                               parent=parent,
                               uac_values=LDAP_AD_USERACCOUNTCONTROL_VALUES)