def ChangeProtectOldMode(self, active, sender, connection):
        """Change whether old boot options are password protected
        active = boolean
        """
        check_authorization(sender, connection, self.__action)

        self.__grub.Change_protect_oldmode(active)
    def ChangeProtectRescueMode(self, active, sender, connection):
        """Change whether the alternate boot option is password protected
        active = boolean
        """
        check_authorization(sender, connection, self.__action)

        self.__grub.Change_protect_rescuemode(active)
    def ChangeTimeout(self, timeout, sender, connection):
        """Change the timeout in seconds used in the Grub menu.
        active = bool whether timeout is used
        timeout = number of seconds
        """
        check_authorization(sender, connection, self.__action)

        self.__grub.set_timeout(timeout)
    def ChangeVgaCode(self, vga, sender, connection):
        """Change the resolution based on Grub vga code
        vga = integer, grub vga code
        """
        check_authorization(sender, connection,
            'org.mandrivalinux.mcc2.grub.rootpassword')

        self.__grub.set_vga_code(vga)
    def UpdatePassword(self, password, active, sender, connection):
        """Change password for grub menu, and whether
        password protection is active
        
        active = boolean
        password = string, must be at least four characters
        """
        check_authorization(sender, connection, self.__action)

        self.__grub.update_password(password, active)
    def ChangePasswordProtection(self, active, sender, connection):
        """Change whether the Grub menu is password protected
        
        @param active: boolean
        
        @return dbus.Bollean
        """
        check_authorization(sender, connection, self.__action)

        self.__grub.set_password_protection(active)
    def ChangeDefaultBoot(self, name, sender, connection):
        """
        Change the default booted option to name.
    
        -1 set it to savedefault.
        Return 0 if successful.
        Return 1 if failed.
        """
        check_authorization(sender, connection, self.__action)

        return self.__grub.set_default_boot(name)
    def DeleteOption(self, option, number, sender, connection):
        check_authorization(sender, connection, self.__action)

        opt = self.__sshd.get_option(option, number)
        if not opt:
            msg = 'org.mandrivalinux.mcc2.Sshd.Error.OptionNotFound'
            raise dbus.exceptions.DBusException, msg
        result = self.__sshd.remove_option(opt)
        if result == -1:
            msg = 'org.mandrivalinux.mcc2.Sshd.Error.DeleteOptionError'
            raise dbus.exceptions.DBusException, msg
        return option
 def AddOption(self, option, value, number, sender, connection):
     check_authorization(sender, connection, self.__action)
     opt = None
     if isinstance(value, dbus.Array):
         print 'Creating MccMultiValueOption'
         opt = MccMultiValueOption(name=option, value=value)
     elif isinstance(value, dbus.String):
         print 'Creating MccOption'
         opt = MccOption(name=option, value=value, num=number)
     else:
         msg = 'org.mandrivalinux.mcc2.Sshd.Error.UnsupportedType'
         raise dbus.exceptions.DBusException, msg
     print self.__sshd.set_option(opt)
     return 1