Permalink
Browse files

ui-web: configurable FINGER_HOST

  • Loading branch information...
1 parent f286c0a commit 88c9a149f0855de52690f713613e16e470655e42 @grawity committed May 21, 2012
Showing with 10 additions and 3 deletions.
  1. +6 −2 config.php.example
  2. +4 −1 ui-web/index.php
View
@@ -1,5 +1,9 @@
-<?php
+<?php // vim: ft=php
+
# See http://php.net/manual/en/pdo.drivers.php
-const DB_PATH = "mysql:FIXME";
+const DB_PATH = "mysql:host=localhost;dbname=rwho";
const DB_USER = "";
const DB_PASS = "";
+
+# For linking from ui-web
+const FINGER_HOST = "localhost";
View
@@ -27,10 +27,13 @@ static function header($title, $width=0) {
function H($str) { return htmlspecialchars($str); }
function make_finger_addr() {
+ $host = defined("FINGER_HOST")
+ ? constant("FINGER_HOST")
+ : $_SERVER["SERVER_NAME"];
$q = (string) query::$user;
if (strlen(query::$host))
$q .= "@".query::$host;
- $q .= "@".$_SERVER["SERVER_NAME"];
+ $q .= "@".$host;
if (query::$detailed and !(strlen(query::$user) or strlen(query::$host)))
$q = "/W ".$q;
$q = (isset($_SERVER["HTTPS"])?"https":"http")."://nullroute.eu.org/finger/?q=".urlencode($q);

0 comments on commit 88c9a14

Please sign in to comment.