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
46e42f4c
Commit
46e42f4c
authored
Jan 16, 2007
by
Martyn Smith
Committed by
Martyn Smith
Jan 16, 2007
Browse files
Start of quota support, adds fields to the usr table, and file plugin to manage default quota
parent
e8512c55
Changes
6
Hide whitespace changes
Inline
Side-by-side
htdocs/artefact/file/db/upgrade.php
View file @
46e42f4c
...
...
@@ -50,7 +50,6 @@ function xmldb_artefact_file_upgrade($oldversion=0) {
insert_record
(
'artefact_file_files'
,
$data
);
}
}
}
return
$status
;
...
...
htdocs/artefact/file/lib.php
View file @
46e42f4c
...
...
@@ -48,6 +48,22 @@ class PluginArtefactFile extends PluginArtefact {
)
);
}
public
static
function
get_event_subscriptions
()
{
$subscriptions
=
array
(
(
object
)
array
(
'plugin'
=>
'file'
,
'event'
=>
'createuser'
,
'callfunction'
=>
'newuser'
,
),
);
return
$subscriptions
;
}
public
static
function
newuser
(
$event
,
$user
)
{
update_record
(
'usr'
,
array
(
'quotaused'
=>
0
,
'quota'
=>
get_config_plugin
(
'defaultquota'
)),
array
(
'id'
=>
$user
->
id
));
}
public
static
function
get_toplevel_artefact_types
()
{
return
array
(
'file'
);
...
...
htdocs/artefact/file/version.php
View file @
46e42f4c
...
...
@@ -27,7 +27,7 @@
defined
(
'INTERNAL'
)
||
die
();
$config
=
new
StdClass
;
$config
->
version
=
200701
0900
;
$config
->
version
=
200701
1603
;
$config
->
release
=
'0.1'
;
?>
htdocs/lib/db/install.xml
View file @
46e42f4c
...
...
@@ -79,6 +79,8 @@
<FIELD
NAME=
"suspendedctime"
TYPE=
"datetime"
NOTNULL=
"false"
/>
<FIELD
NAME=
"suspendedreason"
TYPE=
"text"
NOTNULL=
"false"
/>
<FIELD
NAME=
"suspendedcusr"
TYPE=
"int"
LENGTH=
"10"
NOTNULL=
"false"
/>
<FIELD
NAME=
"quota"
TYPE=
"int"
LENGTH=
"10"
NOTNULL=
"false"
/>
<FIELD
NAME=
"quotaused"
TYPE=
"int"
LENGTH=
"10"
NOTNULL=
"true"
DEFAULT=
"0"
/>
</FIELDS>
<KEYS>
<KEY
NAME=
"primary"
TYPE=
"primary"
FIELDS=
"id"
/>
...
...
htdocs/lib/db/upgrade.php
View file @
46e42f4c
...
...
@@ -159,6 +159,19 @@ function xmldb_core_upgrade($oldversion=0) {
add_field
(
$table
,
$field
);
}
if
(
$oldversion
<
2007011600
)
{
// Add the 'quota' and 'quotaused' fields to the usr table
$table
=
new
XMLDBTable
(
'usr'
);
$field
=
new
XMLDBField
(
'quota'
);
$field
->
setAttributes
(
XMLDB_TYPE_INTEGER
,
10
,
false
,
false
,
false
);
add_field
(
$table
,
$field
);
$field
=
new
XMLDBField
(
'quotaused'
);
$field
->
setAttributes
(
XMLDB_TYPE_INTEGER
,
10
,
false
,
true
,
null
,
null
,
null
,
0
);
add_field
(
$table
,
$field
);
execute_sql
(
'UPDATE '
.
get_config
(
'dbprefix'
)
.
'usr SET quota=10485760'
);
}
return
$status
;
}
...
...
htdocs/lib/version.php
View file @
46e42f4c
...
...
@@ -27,8 +27,8 @@
defined
(
'INTERNAL'
)
||
die
();
$config
=
new
StdClass
;
$config
->
version
=
2007011
5
00
;
$config
->
release
=
'0.3.
1
'
;
$config
->
version
=
2007011
6
00
;
$config
->
release
=
'0.3.
2
'
;
$config
->
minupgradefrom
=
2006121501
;
$config
->
minupgraderelease
=
'0.1 (build tag BUILD_20061215)'
;
...
...
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