From 8e4b79bc61be0c9c534d3d8b518be15c402b2974 Mon Sep 17 00:00:00 2001 From: vargenau Date: Thu, 4 Jun 2009 16:44:46 +0000 Subject: [PATCH] Do not hardcode "The PhpWiki programming team", use ADMIN_USER instead git-svn-id: svn://svn.code.sf.net/p/phpwiki/code/trunk@6896 96ab9672-09ca-45d6-a79d-3d69d39ca109 --- g | 3 +-- lib/PageList.php | 4 ++-- lib/WikiDB.php | 4 ++-- lib/WikiUserNew.php | 2 +- lib/loadsave.php | 9 ++++----- 5 files changed, 10 insertions(+), 12 deletions(-) diff --git a/g b/g index bab94d497..782d5b6f5 100644 --- a/g +++ b/g @@ -99,8 +99,7 @@ if (!$group_id || !$project) { // Disable VACUUM (they are performed every night) define('DATABASE_OPTIMISE_FREQUENCY', 0); - // It is not used but it is required by libs. - define('ADMIN_USER', 'The PhpWiki programming team'); + define('ADMIN_USER', 'ACOS Forge Administrator'); define('ADMIN_PASSWD', 'xxx'); // Allow ".jpeg" as extension diff --git a/lib/PageList.php b/lib/PageList.php index 113ed2104..cef41e32e 100644 --- a/lib/PageList.php +++ b/lib/PageList.php @@ -1111,7 +1111,7 @@ class PageList { return $allPages; } - // UserPages are pages NOT created by "The PhpWiki programming team" + // UserPages are pages NOT created by ADMIN_USER function allUserPages($include_empty=false, $sortby='', $limit='', $exclude='') { $dbi = $GLOBALS['request']->getDbh(); @@ -1120,7 +1120,7 @@ class PageList { while ($pagehandle = $allPagehandles->next()) { $name = $pagehandle->getName(); $creator = $pagehandle->getCreator(); - if ($creator !== _("The PhpWiki programming team")) { + if ($creator !== ADMIN_USER) { $allPages[] = $name; } } diff --git a/lib/WikiDB.php b/lib/WikiDB.php index 9e08a7304..f1c38a667 100644 --- a/lib/WikiDB.php +++ b/lib/WikiDB.php @@ -1400,7 +1400,7 @@ class WikiDB_Page // May be empty. Either the stored owner (/Chown), or the first authorized author function getOwner() { if ($owner = $this->get('owner')) - return ($owner == _("The PhpWiki programming team")) ? ADMIN_USER : $owner; + return $owner; // check all revisions forwards for the first author_id $backend = &$this->_wikidb->_backend; $pagename = &$this->_pagename; @@ -1408,7 +1408,7 @@ class WikiDB_Page for ($v=1; $v <= $latestversion; $v++) { $rev = $this->getRevision($v,false); if ($rev and $owner = $rev->get('author_id')) { - return ($owner == _("The PhpWiki programming team")) ? ADMIN_USER : $owner; + return $owner; } } return ''; diff --git a/lib/WikiUserNew.php b/lib/WikiUserNew.php index 4658c05af..a9d6e2630 100644 --- a/lib/WikiUserNew.php +++ b/lib/WikiUserNew.php @@ -426,7 +426,7 @@ class _WikiUser // function createHomePage() { global $request; - $versiondata = array('author' => _("The PhpWiki programming team")); + $versiondata = array('author' => ADMIN_USER); $request->_dbi->save(_("Automatically created user homepage to be able to store UserPreferences."). "\n{{Template/UserPage}}", 1, $versiondata); diff --git a/lib/loadsave.php b/lib/loadsave.php index 72d424230..0bb1c77fb 100644 --- a/lib/loadsave.php +++ b/lib/loadsave.php @@ -974,7 +974,7 @@ function SavePage (&$request, &$pageinfo, $source, $filename) fmt("has edit conflicts - overwriting anyway")); $skip = false; if (substr_count($source, 'pgsrc')) { - $versiondata['author'] = _("The PhpWiki programming team"); + $versiondata['author'] = ADMIN_USER; // but leave authorid as userid who loaded the file } } @@ -1497,17 +1497,16 @@ function SetupWiki (&$request) // This is a bogo-bogo-login: Login without // saving login information in session state. // This avoids logging in the unsuspecting - // visitor as "The PhpWiki programming team". + // visitor as ADMIN_USER // // This really needs to be cleaned up... // (I'm working on it.) $real_user = $request->_user; if (ENABLE_USER_NEW) - $request->_user = new _BogoUser(_("The PhpWiki programming team")); + $request->_user = new _BogoUser(ADMIN_USER); else - $request->_user = new WikiUser($request, _("The PhpWiki programming team"), - WIKIAUTH_BOGO); + $request->_user = new WikiUser($request, ADMIN_USER, WIKIAUTH_BOGO); StartLoadDump($request, _("Loading up virgin wiki")); -- 2.45.0