2016-09-01 00:45:44 +02:00
|
|
|
# -*- coding: utf-8 -*-
|
|
|
|
|
2016-08-20 23:31:30 +02:00
|
|
|
from django.contrib.auth.context_processors import PermWrapper
|
2017-03-06 02:25:18 +01:00
|
|
|
from .views import KFET_OPEN, KFET_FORCE_CLOSE
|
2017-02-11 00:29:12 +01:00
|
|
|
|
2016-08-20 23:31:30 +02:00
|
|
|
|
2017-04-03 20:32:16 +02:00
|
|
|
from kfet.config import kfet_config
|
|
|
|
|
|
|
|
|
2016-08-20 23:31:30 +02:00
|
|
|
def auth(request):
|
|
|
|
if hasattr(request, 'real_user'):
|
|
|
|
return {
|
|
|
|
'user': request.real_user,
|
|
|
|
'perms': PermWrapper(request.real_user),
|
|
|
|
}
|
|
|
|
return {}
|
2017-02-11 00:29:12 +01:00
|
|
|
|
|
|
|
|
2017-03-11 02:04:30 +01:00
|
|
|
def kfet_open(request):
|
2017-02-11 00:29:12 +01:00
|
|
|
(kfet_open, kfet_open_date) = KFET_OPEN()
|
2017-03-06 02:25:18 +01:00
|
|
|
kfet_force_close = KFET_FORCE_CLOSE()
|
2017-02-11 00:29:12 +01:00
|
|
|
return {
|
|
|
|
'kfet_open': kfet_open,
|
2017-04-09 20:54:30 +02:00
|
|
|
'kfet_open_date': kfet_open_date.isoformat(),
|
2017-03-06 02:25:18 +01:00
|
|
|
'kfet_force_close': kfet_force_close,
|
2017-02-11 00:29:12 +01:00
|
|
|
}
|
2017-06-12 15:18:42 +02:00
|
|
|
|
|
|
|
|
2017-04-03 20:32:16 +02:00
|
|
|
def config(request):
|
|
|
|
return {'kfet_config': kfet_config}
|