()
| 41 | # Helper |
| 42 | |
| 43 | def pre_processor(): |
| 44 | s = request.environ.get('beaker.session') |
| 45 | user = parse_userdata(s) |
| 46 | perms = parse_permissions(s) |
| 47 | status = {} |
| 48 | captcha = False |
| 49 | update = False |
| 50 | plugins = False |
| 51 | if user["is_authenticated"]: |
| 52 | status = PYLOAD.statusServer() |
| 53 | info = PYLOAD.getInfoByPlugin("UpdateManager") |
| 54 | captcha = PYLOAD.isCaptchaWaiting() |
| 55 | |
| 56 | # check if update check is available |
| 57 | if info: |
| 58 | if info["pyload"] == "True": update = True |
| 59 | if info["plugins"] == "True": plugins = True |
| 60 | |
| 61 | |
| 62 | return {"user": user, |
| 63 | 'status': status, |
| 64 | 'captcha': captcha, |
| 65 | 'perms': perms, |
| 66 | 'url': request.url, |
| 67 | 'update': update, |
| 68 | 'plugins': plugins} |
| 69 | |
| 70 | |
| 71 | def base(messages): |
nothing calls this directly
no test coverage detected