diff options
Diffstat (limited to 'includes/extauth/MediaWiki.php')
-rw-r--r-- | includes/extauth/MediaWiki.php | 56 |
1 files changed, 30 insertions, 26 deletions
diff --git a/includes/extauth/MediaWiki.php b/includes/extauth/MediaWiki.php index 7d6a3c71..9df4ea1f 100644 --- a/includes/extauth/MediaWiki.php +++ b/includes/extauth/MediaWiki.php @@ -1,21 +1,26 @@ <?php - -# Copyright (C) 2009 Aryeh Gregor -# -# This program 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. -# -# This program 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 this program; if not, write to the Free Software Foundation, Inc., -# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -# http://www.gnu.org/copyleft/gpl.html +/** + * External authentication with external MediaWiki database. + * + * Copyright © 2009 Aryeh Gregor + * + * This program 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. + * + * This program 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 this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + * http://www.gnu.org/copyleft/gpl.html + * + * @file + */ /** * This class supports authentication against an external MediaWiki database, @@ -67,15 +72,14 @@ class ExternalUser_MediaWiki extends ExternalUser { private function initFromCond( $cond ) { global $wgExternalAuthConf; - $class = 'Database' . $wgExternalAuthConf['DBtype']; - $this->mDb = new $class( - $wgExternalAuthConf['DBserver'], - $wgExternalAuthConf['DBuser'], - $wgExternalAuthConf['DBpassword'], - $wgExternalAuthConf['DBname'], - false, - 0, - $wgExternalAuthConf['DBprefix'] + $this->mDb = DatabaseBase::newFromType( $wgExternalAuthConf['DBtype'], + array( + 'server' => $wgExternalAuthConf['DBserver'], + 'user' => $wgExternalAuthConf['DBuser'], + 'password' => $wgExternalAuthConf['DBpassword'], + 'dbname' => $wgExternalAuthConf['DBname'], + 'tableprefix' => $wgExternalAuthConf['DBprefix'], + ) ); $row = $this->mDb->selectRow( |