Skip to content

Commit

Permalink
v0.1
Browse files Browse the repository at this point in the history
  • Loading branch information
crestAT committed Sep 22, 2016
1 parent 318d6e2 commit c547288
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions owncloud/owncloud-config.php
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ function get_process_info() {
else $status_webserver_msg = '<a style=" background-color: #ff0000; ">&nbsp;&nbsp;<b>'.gettext("stopped").'</b>&nbsp;&nbsp;</a>';

// Retrieve IP@ only if webserver is enabled & running
if ((0 === $status_webserver) && $enable_webserver) {
if ((0 === $status_webserver) && $enable_webserver && ($configuration['enable'] === true)) {
$ipaddr = get_ipaddr($config['interfaces']['lan']['if']);
$owncloud_document_root = str_replace($config['websrv']['documentroot'], "", $configuration['storage_path']);
$url = htmlspecialchars("{$config['websrv']['protocol']}://{$ipaddr}:{$config['websrv']['port']}/{$owncloud_document_root}");
Expand Down Expand Up @@ -120,9 +120,12 @@ function change_perms($dir) {
$input_errors[] = sprintf(gettext("The %s MUST be set to a directory below %s."), gettext("OwnCloud")." ".gettext("data folder"), "<b>'/mnt/'</b>");
}
else {
// get the user for chown => <runasuser>server.username = "www"</runasuser>
$user = explode(" ", $config['websrv']['runasuser']);
$user = str_replace('"', '', $user[2]);
// get the user for chown => <runasuser>server.username = "www"</runasuser> or if not set use "root"
if (isset($config['websrv']['runasuser']) && !empty($config['websrv']['runasuser'])) {
$user = explode(" ", $config['websrv']['runasuser']);
$user = str_replace('"', '', $user[2]);
}
else $user = "root";

if (!is_dir($configuration['storage_path'])) mkdir($configuration['storage_path'], 0775, true);
change_perms($configuration['storage_path']);
Expand All @@ -141,7 +144,7 @@ function change_perms($dir) {
if ($return_val == 0) {
exec("rm {$configuration['storage_path']}/master.zip");
copy("{$configuration['rootfolder']}/.user.ini", "{$configuration['storage_path']}/.user.ini");
$savemsg .= "<br />".gettext("OwnCloud")." ".gettext("successfully installed.");
$savemsg .= "<br />".gettext("OwnCloud")." ".gettext("has been successfully installed.");
}
else {
$input_errors[] = sprintf(gettext("Archive file %s not found, installation aborted!"), "master.zip corrupt /");
Expand Down

0 comments on commit c547288

Please sign in to comment.