Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/nextcloudpi.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authornachoparker <nacho@ownyourbits.com>2018-04-04 15:20:11 +0300
committernachoparker <nacho@ownyourbits.com>2018-04-04 15:20:11 +0300
commitdf9e09ef205007fdf7fe0714691ece74c08d07fb (patch)
treeb2e045818f096399d2dd4e1e587e715eba44a769
parent490d84dbd165069d2399a544cc48506279c83ae6 (diff)
ncp-web: implement is_active()v0.53.16
-rw-r--r--README.md1
-rw-r--r--ncp-web/index.php9
2 files changed, 9 insertions, 1 deletions
diff --git a/README.md b/README.md
index d6f4ee71..c1530e50 100644
--- a/README.md
+++ b/README.md
@@ -35,6 +35,7 @@ This code also generates the [NextCloudPi docker images](https://hub.docker.com/
* Setup wizard ( NEW 09-27-2017 )
* NextCloudPi Web Panel ( NEW 07-24-2017 )
* Wi-Fi ready ( NEW 03-31-2017 )
+ * Ram logs ( NEW 03-31-2017 )
* Automatic security updates, activated by default. ( NEW 03-21-2017 )
* Let’s Encrypt for trusted HTTPS certificates.( NEW 03-16-2017 )
* Fail2Ban protection against brute force attacks. ( NEW 02-24-2017 )
diff --git a/ncp-web/index.php b/ncp-web/index.php
index fb95e778..dac32d7a 100644
--- a/ncp-web/index.php
+++ b/ncp-web/index.php
@@ -17,6 +17,7 @@
<meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0">
<meta name="mobile-web-app-capable" content="yes">
<?php
+ // redirect to activation first time
exec("a2query -s ncp-activation", $output, $ret);
if ($ret == 0) {
header("Location: activate");
@@ -165,12 +166,18 @@ HTML;
$files = array_diff(scandir($modules_path), array('.', '..', 'nc-wifi.sh', 'nc-info.sh', 'l10n'));
foreach ($files as $file) {
+
$script = pathinfo($file, PATHINFO_FILENAME);
+
+
$txt = file_get_contents($modules_path . $file);
$active = "";
- if (preg_match('/^ACTIVE_=yes$/m', $txt, $matches))
+ $etc = '/usr/local/etc';
+ exec("bash -c \"source $etc/library.sh && is_active_script $etc/nextcloudpi-config.d/$script\".sh", $output, $ret);
+ if ($ret == 0) {
$active = " ✓";
+ }
echo "<li id=\"$script\" class=\"nav-recent\">";
echo "<a href=\"#\"> {$l->__($script, $script)}$active </a>";