annotate app/main/index/email_unconfirmed.lua @ 1355:6268a857f6e6
Set correct value in new privilege record
 | author | 
 bsw | 
 | date | 
 Mon Aug 06 13:34:26 2018 +0200 (2018-08-06) | 
 | parents | 
 701a5cf6b067  | 
 | children | 
 ad1107fc0fbf  | 
 
 | rev | 
   line source | 
| 
bsw@558
 | 
     1 if app.session.member.notify_email_unconfirmed then
 | 
| 
bsw@558
 | 
     2 
 | 
| 
bsw@558
 | 
     3   local current = Member:new_selector()
 | 
| 
bsw@558
 | 
     4     :add_where{ "id = ?", app.session.member_id }
 | 
| 
bsw@558
 | 
     5     :add_where("notify_email_unconfirmed NOTNULL")
 | 
| 
bsw@558
 | 
     6     :add_where("notify_email_secret_expiry > now()")
 | 
| 
bsw@558
 | 
     7     :optional_object_mode()
 | 
| 
bsw@558
 | 
     8     :exec()
 | 
| 
bsw@558
 | 
     9 
 | 
| 
bsw@1045
 | 
    10   ui.title(_"Confirm notification address")
 | 
| 
bsw@558
 | 
    11 
 | 
| 
bsw@1045
 | 
    12   ui.section( function()
 | 
| 
bsw@1045
 | 
    13     ui.sectionHead( function()
 | 
| 
bsw@1045
 | 
    14       ui.heading{ level = 1, content = _"Notification address unconfirmed" }
 | 
| 
bsw@1045
 | 
    15     end )
 | 
| 
bsw@1045
 | 
    16     
 | 
| 
bsw@1045
 | 
    17     ui.sectionRow( function()
 | 
| 
bsw@1045
 | 
    18       if current then
 | 
| 
bsw@1045
 | 
    19         ui.tag{
 | 
| 
bsw@1045
 | 
    20           tag = "div",
 | 
| 
bsw@1045
 | 
    21           content = _("You didn't confirm your email address '#{email}'. You have received an email with an activation link.", { email = app.session.member.notify_email_unconfirmed })
 | 
| 
bsw@1045
 | 
    22         }
 | 
| 
bsw@1045
 | 
    23       else
 | 
| 
bsw@1045
 | 
    24         ui.tag{
 | 
| 
bsw@1045
 | 
    25           tag = "div",
 | 
| 
bsw@1045
 | 
    26           content = _("You didn't confirm your email address '#{email}' within 7 days.", { email = app.session.member.notify_email_unconfirmed })
 | 
| 
bsw@1045
 | 
    27         }
 | 
| 
bsw@1045
 | 
    28       end
 | 
| 
bsw@1045
 | 
    29       slot.put("<br />")
 | 
| 
bsw@558
 | 
    30 
 | 
| 
bsw@1045
 | 
    31       ui.link{
 | 
| 
bsw@1045
 | 
    32         text = _"Change email address",
 | 
| 
bsw@1045
 | 
    33         module = "member",
 | 
| 
bsw@1045
 | 
    34         view = "settings_email",
 | 
| 
bsw@1045
 | 
    35       }
 | 
| 
bsw@1045
 | 
    36       slot.put("<br />")
 | 
| 
bsw@1045
 | 
    37       slot.put("<br />")
 | 
| 
bsw@558
 | 
    38 
 | 
| 
bsw@1045
 | 
    39       ui.link{
 | 
| 
bsw@1045
 | 
    40         text = _("Resend activation email to '#{email}'", { email = app.session.member.notify_email_unconfirmed }),
 | 
| 
bsw@1045
 | 
    41         module = "member",
 | 
| 
bsw@1045
 | 
    42         action = "update_email",
 | 
| 
bsw@1045
 | 
    43         params = {
 | 
| 
bsw@1045
 | 
    44           resend = true
 | 
| 
bsw@1045
 | 
    45         },
 | 
| 
bsw@1045
 | 
    46         routing = {
 | 
| 
bsw@1045
 | 
    47           default = {
 | 
| 
bsw@1045
 | 
    48             mode = "redirect",
 | 
| 
bsw@1045
 | 
    49             module = "index",
 | 
| 
bsw@1045
 | 
    50             view = "index"
 | 
| 
bsw@1045
 | 
    51           }
 | 
| 
bsw@1045
 | 
    52         }
 | 
| 
bsw@558
 | 
    53       }
 | 
| 
bsw@1045
 | 
    54     end )
 | 
| 
bsw@1045
 | 
    55   end )
 | 
| 
bsw@558
 | 
    56 end
 |