From 76daccca0cfa86ccb43628f56e628475a0cfe98c Mon Sep 17 00:00:00 2001 From: Luke Shumaker Date: Wed, 23 Nov 2016 00:12:05 -0500 Subject: Make the instance name and domain configurable. --- conf/config.proto | 3 +++ web/html/home.php | 28 +++++++++++++++++----------- web/html/login.php | 4 ++-- web/html/pkgdel.php | 4 ++-- web/html/rss.php | 8 ++++---- web/lib/DB.class.php | 2 +- web/template/account_delete.php | 3 ++- web/template/account_edit_form.php | 2 +- web/template/header.php | 8 ++++---- web/template/stats/updates_table.php | 2 +- 10 files changed, 37 insertions(+), 27 deletions(-) diff --git a/conf/config.proto b/conf/config.proto index 96fad80..c82980b 100644 --- a/conf/config.proto +++ b/conf/config.proto @@ -31,6 +31,9 @@ log_uri = https://aur.archlinux.org/cgit/aur.git/log/?h=%s snapshot_uri = /cgit/aur.git/snapshot/%s.tar.gz enable-maintenance = 1 maintenance-exceptions = 127.0.0.1 +email_domain = aur.parabola.nu +branding_shortname = AUR +branding_longname = Arch User Repository [notifications] notify-cmd = /srv/http/aurweb/scripts/notify.py diff --git a/web/html/home.php b/web/html/home.php index 475370b..204e00d 100644 --- a/web/html/home.php +++ b/web/html/home.php @@ -15,14 +15,17 @@ html_header( __("Home") );
-

AUR

+

', + config_get('options', 'branding_shortname'), '', '', + config_get('options', 'branding_shortname'), '' ); ?> @@ -58,7 +61,7 @@ html_header( __("Home") );

  • :
  • -
  • :
  • +
  • :
  • :

@@ -76,7 +79,8 @@ html_header( __("Home") );

', '' ); @@ -84,7 +88,7 @@ html_header( __("Home") );

- +

    $fingerprint): ?> @@ -98,11 +102,12 @@ html_header( __("Home") );

    ', - '', - '', - '' + 'General discussion regarding the %s (%s) and Trusted User structure takes place on %s. For discussion relating to the development of the %s web interface (aurweb), use the %s mailing list.', + config_get('options', 'branding_longname'), + config_get('options', 'branding_shortname'), + 'aur-general', + config_get('options', 'branding_shortname'), + 'aur-dev' ); ?>

    @@ -112,7 +117,8 @@ html_header( __("Home") );

    ', '', '', diff --git a/web/html/login.php b/web/html/login.php index 7345439..f6b5b87 100644 --- a/web/html/login.php +++ b/web/html/login.php @@ -11,10 +11,10 @@ if (!$disable_http_login || (isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'])) { $login_error = $login['error']; } -html_header('AUR ' . __("Login")); +html_header(config_get('options', 'branding_shortname') . ' ' . __("Login")); ?>

    -

    AUR

    +

    ' . username_from_sid($_COOKIE["AURSID"]) . ''); ?> diff --git a/web/html/pkgdel.php b/web/html/pkgdel.php index 21a2677..f32ff47 100644 --- a/web/html/pkgdel.php +++ b/web/html/pkgdel.php @@ -14,8 +14,8 @@ if (has_credential(CRED_PKGBASE_DELETE)): ?>

    :

    - ', htmlspecialchars($pkgbase_name), ''); ?> + ', htmlspecialchars($pkgbase_name), '', config_get('options', 'branding_shortname')); ?>

      diff --git a/web/html/rss.php b/web/html/rss.php index 8585d81..2ecf218 100644 --- a/web/html/rss.php +++ b/web/html/rss.php @@ -26,15 +26,15 @@ $rss->xslStyleSheet = false; $rss->encoding = "UTF-8"; #All the general RSS setup -$rss->title = "AUR Newest Packages"; -$rss->description = "The latest and greatest packages in the AUR"; +$rss->title = config_get('options', 'branding_shortname') . " Newest Packages"; +$rss->description = "The latest and greatest packages in the " . config_get('options', 'branding_shortname'); $rss->link = "${protocol}://{$host}"; $rss->syndicationURL = "{$protocol}://{$host}" . get_uri('/rss/'); $image = new FeedImage(); -$image->title = "AUR"; +$image->title = config_get('options', 'branding_shortname'); $image->url = "{$protocol}://{$host}/css/archnavbar/aurlogo.png"; $image->link = $rss->link; -$image->description = "AUR Newest Packages Feed"; +$image->description = config_get('options', 'branding_shortname') . " Newest Packages Feed"; $rss->image = $image; #Get the latest packages and add items for them diff --git a/web/lib/DB.class.php b/web/lib/DB.class.php index b538e0d..4c58c3c 100644 --- a/web/lib/DB.class.php +++ b/web/lib/DB.class.php @@ -32,7 +32,7 @@ class DB { self::$dbh = new PDO($dsn, $user, $password); self::$dbh->exec("SET NAMES 'utf8' COLLATE 'utf8_general_ci';"); } catch (PDOException $e) { - die('Error - Could not connect to AUR database'); + die('Error - Could not connect to ' . config_get('options', 'branding_shortname') . ' database'); } } diff --git a/web/template/account_delete.php b/web/template/account_delete.php index 74f386d..6a874f5 100644 --- a/web/template/account_delete.php +++ b/web/template/account_delete.php @@ -1,5 +1,6 @@

      - ' . htmlspecialchars($username) . '') ?> + ' . htmlspecialchars($username) . '') ?>

      ', '') ?> diff --git a/web/template/account_edit_form.php b/web/template/account_edit_form.php index 19821a0..fda5a28 100644 --- a/web/template/account_edit_form.php +++ b/web/template/account_edit_form.php @@ -132,7 +132,7 @@

      - +

      diff --git a/web/template/header.php b/web/template/header.php index 874109a..2ab1d6b 100644 --- a/web/template/header.php +++ b/web/template/header.php @@ -4,7 +4,7 @@ - AUR (<?= htmlspecialchars($LANG); ?>)<?php if ($title != "") { print " - " . htmlspecialchars($title); } ?> + <?= config_get('options', 'branding_shortname'); ?> (<?= htmlspecialchars($LANG); ?>)<?php if ($title != "") { print " - " . htmlspecialchars($title); } ?> @@ -16,7 +16,7 @@

      - +
      @@ -53,7 +53,7 @@
        -
      • AUR
      • +
      • ">
      • diff --git a/web/template/stats/updates_table.php b/web/template/stats/updates_table.php index 580583b..4bc8a63 100644 --- a/web/template/stats/updates_table.php +++ b/web/template/stats/updates_table.php @@ -1,6 +1,6 @@

        ()

        -RSS Feed +RSS Feed -- cgit v1.2.3