Commit 8854414a authored by Leigh B Stoller's avatar Leigh B Stoller

Display the commit has on the front page when not logged in.

parent 1cb7a535
<?php
#
# EMULAB-COPYRIGHT
# Copyright (c) 2000-2009 University of Utah and the Flux Group.
# Copyright (c) 2000-2010 University of Utah and the Flux Group.
# All rights reserved.
#
# Database Constants
......@@ -591,6 +591,22 @@ function TBGetVersionInfo(&$major, &$minor, &$build)
return 1;
}
#
# Get the commit hash.
#
function TBGetCommitHash()
{
$query_result =
DBQueryFatal("select value from version_info ".
"where name='commithash'");
if (mysql_num_rows($query_result)) {
$row = mysql_fetch_row($query_result);
return $row[0];
}
return null;
}
#
# Return a node_tye attribute entry.
#
......
<?php
#
# EMULAB-COPYRIGHT
# Copyright (c) 2000-2009 University of Utah and the Flux Group.
# Copyright (c) 2000-2010 University of Utah and the Flux Group.
# All rights reserved.
#
......@@ -1126,8 +1126,10 @@ function PAGEHEADER($title, $view = NULL, $extra_headers = NULL,
echo "<span class='timestamp'>$now</span>\n";
echo "</div>";
if ($login_user || VIEWSET($view, 'hide_versioninfo'))
if ($login_user || VIEWSET($view, 'hide_versioninfo')) {
$versioninfo = "";
$commithash = "";
}
else {
$major = "";
$minor = "";
......@@ -1135,8 +1137,18 @@ function PAGEHEADER($title, $view = NULL, $extra_headers = NULL,
TBGetVersionInfo($major, $minor, $build);
$versioninfo = "Vers: $major.$minor Build: $build";
$hash = TBGetCommitHash();
if ($hash) {
$commithash = "$hash";
}
}
echo "<div id='versioninfo'>$versioninfo</div>";
echo "<div id='versioninfo'>$versioninfo";
if ($commithash != "") {
echo "<br>";
echo substr($commithash, 0, 24);
}
echo "</div>";
if ($notice) {
echo "<span class='headernotice'>$notice</span>";
}
......@@ -1148,6 +1160,9 @@ function PAGEHEADER($title, $view = NULL, $extra_headers = NULL,
echo "$title</h2>";
# Close off 'contentheader' (rightcontentheader);
echo "</div>\n";
if ($commithash != "") {
echo "<!-- This site is running commit $commithash -->\n";
}
if ($login_user) {
# And start the contentbody.
echo "<div id='fullcontentbody'>";
......
/*
* EMULAB-COPYRIGHT
* Copyright (c) 2000-2009 University of Utah and the Flux Group.
* Copyright (c) 2000-2010 University of Utah and the Flux Group.
* All rights reserved.
*/
......@@ -553,7 +553,7 @@ ul.navmenu li.newgroup {
float: right;
display: inline;
margin-right: 10px;
line-height: 30px; /* Match the height of the header so the text is */
line-height: 15px; /* Match the height of the header so the text is */
/* vertically centered. */
}
#logintime {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment