Explorar o código

Small fixes to installer and 2fa authentication.

Raphael Schneeberger %!s(int64=7) %!d(string=hai) anos
pai
achega
014c203942
Modificáronse 2 ficheiros con 10 adicións e 9 borrados
  1. 8 7
      install/upgrade/0.9.8-28.sh
  2. 2 2
      web/templates/admin/edit_user.html

+ 8 - 7
install/upgrade/0.9.8-28.sh

@@ -60,15 +60,16 @@ fi
 
 # Set Purge to false in roundcube config - https://goo.gl/3Nja3u
 if [ -f /etc/roundcube/config.inc.php ]; then
-    sed "s/deletion'] = 'Purge'/deletion'] = false/g" /etc/roundcube/config.inc.php
-elif [ -f /etc/roundcube/main.inc.php ]
-    sed "s/deletion'] = 'Purge'/deletion'] = false/g" /etc/roundcube/main.inc.php
+    sed -i "s/deletion'] = 'Purge'/deletion'] = false/g" /etc/roundcube/config.inc.php
+fi
+if [ -f /etc/roundcube/main.inc.php ]; then
+    sed -i "s/deletion'] = 'Purge'/deletion'] = false/g" /etc/roundcube/main.inc.php
 fi
 
 # Copy default "Success" page for unassigned hosts
-cp -rf $hestiacp/templates/web/unassigned/* /var/www/
+cp -rf /usr/local/hestia/install/ubuntu/18.04/templates/web/unassigned/* /var/www/
 
 # Move clamav to proper location - https://goo.gl/zNuM11
-if [ -d /usr/local/web/edit/server/clamav-daemon ]; then
-    mv /usr/local/web/edit/server/clamd mv /usr/local/web/edit/server/clamav-daemon
-fi
+if [ ! -d /usr/local/hestia/web/edit/server/clamav-daemon ]; then
+    mv /usr/local/hestia/web/edit/server/clamd /usr/local/web/edit/server/clamav-daemon
+fi

+ 2 - 2
web/templates/admin/edit_user.html

@@ -74,8 +74,8 @@
                             </tr>
                             <tr>
                                 <td>
-                                    <label><input type="checkbox" class="vst-checkbox" name="v_twofa" <?php if($v_twofa == 'yes') echo "checked=yes" ?> onclick="App.Actions.WEB.toggle_twofa(this)"> <?php print __('Enable 2FA');?></label>
-                                    <?php if($v_twofa == 'yes') { ?>
+                                    <label><input type="checkbox" class="vst-checkbox" name="v_twofa" <?php if(!empty($v_twofa)) echo "checked=yes" ?> onclick="App.Actions.WEB.toggle_twofa(this)"> <?php print __('Enable 2FA');?></label>
+                                    <?php if (!empty($v_twofa)) { ?>
                                     <p><?php echo __('Please scan the code below in your 2FA application:'); ?></p>
                                     <img src="<?php echo $v_qrcode; ?>">
                                     <?php } ?>