summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLester Caine <lester@lsces.co.uk>2026-05-18 11:33:31 +0100
committerLester Caine <lester@lsces.co.uk>2026-05-18 11:33:31 +0100
commit22329e97f3a9a5784f16dceea30a882311d907b6 (patch)
treecd522383e75ce578e410bdbea4f527c611b04d0d
parent56097745905585e72341fdc770e350bc304e463f (diff)
downloadkernel-22329e97f3a9a5784f16dceea30a882311d907b6.tar.gz
kernel-22329e97f3a9a5784f16dceea30a882311d907b6.tar.bz2
kernel-22329e97f3a9a5784f16dceea30a882311d907b6.zip
Check if the installer package is enabled.
Prodution sites the symlink should only be added when needed
-rwxr-xr-xadmin/admin_packages_inc.php3
-rwxr-xr-xtemplates/admin_packages.tpl33
2 files changed, 26 insertions, 10 deletions
diff --git a/admin/admin_packages_inc.php b/admin/admin_packages_inc.php
index 83bfddf..eae7c26 100755
--- a/admin/admin_packages_inc.php
+++ b/admin/admin_packages_inc.php
@@ -38,6 +38,9 @@ if( !empty( $_REQUEST['features'] ) ) {
}
}
+// Detect whether the installer is accessible (symlink present on production sites)
+$gBitSmarty->assign( 'install_pkg_accessible', is_readable( BIT_ROOT_PATH . 'install/install.php' ) );
+
global $gBitInstaller;
$gBitInstaller = &$gBitSystem;
$gBitInstaller->verifyInstalledPackages();
diff --git a/templates/admin_packages.tpl b/templates/admin_packages.tpl
index 66afec5..4e92091 100755
--- a/templates/admin_packages.tpl
+++ b/templates/admin_packages.tpl
@@ -1,10 +1,10 @@
{strip}
-{* checks if installer path is available *}
-{assign var=installfile value="`$smarty.const.INSTALL_PKG_PATH`install.php"|is_file}
-{assign var=installread value="`$smarty.const.INSTALL_PKG_PATH`install.php"|is_readable}
-{if $installfile neq 1 && $installread neq 1}
+{* install_unavailable: shown near install links/buttons when installer is not accessible *}
+{if $install_pkg_accessible}
+ {capture assign=install_unavailable}{/capture}
+{else}
{capture assign=install_unavailable}
- <p>{tr}You might have to rename your <strong>install/install.done</strong> file back to <strong>install/install.php</strong>.{/tr}</p>
+ <p class="text-muted"><em>{tr}Installer not accessible — to install or upgrade packages, symlink the <code>install</code> directory into the web root, then reload this page.{/tr}</em></p>
{/capture}
{/if}
@@ -17,7 +17,12 @@
{jstab title="Upgradable"}
{legend legend="Upgradable packages"}
<p class="warning">
- {biticon class="img-responsive" iname="large/dialog-warning" iexplain="Warning"} {tr}You seem to have at least one package that can be upgraded.{/tr} <a href="{$smarty.const.INSTALL_PKG_URL}install.php?step=4">We recommend you visit the installer now</a>.
+ {biticon class="img-responsive" iname="large/dialog-warning" iexplain="Warning"} {tr}You seem to have at least one package that can be upgraded.{/tr}
+ {if $install_pkg_accessible}
+ <a href="{$smarty.const.INSTALL_PKG_URL}install.php?step=4">{tr}We recommend you visit the installer now.{/tr}</a>
+ {else}
+ <em class="text-muted">{tr}Make the installer accessible to proceed with upgrades.{/tr}</em>
+ {/if}
</p>
{foreach from=$upgradable item=package key=name}
@@ -40,7 +45,12 @@
{jstab title="Installed"}
{legend legend="Packages installed on your system"}
<p>
- {tr}Packages with checkmarks are currently enabled, packages without are disabled. To enable or disable a package, check or uncheck it, and click the 'Modify Activation' button.{/tr} <a href='{$smarty.const.INSTALL_PKG_URL}install.php?step=3'>{tr}To uninstall or reinstall a package, visit the installer.{/tr}</a>
+ {tr}Packages with checkmarks are currently enabled, packages without are disabled. To enable or disable a package, check or uncheck it, and click the 'Modify Activation' button.{/tr}
+ {if $install_pkg_accessible}
+ <a href='{$smarty.const.INSTALL_PKG_URL}install.php?step=3'>{tr}To uninstall or reinstall a package, visit the installer.{/tr}</a>
+ {else}
+ {tr}You will need to enable the installer to manage packages.{/tr}
+ {/if}
</p>
{$install_unavailable}
@@ -281,9 +291,12 @@
{jstab title="Not Installed"}
{legend legend="bitweaver packages available for installation"}
- <p><a class="btn btn-default" href='{$smarty.const.INSTALL_PKG_URL}install.php?step=3'>{tr}Install Packages{/tr}</a></p>
-
- {$install_unavailable}
+ {if $install_pkg_accessible}
+ <p><a class="btn btn-default" href='{$smarty.const.INSTALL_PKG_URL}install.php?step=3'>{tr}Install Packages{/tr}</a></p>
+ {else}
+ <p><a class="btn btn-default disabled" href='#' aria-disabled="true">{tr}Install Packages{/tr}</a></p>
+ {$install_unavailable}
+ {/if}
<hr style="clear:both" />