Skip to content

Commit

Permalink
Merge remote-tracking branch 'refs/remotes/origin/development'
Browse files Browse the repository at this point in the history
  • Loading branch information
crestAT committed Nov 29, 2016
2 parents c547288 + c4851aa commit 9e479b2
Show file tree
Hide file tree
Showing 20 changed files with 76 additions and 40 deletions.
Binary file modified owncloud/locale-owncloud/de/LC_MESSAGES/nas4free.mo
Binary file not shown.
Binary file modified owncloud/locale-owncloud/el/LC_MESSAGES/nas4free.mo
Binary file not shown.
Binary file modified owncloud/locale-owncloud/es/LC_MESSAGES/nas4free.mo
Binary file not shown.
Binary file modified owncloud/locale-owncloud/fr/LC_MESSAGES/nas4free.mo
Binary file not shown.
Binary file modified owncloud/locale-owncloud/it/LC_MESSAGES/nas4free.mo
Binary file not shown.
Binary file modified owncloud/locale-owncloud/nl/LC_MESSAGES/nas4free.mo
Binary file not shown.
Binary file modified owncloud/locale-owncloud/ro/LC_MESSAGES/nas4free.mo
Binary file not shown.
Binary file modified owncloud/locale-owncloud/ru/LC_MESSAGES/nas4free.mo
Binary file not shown.
Binary file modified owncloud/locale-owncloud/sv/LC_MESSAGES/nas4free.mo
Binary file not shown.
Binary file modified owncloud/locale-owncloud/tr/LC_MESSAGES/nas4free.mo
Binary file not shown.
Binary file modified owncloud/locale-owncloud/uk/LC_MESSAGES/nas4free.mo
Binary file not shown.
Binary file not shown.
18 changes: 11 additions & 7 deletions owncloud/owncloud-config.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
/*
owncloud-config.php
Copyright (c) 2015 - 2016 Andreas Schmidhuber
Copyright (c) 2013 - 2017 Andreas Schmidhuber
All rights reserved.
Redistribution and use in source and binary forms, with or without
Expand Down Expand Up @@ -41,7 +41,8 @@
bindtextdomain("nas4free", "/usr/local/share/locale-owncloud");
$config_file = "ext/owncloud/owncloud.conf";
if (($configuration = load_config($config_file)) === false) $input_errors[] = sprintf(gettext("Configuration file %s not found!"), "owncloud.conf");
$owncloud_source = "https://download.owncloud.org/community/owncloud-9.1.1.zip";
// https://download.owncloud.org/community/owncloud-9.1.1.zip
$owncloud_source = "https://download.owncloud.org/community/owncloud-9.1.2.zip";

$pgtitle = array(gettext("Extensions"), gettext("OwnCloud")." ".$configuration['version'], gettext("Configuration"));

Expand Down Expand Up @@ -163,11 +164,14 @@ function change_perms($dir) {
$configuration['storage_path'] = !empty($configuration['storage_path']) ? $configuration['storage_path'] : str_replace("//", "/", $config['websrv']['documentroot']."/owncloud");
$configuration['download_path'] = !empty($configuration['download_path']) ? $configuration['download_path'] : $g['media_path'];

$return_val = mwexec("fetch -o {$configuration['rootfolder']}/version_server.txt https://raw.github.com/crestAT/nas4free-owncloud/master/owncloud/version.txt", false);
if ($return_val == 0) {
$server_version = exec("cat {$configuration['rootfolder']}/version_server.txt");
if ($server_version != $configuration['version']) { $savemsg .= sprintf(gettext("New extension version %s available, push '%s' button to install the new version!"), $server_version, gettext("Maintenance")); }
} //EOversion-check
$test_filename = "{$configuration['rootfolder']}/version_server.txt";
if (!is_file($test_filename) || filemtime($test_filename) < time() - 86400) { // test if file exists or is older than 24 hours
$return_val = mwexec("fetch -o {$test_filename} https://raw.github.com/crestAT/nas4free-owncloud/master/owncloud/version.txt", false);
if ($return_val == 0) {
$server_version = exec("cat {$test_filename}");
if ($server_version != $configuration['version']) { $savemsg .= sprintf(gettext("New extension version %s available, push '%s' button to install the new version!"), $server_version, gettext("Maintenance")); }
}
} //EOversion-check

if (is_ajax()) {
$getinfo = get_process_info();
Expand Down
62 changes: 40 additions & 22 deletions owncloud/owncloud-install.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
/*
owncloud-install.php
Copyright (c) 2015 - 2016 Andreas Schmidhuber
Copyright (c) 2013 - 2017 Andreas Schmidhuber
All rights reserved.
Redistribution and use in source and binary forms, with or without
Expand All @@ -29,8 +29,8 @@
of the authors and should not be interpreted as representing official policies,
either expressed or implied, of the FreeBSD Project.
*/
$version = "v0.1"; // extension version
$appname = "OwnCloud"; // extension name
$version = "v0.1.1"; // extension version
$appname = "OwnCloud"; // extension name

require_once("config.inc");

Expand Down Expand Up @@ -64,7 +64,6 @@
$config_file = "{$install_dir}/{$config_name}/{$config_name}.conf";
if (is_file("{$install_dir}/version.txt")) { $file_version = exec("cat {$install_dir}/version.txt"); }
else { $file_version = "n/a"; }
// $savemsg = sprintf(gettext("Update to version %s completed!"), $file_version);
}
else {
$input_errors[] = sprintf(gettext("Archive file %s not found, installation aborted!"), "master.zip corrupt /");
Expand All @@ -81,25 +80,44 @@
$configuration = array(); // new installation
$new_installation = true;
}
$configuration['appname'] = $appname;
$configuration['version'] = exec("cat {$install_dir}/version.txt");
$configuration['rootfolder'] = $install_dir;
$configuration['postinit'] = "/usr/local/bin/php-cgi -f {$install_dir}/{$config_name}-start.php";
$configuration['appname'] = $appname;
$configuration['version'] = exec("cat {$install_dir}/version.txt");
$configuration['rootfolder'] = $install_dir;
$configuration['postinit'] = "/usr/local/bin/php-cgi -f {$install_dir}/{$config_name}-start.php";

if ( is_array($config['rc']['postinit'] ) && is_array( $config['rc']['postinit']['cmd'] ) ) {
for ($i; $i < count($config['rc']['postinit']['cmd']);) {
if (preg_match('/extended-gui/', $config['rc']['postinit']['cmd'][$i])) break; ++$i; }
// remove start/stop commands
// remove existing old rc format entries
if (is_array($config['rc']) && is_array($config['rc']['postinit']) && is_array( $config['rc']['postinit']['cmd'])) {
$rc_param_count = count($config['rc']['postinit']['cmd']);
for ($i = 0; $i < $rc_param_count; $i++) {
if (preg_match("/{$config_name}/", $config['rc']['postinit']['cmd'][$i])) unset($config['rc']['postinit']['cmd'][$i]);
}
$config['rc']['postinit']['cmd'][$i] = $config['extended-gui']['rootfolder']."extended-gui_start.php";

if (is_array($config['rc']['postinit'] ) && is_array($config['rc']['postinit']['cmd'] ) ) {
for ($i = 0; $i < count($config['rc']['postinit']['cmd']); $i++) {
if (preg_match("/{$config_name}/", $config['rc']['postinit']['cmd'][$i])) break; }
}
$config['rc']['postinit']['cmd'][$i] = $configuration['postinit'];
save_config($config_file, $configuration);
write_config();
require_once("{$install_dir}/{$config_name}-start.php");
if ($new_installation) echo "\nInstallation completed, use WebGUI | Extensions | ".$appname." to configure the application!\n";
}
// remove existing entries for new rc format
if (is_array($config['rc']) && is_array($config['rc']['param'])) {
$rc_param_count = count($config['rc']['param']);
for ($i = 0; $i < $rc_param_count; $i++) {
if (preg_match("/{$config_name}/", $config['rc']['param'][$i]['value'])) unset($config['rc']['param'][$i]);
}
}

if ($release[0] >= 11.0) { // new rc format
// postinit command
$rc_param = [];
$rc_param['uuid'] = uuid();
$rc_param['name'] = "{$appname} Extension";
$rc_param['value'] = $configuration['postinit'];
$rc_param['comment'] = "Start {$appname} Extension";
$rc_param['typeid'] = '2';
$rc_param['enable'] = true;
$config['rc']['param'][] = $rc_param;
$configuration['rc_uuid_start'] = $rc_param['uuid'];
}
else {
$config['rc']['postinit']['cmd'][$i] = $configuration['postinit'];
}
save_config($config_file, $configuration);
write_config();
require_once("{$install_dir}/{$config_name}-start.php");
if ($new_installation) echo "\nInstallation completed, use WebGUI | Extensions | ".$appname." to configure the application!\n";
?>
2 changes: 1 addition & 1 deletion owncloud/owncloud-start.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
/*
owncloud-start.php
Copyright (c) 2015 - 2016 Andreas Schmidhuber
Copyright (c) 2013 - 2017 Andreas Schmidhuber
All rights reserved.
Redistribution and use in source and binary forms, with or without
Expand Down
23 changes: 16 additions & 7 deletions owncloud/owncloud-update_extension.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
/*
owncloud-update_extension.php
Copyright (c) 2015 - 2016 Andreas Schmidhuber
Copyright (c) 2013 - 2017 Andreas Schmidhuber
All rights reserved.
Redistribution and use in source and binary forms, with or without
Expand Down Expand Up @@ -52,12 +52,21 @@
else { $server_version = gettext("Unable to retrieve version from server!"); }

if (isset($_POST['ext_remove']) && $_POST['ext_remove']) {
// remove start command
if (is_array($config['rc']['postinit'] ) && is_array($config['rc']['postinit']['cmd'])) {
for ($i = 0; $i < count($config['rc']['postinit']['cmd']); $i++) {
if (preg_match('/owncloud/', $config['rc']['postinit']['cmd'][$i])) unset($config['rc']['postinit']['cmd'][$i]);
}
// remove start/stop commands
// remove existing old rc format entries
if (is_array($config['rc']) && is_array($config['rc']['postinit']) && is_array( $config['rc']['postinit']['cmd'])) {
$rc_param_count = count($config['rc']['postinit']['cmd']);
for ($i = 0; $i < $rc_param_count; $i++) {
if (preg_match("/owncloud/", $config['rc']['postinit']['cmd'][$i])) unset($config['rc']['postinit']['cmd'][$i]);
}
}
// remove existing entries for new rc format
if (is_array($config['rc']) && is_array($config['rc']['param'])) {
$rc_param_count = count($config['rc']['param']);
for ($i = 0; $i < $rc_param_count; $i++) {
if (preg_match("/owncloud/", $config['rc']['param'][$i]['value'])) unset($config['rc']['param'][$i]);
}
}
// remove links
if (is_link("/usr/local/share/locale-owncloud")) unlink("/usr/local/share/locale-owncloud");
if (is_link("/usr/local/www/owncloud-config.php")) unlink("/usr/local/www/owncloud-config.php");
Expand All @@ -74,7 +83,7 @@
if ($return_val == 0) {
require_once("{$configuration['rootfolder']}/owncloud-install.php");
$version = exec("cat {$configuration['rootfolder']}/version.txt");
$savemsg = sprintf(gettext("Update to version %s completed!"), $version);
$savemsg .= sprintf(gettext("Update to version %s completed!"), $version);
header("Refresh:8");;
}
else { $input_errors[] = sprintf(gettext("Download of installation file %s failed, installation aborted!"), "owncloud-install.php"); }
Expand Down
2 changes: 1 addition & 1 deletion owncloud/owncloud/json.inc
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
/*
json.inc
Copyright (c) 2013 - 2016 Andreas Schmidhuber
Copyright (c) 2013 - 2017 Andreas Schmidhuber
All rights reserved.
Redistribution and use in source and binary forms, with or without
Expand Down
2 changes: 1 addition & 1 deletion owncloud/owncloud/spinner.inc
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<!--
spinner.inc

Copyright (c) 2015 - 2016 Andreas Schmidhuber
Copyright (c) 2013 - 2017 Andreas Schmidhuber
All rights reserved.

Uses spin.js by Felix Gnass (fgnass) at http://spin.js.org
Expand Down
5 changes: 5 additions & 0 deletions owncloud/release_notes.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
Version Date Description
0.1.1 2016.11.28 N: command scripts rc format for NAS4Free 11.x compatibility
N: Chinese (Simplified) translation
C: update German translation
C: update OwnCloud download source to latest stable version 9.1.2

0.1 2016.09.22 initial release

N: ... new feature
Expand Down
2 changes: 1 addition & 1 deletion owncloud/version.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0.1
0.1.1

0 comments on commit 9e479b2

Please sign in to comment.