OLD | NEW |
| (Empty) |
1 define discourse::admin( | |
2 $email = $title, | |
3 $ensure = 'present' | |
4 ) { | |
5 # Attempt some escaping | |
6 $escaped_email = regsubst($email, '[\'\\]', '\\\1', 'G') | |
7 | |
8 case $ensure { | |
9 default: { | |
10 err("unknown ensure value ${ensure}") | |
11 } | |
12 present: { | |
13 # Only confirmed accounts should be made admins | |
14 postgresql_psql {"UPDATE users SET admin = true WHERE email = '$escaped_em
ail'": | |
15 db => 'discourse', | |
16 psql_user => 'discourse' | |
17 } | |
18 } | |
19 absent: { | |
20 postgresql_psql {"UPDATE users SET admin = false WHERE email = '$escaped_e
mail'": | |
21 db => 'discourse', | |
22 psql_user => 'discourse' | |
23 } | |
24 } | |
25 } | |
26 } | |
OLD | NEW |