Exemple #1
0
 def XPACK_LICENSE_IS_VALID(self):
     if not HAS_XPACK:
         return False
     try:
         from xpack.plugins.license.models import License
         return License.has_valid_license()
     except:
         return False
Exemple #2
0
 def get_xpack_license_is_valid():
     if not settings.XPACK_ENABLED:
         return False
     try:
         from xpack.plugins.license.models import License
         return License.has_valid_license()
     except Exception as e:
         logger.error(e)
         return False
Exemple #3
0
 def set_action_choices(self):
     from xpack.plugins.license.models import License
     action = self.fields.get('action')
     if not action:
         return
     choices = action._choices
     if not License.has_valid_license():
         choices.pop(LoginACL.ActionChoices.confirm, None)
     action._choices = choices
Exemple #4
0
    def get_template_names(self):
        template_name = 'authentication/login.html'
        if not settings.XPACK_ENABLED:
            return template_name

        from xpack.plugins.license.models import License
        if not License.has_valid_license():
            return template_name

        template_name = 'authentication/xpack_login.html'
        return template_name
Exemple #5
0
    def get_template_names(self):
        template_name = 'users/login.html'
        if not settings.XPACK_ENABLED:
            return template_name

        from xpack.plugins.license.models import License
        if not License.has_valid_license():
            return template_name

        template_name = 'users/new_login.html'
        return template_name
Exemple #6
0
    def get_xpack_license_is_valid():
        if not settings.XPACK_ENABLED:
            return False

        from xpack.plugins.license.models import License
        return License.has_valid_license()