예제 #1
0
def fixture_disable_restricted_access(needs_root, load_cfg):
    """Disable console login restrictions."""
    restricted_access = security.get_restricted_access_enabled()
    if restricted_access:
        security.set_restricted_access(False)
        yield
        security.set_restricted_access(True)
    else:
        yield
예제 #2
0
 def setUp(self):
     """Setup each ."""
     current_directory = os.path.dirname(__file__)
     self.action_file = os.path.join(current_directory, '..', '..', '..',
                                     '..', 'actions', 'users')
     self.users = set()
     self.groups = set()
     self.restricted_access = security.get_restricted_access_enabled()
     if self.restricted_access:
         security.set_restricted_access(False)
예제 #3
0
파일: views.py 프로젝트: fonfon/Plinth
def get_status(request):
    """Return the current status"""
    return {'restricted_access': security.get_restricted_access_enabled()}
예제 #4
0
파일: views.py 프로젝트: rajur7/Plinth
def get_status(request):
    """Return the current status"""
    return {'restricted_access': security.get_restricted_access_enabled()}
예제 #5
0
def get_status(request):
    """Return the current status"""
    return {
        'restricted_access': security.get_restricted_access_enabled(),
        'fail2ban_enabled': action_utils.service_is_enabled('fail2ban')
    }