Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
mahara
mahara
Commits
410e6e62
Commit
410e6e62
authored
Jul 09, 2009
by
Richard Mansfield
Browse files
Drop lastauthinstance column from usr table (bug 3154)
parent
7645954e
Changes
6
Hide whitespace changes
Inline
Side-by-side
htdocs/admin/users/institutions.php
View file @
410e6e62
...
...
@@ -81,7 +81,6 @@ if ($institution || $add) {
db_begin
();
foreach
(
$authinstanceids
as
$id
)
{
delete_records
(
'auth_instance_config'
,
'instance'
,
$id
);
execute_sql
(
'UPDATE {usr} SET lastauthinstance = NULL WHERE lastauthinstance = ?'
,
array
(
$id
));
}
delete_records
(
'auth_instance'
,
'institution'
,
$values
[
'i'
]);
delete_records
(
'host'
,
'institution'
,
$values
[
'i'
]);
...
...
@@ -425,7 +424,6 @@ function institution_submit(Pieform $form, $values) {
}
foreach
(
$values
[
'authplugin'
][
'deletearray'
]
as
$instanceid
)
{
execute_sql
(
'UPDATE {usr} SET lastauthinstance = NULL WHERE lastauthinstance = ?'
,
array
(
$instanceid
));
delete_records
(
'auth_remote_user'
,
'authinstance'
,
$instanceid
);
delete_records
(
'auth_instance_config'
,
'instance'
,
$instanceid
);
delete_records
(
'auth_instance'
,
'id'
,
$instanceid
);
...
...
htdocs/auth/user.php
View file @
410e6e62
...
...
@@ -64,7 +64,6 @@ class User {
'lastlogin'
=>
null
,
'lastlastlogin'
=>
null
,
'lastaccess'
=>
null
,
/* Is not necessarily updated every request, see accesstimeupdatefrequency config variable */
'lastauthinstance'
=>
null
,
'inactivemailsent'
=>
0
,
'staff'
=>
0
,
'admin'
=>
0
,
...
...
@@ -799,7 +798,6 @@ class LiveUser extends User {
}
$auth
=
AuthFactory
::
create
(
$instanceid
);
if
(
$auth
->
authenticate_user_account
(
$user
,
$password
))
{
$user
->
lastauthinstance
=
$auth
->
instanceid
;
$this
->
authenticate
(
$user
,
$auth
->
instanceid
);
// Check for a suspended institution
...
...
@@ -924,7 +922,6 @@ class LiveUser extends User {
*/
public
function
reanimate
(
$id
,
$instanceid
)
{
if
(
$user
=
get_record
(
'usr'
,
'id'
,
$id
))
{
$user
->
lastauthinstance
=
$instanceid
;
$this
->
authenticate
(
$user
,
$instanceid
);
return
true
;
}
...
...
htdocs/lib/db/install.xml
View file @
410e6e62
...
...
@@ -105,11 +105,9 @@
<FIELD
NAME=
"quotaused"
TYPE=
"int"
LENGTH=
"10"
NOTNULL=
"true"
DEFAULT=
"0"
/>
<FIELD
NAME=
"authinstance"
TYPE=
"int"
LENGTH=
"10"
NOTNULL=
"true"
DEFAULT=
"1"
/>
<FIELD
NAME=
"sessionid"
TYPE=
"char"
LENGTH=
"32"
NOTNULL=
"false"
DEFAULT=
""
/>
<FIELD
NAME=
"lastauthinstance"
TYPE=
"int"
LENGTH=
"10"
NOTNULL=
"false"
DEFAULT=
"NULL"
/>
</FIELDS>
<KEYS>
<KEY
NAME=
"primary"
TYPE=
"primary"
FIELDS=
"id"
/>
<KEY
NAME=
"lastauthinstancefk"
TYPE=
"foreign"
FIELDS=
"lastauthinstance"
REFTABLE=
"auth_instance"
REFFIELDS=
"id"
/>
<KEY
NAME=
"authinstancefk"
TYPE=
"foreign"
FIELDS=
"authinstance"
REFTABLE=
"auth_instance"
REFFIELDS=
"id"
/>
</KEYS>
<INDEXES>
...
...
htdocs/lib/db/upgrade.php
View file @
410e6e62
...
...
@@ -1113,6 +1113,12 @@ function xmldb_core_upgrade($oldversion=0) {
}
}
if
(
$oldversion
<
2009070900
)
{
$table
=
new
XMLDBTable
(
'usr'
);
$field
=
new
XMLDBField
(
'lastauthinstance'
);
drop_field
(
$table
,
$field
);
}
return
$status
;
}
...
...
htdocs/lib/user.php
View file @
410e6e62
...
...
@@ -760,7 +760,7 @@ function delete_user($userid) {
// by deleted users.
$authinst
=
get_field
(
'auth_instance'
,
'id'
,
'institution'
,
'mahara'
,
'authname'
,
'internal'
);
if
(
$authinst
)
{
$deleterec
->
authinstance
=
$deleterec
->
lastauthinstance
=
$authinst
;
$deleterec
->
authinstance
=
$authinst
;
}
update_record
(
'usr'
,
$deleterec
);
...
...
htdocs/lib/version.php
View file @
410e6e62
...
...
@@ -27,7 +27,7 @@
defined
(
'INTERNAL'
)
||
die
();
$config
=
new
StdClass
;
$config
->
version
=
2009070
7
00
;
$config
->
version
=
2009070
9
00
;
$config
->
release
=
'1.2.0alpha3dev'
;
$config
->
minupgradefrom
=
2008040200
;
$config
->
minupgraderelease
=
'1.0.0 (release tag 1.0.0_RELEASE)'
;
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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