liquid_feedback_frontend

diff app/main/index/login.lua @ 51:0849be391140

Public read access; Read-only API for initiatives; Prepared integration of OpenID
author bsw
date Sun Apr 04 22:05:11 2010 +0200 (2010-04-04)
parents 00d1004545f1
children c553898f64cb
line diff
     1.1 --- a/app/main/index/login.lua	Wed Mar 31 17:50:32 2010 +0200
     1.2 +++ b/app/main/index/login.lua	Sun Apr 04 22:05:11 2010 +0200
     1.3 @@ -44,27 +44,9 @@
     1.4  end)
     1.5  
     1.6  
     1.7 -local lang = locale.get("lang")
     1.8 -local basepath = request.get_app_basepath() 
     1.9 -local file_name = basepath .. "/locale/motd/" .. lang .. "_public.txt"
    1.10 -local file = io.open(file_name)
    1.11 -if file ~= nil then
    1.12 -  local help_text = file:read("*a")
    1.13 -  if #help_text > 0 then
    1.14 -    ui.container{
    1.15 -      attr = { class = "motd wiki" },
    1.16 -      content = function()
    1.17 -        slot.put(format.wiki_text(help_text))
    1.18 -      end
    1.19 -    }
    1.20 -  end
    1.21 -end
    1.22 -
    1.23 -
    1.24 -
    1.25  ui.tag{
    1.26    tag = 'p',
    1.27 -  content = _'You need to be logged in, to use this system.'
    1.28 +  content = _'You need to be logged in, to use all features of this system.'
    1.29  }
    1.30  
    1.31  ui.form{
    1.32 @@ -74,8 +56,9 @@
    1.33    routing = {
    1.34      ok = {
    1.35        mode   = 'redirect',
    1.36 -      module = 'index',
    1.37 -      view   = 'index'
    1.38 +      module = param.get("redirect_module") or "index",
    1.39 +      view = param.get("redirect_view") or "index",
    1.40 +      id = param.get("redirect_id"),
    1.41      },
    1.42      error = {
    1.43        mode   = 'forward',
    1.44 @@ -102,3 +85,27 @@
    1.45    end
    1.46  }
    1.47  
    1.48 +if config.auth_openid_enabled then
    1.49 +  ui.form{
    1.50 +    attr = { class = "login" },
    1.51 +    module = 'openid',
    1.52 +    action = 'initiate',
    1.53 +    routing = {
    1.54 +      default = {
    1.55 +        mode   = 'forward',
    1.56 +        module = 'index',
    1.57 +        view   = 'login',
    1.58 +      }
    1.59 +    },
    1.60 +    content = function()
    1.61 +      ui.field.text{
    1.62 +        label     = _'OpenID',
    1.63 +        html_name = 'openid_identifier',
    1.64 +        value     = ''
    1.65 +      }
    1.66 +      ui.submit{
    1.67 +        text = _'OpenID Login'
    1.68 +      }
    1.69 +    end
    1.70 +  }
    1.71 +end

Impressum / About Us