diff options
Diffstat (limited to 'web')
-rw-r--r-- | web/template/pkg_details.php | 10 | ||||
-rw-r--r-- | web/template/pkgbase_details.php | 10 |
2 files changed, 16 insertions, 4 deletions
diff --git a/web/template/pkg_details.php b/web/template/pkg_details.php index 90360769..ecb081c1 100644 --- a/web/template/pkg_details.php +++ b/web/template/pkg_details.php @@ -1,7 +1,8 @@ <?php $cgit_uri = config_get('options', 'cgit_uri'); -$git_clone_uri = config_get('options', 'git_clone_uri'); +$git_clone_uri_anon = sprintf(config_get('options', 'git_clone_uri_anon'), htmlspecialchars($row['Name'])); +$git_clone_uri_priv = sprintf(config_get('options', 'git_clone_uri_priv'), htmlspecialchars($row['Name'])); $uid = uid_from_sid($SID); @@ -160,7 +161,12 @@ $sources = pkg_sources($row["ID"]); <table id="pkginfo"> <tr> <th><?= __('Git Clone URL') . ': ' ?></th> - <td><?= sprintf($git_clone_uri, htmlspecialchars($row['BaseName'])) ?></td> + <td> + <a href="<?= $git_clone_uri_anon ?>"><?= $git_clone_uri_anon ?></a> + <?php if ($uid == $row["MaintainerUID"]): ?> + <br /> <a href="<?= $git_clone_uri_priv ?>"><?= $git_clone_uri_priv ?></a> + <?php endif; ?> + </td> </tr> <tr> <th><?= __('Package Base') . ': ' ?></th> diff --git a/web/template/pkgbase_details.php b/web/template/pkgbase_details.php index 3f8f4a5f..e698fb0a 100644 --- a/web/template/pkgbase_details.php +++ b/web/template/pkgbase_details.php @@ -1,7 +1,8 @@ <?php $cgit_uri = config_get('options', 'cgit_uri'); -$git_clone_uri = config_get('options', 'git_clone_uri'); +$git_clone_uri_anon = sprintf(config_get('options', 'git_clone_uri_anon'), htmlspecialchars($row['Name'])); +$git_clone_uri_priv = sprintf(config_get('options', 'git_clone_uri_priv'), htmlspecialchars($row['Name'])); $uid = uid_from_sid($SID); @@ -111,7 +112,12 @@ $pkgs = pkgbase_get_pkgnames($base_id); <table id="pkginfo"> <tr> <th><?= __('Git Clone URL') . ': ' ?></th> - <td><?= sprintf($git_clone_uri, htmlspecialchars($row['Name'])) ?></td> + <td> + <a href="<?= $git_clone_uri_anon ?>"><?= $git_clone_uri_anon ?></a> + <?php if ($uid == $row["MaintainerUID"]): ?> + <br /> <a href="<?= $git_clone_uri_priv ?>"><?= $git_clone_uri_priv ?></a> + <?php endif; ?> + </td> </tr> <tr> <th><?= __('Category') . ': ' ?></th> |