Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
scripts
mediawiki-auth-mahara
Commits
01c6238c
Commit
01c6238c
authored
Sep 27, 2010
by
Brett Wilkins
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
MaharaAuthPlugin: Adding a couple of minor changes (shouldn't change operation)
parent
bec35da3
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
37 deletions
+2
-37
MaharaAuthPlugin.php
MaharaAuthPlugin.php
+2
-37
No files found.
MaharaAuthPlugin.php
View file @
01c6238c
<?php
/**
*/
require
(
'GlobalFunctions.php'
);
# Copyright (C) 2004 Brion Vibber <brion@pobox.com>
# http://www.mediawiki.org/
#
...
...
@@ -55,17 +54,14 @@ class MaharaAuthPlugin extends AuthPlugin {
$this
->
dbtype
=
$dbtype
;
$this
->
dbuser
=
$user
;
$this
->
dbpass
=
$password
;
wfDebugLog
(
'mahara'
,
'authplugin constructed'
);
}
public
function
userExists
(
$username
)
{
$username
=
strtolower
(
$username
);
$db
=
$this
->
getDatabase
();
$sql
=
"SELECT username FROM "
.
$this
->
prefix
.
"usr where username = '"
.
$username
.
"'"
;
wfDebugLog
(
'mahara'
,
$sql
);
$res
=
$db
->
query
(
$sql
);
$val
=
$db
->
fetchObject
(
$res
);
wfDebugLog
(
'mahara'
,
print_r
(
$val
,
true
));
$db
->
close
();
if
(
!
empty
(
$val
))
{
return
true
;
...
...
@@ -87,7 +83,6 @@ class MaharaAuthPlugin extends AuthPlugin {
$username
=
strtolower
(
$username
);
$db
=
$this
->
getDatabase
();
$sql
=
"SELECT username, password, salt FROM "
.
$this
->
prefix
.
"usr where username = '"
.
$username
.
"'"
;
wfDebugLog
(
'mahara'
,
$sql
);
$res
=
$db
->
query
(
$sql
);
$val
=
$db
->
fetchObject
(
$res
);
$db
->
close
();
...
...
@@ -143,13 +138,12 @@ class MaharaAuthPlugin extends AuthPlugin {
public
function
updateUser
(
&
$user
)
{
$db
=
$this
->
getDatabase
();
$sql
=
"SELECT * FROM "
.
$this
->
prefix
.
"usr where username = '"
.
$username
.
"'"
;
wfDebugLog
(
'mahara'
,
$sql
);
$res
=
$db
->
query
(
$sql
);
$val
=
$db
->
fetchRow
(
$res
);
$db
->
close
();
$user
->
setOption
(
'nickname'
,
$val
->
username
);
$user
->
setEmail
(
$
this
->
email
);
$user
->
setRealName
(
$
this
->
firstname
.
' '
.
$
this
->
lastname
);
$user
->
setEmail
(
$
val
->
email
);
$user
->
setRealName
(
$
val
->
firstname
.
' '
.
$
val
->
lastname
);
return
true
;
}
...
...
@@ -268,11 +262,9 @@ class MaharaAuthPlugin extends AuthPlugin {
public
function
initUser
(
&
$user
,
$autocreate
=
false
)
{
$db
=
$this
->
getDatabase
();
$sql
=
"SELECT * FROM "
.
$this
->
prefix
.
"usr where username = '"
.
$username
.
"'"
;
wfDebugLog
(
'mahara'
,
$sql
);
$res
=
$db
->
query
(
$sql
);
$val
=
$db
->
fetchRow
(
$res
);
$db
->
close
();
wfDebugLog
(
'mahara'
,
print_r
(
$val
,
true
),
false
);
$user
->
setOption
(
'nickname'
,
$val
->
username
);
$user
->
setEmail
(
$this
->
email
);
$user
->
setRealName
(
$this
->
firstname
.
' '
.
$this
->
lastname
);
...
...
@@ -318,30 +310,3 @@ class MaharaAuthPlugin extends AuthPlugin {
return
false
;
}
}
/*
class AuthPluginUser {
function __construct( $user ) {
# Override this!
}
public function getId() {
# Override this!
return -1;
}
public function isLocked() {
# Override this!
return false;
}
public function isHidden() {
# Override this!
return false;
}
public function resetAuthToken() {
# Override this!
return true;
}
}*/
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment