diff options
author | Romain d'Alverny <rdalverny@gmail.com> | 2022-01-11 12:36:17 +0100 |
---|---|---|
committer | Romain d'Alverny <rdalverny@gmail.com> | 2022-01-11 12:36:17 +0100 |
commit | 138865bbde25bb6193930c98e30c33913d19e367 (patch) | |
tree | 626e8e26dd4f4776ce9f8cd743987f08377127ed /admin | |
parent | 5f2b708377aec4bc5f1d731dfbb50557552d0482 (diff) | |
download | planet-138865bbde25bb6193930c98e30c33913d19e367.tar planet-138865bbde25bb6193930c98e30c33913d19e367.tar.gz planet-138865bbde25bb6193930c98e30c33913d19e367.tar.bz2 planet-138865bbde25bb6193930c98e30c33913d19e367.tar.xz planet-138865bbde25bb6193930c98e30c33913d19e367.zip |
Install code QA helpers, enforce PSR2
Installs phpcs, phpmd, parallel-lint, phpstan.
Diffstat (limited to 'admin')
-rwxr-xr-x | admin/index.php | 8 | ||||
-rwxr-xr-x | admin/login.php | 2 | ||||
-rw-r--r-- | admin/logout.php | 2 | ||||
-rw-r--r-- | admin/purgecache.php | 4 | ||||
-rwxr-xr-x | admin/subscriptions.php | 12 | ||||
-rwxr-xr-x | admin/template.php | 7 |
6 files changed, 18 insertions, 17 deletions
diff --git a/admin/index.php b/admin/index.php index 0118923..3a9e259 100755 --- a/admin/index.php +++ b/admin/index.php @@ -6,7 +6,7 @@ require_once __DIR__ . '/inc/auth.inc.php'; //Load configuration $config_file = __DIR__ . '/../custom/config.yml'; -if (is_file($config_file)){ +if (is_file($config_file)) { $conf = Spyc::YAMLLoad($config_file); $PlanetConfig = new PlanetConfig($conf); } else { @@ -107,9 +107,9 @@ ob_start(); <tbody> <?php $i = 0; - foreach ($everyone as $opml_person){ - $i++; - ?> + foreach ($everyone as $opml_person) { + $i++; + ?> <tr class="<?=($i%2)?'odd':'even'; ?>"> <td><input type="checkbox" class="checkbox" name="opml[<?=$i; ?>][delete]" /></td> <td><input type="text" size="10" class="text" name="opml[<?=$i; ?>][name]" value="<?=$opml_person->getName(); ?>" /></td> diff --git a/admin/login.php b/admin/login.php index a95e59f..618cfb9 100755 --- a/admin/login.php +++ b/admin/login.php @@ -4,7 +4,7 @@ require_once __DIR__ . '/../app/app.php'; if (isset($_POST['password'])) { session_regenerate_id(); - setcookie('auth',md5($_POST['password'])); + setcookie('auth', md5($_POST['password'])); header('Location: index.php'); } diff --git a/admin/logout.php b/admin/logout.php index adb843f..88c60b3 100644 --- a/admin/logout.php +++ b/admin/logout.php @@ -2,7 +2,7 @@ require_once __DIR__ . '/../app/app.php'; -setcookie('auth','', time()-3600); +setcookie('auth', '', time() - 3600); session_destroy(); session_regenerate_id(); diff --git a/admin/purgecache.php b/admin/purgecache.php index 23a5712..7b01c97 100644 --- a/admin/purgecache.php +++ b/admin/purgecache.php @@ -3,13 +3,13 @@ require_once __DIR__.'/../app/app.php'; require_once __DIR__.'/inc/auth.inc.php'; -if (isset($_POST['purge'])){ +if (isset($_POST['purge'])) { $dir = __DIR__.'/../cache/'; $dh = opendir($dir); while ($filename = readdir($dh)) { - if ($filename == '.' OR $filename == '..') { + if ($filename == '.' or $filename == '..') { continue; } diff --git a/admin/subscriptions.php b/admin/subscriptions.php index 0940168..313e5bd 100755 --- a/admin/subscriptions.php +++ b/admin/subscriptions.php @@ -3,7 +3,8 @@ require_once __DIR__ . '/../app/app.php'; require_once __DIR__ . '/inc/auth.inc.php'; -function removeSlashes(&$item, $key){ +function removeSlashes(&$item, $key) +{ $item = stripslashes($item); } @@ -12,7 +13,6 @@ if (!$csrf->verify($_POST['_csrf'], 'feedmanage')) { } if (isset($_POST['opml']) || isset($_POST['add'])) { - // Load old OPML $oldOpml = OpmlManager::load(__DIR__.'/../custom/people.opml'); if ($PlanetConfig->getName() === '') { @@ -26,11 +26,11 @@ if (isset($_POST['opml']) || isset($_POST['add'])) { array_walk_recursive($_POST['opml'], 'removeSlashes'); } // Delete/Save feeds - if (isset($_POST['delete']) || isset($_POST['save'])){ - foreach ($_POST['opml'] as $person){ + if (isset($_POST['delete']) || isset($_POST['save'])) { + foreach ($_POST['opml'] as $person) { if (isset($_POST['delete'])) { //delete mode, check if to be deleted - if (!isset($person['delete'])){ + if (!isset($person['delete'])) { $newOpml->entries[] = $person; } } else { @@ -40,7 +40,7 @@ if (isset($_POST['opml']) || isset($_POST['add'])) { } // Add feed - if (isset($_POST['add'])){ + if (isset($_POST['add'])) { if ('http://' != $_POST['url']) { //autodiscover feed $feed = new SimplePie(); diff --git a/admin/template.php b/admin/template.php index 7818bef..964c639 100755 --- a/admin/template.php +++ b/admin/template.php @@ -1,4 +1,6 @@ -<?php if(!isset($admin_access)) return; ?> +<?php if (!isset($admin_access)) { + return; +} ?> <!DOCTYPE html> <html lang="en"> <head> @@ -26,8 +28,7 @@ <p><a href="../"><?=_g('Back to main page')?></a></p> </header> - <?php if($admin_access == 1) : ?> - + <?php if ($admin_access == 1) : ?> <p class="logout"><a href="logout.php"><?=_g('Logout')?></a></p> <nav> <ul> |