From a30ea4568ff4b2a324a8a6a8870d1d72fa9ddab3 Mon Sep 17 00:00:00 2001 From: Brion Vibber Date: Fri, 8 Oct 2010 11:23:53 -0700 Subject: Normalize execution guards in OpenID plugin files; avoids annoying fatal errors when .php files get spidered. --- plugins/OpenID/User_openid.php | 5 ++++- plugins/OpenID/User_openid_trustroot.php | 5 ++++- plugins/OpenID/finishaddopenid.php | 2 +- plugins/OpenID/finishopenidlogin.php | 4 +++- plugins/OpenID/openid.php | 6 +++--- plugins/OpenID/openidlogin.php | 4 +++- plugins/OpenID/openidserver.php | 4 +--- plugins/OpenID/openidsettings.php | 3 +-- plugins/OpenID/openidtrust.php | 5 +++-- 9 files changed, 23 insertions(+), 15 deletions(-) diff --git a/plugins/OpenID/User_openid.php b/plugins/OpenID/User_openid.php index 1beff9ea3..e34cf21f2 100644 --- a/plugins/OpenID/User_openid.php +++ b/plugins/OpenID/User_openid.php @@ -2,7 +2,10 @@ /** * Table Definition for user_openid */ -require_once INSTALLDIR.'/classes/Memcached_DataObject.php'; + +if (!defined('STATUSNET')) { + exit(1); +} class User_openid extends Memcached_DataObject { diff --git a/plugins/OpenID/User_openid_trustroot.php b/plugins/OpenID/User_openid_trustroot.php index 17c03afb0..69e0a3f3e 100644 --- a/plugins/OpenID/User_openid_trustroot.php +++ b/plugins/OpenID/User_openid_trustroot.php @@ -2,7 +2,10 @@ /** * Table Definition for user_openid_trustroot */ -require_once INSTALLDIR.'/classes/Memcached_DataObject.php'; + +if (!defined('STATUSNET')) { + exit(1); +} class User_openid_trustroot extends Memcached_DataObject { diff --git a/plugins/OpenID/finishaddopenid.php b/plugins/OpenID/finishaddopenid.php index 47b3f7fb1..6eb2f2d20 100644 --- a/plugins/OpenID/finishaddopenid.php +++ b/plugins/OpenID/finishaddopenid.php @@ -27,7 +27,7 @@ * @link http://status.net/ */ -if (!defined('STATUSNET') && !defined('LACONICA')) { +if (!defined('STATUSNET')) { exit(1); } diff --git a/plugins/OpenID/finishopenidlogin.php b/plugins/OpenID/finishopenidlogin.php index 0c03b5c4d..01dd61edb 100644 --- a/plugins/OpenID/finishopenidlogin.php +++ b/plugins/OpenID/finishopenidlogin.php @@ -17,7 +17,9 @@ * along with this program. If not, see . */ -if (!defined('STATUSNET') && !defined('LACONICA')) { exit(1); } +if (!defined('STATUSNET')) { + exit(1); +} require_once INSTALLDIR.'/plugins/OpenID/openid.php'; diff --git a/plugins/OpenID/openid.php b/plugins/OpenID/openid.php index 1b93163e5..ad251aa2c 100644 --- a/plugins/OpenID/openid.php +++ b/plugins/OpenID/openid.php @@ -17,9 +17,9 @@ * along with this program. If not, see . */ -if (!defined('STATUSNET') && !defined('LACONICA')) { exit(1); } - -require_once(INSTALLDIR.'/plugins/OpenID/User_openid.php'); +if (!defined('STATUSNET')) { + exit(1); +} require_once('Auth/OpenID.php'); require_once('Auth/OpenID/Consumer.php'); diff --git a/plugins/OpenID/openidlogin.php b/plugins/OpenID/openidlogin.php index 20d6e070c..4046068cf 100644 --- a/plugins/OpenID/openidlogin.php +++ b/plugins/OpenID/openidlogin.php @@ -17,7 +17,9 @@ * along with this program. If not, see . */ -if (!defined('STATUSNET') && !defined('LACONICA')) { exit(1); } +if (!defined('STATUSNET')) { + exit(1); +} require_once INSTALLDIR.'/plugins/OpenID/openid.php'; diff --git a/plugins/OpenID/openidserver.php b/plugins/OpenID/openidserver.php index b2cf1f8ac..ed9db4fd2 100644 --- a/plugins/OpenID/openidserver.php +++ b/plugins/OpenID/openidserver.php @@ -28,13 +28,11 @@ * @link http://status.net/ */ -if (!defined('STATUSNET') && !defined('LACONICA')) { +if (!defined('STATUSNET')) { exit(1); } -require_once INSTALLDIR.'/lib/action.php'; require_once INSTALLDIR.'/plugins/OpenID/openid.php'; -require_once(INSTALLDIR.'/plugins/OpenID/User_openid_trustroot.php'); /** * Settings for OpenID diff --git a/plugins/OpenID/openidsettings.php b/plugins/OpenID/openidsettings.php index 505e7d0ee..b7d5bd084 100644 --- a/plugins/OpenID/openidsettings.php +++ b/plugins/OpenID/openidsettings.php @@ -27,11 +27,10 @@ * @link http://status.net/ */ -if (!defined('STATUSNET') && !defined('LACONICA')) { +if (!defined('STATUSNET')) { exit(1); } -require_once INSTALLDIR.'/lib/accountsettingsaction.php'; require_once INSTALLDIR.'/plugins/OpenID/openid.php'; /** diff --git a/plugins/OpenID/openidtrust.php b/plugins/OpenID/openidtrust.php index ed6ca73a4..89f3150f6 100644 --- a/plugins/OpenID/openidtrust.php +++ b/plugins/OpenID/openidtrust.php @@ -17,10 +17,11 @@ * along with this program. If not, see . */ -if (!defined('STATUSNET') && !defined('LACONICA')) { exit(1); } +if (!defined('STATUSNET')) { + exit(1); +} require_once INSTALLDIR.'/plugins/OpenID/openid.php'; -require_once(INSTALLDIR.'/plugins/OpenID/User_openid_trustroot.php'); class OpenidtrustAction extends Action { -- cgit v1.2.3-54-g00ecf