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
137591f9
Commit
137591f9
authored
Dec 10, 2007
by
Richard Mansfield
Browse files
Add max user accounts option to Edit institution page
parent
2d1da0c1
Changes
4
Show whitespace changes
Inline
Side-by-side
htdocs/admin/users/institutions.php
View file @
137591f9
...
...
@@ -225,6 +225,15 @@ if ($institution || $add) {
'options'
=>
$themeoptions
,
'help'
=>
true
,
);
if
(
$USER
->
get
(
'admin'
))
{
$elements
[
'maxuseraccounts'
]
=
array
(
'type'
=>
'text'
,
'title'
=>
get_string
(
'maxuseraccounts'
,
'admin'
),
'description'
=>
get_string
(
'maxuseraccountsdescription'
,
'admin'
),
'defaultvalue'
=>
empty
(
$data
->
maxuseraccounts
)
?
''
:
$data
->
maxuseraccounts
,
'rules'
=>
array
(
'regex'
=>
'/^\d*$/'
),
);
}
}
$elements
[
'lockedfields'
]
=
array
(
...
...
@@ -274,7 +283,7 @@ else {
}
function
institution_submit
(
Pieform
$form
,
$values
)
{
global
$SESSION
,
$institution
,
$add
,
$instancearray
;
global
$SESSION
,
$institution
,
$add
,
$instancearray
,
$USER
;
db_begin
();
// Update the basic institution record...
...
...
@@ -289,6 +298,10 @@ function institution_submit(Pieform $form, $values) {
$newinstitution
->
theme
=
empty
(
$values
[
'theme'
])
?
null
:
$values
[
'theme'
];
$newinstitution
->
defaultmembershipperiod
=
(
$values
[
'defaultmembershipperiod'
])
?
intval
(
$values
[
'defaultmembershipperiod'
])
:
null
;
if
(
$USER
->
get
(
'admin'
))
{
$newinstitution
->
maxuseraccounts
=
(
$values
[
'maxuseraccounts'
])
?
intval
(
$values
[
'maxuseraccounts'
])
:
null
;
}
$allinstances
=
array_merge
(
$values
[
'authplugin'
][
'instancearray'
],
$values
[
'authplugin'
][
'deletearray'
]);
if
(
array_diff
(
$allinstances
,
$instancearray
))
{
...
...
htdocs/lang/en.utf8/admin.php
View file @
137591f9
...
...
@@ -316,6 +316,9 @@ $string['institutionusersupdatedrequesters'] = 'Users added';
$string
[
'institutionusersupdatedmembers'
]
=
'Users removed'
;
$string
[
'institutionusersupdatednonmembers'
]
=
'Invitations sent'
;
$string
[
'maxuseraccounts'
]
=
'Maximum User Accounts Allowed'
;
$string
[
'maxuseraccountsdescription'
]
=
'The maximum number of user accounts that can be associated with the institution. If there is no limit, this field should be left blank.'
;
// general stuff
$string
[
'notificationssaved'
]
=
'Notification settings saved'
;
...
...
htdocs/lib/db/upgrade.php
View file @
137591f9
...
...
@@ -535,6 +535,10 @@ function xmldb_core_upgrade($oldversion=0) {
}
}
if
(
$oldversion
<
2007121000
)
{
execute_sql
(
'ALTER TABLE {institution} ADD COLUMN maxuseraccounts bigint'
);
}
return
$status
;
}
...
...
htdocs/lib/version.php
View file @
137591f9
...
...
@@ -27,7 +27,7 @@
defined
(
'INTERNAL'
)
||
die
();
$config
=
new
StdClass
;
$config
->
version
=
2007120
5
00
;
$config
->
version
=
200712
1
000
;
$config
->
release
=
'0.9.0alpha3dev'
;
$config
->
minupgradefrom
=
2007080700
;
$config
->
minupgraderelease
=
'0.8.0 (release tag 0.8.0_RELEASE)'
;
...
...
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