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
7249cb9a
Commit
7249cb9a
authored
Jan 16, 2007
by
Richard Mansfield
Browse files
Merge with
git+ssh://git.catalyst.net.nz/var/git/mahara.git
parents
84a2d3cd
a256d4ad
Changes
10
Hide whitespace changes
Inline
Side-by-side
htdocs/artefact/file/db/upgrade.php
View file @
7249cb9a
...
...
@@ -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 @
7249cb9a
...
...
@@ -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 @
7249cb9a
...
...
@@ -27,7 +27,7 @@
defined
(
'INTERNAL'
)
||
die
();
$config
=
new
StdClass
;
$config
->
version
=
200701
0900
;
$config
->
version
=
200701
1603
;
$config
->
release
=
'0.1'
;
?>
htdocs/contacts/groups/create.php
View file @
7249cb9a
...
...
@@ -47,9 +47,10 @@ $creategroup = pieform(array(
'cols'
=>
70
,
),
'members'
=>
array
(
'type'
=>
'userlist'
,
'title'
=>
get_string
(
'groupmembers'
),
'rules'
=>
array
(
'required'
=>
true
),
'type'
=>
'userlist'
,
'title'
=>
get_string
(
'groupmembers'
),
'rules'
=>
array
(
'required'
=>
true
),
'filter'
=>
false
,
),
'submit'
=>
array
(
'type'
=>
'submitcancel'
,
...
...
htdocs/lib/db/install.xml
View file @
7249cb9a
...
...
@@ -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 @
7249cb9a
...
...
@@ -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/form/elements/userlist.php
View file @
7249cb9a
...
...
@@ -87,15 +87,15 @@ function pieform_element_userlist_get_value(Pieform $form, $element) {
return
null
;
}
function
form_element_userlist_rule_required
(
$value
,
$element
)
{
function
pie
form_element_userlist_rule_required
(
Pieform
$form
,
$value
,
$element
)
{
if
(
is_array
(
$value
)
&&
count
(
$value
))
{
return
false
;
return
null
;
}
return
true
;
return
$form
->
i18n
(
'rule'
,
'required'
,
'required'
,
$element
)
;
}
function
form_element_userlist_set_attributes
(
$element
)
{
function
pie
form_element_userlist_set_attributes
(
$element
)
{
// By default, use the filter select box
if
(
!
isset
(
$element
[
'filter'
]))
{
$element
[
'filter'
]
=
true
;
...
...
htdocs/lib/pieforms/pieform.php
View file @
7249cb9a
...
...
@@ -815,7 +815,7 @@ class Pieform {
if
(
!
$this
->
get_error
(
$element
[
'name'
]))
{
// See if this element has a function that describes
// how this rule should apply to it
$function
=
'pieform_element_'
.
$element
[
'
nam
e'
]
.
'_rule_'
.
$rule
;
$function
=
'pieform_element_'
.
$element
[
'
typ
e'
]
.
'_rule_'
.
$rule
;
if
(
!
function_exists
(
$function
))
{
// Try instead the default rule function
$function
=
'pieform_rule_'
.
$rule
;
...
...
htdocs/lib/upgrade.php
View file @
7249cb9a
...
...
@@ -334,7 +334,7 @@ function upgrade_plugin($upgrade) {
$exists
=
false
;
$table
=
$plugintype
.
'_event_subscription'
;
if
(
empty
(
$upgrade
->
install
))
{
$exists
=
record_exists
(
$table
,
'plugin'
,
$pluginname
,
'event'
,
$event
->
event
()
);
$exists
=
record_exists
(
$table
,
'plugin'
,
$pluginname
,
'event'
,
$event
->
event
);
}
$event
->
plugin
=
$pluginname
;
if
(
empty
(
$exists
))
{
...
...
htdocs/lib/version.php
View file @
7249cb9a
...
...
@@ -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