[or-cvs] r14705: (ticket 70) Adding HSDir to the CVS output (torstatus/trunk/web)
kasimir at seul.org
kasimir at seul.org
Sat May 24 18:15:31 UTC 2008
Author: kasimir
Date: 2008-05-24 14:15:31 -0400 (Sat, 24 May 2008)
New Revision: 14705
Modified:
torstatus/trunk/web/index.php
torstatus/trunk/web/query_export.php
Log:
(ticket 70) Adding HSDir to the CVS output
Modified: torstatus/trunk/web/index.php
===================================================================
--- torstatus/trunk/web/index.php 2008-05-24 15:27:19 UTC (rev 14704)
+++ torstatus/trunk/web/index.php 2008-05-24 18:15:31 UTC (rev 14705)
@@ -530,10 +530,10 @@
{
$HeaderRowString .= "<td class='HRN'>";
}
- if ($SR == 'FBadDirectory' && $SO == 'Asc'){$HeaderRowString .= "<a class='header' href='$Self?SR=FBadDirectory&SO=Desc'>";}
- else if ($SR == 'FBadDirectory' && $SO == 'Desc'){$HeaderRowString .= "<a class='header' href='$Self?SR=FBadDirectory&SO=Asc'>";}
- else $HeaderRowString .= "<a class='header' href='$Self?SR=FBadDirectory&SO=Asc'>";
- $HeaderRowString .= "Bad Dir</a></td>\n";
+ //if ($SR == 'FBadDirectory' && $SO == 'Asc'){$HeaderRowString .= "<a class='header' href='$Self?SR=FBadDirectory&SO=Desc'>";}
+ //else if ($SR == 'FBadDirectory' && $SO == 'Desc'){$HeaderRowString .= "<a class='header' href='$Self?SR=FBadDirectory&SO=Asc'>";}
+ //else $HeaderRowString .= "<a class='header' href='$Self?SR=FBadDirectory&SO=Asc'>";
+ //$HeaderRowString .= "Bad Dir</a></td>\n";
break;
case "BadExit":
@@ -561,9 +561,9 @@
{
$HeaderRowString .= "<td class='HRN'>";
}
- if ($SR == 'FBadExit' && $SO == 'Asc'){$HeaderRowString .= "<a class='header' href='$Self?SR=FBadExit&SO=Desc'>";}
- else if ($SR == 'FBadExit' && $SO == 'Desc'){$HeaderRowString .= "<a class='header' href='$Self?SR=FBadExit&SO=Asc'>";}
- else $HeaderRowString .= "<a class='header' href='$Self?SR=FBadExit&SO=Asc'>";
+ //if ($SR == 'FBadExit' && $SO == 'Asc'){$HeaderRowString .= "<a class='header' href='$Self?SR=FBadExit&SO=Desc'>";}
+ //else if ($SR == 'FBadExit' && $SO == 'Desc'){$HeaderRowString .= "<a class='header' href='$Self?SR=FBadExit&SO=Asc'>";}
+ //else $HeaderRowString .= "<a class='header' href='$Self?SR=FBadExit&SO=Asc'>";
$HeaderRowString .= "Bad Exit</a></td>\n";
break;
Modified: torstatus/trunk/web/query_export.php
===================================================================
--- torstatus/trunk/web/query_export.php 2008-05-24 15:27:19 UTC (rev 14704)
+++ torstatus/trunk/web/query_export.php 2008-05-24 18:15:31 UTC (rev 14705)
@@ -30,6 +30,7 @@
$FRunning = null;
$FValid = null;
$FV2Dir = null;
+$FHSDir = null;
$CSField = null;
$CSMod = null;
$CSInput = null;
@@ -138,6 +139,9 @@
case "V2Dir":
$HeaderRowString .= ",Flag - V2Dir";
break;
+
+ case "HSDir":
+ $HeaderRowString .= ",Flag - HSDir";
}
}
@@ -259,6 +263,10 @@
{
$FV2Dir = $_SESSION["FV2Dir"];
}
+if (isset($_SESSION["FHSDir"]))
+{
+ $FV2Dir = $_SESSION["FHSDir"];
+}
if (isset($_SESSION["CSField"]))
{
$CSField = $_SESSION["CSField"];
@@ -297,6 +305,7 @@
$SR != "FStable" &&
$SR != "FRunning" &&
$SR != "FValid" &&
+ $SR != "FHSDir" &&
$SR != "FV2Dir")
{
$SR = "Name";
@@ -374,6 +383,11 @@
$FV2Dir = 'OFF';
}
+if($FHSDir != '0' && $FHSDir != '1' && $FHSDir != 'OFF')
+{
+ $FHSDir = 'OFF';
+}
+
if(
$CSField != "Fingerprint" &&
$CSField != "Name" &&
@@ -529,6 +543,11 @@
$query .= ", $ActiveNetworkStatusTable.FV2Dir as V2Dir";
}
+if (in_array("HSDir", $ColumnList_ACTIVE))
+{
+ $query .= ", $ActiveNetworkStatusTable.FHSDir as HSDir";
+}
+
$query .= ", INET_ATON($ActiveNetworkStatusTable.IP) as NIP from $ActiveNetworkStatusTable inner join $ActiveDescriptorTable on $ActiveNetworkStatusTable.Fingerprint = $ActiveDescriptorTable.Fingerprint";
if ($FAuthority != 'OFF')
@@ -674,6 +693,17 @@
$query = $query . " and FV2Dir = $FV2Dir";
}
}
+if ($FHSDir != 'OFF')
+{
+ if (strpos($query, "where") === false)
+ {
+ $query = $query . " where FHSDir = $FHSDir";
+ }
+ else
+ {
+ $query = $query . " and FHSDir = $FHSDir";
+ }
+}
if ($CSInput != null)
{
More information about the tor-commits
mailing list