summaryrefslogtreecommitdiff
path: root/includes/extauth
diff options
context:
space:
mode:
Diffstat (limited to 'includes/extauth')
-rw-r--r--includes/extauth/MediaWiki.php35
-rw-r--r--includes/extauth/vB.php6
2 files changed, 32 insertions, 9 deletions
diff --git a/includes/extauth/MediaWiki.php b/includes/extauth/MediaWiki.php
index 9df4ea1f..0a5efae6 100644
--- a/includes/extauth/MediaWiki.php
+++ b/includes/extauth/MediaWiki.php
@@ -50,8 +50,17 @@
* @ingroup ExternalUser
*/
class ExternalUser_MediaWiki extends ExternalUser {
- private $mRow, $mDb;
+ private $mRow;
+ /**
+ * @var DatabaseBase
+ */
+ private $mDb;
+
+ /**
+ * @param $name string
+ * @return bool
+ */
protected function initFromName( $name ) {
# We might not need the 'usable' bit, but let's be safe. Theoretically
# this might return wrong results for old versions, but it's probably
@@ -65,20 +74,28 @@ class ExternalUser_MediaWiki extends ExternalUser {
return $this->initFromCond( array( 'user_name' => $name ) );
}
+ /**
+ * @param $id int
+ * @return bool
+ */
protected function initFromId( $id ) {
return $this->initFromCond( array( 'user_id' => $id ) );
}
+ /**
+ * @param $cond array
+ * @return bool
+ */
private function initFromCond( $cond ) {
global $wgExternalAuthConf;
- $this->mDb = DatabaseBase::newFromType( $wgExternalAuthConf['DBtype'],
+ $this->mDb = DatabaseBase::factory( $wgExternalAuthConf['DBtype'],
array(
- 'server' => $wgExternalAuthConf['DBserver'],
+ 'host' => $wgExternalAuthConf['DBserver'],
'user' => $wgExternalAuthConf['DBuser'],
'password' => $wgExternalAuthConf['DBpassword'],
'dbname' => $wgExternalAuthConf['DBname'],
- 'tableprefix' => $wgExternalAuthConf['DBprefix'],
+ 'tablePrefix' => $wgExternalAuthConf['DBprefix'],
)
);
@@ -105,6 +122,9 @@ class ExternalUser_MediaWiki extends ExternalUser {
return $this->mRow->user_id;
}
+ /**
+ * @return string
+ */
public function getName() {
return $this->mRow->user_name;
}
@@ -117,7 +137,7 @@ class ExternalUser_MediaWiki extends ExternalUser {
}
public function getPref( $pref ) {
- # FIXME: Return other prefs too. Lots of global-riddled code that does
+ # @todo FIXME: Return other prefs too. Lots of global-riddled code that does
# this normally.
if ( $pref === 'emailaddress'
&& $this->row->user_email_authenticated !== null ) {
@@ -126,8 +146,11 @@ class ExternalUser_MediaWiki extends ExternalUser {
return null;
}
+ /**
+ * @return array
+ */
public function getGroups() {
- # FIXME: Untested.
+ # @todo FIXME: Untested.
$groups = array();
$res = $this->mDb->select(
'user_groups',
diff --git a/includes/extauth/vB.php b/includes/extauth/vB.php
index 860048f3..f516c423 100644
--- a/includes/extauth/vB.php
+++ b/includes/extauth/vB.php
@@ -34,7 +34,7 @@
* 'username' => 'forum',
* 'password' => 'udE,jSqDJ<""p=fI.K9',
* 'dbname' => 'forum',
- * 'tableprefix' => '',
+ * 'tablePrefix' => '',
* 'cookieprefix' => 'bb'
* );
*
@@ -108,8 +108,8 @@ class ExternalUser_vB extends ExternalUser {
$wgExternalAuthConf['username'],
$wgExternalAuthConf['password'],
$wgExternalAuthConf['dbname'],
- false, 0,
- $wgExternalAuthConf['tableprefix']
+ 0,
+ $wgExternalAuthConf['tablePrefix']
);
}