From 7b13203b817084717a46e2f671e3cb533fdb1092 Mon Sep 17 00:00:00 2001 From: Eric Engestrom Date: Sat, 12 Mar 2016 14:50:03 +0000 Subject: Limit comment height to 15 lines Signed-off-by: Eric Engestrom Signed-off-by: Lukas Fleischer --- web/html/css/aurweb.css | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'web/html') diff --git a/web/html/css/aurweb.css b/web/html/css/aurweb.css index f5e1037..f777ab8 100644 --- a/web/html/css/aurweb.css +++ b/web/html/css/aurweb.css @@ -148,3 +148,8 @@ label.confirmation, color: red; font-weight: bold; } + +#news div p { + max-height: 15em; + overflow: auto; +} -- cgit v1.2.3-54-g00ecf From 2dfa72131bfbc96584b78b597f86471874108a89 Mon Sep 17 00:00:00 2001 From: "Ian D. Scott" Date: Sat, 12 Mar 2016 13:49:46 -0800 Subject: Remove code referencing non-existent and unused file Signed-off-by: Lukas Fleischer --- web/html/index.php | 4 ---- 1 file changed, 4 deletions(-) (limited to 'web/html') diff --git a/web/html/index.php b/web/html/index.php index 3787d4e..78ab6ad 100644 --- a/web/html/index.php +++ b/web/html/index.php @@ -167,10 +167,6 @@ if (!empty($tokens[1]) && '/' . $tokens[1] == get_pkg_route()) { header("Content-Type: image/gif"); readfile("./$path"); break; - case "/css/archnavbar/archlogo.gif": - header("Content-Type: image/png"); - readfile("./$path"); - break; case "/css/archnavbar/archlogo.png": case "/css/archnavbar/aurlogo.png": case "/images/favicon.ico": -- cgit v1.2.3-54-g00ecf From e3670ef1888a3f030452b229e8d48b83bb83b240 Mon Sep 17 00:00:00 2001 From: Lukas Fleischer Date: Thu, 2 Jun 2016 08:51:29 +0200 Subject: Add a homepage field to accounts Allow users to add a link to their homepage to their profile. Implements FS#22774. Signed-off-by: Lukas Fleischer --- schema/aur-schema.sql | 1 + upgrading/4.3.0.txt | 6 +++++ web/html/account.php | 53 +++++++++++++++++++++++++++----------- web/lib/acctfuncs.inc.php | 12 ++++++--- web/template/account_details.php | 4 +++ web/template/account_edit_form.php | 5 ++++ 6 files changed, 62 insertions(+), 19 deletions(-) (limited to 'web/html') diff --git a/schema/aur-schema.sql b/schema/aur-schema.sql index ea19d46..7edf94c 100644 --- a/schema/aur-schema.sql +++ b/schema/aur-schema.sql @@ -32,6 +32,7 @@ CREATE TABLE Users ( ResetKey CHAR(32) NOT NULL DEFAULT '', RealName VARCHAR(64) NOT NULL DEFAULT '', LangPreference VARCHAR(5) NOT NULL DEFAULT 'en', + Homepage TEXT NULL DEFAULT NULL, IRCNick VARCHAR(32) NOT NULL DEFAULT '', PGPKey VARCHAR(40) NULL DEFAULT NULL, LastLogin BIGINT UNSIGNED NOT NULL DEFAULT 0, diff --git a/upgrading/4.3.0.txt b/upgrading/4.3.0.txt index f7f3e08..6c1753d 100644 --- a/upgrading/4.3.0.txt +++ b/upgrading/4.3.0.txt @@ -15,3 +15,9 @@ ALTER TABLE Users MODIFY LastLoginIPAddress VARCHAR(45) NULL DEFAULT NULL; ---- ALTER TABLE OfficialProviders ADD COLUMN Repo VARCHAR(64) NOT NULL; ---- + +4. Add a column to store users' homepages: + +---- +ALTER TABLE Users ADD COLUMN Homepage TEXT NULL DEFAULT NULL; +---- diff --git a/web/html/account.php b/web/html/account.php index 9007ace..8d92b2c 100644 --- a/web/html/account.php +++ b/web/html/account.php @@ -78,12 +78,25 @@ if (isset($_COOKIE["AURSID"])) { } else { /* Verify user has permission to edit the account */ if (can_edit_account($row)) { - display_account_form("UpdateAccount", $row["Username"], - $row["AccountTypeID"], $row["Suspended"], $row["Email"], - $row["HideEmail"], "", "", $row["RealName"], - $row["LangPreference"], $row["IRCNick"], $row["PGPKey"], $PK, - $row["InactivityTS"] ? 1 : 0, $row["CommentNotify"], - $row["UpdateNotify"], $row["ID"], $row["Username"]); + display_account_form("UpdateAccount", + $row["Username"], + $row["AccountTypeID"], + $row["Suspended"], + $row["Email"], + $row["HideEmail"], + "", + "", + $row["RealName"], + $row["LangPreference"], + $row["Homepage"], + $row["IRCNick"], + $row["PGPKey"], + $PK, + $row["InactivityTS"] ? 1 : 0, + $row["CommentNotify"], + $row["UpdateNotify"], + $row["ID"], + $row["Username"]); } else { print __("You do not have permission to edit this account."); } @@ -116,15 +129,25 @@ if (isset($_COOKIE["AURSID"])) { print $update_account_message; if (!$success) { - display_account_form("UpdateAccount", in_request("U"), - in_request("T"), in_request("S"), - in_request("E"), in_request("H"), - in_request("P"), in_request("C"), - in_request("R"), in_request("L"), - in_request("I"), in_request("K"), - in_request("PK"), in_request("J"), - in_request("CN"), in_request("UN"), - in_request("ID"), $row["Username"]); + display_account_form("UpdateAccount", + in_request("U"), + in_request("T"), + in_request("S"), + in_request("E"), + in_request("H"), + in_request("P"), + in_request("C"), + in_request("R"), + in_request("L"), + in_request("HP"), + in_request("I"), + in_request("K"), + in_request("PK"), + in_request("J"), + in_request("CN"), + in_request("UN"), + in_request("ID"), + $row["Username"]); } } else { diff --git a/web/lib/acctfuncs.inc.php b/web/lib/acctfuncs.inc.php index 0eb021e..172b962 100644 --- a/web/lib/acctfuncs.inc.php +++ b/web/lib/acctfuncs.inc.php @@ -52,6 +52,7 @@ function html_format_pgp_fingerprint($fingerprint) { * @param string $C The confirmed password value of the displayed user * @param string $R The real name of the displayed user * @param string $L The language preference of the displayed user + * @param string $HP The homepage of the displayed user * @param string $I The IRC nickname of the displayed user * @param string $K The PGP key fingerprint of the displayed user * @param string $PK The list of SSH public keys @@ -65,7 +66,7 @@ function html_format_pgp_fingerprint($fingerprint) { * @return void */ function display_account_form($A,$U="",$T="",$S="",$E="",$H="",$P="",$C="",$R="", - $L="",$I="",$K="",$PK="",$J="",$CN="",$UN="",$ON="",$UID=0,$N="") { + $L="",$HP="",$I="",$K="",$PK="",$J="",$CN="",$UN="",$ON="",$UID=0,$N="") { global $SUPPORTED_LANGS; include("account_edit_form.php"); @@ -87,6 +88,7 @@ function display_account_form($A,$U="",$T="",$S="",$E="",$H="",$P="",$C="",$R="" * @param string $C The confirmed password for the user * @param string $R The real name of the user * @param string $L The language preference of the user + * @param string $HP The homepage of the displayed user * @param string $I The IRC nickname of the user * @param string $K The PGP fingerprint of the user * @param string $PK The list of public SSH keys @@ -100,7 +102,7 @@ function display_account_form($A,$U="",$T="",$S="",$E="",$H="",$P="",$C="",$R="" * @return array Boolean indicating success and message to be printed */ function process_account_form($TYPE,$A,$U="",$T="",$S="",$E="",$H="",$P="",$C="", - $R="",$L="",$I="",$K="",$PK="",$J="",$CN="",$UN="",$ON="",$UID=0,$N="") { + $R="",$L="",$HP="",$I="",$K="",$PK="",$J="",$CN="",$UN="",$ON="",$UID=0,$N="") { global $SUPPORTED_LANGS; $error = ''; @@ -276,13 +278,14 @@ function process_account_form($TYPE,$A,$U="",$T="",$S="",$E="",$H="",$P="",$C="" $salt = $dbh->quote($salt); $R = $dbh->quote($R); $L = $dbh->quote($L); + $HP = $dbh->quote($HP); $I = $dbh->quote($I); $K = $dbh->quote(str_replace(" ", "", $K)); $q = "INSERT INTO Users (AccountTypeID, Suspended, "; $q.= "InactivityTS, Username, Email, Passwd, Salt, "; - $q.= "RealName, LangPreference, IRCNick, PGPKey) "; + $q.= "RealName, LangPreference, Homepage, IRCNick, PGPKey) "; $q.= "VALUES (1, 0, 0, $U, $E, $P, $salt, $R, $L, "; - $q.= "$I, $K)"; + $q.= "$HP, $I, $K)"; $result = $dbh->exec($q); if (!$result) { $message = __("Error trying to create account, %s%s%s.", @@ -344,6 +347,7 @@ function process_account_form($TYPE,$A,$U="",$T="",$S="",$E="",$H="",$P="",$C="" } $q.= ", RealName = " . $dbh->quote($R); $q.= ", LangPreference = " . $dbh->quote($L); + $q.= ", Homepage = " . $dbh->quote($HP); $q.= ", IRCNick = " . $dbh->quote($I); $q.= ", PGPKey = " . $dbh->quote(str_replace(" ", "", $K)); $q.= ", InactivityTS = " . $inactivity_ts; diff --git a/web/template/account_details.php b/web/template/account_details.php index 59a6a63..0ac85a5 100644 --- a/web/template/account_details.php +++ b/web/template/account_details.php @@ -41,6 +41,10 @@ + + + + diff --git a/web/template/account_edit_form.php b/web/template/account_edit_form.php index b4f0192..6c2b8fb 100644 --- a/web/template/account_edit_form.php +++ b/web/template/account_edit_form.php @@ -98,6 +98,11 @@

+

+ + +

+

-- cgit v1.2.3-54-g00ecf From a2a888625eb3c3dc353e2ef55e6fcbe054ab582f Mon Sep 17 00:00:00 2001 From: Johannes Löthberg Date: Wed, 22 Jun 2016 23:24:24 +0200 Subject: Add missing database and account fields MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Commits 6ec4a35 (Send notifications when changing ownership, 2016-02-21) and e3670ef (Add a homepage field to accounts, 2016-06-02) forgot to change some usages of display_account_form() and process_account_form() to account for the new parameter. The former also forgot to add the new column to the database schema. Signed-off-by: Johannes Löthberg Signed-off-by: Lukas Fleischer --- schema/aur-schema.sql | 1 + web/html/account.php | 9 ++++++--- web/html/register.php | 45 +++++++++++++++++++++++++++++++++++++-------- 3 files changed, 44 insertions(+), 11 deletions(-) (limited to 'web/html') diff --git a/schema/aur-schema.sql b/schema/aur-schema.sql index 7edf94c..1affc25 100644 --- a/schema/aur-schema.sql +++ b/schema/aur-schema.sql @@ -41,6 +41,7 @@ CREATE TABLE Users ( RegistrationTS TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP, CommentNotify TINYINT(1) NOT NULL DEFAULT 1, UpdateNotify TINYINT(1) NOT NULL DEFAULT 0, + OwnershipNotify TINYINT(1) NOT NULL DEFAULT 1, PRIMARY KEY (ID), UNIQUE (Username), UNIQUE (Email), diff --git a/web/html/account.php b/web/html/account.php index 8d92b2c..2892f04 100644 --- a/web/html/account.php +++ b/web/html/account.php @@ -34,9 +34,10 @@ if ($action == "UpdateAccount") { in_request("U"), in_request("T"), in_request("S"), in_request("E"), in_request("H"), in_request("P"), in_request("C"), in_request("R"), in_request("L"), - in_request("I"), in_request("K"), in_request("PK"), - in_request("J"), in_request("CN"), in_request("UN"), - in_request("ID"), $row["Username"]); + in_request("HP"), in_request("I"), in_request("K"), + in_request("PK"), in_request("J"), in_request("CN"), + in_request("UN"), in_request("ON"), in_request("ID"), + $row["Username"]); } } @@ -95,6 +96,7 @@ if (isset($_COOKIE["AURSID"])) { $row["InactivityTS"] ? 1 : 0, $row["CommentNotify"], $row["UpdateNotify"], + $row["OwnershipNotify"], $row["ID"], $row["Username"]); } else { @@ -146,6 +148,7 @@ if (isset($_COOKIE["AURSID"])) { in_request("J"), in_request("CN"), in_request("UN"), + in_request("ON"), in_request("ID"), $row["Username"]); } diff --git a/web/html/register.php b/web/html/register.php index 3155449..6c6d52e 100644 --- a/web/html/register.php +++ b/web/html/register.php @@ -20,18 +20,47 @@ echo '

' . __('Register') . '

'; if (in_request("Action") == "NewAccount") { list($success, $message) = process_account_form( - "new", "NewAccount", in_request("U"), 1, 0, - in_request("E"), in_request("H"), '', '', in_request("R"), - in_request("L"), in_request("I"), in_request("K"), - in_request("PK"), 0, in_request("CN"), in_request("UN")); + "new", + "NewAccount", + in_request("U"), + 1, + 0, + in_request("E"), + in_request("H"), + '', + '', + in_request("R"), + in_request("L"), + in_request("HP"), + in_request("I"), + in_request("K"), + in_request("PK"), + 0, + in_request("CN"), + in_request("UN"), + in_request("ON")); print $message; if (!$success) { - display_account_form("NewAccount", in_request("U"), 1, 0, - in_request("E"), in_request("H"), '', '', in_request("R"), - in_request("L"), in_request("I"), in_request("K"), - in_request("PK"), 0, in_request("CN"), in_request("UN")); + display_account_form("NewAccount", + in_request("U"), + 1, + 0, + in_request("E"), + in_request("H"), + '', + '', + in_request("R"), + in_request("L"), + in_request("HP"), + in_request("I"), + in_request("K"), + in_request("PK"), + 0, + in_request("CN"), + in_request("UN"), + in_request("ON")); } } else { print '

' . __("Use this form to create an account.") . '

'; -- cgit v1.2.3-54-g00ecf From e182ba0c42a9d2b2afecb8da32d00f634999935e Mon Sep 17 00:00:00 2001 From: Lukas Fleischer Date: Fri, 7 Oct 2016 21:52:07 +0200 Subject: Add clone hints to 404 error pages When clicking on the linked Git clone URL of a package base, users are faced with a 404 error page since the URL is not supposed to be opened in a web browser. Add some notes to 404 error pages corresponding to Git clone URLs that explain how to use them instead. Fixes FS#51266. Signed-off-by: Lukas Fleischer --- web/html/404.php | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) (limited to 'web/html') diff --git a/web/html/404.php b/web/html/404.php index a47ae1e..757c485 100644 --- a/web/html/404.php +++ b/web/html/404.php @@ -2,12 +2,45 @@ set_include_path(get_include_path() . PATH_SEPARATOR . '../lib'); +$path = $_SERVER['PATH_INFO']; +$tokens = explode('/', $path); + +if (preg_match('/^([a-z0-9][a-z0-9.+_-]*?)(\.git)?$/', $tokens[1], $matches)) { + $gitpkg = $matches[1]; + if (pkg_from_name($gitpkg)) { + $gitcmd = 'git clone ' . sprintf(config_get('options', 'git_clone_uri_anon'), htmlspecialchars($gitpkg)); + $gitlink = get_pkgbase_uri($gitpkg); + } else { + unset($gitpkg); + } +} else { + unset($gitpkg); +} + html_header( __("Page Not Found") ); ?>

404 -

+ +
    +
  • + : + +
  • +
  • + ' . htmlspecialchars($gitpkg) . '', + '' . htmlspecialchars($gitcmd) . '') ?> +
  • +
  • + ', '', + '' . htmlspecialchars($gitpkg) . '') ?> +
  • +
+