Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
7
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
mahara
mahara
Commits
4c30fab0
Commit
4c30fab0
authored
Jun 13, 2019
by
Robert Lyon
Committed by
Gerrit Code Review
Jun 13, 2019
Browse files
Options
Browse Files
Download
Plain Diff
Merge "Bug 1829431: fixing how we calculate user data on creation"
parents
ea95604c
b618d858
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
8 additions
and
4 deletions
+8
-4
htdocs/lib/user.php
htdocs/lib/user.php
+2
-2
htdocs/testing/classes/generator/TestingDataGenerator.php
htdocs/testing/classes/generator/TestingDataGenerator.php
+5
-1
htdocs/testing/frameworks/behat/classes/BehatDataGenerators.php
.../testing/frameworks/behat/classes/BehatDataGenerators.php
+1
-1
No files found.
htdocs/lib/user.php
View file @
4c30fab0
...
...
@@ -2548,8 +2548,8 @@ function create_user($user, $profile=array(), $institution=null, $remoteauth=nul
}
if
(
empty
(
$user
->
quota
))
{
$quota
=
get_config_plugin
(
'artefact'
,
'file'
,
'defaultquota'
);
if
(
!
empty
(
$institution
)
&&
!
empty
(
$institution
->
quota
)
)
{
$quota
=
min
(
$quota
,
$institution
->
quota
);
if
(
!
empty
(
$institution
)
&&
$institution
->
default
quota
>
0
)
{
$quota
=
min
(
$quota
,
$institution
->
default
quota
);
}
$user
->
quota
=
$quota
;
}
...
...
htdocs/testing/classes/generator/TestingDataGenerator.php
View file @
4c30fab0
...
...
@@ -373,7 +373,7 @@ EOD;
$profiles
[
$field
]
=
$record
[
$field
];
}
}
$user
->
id
=
create_user
(
$user
,
$profiles
,
$
record
[
'
institution
'
]
,
$remoteauth
,
$record
[
'remoteusername'
],
$record
);
$user
->
id
=
create_user
(
$user
,
$profiles
,
$institution
,
$remoteauth
,
$record
[
'remoteusername'
],
$record
);
if
(
isset
(
$user
->
admin
)
&&
$user
->
admin
)
{
require_once
(
'activity.php'
);
...
...
@@ -592,6 +592,10 @@ EOD;
$newinstitution
->
licensedefault
=
(
isset
(
$record
[
'licensedefault'
]))
?
$record
[
'licensedefault'
]
:
''
;
}
if
(
!
empty
(
$record
[
'defaultquota'
]))
{
// make sure that it is bytes
$record
[
'defaultquota'
]
=
get_real_size
(
$record
[
'defaultquota'
]);
}
$newinstitution
->
defaultquota
=
empty
(
$record
[
'defaultquota'
])
?
get_config_plugin
(
'artefact'
,
'file'
,
'defaultquota'
)
:
$record
[
'defaultquota'
];
$newinstitution
->
defaultmembershipperiod
=
!
empty
(
$record
[
'defaultmembershipperiod'
])
?
intval
(
$record
[
'defaultmembershipperiod'
])
:
null
;
...
...
htdocs/testing/frameworks/behat/classes/BehatDataGenerators.php
View file @
4c30fab0
...
...
@@ -93,7 +93,7 @@ class BehatDataGenerators extends BehatBase {
'skins'
=>
'bool'
,
'licensemandatory'
=>
'bool'
,
'licensedefault'
=>
'text'
,
'defaultquota'
=>
'
number
'
,
'defaultquota'
=>
'
text
'
,
'defaultmembershipperiod'
=>
'number'
,
'maxuseraccounts'
=>
'number'
,
'expiry'
=>
'text'
,
...
...
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