Skip to content
GitLab
Menu
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
5a355bb4
Commit
5a355bb4
authored
Oct 17, 2007
by
Nigel McNie
Browse files
Fixed a notice being generated. Added TODOs about all the broken exceptions
parent
db1b6270
Changes
1
Hide whitespace changes
Inline
Side-by-side
htdocs/admin/users/institutions.php
View file @
5a355bb4
...
...
@@ -49,6 +49,7 @@ if ($institution || $add) {
if
(
$delete
)
{
function
delete_validate
(
Pieform
$form
,
$values
)
{
if
(
get_field
(
'usr'
,
'COUNT(*)'
,
'institution'
,
$values
[
'i'
]))
{
// TODO: exception is of the wrong type
throw
new
Exception
(
'Attempt to delete an institution that has members'
);
}
}
...
...
@@ -107,7 +108,7 @@ if ($institution || $add) {
$instancestring
=
implode
(
','
,
$instancearray
);
$inuserecords
=
array
();
$records
=
get_records_sql_assoc
(
'select authinstance, count(id) from {usr} where authinstance in ('
.
$instancestring
.
') group by authinstance'
);
$records
=
get_records_sql_assoc
(
'select authinstance, count(id) from {usr} where authinstance in ('
.
$instancestring
.
') group by authinstance'
,
array
()
);
foreach
(
$records
as
$record
)
{
$inuserecords
[]
=
$record
->
authinstance
;
}
...
...
@@ -264,16 +265,19 @@ function institution_submit(Pieform $form, $values) {
$allinstances
=
array_merge
(
$values
[
'authplugin'
][
'instancearray'
],
$values
[
'authplugin'
][
'deletearray'
]);
if
(
array_diff
(
$allinstances
,
$instancearray
))
{
// TODO wrong exception type
throw
new
Exception
(
'Attempt to delete or update another institution\'s auth instance'
);
}
if
(
array_diff
(
$instancearray
,
$allinstances
))
{
// TODO wrong exception type
throw
new
Exception
(
'One of your instances is unaccounted for in this transaction'
);
}
foreach
(
$values
[
'authplugin'
][
'instancearray'
]
as
$priority
=>
$instanceid
)
{
if
(
in_array
(
$instanceid
,
$values
[
'authplugin'
][
'deletearray'
]))
{
// Should never happen:
// TODO wrong exception type
throw
new
Exception
(
'Attempt to update AND delete an auth instance'
);
}
$record
=
new
StdClass
;
...
...
Write
Preview
Supports
Markdown
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