コード例 #1
0
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()
コード例 #2
0
ファイル: __init__.py プロジェクト: decoit/asterisk4ucs
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()
コード例 #3
0
    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!")
コード例 #4
0
ファイル: __init__.py プロジェクト: decoit/asterisk4ucs
	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!" )