From: <var...@us...> - 2010-08-31 16:08:42
|
Revision: 7663 http://phpwiki.svn.sourceforge.net/phpwiki/?rev=7663&view=rev Author: vargenau Date: 2010-08-31 15:23:17 +0000 (Tue, 31 Aug 2010) Log Message: ----------- Rename WikiUser/GForge.php as WikiUser/FusionForge.php Modified Paths: -------------- trunk/g trunk/lib/SemanticWeb.php Added Paths: ----------- trunk/lib/WikiUser/FusionForge.php Removed Paths: ------------- trunk/lib/WikiUser/GForge.php Modified: trunk/g =================================================================== --- trunk/g 2010-08-31 15:12:14 UTC (rev 7662) +++ trunk/g 2010-08-31 15:23:17 UTC (rev 7663) @@ -160,9 +160,9 @@ // Do not allow fake user define('ALLOW_BOGO_LOGIN', false); - // A dedicated auth has been created to get auth from GForge - $USER_AUTH_ORDER = array("GForge"); - define('USER_AUTH_ORDER', 'GForge'); + // A dedicated auth has been created to get auth from FusionForge + $USER_AUTH_ORDER = array("FusionForge"); + define('USER_AUTH_ORDER', 'FusionForge'); define('USER_AUTH_POLICY', 'strict'); define('EXTERNAL_LINK_TARGET', '_top'); Modified: trunk/lib/SemanticWeb.php =================================================================== --- trunk/lib/SemanticWeb.php 2010-08-31 15:12:14 UTC (rev 7662) +++ trunk/lib/SemanticWeb.php 2010-08-31 15:23:17 UTC (rev 7663) @@ -77,7 +77,7 @@ * http://phpwiki.org/SemanticWeb, * http://en.wikipedia.org/wiki/Knowledge_representation * http://www.ontoweb.org/ - * http://www.semwebcentral.org/ (OWL on top of GForge) + * http://www.semwebcentral.org/ (OWL on top of FusionForge) * * * Author: Reini Urban <ru...@x-...> Copied: trunk/lib/WikiUser/FusionForge.php (from rev 7658, trunk/lib/WikiUser/GForge.php) =================================================================== --- trunk/lib/WikiUser/FusionForge.php (rev 0) +++ trunk/lib/WikiUser/FusionForge.php 2010-08-31 15:23:17 UTC (rev 7663) @@ -0,0 +1,108 @@ +<?php //-*-php-*- +// rcs_id('$Id$'); +/* + * Copyright (C) 2006 Alain Peyrat + * + * This file is part of PhpWiki. + * + * PhpWiki is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * PhpWiki is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with PhpWiki; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/** Call the FusionForge functions to get the username + * + */ +class _FusionForgePassUser extends _PassUser { + + var $_is_external = 0; + + function _FusionForgePassUser($UserName='',$prefs=false) { + if ($prefs) $this->_prefs = $prefs; + if (!isset($this->_prefs->_method)) + _PassUser::_PassUser($UserName); + if ($UserName) $this->_userid = $UserName; + $this->_authmethod = 'FusionForge'; + + // Is this double check really needed? + // It is not expensive so we keep it for now. + if ($this->userExists()) + return $this; + else + return $GLOBALS['ForbiddenUser']; + } + + function userExists() { + global $group_id; + + // Mapping (PhpWiki vs FusionForge) performed is: + // ANON for non logged or non member + // USER for member of the project. + // ADMIN for member having admin rights + if (session_loggedin()){ + + // Get project object (if error => ANON) + $project =& group_get_object($group_id); + + if (!$project || !is_object($project)) { + $this->_level = WIKIAUTH_ANON; + return false; + } elseif ($project->isError()) { + $this->_level = WIKIAUTH_ANON; + return false; + } + + $member = false ; + $user = session_get_user(); + $perm =& $project->getPermission($user); + if (!$perm || !is_object($perm)) { + $this->_level = WIKIAUTH_ANON; + return false; + } elseif (!$perm->isError()) { + $member = $perm->isMember(); + } + + if ($member) { + $this->_userid = $user->getRealName(); + $this->_is_external = $user->getIsExternal(); + if ($perm->isAdmin()) { + $this->_level = WIKIAUTH_ADMIN; + } else { + $this->_level = WIKIAUTH_USER; + } + return $this; + } + } + $this->_level = WIKIAUTH_ANON; + return false; + } + + function checkPass($submitted_password) { + return $this->userExists() + ? ($this->isAdmin() ? WIKIAUTH_ADMIN : WIKIAUTH_USER) + : WIKIAUTH_ANON; + } + + function mayChangePass() { + return false; + } +} + +// Local Variables: +// mode: php +// tab-width: 8 +// c-basic-offset: 4 +// c-hanging-comment-ender-p: nil +// indent-tabs-mode: nil +// End: +?> Deleted: trunk/lib/WikiUser/GForge.php =================================================================== --- trunk/lib/WikiUser/GForge.php 2010-08-31 15:12:14 UTC (rev 7662) +++ trunk/lib/WikiUser/GForge.php 2010-08-31 15:23:17 UTC (rev 7663) @@ -1,108 +0,0 @@ -<?php //-*-php-*- -// rcs_id('$Id$'); -/* - * Copyright (C) 2006 Alain Peyrat - * - * This file is part of PhpWiki. - * - * PhpWiki is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * PhpWiki is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with PhpWiki; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -/** Call the gforge functions to get the username - * - */ -class _GForgePassUser extends _PassUser { - - var $_is_external = 0; - - function _GForgePassUser($UserName='',$prefs=false) { - if ($prefs) $this->_prefs = $prefs; - if (!isset($this->_prefs->_method)) - _PassUser::_PassUser($UserName); - if ($UserName) $this->_userid = $UserName; - $this->_authmethod = 'GForge'; - - // Is this double check really needed? - // It is not expensive so we keep it for now. - if ($this->userExists()) - return $this; - else - return $GLOBALS['ForbiddenUser']; - } - - function userExists() { - global $group_id; - - // Mapping (phpWiki vs GForge) performed is: - // ANON for non logged or non member - // USER for member of the project. - // ADMIN for member having admin rights - if (session_loggedin()){ - - // Get project object (if error => ANON) - $project =& group_get_object($group_id); - - if (!$project || !is_object($project)) { - $this->_level = WIKIAUTH_ANON; - return false; - } elseif ($project->isError()) { - $this->_level = WIKIAUTH_ANON; - return false; - } - - $member = false ; - $user = session_get_user(); - $perm =& $project->getPermission($user); - if (!$perm || !is_object($perm)) { - $this->_level = WIKIAUTH_ANON; - return false; - } elseif (!$perm->isError()) { - $member = $perm->isMember(); - } - - if ($member) { - $this->_userid = $user->getRealName(); - $this->_is_external = $user->getIsExternal(); - if ($perm->isAdmin()) { - $this->_level = WIKIAUTH_ADMIN; - } else { - $this->_level = WIKIAUTH_USER; - } - return $this; - } - } - $this->_level = WIKIAUTH_ANON; - return false; - } - - function checkPass($submitted_password) { - return $this->userExists() - ? ($this->isAdmin() ? WIKIAUTH_ADMIN : WIKIAUTH_USER) - : WIKIAUTH_ANON; - } - - function mayChangePass() { - return false; - } -} - -// Local Variables: -// mode: php -// tab-width: 8 -// c-basic-offset: 4 -// c-hanging-comment-ender-p: nil -// indent-tabs-mode: nil -// End: -?> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |