def changePhoneOrder(userdn, phonedn, change): co, lo = getCoLo() user = getUser(co, lo, userdn) phones = user.get("phones", []) i = phones.index(phonedn) phones.pop(i) if change == -1 and i > 0: phones.insert(i - 1, phonedn) elif change == 1: phones.insert(i + 1, phonedn) user["phones"] = phones user.modify()
def changePhoneOrder(userdn, phonedn, change): co, lo = getCoLo() user = getUser(co, lo, userdn) phones = user.get("phones", []) i = phones.index(phonedn) phones.pop(i) if change == -1 and i > 0: phones.insert(i-1, phonedn) elif change == 1: phones.insert(i+1, phonedn) user["phones"] = phones user.modify()
def save(self, request): user, mailbox = getUserAndMailbox(self._user_dn) user["ringdelay"] = request.options["phones/interval"] user["timeout"] = request.options["mailbox/timeout"] if request.options["forwarding/number"]: user["forwarding"] = request.options["forwarding/number"] else: try: del user.info["forwarding"] except KeyError: pass user.modify() if mailbox: mailbox["password"] = request.options["mailbox/password"] mailbox["email"] = request.options["mailbox/email"] mailbox.modify() self.finished(request.id, None, "Speichern war erfolgreich!")
def save( self, request ): user, mailbox = getUserAndMailbox(self._user_dn) user["ringdelay"] = request.options["phones/interval"] user["timeout"] = request.options["mailbox/timeout"] if request.options["forwarding/number"]: user["forwarding"] = request.options[ "forwarding/number"] else: try: del user.info["forwarding"] except KeyError: pass user.modify() if mailbox: mailbox["password"] = request.options["mailbox/password"] mailbox["email"] = request.options["mailbox/email"] mailbox.modify() self.finished( request.id, None, "Speichern war erfolgreich!" )