Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 8 additions & 4 deletions lib/public/Util.php
Original file line number Diff line number Diff line change
Expand Up @@ -711,7 +711,7 @@ public static function needUpgrade() {
* @return array
* @since 10.0
*/
public static function getStatusInfo($includeVersion = false) {
public static function getStatusInfo($includeVersion = false, $serverHide = false) {
$systemConfig = \OC::$server->getSystemConfig();

$installed = (bool) $systemConfig->getValue('installed', false);
Expand All @@ -726,17 +726,21 @@ public static function getStatusInfo($includeVersion = false) {
'version' => '',
'versionstring' => '',
'edition' => '',
'productname' => '',
'hostname' => ''];
'productname' => ''];

# expose version and servername details
if ($includeVersion || (bool) $systemConfig->getValue('version.hide', false) === false) {
$values['version'] = implode('.', self::getVersion());
$values['versionstring'] = \OC_Util::getVersionString();
$values['edition'] = \OC_Util::getEditionString();
$values['productname'] = $defaults->getName();
$values['hostname'] = gethostname();
# expose the servername only if allowed via version, but never when called via status.php
if ($serverHide === false) {
$values['hostname'] = gethostname();
}
}


return $values;
}
}
4 changes: 3 additions & 1 deletion status.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,9 @@

require_once __DIR__ . '/lib/base.php';

$values = \OCP\Util::getStatusInfo();
# show the version details based on config.php parameter,
# but do not expose the servername in the public via url
$values = \OCP\Util::getStatusInfo(null,true);

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why null and not false?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@individual-it
because you must not override default settings from getStatusInfo / config.php parameter.
lib/private/OCS/CoreCapabilities.php is the only place where you hard override it because it is needed to properly interact with the sync client.


if (OC::$CLI) {
print_r($values);
Expand Down