diff options
author | nashe <contact@nashe.fr> | 2015-08-11 11:59:40 +0200 |
---|---|---|
committer | nashe <contact@nashe.fr> | 2015-08-11 11:59:40 +0200 |
commit | f2788a4ed2eae7f0056ab200b8fc787ed20a32da (patch) | |
tree | c9c5ded4176bb6390f6f5773ebfa2f8b91d67a5a /admin | |
parent | e47418ee75998ae22a506b8fd596dbba58388266 (diff) | |
download | planet-f2788a4ed2eae7f0056ab200b8fc787ed20a32da.tar planet-f2788a4ed2eae7f0056ab200b8fc787ed20a32da.tar.gz planet-f2788a4ed2eae7f0056ab200b8fc787ed20a32da.tar.bz2 planet-f2788a4ed2eae7f0056ab200b8fc787ed20a32da.tar.xz planet-f2788a4ed2eae7f0056ab200b8fc787ed20a32da.zip |
Fix class autoloading
Made some mistakes with my last PR: I tested that everything were
working, but on the wrong branch.
This commit fixes all the autoloading error that were left.
Diffstat (limited to 'admin')
-rwxr-xr-x | admin/administration.php | 3 | ||||
-rw-r--r-- | admin/inc/auth.inc.php | 5 | ||||
-rwxr-xr-x | admin/index.php | 2 | ||||
-rw-r--r-- | admin/purgecache.php | 10 | ||||
-rwxr-xr-x | admin/subscriptions.php | 3 |
5 files changed, 15 insertions, 8 deletions
diff --git a/admin/administration.php b/admin/administration.php index 1202e91..d3a8fdf 100755 --- a/admin/administration.php +++ b/admin/administration.php @@ -1,7 +1,8 @@ <?php -require_once dirname(__FILE__) . '/inc/auth.inc.php'; require_once dirname(__FILE__) . '/../app/app.php'; +require_once dirname(__FILE__) . '/inc/auth.inc.php'; + $opml = OpmlManager::load(dirname(__FILE__) . '/../custom/people.opml'); $opml_people = $opml->getPeople(); diff --git a/admin/inc/auth.inc.php b/admin/inc/auth.inc.php index db6e571..0acf934 100644 --- a/admin/inc/auth.inc.php +++ b/admin/inc/auth.inc.php @@ -1,7 +1,10 @@ <?php include dirname(__FILE__).'/pwd.inc.php'; -require_once __DIR__.'/../../app/classes/Planet.class.php'; + +if (!class_exists('Planet')) { + require __DIR__.'/../../vendor/autoload.php'; +} if (!Planet::authenticateUser($_COOKIE['auth'], $password)) { setcookie('auth', '', time() - 3600); diff --git a/admin/index.php b/admin/index.php index 76ddc98..25b337b 100755 --- a/admin/index.php +++ b/admin/index.php @@ -1,7 +1,7 @@ <?php -require_once dirname(__FILE__) . '/inc/auth.inc.php'; require_once dirname(__FILE__) . '/../app/app.php'; +require_once dirname(__FILE__) . '/inc/auth.inc.php'; //Load configuration $config_file = dirname(__FILE__) . '/../custom/config.yml'; diff --git a/admin/purgecache.php b/admin/purgecache.php index a5af5cf..8657938 100644 --- a/admin/purgecache.php +++ b/admin/purgecache.php @@ -1,16 +1,18 @@ <?php + +require_once __DIR__.'/../app/app.php'; require_once dirname(__FILE__).'/inc/auth.inc.php'; if (isset($_POST['purge'])){ $dir = dirname(__FILE__).'/../cache/'; - + $dh = opendir($dir); - + while ($filename = readdir($dh)) { if ($filename == '.' OR $filename == '..') { continue; } - + if (filemtime($dir . DIRECTORY_SEPARATOR . $filename) < time()) { @unlink($dir . DIRECTORY_SEPARATOR . $filename); } @@ -18,4 +20,4 @@ if (isset($_POST['purge'])){ } header('Location: administration.php'); -die();
\ No newline at end of file +die(); diff --git a/admin/subscriptions.php b/admin/subscriptions.php index 3612666..8367a16 100755 --- a/admin/subscriptions.php +++ b/admin/subscriptions.php @@ -1,6 +1,7 @@ <?php -require_once dirname(__FILE__) . '/inc/auth.inc.php'; + require_once dirname(__FILE__) . '/../app/app.php'; +require_once dirname(__FILE__) . '/inc/auth.inc.php'; function removeSlashes(&$item, $key){ $item = stripslashes($item); |