View | Details | Raw Unified | Return to bug 42403
Collapse All | Expand All

(-)a/management/univention-directory-manager-modules/modules/univention/admin/uldap.py (+12 lines)
 Lines 363-368   def search(self, filter='(objectClass=*)', base='', scope='sub', attr=[], unique Link Here 
363
			raise univention.admin.uexceptions.ldapSizelimitExceeded(_err2str(msg))
363
			raise univention.admin.uexceptions.ldapSizelimitExceeded(_err2str(msg))
364
		except ldap.FILTER_ERROR as msg:
364
		except ldap.FILTER_ERROR as msg:
365
			raise univention.admin.uexceptions.ldapError('%s: %s' % (_err2str(msg), filter))
365
			raise univention.admin.uexceptions.ldapError('%s: %s' % (_err2str(msg), filter))
366
		except ldap.INVALID_DN_SYNTAX as msg:
367
			raise univention.admin.uexceptions.ldapError('%s: %s' % (_err2str(msg), base), original_exception=msg)
366
		except ldap.LDAPError as msg:
368
		except ldap.LDAPError as msg:
367
			raise univention.admin.uexceptions.ldapError(_err2str(msg), original_exception=msg)
369
			raise univention.admin.uexceptions.ldapError(_err2str(msg), original_exception=msg)
368
370
 Lines 379-384   def searchDn(self, filter='(objectClass=*)', base='', scope='sub', unique=0, req Link Here 
379
			raise univention.admin.uexceptions.ldapSizelimitExceeded(_err2str(msg))
381
			raise univention.admin.uexceptions.ldapSizelimitExceeded(_err2str(msg))
380
		except ldap.FILTER_ERROR as msg:
382
		except ldap.FILTER_ERROR as msg:
381
			raise univention.admin.uexceptions.ldapError('%s: %s' % (_err2str(msg), filter))
383
			raise univention.admin.uexceptions.ldapError('%s: %s' % (_err2str(msg), filter))
384
		except ldap.INVALID_DN_SYNTAX as msg:
385
			raise univention.admin.uexceptions.ldapError('%s: %s' % (_err2str(msg), base), original_exception=msg)
382
		except ldap.LDAPError as msg:
386
		except ldap.LDAPError as msg:
383
			raise univention.admin.uexceptions.ldapError(_err2str(msg), original_exception=msg)
387
			raise univention.admin.uexceptions.ldapError(_err2str(msg), original_exception=msg)
384
388
 Lines 403-408   def add(self, dn, al, exceptions=False): Link Here 
403
		except ldap.INSUFFICIENT_ACCESS as msg:
407
		except ldap.INSUFFICIENT_ACCESS as msg:
404
			univention.debug.debug(univention.debug.LDAP, univention.debug.ALL, 'add dn=%s err=%s' % (dn, msg))
408
			univention.debug.debug(univention.debug.LDAP, univention.debug.ALL, 'add dn=%s err=%s' % (dn, msg))
405
			raise univention.admin.uexceptions.permissionDenied
409
			raise univention.admin.uexceptions.permissionDenied
410
		except ldap.INVALID_DN_SYNTAX as msg:
411
			raise univention.admin.uexceptions.ldapError('%s: %s' % (_err2str(msg), dn), original_exception=msg)
406
		except ldap.LDAPError as msg:
412
		except ldap.LDAPError as msg:
407
			univention.debug.debug(univention.debug.LDAP, univention.debug.ALL, 'add dn=%s err=%s' % (dn, msg))
413
			univention.debug.debug(univention.debug.LDAP, univention.debug.ALL, 'add dn=%s err=%s' % (dn, msg))
408
			raise univention.admin.uexceptions.ldapError(_err2str(msg), original_exception=msg)
414
			raise univention.admin.uexceptions.ldapError(_err2str(msg), original_exception=msg)
 Lines 424-429   def modify(self, dn, changes, exceptions=False, ignore_license=0): Link Here 
424
		except ldap.INSUFFICIENT_ACCESS as msg:
430
		except ldap.INSUFFICIENT_ACCESS as msg:
425
			univention.debug.debug(univention.debug.LDAP, univention.debug.ALL, 'mod dn=%s err=%s' % (dn, msg))
431
			univention.debug.debug(univention.debug.LDAP, univention.debug.ALL, 'mod dn=%s err=%s' % (dn, msg))
426
			raise univention.admin.uexceptions.permissionDenied
432
			raise univention.admin.uexceptions.permissionDenied
433
		except ldap.INVALID_DN_SYNTAX as msg:
434
			raise univention.admin.uexceptions.ldapError('%s: %s' % (_err2str(msg), dn), original_exception=msg)
427
		except ldap.LDAPError as msg:
435
		except ldap.LDAPError as msg:
428
			univention.debug.debug(univention.debug.LDAP, univention.debug.ALL, 'mod dn=%s err=%s' % (dn, msg))
436
			univention.debug.debug(univention.debug.LDAP, univention.debug.ALL, 'mod dn=%s err=%s' % (dn, msg))
429
			raise univention.admin.uexceptions.ldapError(_err2str(msg), original_exception=msg)
437
			raise univention.admin.uexceptions.ldapError(_err2str(msg), original_exception=msg)
 Lines 445-450   def rename(self, dn, newdn, move_childs=0, ignore_license=False): Link Here 
445
		except ldap.INSUFFICIENT_ACCESS as msg:
453
		except ldap.INSUFFICIENT_ACCESS as msg:
446
			univention.debug.debug(univention.debug.LDAP, univention.debug.ALL, 'ren dn=%s err=%s' % (dn, msg))
454
			univention.debug.debug(univention.debug.LDAP, univention.debug.ALL, 'ren dn=%s err=%s' % (dn, msg))
447
			raise univention.admin.uexceptions.permissionDenied
455
			raise univention.admin.uexceptions.permissionDenied
456
		except ldap.INVALID_DN_SYNTAX as msg:
457
			raise univention.admin.uexceptions.ldapError('%s: %s' % (_err2str(msg), dn), original_exception=msg)
448
		except ldap.LDAPError as msg:
458
		except ldap.LDAPError as msg:
449
			univention.debug.debug(univention.debug.LDAP, univention.debug.ALL, 'ren dn=%s err=%s' % (dn, msg))
459
			univention.debug.debug(univention.debug.LDAP, univention.debug.ALL, 'ren dn=%s err=%s' % (dn, msg))
450
			raise univention.admin.uexceptions.ldapError(_err2str(msg), original_exception=msg)
460
			raise univention.admin.uexceptions.ldapError(_err2str(msg), original_exception=msg)
 Lines 465-470   def delete(self, dn, exceptions=False): Link Here 
465
		except ldap.INSUFFICIENT_ACCESS as msg:
475
		except ldap.INSUFFICIENT_ACCESS as msg:
466
			univention.debug.debug(univention.debug.LDAP, univention.debug.ALL, 'del dn=%s err=%s' % (dn, msg))
476
			univention.debug.debug(univention.debug.LDAP, univention.debug.ALL, 'del dn=%s err=%s' % (dn, msg))
467
			raise univention.admin.uexceptions.permissionDenied
477
			raise univention.admin.uexceptions.permissionDenied
478
		except ldap.INVALID_DN_SYNTAX as msg:
479
			raise univention.admin.uexceptions.ldapError('%s: %s' % (_err2str(msg), dn), original_exception=msg)
468
		except ldap.LDAPError as msg:
480
		except ldap.LDAPError as msg:
469
			univention.debug.debug(univention.debug.LDAP, univention.debug.ALL, 'del dn=%s err=%s' % (dn, msg))
481
			univention.debug.debug(univention.debug.LDAP, univention.debug.ALL, 'del dn=%s err=%s' % (dn, msg))
470
			raise univention.admin.uexceptions.ldapError(_err2str(msg), original_exception=msg)
482
			raise univention.admin.uexceptions.ldapError(_err2str(msg), original_exception=msg)

Return to bug 42403