Esempio n. 1
0
    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)
Esempio n. 2
0
    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)
Esempio n. 3
0
    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)
Esempio n. 4
0
    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)
Esempio n. 5
0
    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)
Esempio n. 6
0
    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)
Esempio n. 7
0
    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)
Esempio n. 8
0
    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 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
Esempio n. 10
0
 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
 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