16 Commits
2.2.0 ... v3

Author SHA1 Message Date
f7e0f37528 Init 2023-03-28 10:34:44 +02:00
f803effbbd Beta zu Final Version gesetzt 2022-06-09 20:24:03 +02:00
fcceec8545 Footer URL angepasst 2022-06-09 20:22:48 +02:00
130dee67ea Versionsnummer angepasst 2022-06-08 21:02:14 +02:00
79c7fbc841 Update URL korrigiert
Git Link angepasst
2022-06-08 21:01:00 +02:00
Gregor Schulte
57608f3b2f Korrekturen
URLs angepasst
Statistik Einheit automatisch ändern (MB -> GB)
2022-04-16 20:56:12 +02:00
Gregor Schulte
1e60371abe 64bit Anpassungen
Name der Distro angepasst
Max Value in Statistiken angepasst
Hash Verfahren auf SHA256 umgestellt
2022-02-09 09:40:58 +01:00
Gregor Schulte
79fc07e010 ReadMe angepasst 2021-12-14 12:27:22 +01:00
Gregor Schulte
db683a5b19 Merge durchgeführt in bullseye (Pull-Request #1)
Bullseye
2021-12-14 11:22:25 +00:00
Gregor Schulte
3ebc78f14d PiControl-2.2.0.zip edited online with Bitbucket 2021-12-14 11:22:01 +00:00
Gregor Schulte
588c82f4e8 PiControl-2.2.0-full.zip edited online with Bitbucket 2021-12-14 11:21:54 +00:00
Gregor Schulte
22fa53e3a3 Pi Control.iml edited online with Bitbucket 2021-12-14 10:54:44 +00:00
Gregor Schulte
1257825709 PiControl-2.2.0.zip edited online with Bitbucket 2021-12-14 10:54:32 +00:00
Gregor Schulte
6f819ed9f5 PiControl-2.2.0-full.zip edited online with Bitbucket 2021-12-14 10:54:18 +00:00
Gregor Schulte
6adb4fe93e Korrektur bei der Download URL 2021-12-14 11:50:53 +01:00
Gregor Schulte
97d666a794 Debian 11 Support 2021-12-14 09:50:28 +01:00
433 changed files with 10678 additions and 897 deletions

3
.gitignore vendored
View File

@@ -10,6 +10,7 @@
.idea/**/shelf .idea/**/shelf
.idea .idea
.vscode .vscode
pack.sh
# Generated files # Generated files
.idea/**/contentModel.xml .idea/**/contentModel.xml
@@ -99,3 +100,5 @@ data/DoctrineORMModule/cache/
demos/ demos/
extras/documentation extras/documentation
*.zip

View File

@@ -1,8 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<module type="WEB_MODULE" version="4">
<component name="NewModuleRootManager" inherit-compiler-output="true">
<exclude-output />
<content url="file://$MODULE_DIR$" />
<orderEntry type="sourceFolder" forTests="false" />
</component>
</module>

Binary file not shown.

Binary file not shown.

View File

@@ -1,7 +0,0 @@
# Pi Control
## Installation
[Pi Control Installation](https://pi-control.de/install/)
## Bei Fragen oder Problemen
Schreibe mir eine E-Mail an [support@pi-control.de](mailto:support@pi-control.de) oder nutze das Feedback in Pi Control.

View File

@@ -1,88 +0,0 @@
<?php
const PICONTROL = true;
(include_once realpath(dirname(__FILE__)).'/../../resources/init.php') or die('Error: 0x0000');
(include_once LIBRARY_PATH.'main/main.function.php') or die('Error: 0x0001');
(include_once LIBRARY_PATH.'statistic/statistic.class.php') or die('Error: 0x0002');
(include_once LIBRARY_PATH.'statistic/statistic.function.php') or die('Error: 0x0003');
(include_once LIBRARY_PATH.'api/api.class.php') or die('Error: 0x0004');
(include_once LIBRARY_PATH.'plugin/plugin.function.php') or die('Error: 0x0005');
$api = new API;
if (isset($_POST['id']))
{
$controller = new StatisticController();
$controller->loadStatistics();
if (($name = $controller->getStatisticName($_POST['id'])) !== false)
{
if (isset($_POST['plugin']) && trim($_POST['plugin']) != '')
pluginLanguage(trim($_POST['plugin']));
$builder = new StatisticBuilder();
$builder->loadFromFile($name, (isset($_POST['plugin']) && trim($_POST['plugin']) != '') ? $_POST['plugin'] : NULL);
$statistic = $builder->getArray();
$log = new LogStatistic();
$log->setFile(LOG_PATH.$statistic['raw'].'.csv');
$arr = $info = array();
foreach ($statistic['columns'] as $column)
$arr['cols'][] = array('id' => '', 'label' => _t($column['label']), 'type' => $column['type']);
getRowsFromLog($arr, $info, $log->getAll(), $statistic['columns'], $statistic['cycle']);
if (isset($arr['rows']))
{
if (isset($_POST['type']) && $_POST['type'] == 'googleChart')
$arr['rows'] = convertForGoogleChart($arr['rows']);
$arr['rows'] = array_slice($arr['rows'], -2016);
$arr['periods'] = $info['periods'];
foreach (array('min', 'max') as $type)
{
if ($statistic['limits'][$type]['use'] == 'multiply')
$arr[$type] = round($info[$type] * $statistic['limits'][$type]['value']);
elseif ($statistic['limits'][$type]['use'] == 'fix')
{
if ($statistic['limits'][$type]['fix'] == true)
$arr[$type] = $statistic['limits'][$type]['value'];
else
$arr[$type] = round($info[$type]);
}
}
$api->addData('statistic', $arr);
}
else
$api->setError('error', 'Empty data.');
}
else
$api->setError('error', 'Data not found.');
}
else
{
$statistics = array();
$hiddenStatistics = unserialize(htmlspecialchars_decode(getConfig('main:statistic.hidden', 'a:0:{}')));
$controller = new StatisticController();
$controller->loadStatistics();
foreach ($controller->getStatistics() as $statistic)
{
$builder = new StatisticBuilder();
$builder->loadFromFile($statistic);
$array = $builder->getArray();
if (!in_array($builder->getId(), $hiddenStatistics))
$statistics[] = array('array' => $array);
}
$api->addData('statistics', $statistics);
$api->addData('hidden', $hiddenStatistics);
}
$api->display();

7
backend/README.md Normal file
View File

@@ -0,0 +1,7 @@
# Pi Control
## Installation
[Pi Control Installation](https://pi-control.de/install/)
## Bei Fragen oder Problemen
Über das [Ticketsystem](https://bugs.die-schultes.eu/projects/pi-control/issues) können Fehler gemeldet werden und im [Forum](https://bugs.die-schultes.eu/projects/pi-control/boards) gibt es Hilfe zu Fragen rund um Pi Control

View File

@@ -0,0 +1,101 @@
<?php
const PICONTROL = true;
(include_once realpath(dirname(__FILE__)) . '/../../resources/init.php') or die('Error: 0x0000');
(include_once LIBRARY_PATH . 'main/main.function.php') or die('Error: 0x0001');
(include_once LIBRARY_PATH . 'statistic/statistic.class.php') or die('Error: 0x0002');
(include_once LIBRARY_PATH . 'statistic/statistic.function.php') or die('Error: 0x0003');
(include_once LIBRARY_PATH . 'api/api.class.php') or die('Error: 0x0004');
(include_once LIBRARY_PATH . 'plugin/plugin.function.php') or die('Error: 0x0005');
$requestMethod = $_SERVER["REQUEST_METHOD"];
if ($requestMethod == 'GET') {
$log = new LogStatistic();
$log->setFile(LOG_PATH . 'statistic/' . $_GET['statistic'] . '.csv');
$data = array();
$data['data'] = array();
$limit = 2016;
if (isset($_GET['limit'])) {
$limit = $_GET['limit'];
}
$i = 0;
foreach ($log->getAll() as $row) {
if ($i >= 2016 - $limit) {
array_push($data['data'], array('time' => (int)$row[0], 'value' => (float)$row[1]));
}
$i++;
}
echo json_encode($data);
} else {
$api = new API;
if (isset($_POST['id'])) {
$controller = new StatisticController();
$controller->loadStatistics();
if (($name = $controller->getStatisticName($_POST['id'])) !== false) {
if (isset($_POST['plugin']) && trim($_POST['plugin']) != '')
pluginLanguage(trim($_POST['plugin']));
$builder = new StatisticBuilder();
$builder->loadFromFile($name, (isset($_POST['plugin']) && trim($_POST['plugin']) != '') ? $_POST['plugin'] : NULL);
$statistic = $builder->getArray();
$log = new LogStatistic();
$log->setFile(LOG_PATH . $statistic['raw'] . '.csv');
$logData = $log->getAll();
$arr = $info = array();
foreach ($statistic['columns'] as $column) {
$arr['cols'][] = array('id' => '', 'label' => _t($column['label']), 'type' => $column['type']);
}
getRowsFromLog($arr, $info, $logData, $statistic['columns'], $statistic['cycle']);
if (isset($arr['rows'])) {
if (isset($_POST['type']) && $_POST['type'] == 'googleChart')
$arr['rows'] = convertForGoogleChart($arr['rows']);
$arr['rows'] = array_slice($arr['rows'], -2016);
$arr['periods'] = $info['periods'];
foreach (array('min', 'max') as $type) {
if ($statistic['limits'][$type]['use'] == 'multiply')
$arr[$type] = round($info[$type] * $statistic['limits'][$type]['value']);
elseif ($statistic['limits'][$type]['use'] == 'fix') {
if ($statistic['limits'][$type]['fix'] == true)
$arr[$type] = $statistic['limits'][$type]['value'];
else
$arr[$type] = round($info[$type]);
}
}
$api->addData('statistic', $arr);
} else
$api->setError('error', 'Empty data.');
} else
$api->setError('error', 'Data not found.');
} else {
$statistics = array();
$hiddenStatistics = unserialize(htmlspecialchars_decode(getConfig('main:statistic.hidden', 'a:0:{}')));
$controller = new StatisticController();
$controller->loadStatistics();
foreach ($controller->getStatistics() as $statistic) {
$builder = new StatisticBuilder();
$builder->loadFromFile($statistic);
$array = $builder->getArray();
if (!in_array($builder->getId(), $hiddenStatistics))
$statistics[] = array('array' => $array);
}
$api->addData('statistics', $statistics);
$api->addData('hidden', $hiddenStatistics);
}
$api->display();
}

View File

Before

Width:  |  Height:  |  Size: 162 B

After

Width:  |  Height:  |  Size: 162 B

View File

Before

Width:  |  Height:  |  Size: 194 B

After

Width:  |  Height:  |  Size: 194 B

View File

Before

Width:  |  Height:  |  Size: 2.5 KiB

After

Width:  |  Height:  |  Size: 2.5 KiB

View File

Before

Width:  |  Height:  |  Size: 3.0 KiB

After

Width:  |  Height:  |  Size: 3.0 KiB

View File

Before

Width:  |  Height:  |  Size: 883 B

After

Width:  |  Height:  |  Size: 883 B

View File

Before

Width:  |  Height:  |  Size: 993 B

After

Width:  |  Height:  |  Size: 993 B

View File

Before

Width:  |  Height:  |  Size: 1.4 KiB

After

Width:  |  Height:  |  Size: 1.4 KiB

View File

Before

Width:  |  Height:  |  Size: 1.6 KiB

After

Width:  |  Height:  |  Size: 1.6 KiB

View File

Before

Width:  |  Height:  |  Size: 1.7 KiB

After

Width:  |  Height:  |  Size: 1.7 KiB

View File

Before

Width:  |  Height:  |  Size: 2.1 KiB

After

Width:  |  Height:  |  Size: 2.1 KiB

View File

Before

Width:  |  Height:  |  Size: 2.7 KiB

After

Width:  |  Height:  |  Size: 2.7 KiB

View File

Before

Width:  |  Height:  |  Size: 911 B

After

Width:  |  Height:  |  Size: 911 B

View File

Before

Width:  |  Height:  |  Size: 1.6 KiB

After

Width:  |  Height:  |  Size: 1.6 KiB

View File

Before

Width:  |  Height:  |  Size: 15 KiB

After

Width:  |  Height:  |  Size: 15 KiB

View File

Before

Width:  |  Height:  |  Size: 1.0 KiB

After

Width:  |  Height:  |  Size: 1.0 KiB

View File

Before

Width:  |  Height:  |  Size: 446 B

After

Width:  |  Height:  |  Size: 446 B

View File

Before

Width:  |  Height:  |  Size: 259 B

After

Width:  |  Height:  |  Size: 259 B

View File

Before

Width:  |  Height:  |  Size: 897 B

After

Width:  |  Height:  |  Size: 897 B

View File

Before

Width:  |  Height:  |  Size: 4.4 KiB

After

Width:  |  Height:  |  Size: 4.4 KiB

View File

Before

Width:  |  Height:  |  Size: 1.2 KiB

After

Width:  |  Height:  |  Size: 1.2 KiB

View File

@@ -48,10 +48,10 @@
<td><?php _e('SSH2-Erweiterung installiert'); ?></td> <td><?php _e('SSH2-Erweiterung installiert'); ?></td>
<td class="<?php echo ($data['phpSSH']['status'] == true) ? 'green' : 'red'; ?>"><?php echo ($data['phpSSH']['status'] == true) ? '&#10004;' : '&#10006; <a style="color: inherit; text-decoration: underline" href="'.$data['configHelp'].'#phpssh'.getURLLangParam().'" target="_blank">'._t('Anleitung zur Installation').'</a>'; ?></td> <td class="<?php echo ($data['phpSSH']['status'] == true) ? 'green' : 'red'; ?>"><?php echo ($data['phpSSH']['status'] == true) ? '&#10004;' : '&#10006; <a style="color: inherit; text-decoration: underline" href="'.$data['configHelp'].'#phpssh'.getURLLangParam().'" target="_blank">'._t('Anleitung zur Installation').'</a>'; ?></td>
</tr> </tr>
<tr> <!--<tr>
<td><?php _e('Mcrypt-Erweiterung installiert'); ?></td> <td><?php _e('Mcrypt-Erweiterung installiert'); ?></td>
<td class="<?php echo ($data['phpMcrypt']['status'] == true) ? 'green' : 'red'; ?>"><?php echo ($data['phpMcrypt']['status'] == true) ? '&#10004;' : '&#10006; <a style="color: inherit; text-decoration: underline" href="'.$data['configHelp'].'?s=view&amp;i=12'.getURLLangParam().'" target="_blank">'._t('Anleitung zur Installation').'</a>'; ?></td> <td class="<?php echo ($data['phpMcrypt']['status'] == true) ? 'green' : 'red'; ?>"><?php echo ($data['phpMcrypt']['status'] == true) ? '&#10004;' : '&#10006; <a style="color: inherit; text-decoration: underline" href="'.$data['configHelp'].'?s=view&amp;i=12'.getURLLangParam().'" target="_blank">'._t('Anleitung zur Installation').'</a>'; ?></td>
</tr> </tr>-->
<tr> <tr>
<td><?php _e('CLI-Erweiterung installiert'); ?></td> <td><?php _e('CLI-Erweiterung installiert'); ?></td>
<td class="<?php echo ($data['phpCLI']['status'] == true) ? 'green' : 'red'; ?>"><?php echo ($data['phpCLI']['status'] == true) ? '&#10004;' : '&#10006; <a style="color: inherit; text-decoration: underline" href="'.$data['configHelp'].'?s=view&amp;i=13'.getURLLangParam().'" target="_blank">'._t('Anleitung zur Installation').'</a>'; ?></td> <td class="<?php echo ($data['phpCLI']['status'] == true) ? 'green' : 'red'; ?>"><?php echo ($data['phpCLI']['status'] == true) ? '&#10004;' : '&#10006; <a style="color: inherit; text-decoration: underline" href="'.$data['configHelp'].'?s=view&amp;i=13'.getURLLangParam().'" target="_blank">'._t('Anleitung zur Installation').'</a>'; ?></td>

View File

@@ -7,7 +7,7 @@ $tpl->setHeaderTitle(_t('Anforderungen'));
// PHP // PHP
$phpVersion = array('version' => PHP_VERSION, 'status' => false); $phpVersion = array('version' => PHP_VERSION, 'status' => false);
$phpSSH = array('status' => false); $phpSSH = array('status' => true);
$phpMcrypt = array('status' => false); $phpMcrypt = array('status' => false);
$phpCLI = array('status' => false); $phpCLI = array('status' => false);
$phpCURL = array('status' => false); $phpCURL = array('status' => false);
@@ -25,10 +25,10 @@ if (version_compare(PHP_VERSION, '7.0.0') >= 0)
if (extension_loaded('ssh2')) if (extension_loaded('ssh2'))
$phpSSH['status'] = true; $phpSSH['status'] = true;
//if (function_exists('mcrypt_encrypt') !== false) #if (function_exists('mcrypt_encrypt') !== false)
$phpMcrypt['status'] = true; # $phpMcrypt['status'] = true;
if (trim(exec('dpkg -s php7.3-cli | grep Status: ')) != '' || trim(exec('dpkg -s php7.4-cli | grep Status: ')) != '') if (trim(exec('dpkg -s php7.3-cli | grep Status: ')) != '' || trim(exec('dpkg -s php7.4-cli | grep Status: ')) != '' || trim(exec('dpkg -s php8.0-cli | grep Status: ')) != '' || trim(exec('dpkg -s php8.1-cli | grep Status: ')) != '' || trim(exec('dpkg -s php8.2-cli | grep Status: ')) != '')
$phpCLI['status'] = true; $phpCLI['status'] = true;
if (function_exists('curl_init') !== false) if (function_exists('curl_init') !== false)
@@ -62,7 +62,7 @@ foreach ($filesFolders as $file => $info)
} }
// Sonstiges // Sonstiges
if ($otherDistribution['version'] == 'Raspbian GNU/Linux 10' || $otherDistribution['version'] == 'Raspbian GNU/Linux 11') if ($otherDistribution['version'] == 'Raspbian GNU/Linux 10' || $otherDistribution['version'] == 'Raspbian GNU/Linux 11' || $otherDistribution['version'] == 'Debian GNU/Linux 11')
$otherDistribution['status'] = true; $otherDistribution['status'] = true;
if (isset($_COOKIE['_pi-control_install_language']) && $_COOKIE['_pi-control_install_language'] != '') if (isset($_COOKIE['_pi-control_install_language']) && $_COOKIE['_pi-control_install_language'] != '')
@@ -71,7 +71,8 @@ else
setCookie('_pi-control_install_language', $globalLanguage); setCookie('_pi-control_install_language', $globalLanguage);
// Button // Button
if ($phpVersion['status'] === false || $phpSSH['status'] === false || $phpMcrypt['status'] === false || $phpCLI['status'] === false || $phpCURL['status'] === false || $phpZipArchive['status'] === false || $phpAllowUrlFopen['status'] === false || $filesFoldersExist['status'] === false || $filesFoldersPermission['status'] === false || $otherDistribution['status'] === false || $otherCookie['status'] === false) //if ($phpVersion['status'] === false || $phpSSH['status'] === false || $phpMcrypt['status'] === false || $phpCLI['status'] === false || $phpCURL['status'] === false || $phpZipArchive['status'] === false || $phpAllowUrlFopen['status'] === false || $filesFoldersExist['status'] === false || $filesFoldersPermission['status'] === false || $otherDistribution['status'] === false || $otherCookie['status'] === false)
if ($phpVersion['status'] === false || $phpSSH['status'] === false || $phpCLI['status'] === false || $phpCURL['status'] === false || $phpZipArchive['status'] === false || $phpAllowUrlFopen['status'] === false || $filesFoldersExist['status'] === false || $filesFoldersPermission['status'] === false || $otherDistribution['status'] === false || $otherCookie['status'] === false)
$error = true; $error = true;
$tpl->assign('phpVersion', $phpVersion); $tpl->assign('phpVersion', $phpVersion);

View File

@@ -368,8 +368,15 @@ function urlIsPublic($url)
$ip = gethostbyname($url); $ip = gethostbyname($url);
$long = ip2long($ip); $long = ip2long($ip);
if (($long >= 167772160 && $long <= 184549375) || ($long >= -1408237568 && $long <= -1407188993) || ($long >= -1062731776 && $long <= -1062666241) || ($long >= 2130706432 && $long <= 2147483647) || $long == -1) if (PHP_INT_SIZE == 4) {
return false; if (($long >= 167772160 && $long <= 184549375) || ($long >= -1408237568 && $long <= -1407188993) || ($long >= -1062731776 && $long <= -1062666241) || ($long >= 2130706432 && $long <= 2147483647) || $long == -1) {
return false;
}
} else {
if (($long >= 3232235520 && $long <= 3232301055) || ($long >= 2886729728 && $long <= 2887778303) || ($long >= 167772160 && $long <= 184549375) || $long == -1) {
return false;
}
}
return true; return true;
} }
@@ -614,4 +621,3 @@ function getURLLangParam($echo = false, $html = true, $first = false)
return $param; return $param;
} }
?>

Some files were not shown because too many files have changed in this diff Show More