From 7259cbbc9eb796dade85e3d0c6b9fbfd61fb66af Mon Sep 17 00:00:00 2001 From: vargenau Date: Wed, 5 Dec 2012 19:01:32 +0000 Subject: [PATCH] (defined('FUSIONFORGE') and FUSIONFORGE) git-svn-id: svn://svn.code.sf.net/p/phpwiki/code/trunk@8607 96ab9672-09ca-45d6-a79d-3d69d39ca109 --- lib/EditToolbar.php | 4 ++-- lib/IniConfig.php | 10 +++++----- lib/MailNotify.php | 6 +++--- lib/PageList.php | 2 +- lib/PagePerm.php | 2 +- lib/WikiTheme.php | 2 +- lib/WikiUserNew.php | 14 +++++++------- lib/loadsave.php | 2 +- lib/main.php | 2 +- 9 files changed, 22 insertions(+), 22 deletions(-) diff --git a/lib/EditToolbar.php b/lib/EditToolbar.php index 8f873f22d..7b36fd9f7 100644 --- a/lib/EditToolbar.php +++ b/lib/EditToolbar.php @@ -117,7 +117,7 @@ msg_repl_close = '" . _("Close") . "' if (ENABLE_EDIT_TOOLBAR) { $username = $request->_user->UserName(); - if (FUSIONFORGE or DISABLE_MARKUP_WIKIWORD or (!isWikiWord($username))) { + if ((defined('FUSIONFORGE') and FUSIONFORGE) or DISABLE_MARKUP_WIKIWORD or (!isWikiWord($username))) { $username = '[[' . $username . ']]'; } $signature = " ––" . $username . " " . CTime(); @@ -305,7 +305,7 @@ msg_repl_close = '" . _("Close") . "' $categories = array(); while ($p = $pages->next()) { $page = $p->getName(); - if (FUSIONFORGE) { + if ((defined('FUSIONFORGE') and FUSIONFORGE)) { $categories[] = "['$page', '%0A----%0A%5B%5B" . $page . "%5D%5D']"; } elseif (DISABLE_MARKUP_WIKIWORD or (!isWikiWord($page))) { $categories[] = "['$page', '%0A%5B" . $page . "%5D']"; diff --git a/lib/IniConfig.php b/lib/IniConfig.php index 90383d241..9fe1436e8 100644 --- a/lib/IniConfig.php +++ b/lib/IniConfig.php @@ -635,7 +635,7 @@ function fixup_static_configs($file) . 'WantedPages:WatchPage:WhoIsOnline:WikiAdminSelect'); // The FUSIONFORGE theme omits them - if (!FUSIONFORGE) { + if (!(defined('FUSIONFORGE') and FUSIONFORGE)) { // Add some some action pages depending on configuration if (DEBUG) { $ActionPages[] = 'DebugInfo'; @@ -726,7 +726,7 @@ function fixup_static_configs($file) $AllAllowedPlugins[] = 'YouTube'; // The FUSIONFORGE theme omits them - if (!FUSIONFORGE) { + if (!(defined('FUSIONFORGE') and FUSIONFORGE)) { $AllAllowedPlugins[] = 'AnalyseAccessLogSql'; $AllAllowedPlugins[] = '_AuthInfo'; $AllAllowedPlugins[] = '_BackendInfo'; @@ -790,7 +790,7 @@ function fixup_static_configs($file) $AllActionPages[] = 'UserContribs'; // The FUSIONFORGE theme omits them - if (!FUSIONFORGE) { + if (!(defined('FUSIONFORGE') and FUSIONFORGE)) { // Add some some action pages depending on configuration if (DEBUG) { $AllActionPages[] = 'PhpWikiAdministration/Chmod'; @@ -798,7 +798,7 @@ function fixup_static_configs($file) $AllActionPages[] = 'PhpWikiAdministration/Markup'; } - if (FUSIONFORGE) { + if ((defined('FUSIONFORGE') and FUSIONFORGE)) { if (ENABLE_EXTERNAL_PAGES) { $AllAllowedPlugins[] = 'WikiAdminSetExternal'; $AllActionPages[] = 'PhpWikiAdministration/SetExternal'; @@ -937,7 +937,7 @@ function fixup_dynamic_configs() define('DEFAULT_LANGUAGE', ''); // detect from client // FusionForge hack - if (!FUSIONFORGE) { + if (!(defined('FUSIONFORGE') and FUSIONFORGE)) { // Disable update_locale because Zend Debugger crash if (!extension_loaded('Zend Debugger')) { update_locale(isset($LANG) ? $LANG : DEFAULT_LANGUAGE); diff --git a/lib/MailNotify.php b/lib/MailNotify.php index 741893c67..ba335593e 100644 --- a/lib/MailNotify.php +++ b/lib/MailNotify.php @@ -66,7 +66,7 @@ class MailNotify function fromId() { global $request; - if (FUSIONFORGE) { + if (defined('FUSIONFORGE') and FUSIONFORGE) { return $request->_user->getId(); } else { return $request->_user->getId() . '@' . $request->get('REMOTE_HOST'); @@ -84,7 +84,7 @@ class MailNotify global $request; // Disable verification of emails for corporate env. - if (FUSIONFORGE) { + if (defined('FUSIONFORGE') and FUSIONFORGE) { $doverify = false; } @@ -193,7 +193,7 @@ class MailNotify $encoded_subject = $this->subject_encode($subject); $emails = $this->emails; // Do not send if modification is from FusionForge admin - if (FUSIONFORGE and ($this->fromId() == ADMIN_USER)) { + if ((defined('FUSIONFORGE') and FUSIONFORGE) and ($this->fromId() == ADMIN_USER)) { return true; } if (!$notice) { diff --git a/lib/PageList.php b/lib/PageList.php index 4ae0e3df4..ccbee616b 100644 --- a/lib/PageList.php +++ b/lib/PageList.php @@ -1368,7 +1368,7 @@ class PageList trigger_error(sprintf("%s: Bad column", $column), E_USER_NOTICE); return false; } - if (!FUSIONFORGE) { + if (!(defined('FUSIONFORGE') and FUSIONFORGE)) { // FIXME: anon users might rate and see ratings also. // Defer this logic to the plugin. if ($column == 'rating' and !$GLOBALS['request']->_user->isSignedIn()) { diff --git a/lib/PagePerm.php b/lib/PagePerm.php index e08eecad3..e0c86f687 100644 --- a/lib/PagePerm.php +++ b/lib/PagePerm.php @@ -239,7 +239,7 @@ function _requiredAuthorityForPagename($access, $pagename) $page = $request->getPage($pagename); // Exceptions: - if (FUSIONFORGE) { + if (defined('FUSIONFORGE') and FUSIONFORGE) { if ($pagename != '.' && isset($request->_user->_is_external) && $request->_user->_is_external && !$page->get('external')) { $permcache[$pagename][$access] = 0; return 0; diff --git a/lib/WikiTheme.php b/lib/WikiTheme.php index a221d410a..3aab37aaa 100644 --- a/lib/WikiTheme.php +++ b/lib/WikiTheme.php @@ -215,7 +215,7 @@ class WikiTheme return; } $this->addMoreHeaders(JavaScript('', array('src' => $this->_findData("wikicommon.js")))); - if (!FUSIONFORGE) { + if (!(defined('FUSIONFORGE') and FUSIONFORGE)) { // FusionForge already loads this $this->addMoreHeaders(JavaScript('', array('src' => $this->_findData("sortable.js")))); } diff --git a/lib/WikiUserNew.php b/lib/WikiUserNew.php index e6457613a..f331e6967 100644 --- a/lib/WikiUserNew.php +++ b/lib/WikiUserNew.php @@ -595,7 +595,7 @@ class _WikiUser { if (!$userid) $userid = $this->_userid; if (!$userid) return false; - if (FUSIONFORGE) { + if (defined('FUSIONFORGE') and FUSIONFORGE) { return true; } return preg_match("/^[\-\w\.@ ]+$/U", $userid) and strlen($userid) < 32; @@ -1764,7 +1764,7 @@ class _UserPreference_email function get($name) { // get e-mail address from FusionForge - if (FUSIONFORGE && session_loggedin()) { + if ((defined('FUSIONFORGE') and FUSIONFORGE) && session_loggedin()) { $user = session_get_user(); return $user->getEmail(); } else { @@ -1775,7 +1775,7 @@ class _UserPreference_email function sanify($value) { // e-mail address is already checked by FusionForge - if (FUSIONFORGE) { + if (defined('FUSIONFORGE') and FUSIONFORGE) { return $value; } // check for valid email address @@ -1802,7 +1802,7 @@ class _UserPreference_email function update($value) { // e-mail address is already checked by FusionForge - if (FUSIONFORGE) { + if (defined('FUSIONFORGE') and FUSIONFORGE) { return; } if (!empty($this->_init)) { @@ -1985,7 +1985,7 @@ class UserPreferences // This should be probably be done with $customUserPreferenceColumns // For now, we use FUSIONFORGE define - if (FUSIONFORGE) { + if (defined('FUSIONFORGE') and FUSIONFORGE) { $fusionforgeprefs = array( 'pageTrail' => new _UserPreference_bool(), 'diffMenuItem' => new _UserPreference_bool(), @@ -2177,7 +2177,7 @@ class UserPreferences } } - if (FUSIONFORGE) { + if (defined('FUSIONFORGE') and FUSIONFORGE) { // Merge current notifyPages with notifyPagesAll // notifyPages are pages to notify in the current project // while $notifyPagesAll is used to store all the monitored pages. @@ -2227,7 +2227,7 @@ class UserPreferences } } - if (FUSIONFORGE) { + if (defined('FUSIONFORGE') and FUSIONFORGE) { // Restore notifyPages from notifyPagesAll // notifyPages are pages to notify in the current project // while $notifyPagesAll is used to store all the monitored pages. diff --git a/lib/loadsave.php b/lib/loadsave.php index 4f5f84489..dcdee2ea9 100644 --- a/lib/loadsave.php +++ b/lib/loadsave.php @@ -1527,7 +1527,7 @@ function SetupWiki(&$request) // Ensure that all mandatory pages are loaded $finder = new FileFinder; - if (!FUSIONFORGE) { + if (!(defined('FUSIONFORGE') and FUSIONFORGE)) { $mandatory = explode(':', 'SandBox:Template/Category:Template/Talk:SpecialPages:CategoryCategory:CategoryActionPage:Help/OldTextFormattingRules:Help/TextFormattingRules:PhpWikiAdministration'); } elseif (WIKI_NAME == "help") { $mandatory = explode(':', 'SandBox:Template/Category:Template/Talk:SpecialPages:CategoryCategory:CategoryActionPage:Help/TextFormattingRules:PhpWikiAdministration'); diff --git a/lib/main.php b/lib/main.php index e33e87b04..cdba5e992 100644 --- a/lib/main.php +++ b/lib/main.php @@ -1482,7 +1482,7 @@ function main() $request->finish(); } -if ((!FUSIONFORGE) || (forge_get_config('installation_environment') != 'production')) { +if ((!(defined('FUSIONFORGE') and FUSIONFORGE)) || (forge_get_config('installation_environment') != 'production')) { if (defined('E_STRICT') and (E_ALL & E_STRICT)) // strict php5? error_reporting(E_ALL & ~E_STRICT); // exclude E_STRICT else -- 2.45.0