Skip to content

Automagically logs out users from Megaplan when the amount of active licenses is near depletion.

License

Notifications You must be signed in to change notification settings

shumakoff/miniplan

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Auto-logout mechanism for Megaplan system. Автоматически разлогинивает пользователей из системы Мегаплан, когда количество активных лицензий подходит к концу.

Put miniplan wherever, run it by cron.

Put this code in /etc/nginx/megaplan/userlive.redis.conf:

location = /userLive {
    rewrite_by_lua '
    local user_id = ngx.var[\'arg_uid\']
    local domain_name = ngx.var[\'http_host\']
    local redirect_url = "https://"..domain_name.."/logout"
    local file = io.open("/tmp/uids.txt", "r")
    local line = file:read()
        --ngx.log(ngx.ERR, "==== Redirecting to: "..redirect_url.." ====")
        if line == user_id then
            ngx.redirect(redirect_url)
            ngx.exit(503)
            end
        ';

About

Automagically logs out users from Megaplan when the amount of active licenses is near depletion.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages