def objectclass_by_usertype(usertype=None):
    global _ldap_userstruct

    if _ldap_userstruct["objectclass"].has_key(userdef.usertype_as_id(usertype)):
        return _ldap_userstruct["objectclass"][userdef.usertype_as_id(usertype)]

    return None
def ou_confkey_by_usertype(usertype=None):
    global _ldap_userstruct

    if _ldap_userstruct["ou_confkey"].has_key(userdef.usertype_as_id(usertype)):
        return _ldap_userstruct["ou_confkey"][userdef.usertype_as_id(usertype)]

    return None
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
# Library General Public License for more details.
#
# You should have received a copy of the GNU Library General Public License
# along with this library; see the file COPYING.LIB.  If not, write to
# the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
# Boston, MA 02110-1301, USA.

import userdef
import groupdef

_ldap_userstruct = {}

_ldap_userstruct["ou_confkey"] = {
    userdef.usertype_as_id("teacher"): "teachers_ou",
    userdef.usertype_as_id("student"): "students_ou",
    userdef.usertype_as_id("parent"): "parents_ou",
    userdef.usertype_as_id("other"): "others_ou",
    None: "undefined_ou",
}

_ldap_userstruct["objectclass"] = {
    userdef.usertype_as_id("teacher"): [
        "inetOrgPerson",
        "organizationalPerson",
        "posixAccount",
        "shadowAccount",
        "person",
        "top",
        "skoleSysTeacher",