diff options
-rw-r--r-- | .debianinstall/debian-setup.sh | 24 | ||||
-rw-r--r-- | Zotlabs/Module/Lang.php | 16 | ||||
-rw-r--r-- | include/language.php | 36 |
3 files changed, 32 insertions, 44 deletions
diff --git a/.debianinstall/debian-setup.sh b/.debianinstall/debian-setup.sh index 758d13e68..2982b82eb 100644 --- a/.debianinstall/debian-setup.sh +++ b/.debianinstall/debian-setup.sh @@ -160,8 +160,8 @@ function install_composer { print_info "We check if Composer is already downloaded" if [ ! -f /usr/local/bin/composer ] then - EXPECTED_CHECKSUM="$(php -r 'copy("https://composer.github.io/installer.sig", "php://stdout");')" - php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');" + EXPECTED_CHECKSUM="`wget -qO- https://composer.github.io/installer.sig`" + wget https://getcomposer.org/installer -O composer-setup.php ACTUAL_CHECKSUM="$(php -r "echo hash_file('sha384', 'composer-setup.php');")" if [ "$EXPECTED_CHECKSUM" != "$ACTUAL_CHECKSUM" ] then @@ -171,6 +171,7 @@ function install_composer { fi php composer-setup.php --quiet RESULT=$? + composer --version rm composer-setup.php # exit $RESULT # We install Composer globally @@ -181,7 +182,7 @@ function install_composer { fi cd $install_path export COMPOSER_ALLOW_SUPERUSER=1; - /usr/local/bin/composer install --no-dev + /usr/local/bin/composer install --no-dev --quiet /usr/local/bin/composer show export COMPOSER_ALLOW_SUPERUSER=0; } @@ -307,10 +308,19 @@ function install_run_selfhost { # https://carol.selfhost.de/update?username=123456&password=supersafe # # the prefered way - wget --output-document=$selfhostdir/$selfhostscript https://jonaspasche.de/selfhost-updater - echo "router" > $selfhostdir/device - echo "$selfhost_user" > $selfhostdir/user - echo "$selfhost_pass" > $selfhostdir/pass + if [ ! -f $selfhostdir/$selfhostscript ] + then + wget --output-document=$selfhostdir/$selfhostscript https://jonaspasche.de/selfhost-updater + if [ ! -s $selfhostdir/$selfhostscript ] + then + die "Failed to download selfHOST file for dynDNS" + fi + echo "router" > $selfhostdir/device + echo "$selfhost_user" > $selfhostdir/user + echo "$selfhost_pass" > $selfhostdir/pass + print_info "Wrote file to update dynamic IP. File: $selfhostdir/$selfhostscript" + fi + print_info "executing $selfhostdir/$selfhostscript update..." bash $selfhostdir/$selfhostscript update fi } diff --git a/Zotlabs/Module/Lang.php b/Zotlabs/Module/Lang.php index fe185ebea..1eeb29363 100644 --- a/Zotlabs/Module/Lang.php +++ b/Zotlabs/Module/Lang.php @@ -65,8 +65,22 @@ class Lang extends Controller { } nav_set_selected('Language'); - return lang_selector(); + return $this->lang_selector(); } + private function lang_selector(): string + { + $lang_options = language_list(); + array_unshift($lang_options, t('default')); + + $tpl = get_markup_template('lang_selector.tpl'); + + return replace_macros($tpl, [ + '$title' => t('Select an alternate language'), + '$langs' => array($lang_options, App::$language), + + ]); + } + } diff --git a/include/language.php b/include/language.php index 538f67d90..44b3419d5 100644 --- a/include/language.php +++ b/include/language.php @@ -391,7 +391,6 @@ function language_list() { $langs = glob('view/*/hstrings.php'); $lang_options = array(); - $selected = ""; if(is_array($langs) && count($langs)) { if(! in_array('view/en/hstrings.php',$langs)) @@ -406,41 +405,6 @@ function language_list() { return $lang_options; } -function lang_selector() { - - $langs = glob('view/*/hstrings.php'); - - $lang_options = array(); - $selected = ""; - - if(is_array($langs) && count($langs)) { - $langs[] = ''; - if(! in_array('view/en/hstrings.php',$langs)) - $langs[] = 'view/en/'; - asort($langs); - foreach($langs as $l) { - if($l == '') { - $lang_options[""] = t('default'); - continue; - } - $ll = substr($l,5); - $ll = substr($ll,0,strrpos($ll,'/')); - $selected = (($ll === App::$language && (x($_SESSION, 'language'))) ? $ll : $selected); - $lang_options[$ll] = get_language_name($ll, $ll) . " ($ll)"; - } - } - - $tpl = get_markup_template('lang_selector.tpl'); - - $o = replace_macros($tpl, array( - '$title' => t('Select an alternate language'), - '$langs' => array($lang_options, $selected), - - )); - - return $o; -} - function rtl_languages() { return [ 'ar', |