Esempio n. 1
0
 def on_save(cls, changes: Changeset, database: Database) -> Changeset:
     changes = BaseAccount.on_save(changes, database)
     changes = dhelpers.save_account(changes, OpenldapAccount, database)
     changes = helpers.save_pwdpolicy(changes)
     changes = helpers.set_object_class(changes, ['top', 'person', 'inetOrgPerson', 'organizationalPerson',
                                                  'shadowAccount', 'posixAccount', 'pwdPolicy'])
     return changes
Esempio n. 2
0
 def on_save(cls, changes: Changeset, database: Database) -> Changeset:
     changes = BaseAccount.on_save(changes, database)
     changes = dhelpers.save_account(changes, Ds389Account, database)
     changes = helpers.save_password_object(changes)
     changes = helpers.set_object_class(changes, ['top', 'person', 'inetOrgPerson', 'organizationalPerson',
                                                  'shadowAccount', 'posixAccount', 'passwordObject'])
     return changes
Esempio n. 3
0
 def on_save(cls, changes: Changeset, database: Database) -> Changeset:
     settings = database.settings
     changes = helpers.save_group(changes)
     changes = dhelpers.save_group(changes, Group, database)
     changes = helpers.set_object_class(changes, ['top', 'posixGroup'])
     changes = helpers.rdn_to_dn(changes, 'cn', settings['LDAP_GROUP_BASE'])
     return changes
Esempio n. 4
0
 def on_save(cls, changes: Changeset, database: Database) -> Changeset:
     changes = BaseAccount.on_save(changes, database)
     changes = dhelpers.save_account(changes, Ds389Account, database)
     changes = helpers.save_password_object(changes)
     changes = helpers.set_object_class(changes, ['top', 'person', 'inetOrgPerson', 'organizationalPerson',
                                                  'shadowAccount', 'posixAccount', 'passwordObject'])
     return changes
Esempio n. 5
0
 def on_save(cls, changes: Changeset, database: Database) -> Changeset:
     changes = BaseAccount.on_save(changes, database)
     changes = dhelpers.save_account(changes, OpenldapAccount, database)
     changes = helpers.save_pwdpolicy(changes)
     changes = helpers.set_object_class(changes, ['top', 'person', 'inetOrgPerson', 'organizationalPerson',
                                                  'shadowAccount', 'posixAccount', 'pwdPolicy'])
     return changes
Esempio n. 6
0
    def on_save(cls, changes: Changeset, database: Database) -> Changeset:
        settings = database.settings
        changes = helpers.save_person(changes, database)
        changes = helpers.save_account(changes, database)
        changes = helpers.save_shadow(changes)

        classes = ['top', 'person', 'inetOrgPerson', 'organizationalPerson',
                   'shadowAccount', 'posixAccount']

        if os.environ['LDAP_TYPE'] == "openldap":
            changes = helpers.save_pwdpolicy(changes)
            classes = classes + ['pwdPolicy']
        elif os.environ['LDAP_TYPE'] == 'ds389':
            changes = helpers.save_password_object(changes)
            classes = classes + ['passwordObject']

        changes = dhelpers.save_account(changes, Account, database)
        changes = helpers.set_object_class(changes, classes)
        changes = helpers.rdn_to_dn(changes, 'uid', settings['LDAP_ACCOUNT_BASE'])
        return changes
Esempio n. 7
0
 def on_save(cls, changes: Changeset, database: Database) -> Changeset:
     settings = database.settings
     changes = helpers.save_group(changes)
     changes = helpers.set_object_class(changes, ['top', 'posixGroup'])
     changes = helpers.rdn_to_dn(changes, 'cn', settings['LDAP_GROUP_BASE'])
     return changes
Esempio n. 8
0
 def on_save(cls, changes: Changeset, _database: Database) -> Changeset:
     changes = helpers.set_object_class(changes, ['top', 'organizationalUnit'])
     return changes