Browse Source

Opening and closing friendica account registrations

Bob Mottram 8 years ago
parent
commit
e03a67f1e3
1 changed files with 19 additions and 3 deletions
  1. 19
    3
      src/freedombone-app-friendica

+ 19
- 3
src/freedombone-app-friendica View File

@@ -128,6 +128,18 @@ function friendica_channel_directory_server {
128 128
     esac
129 129
 }
130 130
 
131
+function friendica_close_registrations {
132
+    sed -i "s|REGISTER_OPEN|REGISTER_CLOSED|g" /var/www/$FRIENDICA_DOMAIN_NAME/htdocs/.htconfig.php
133
+    dialog --title $"Friendica Account Registrations" \
134
+           --msgbox $"New registrations are now closed" 6 40
135
+}
136
+
137
+function friendica_open_registrations {
138
+    sed -i "s|REGISTER_CLOSED|REGISTER_OPEN|g" /var/www/$FRIENDICA_DOMAIN_NAME/htdocs/.htconfig.php
139
+    dialog --title $"Friendica Account Registrations" \
140
+           --msgbox $"New registrations are permitted" 6 40
141
+}
142
+
131 143
 function configure_interactive_friendica {
132 144
     while true
133 145
     do
@@ -135,10 +147,12 @@ function configure_interactive_friendica {
135 147
         trap "rm -f $data" 0 1 2 5 15
136 148
         dialog --backtitle $"Freedombone Control Panel" \
137 149
                --title $"Friendica" \
138
-               --radiolist $"Choose an operation:" 13 70 4 \
150
+               --radiolist $"Choose an operation:" 15 70 6 \
139 151
                1 $"Set channel directory server" off \
140 152
                2 $"Renew SSL certificate" off \
141
-               3 $"Back to main menu" on 2> $data
153
+               3 $"Close new account registrations" off \
154
+               4 $"Open new account registrations" off \
155
+               5 $"Back to main menu" on 2> $data
142 156
         sel=$?
143 157
         case $sel in
144 158
             1) break;;
@@ -147,7 +161,9 @@ function configure_interactive_friendica {
147 161
         case $(cat $data) in
148 162
             1) friendica_channel_directory_server;;
149 163
             2) friendica_renew_cert;;
150
-            3) break;;
164
+            3) friendica_close_registrations;;
165
+            4) friendica_open_registrations;;
166
+            5) break;;
151 167
         esac
152 168
     done
153 169
 }