Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
mahara
mahara
Commits
862af91d
Commit
862af91d
authored
Feb 19, 2009
by
Nigel McNie
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Install a cron job to send data weekly to mahara.org
parent
0b3cacce
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
30 additions
and
15 deletions
+30
-15
htdocs/lib/db/upgrade.php
htdocs/lib/db/upgrade.php
+12
-0
htdocs/lib/mahara.php
htdocs/lib/mahara.php
+16
-0
htdocs/lib/registration.php
htdocs/lib/registration.php
+0
-14
htdocs/lib/upgrade.php
htdocs/lib/upgrade.php
+1
-0
htdocs/lib/version.php
htdocs/lib/version.php
+1
-1
No files found.
htdocs/lib/db/upgrade.php
View file @
862af91d
...
...
@@ -825,6 +825,18 @@ function xmldb_core_upgrade($oldversion=0) {
set_config
(
'installation_key'
,
get_random_key
());
}
if
(
$oldversion
<
2009021901
)
{
// Insert a cron job to send registration data to mahara.org
$cron
=
new
StdClass
;
$cron
->
callfunction
=
'cron_send_registration_data'
;
$cron
->
minute
=
rand
(
0
,
59
);
$cron
->
hour
=
rand
(
0
,
23
);
$cron
->
day
=
'*'
;
$cron
->
month
=
'*'
;
$cron
->
dayofweek
=
rand
(
0
,
6
);
insert_record
(
'cron'
,
$cron
);
}
return
$status
;
}
...
...
htdocs/lib/mahara.php
View file @
862af91d
...
...
@@ -1995,6 +1995,22 @@ function recalculate_quota() {
}
}
/**
* Cronjob to send an update of site statistics to mahara.org
*/
function
cron_send_registration_data
()
{
require_once
(
get_config
(
'libroot'
)
.
'registration.php'
);
$result
=
registration_send_data
();
if
(
$result
->
data
!=
'1'
)
{
log_info
(
$result
);
}
else
{
set_config
(
'registration_lastsent'
,
time
());
}
}
function
random_string
(
$length
=
15
)
{
$pool
=
'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789'
;
$poollen
=
strlen
(
$pool
);
...
...
htdocs/lib/registration.php
View file @
862af91d
...
...
@@ -81,20 +81,6 @@ function register_submit(Pieform $form, $values) {
redirect
(
'/admin/'
);
}
/**
* Cronjob to send an update of site statistics to mahara.org
*/
function
cron_send_registration_data
()
{
$result
=
registration_send_data
();
if
(
$result
->
data
!=
'1'
)
{
log_info
(
$result
);
}
else
{
set_config
(
'registration_lastsent'
,
time
());
}
}
/**
* Worker - performs sending of registration data to mahara.org
...
...
htdocs/lib/upgrade.php
View file @
862af91d
...
...
@@ -736,6 +736,7 @@ function core_install_firstcoredata_defaults() {
'auth_remove_old_session_files'
=>
array
(
'30'
,
'20'
,
'*'
,
'*'
,
'*'
),
'recalculate_quota'
=>
array
(
'15'
,
'2'
,
'*'
,
'*'
,
'*'
),
'import_process_queue'
=>
array
(
'*/5'
,
'*'
,
'*'
,
'*'
,
'*'
),
'cron_send_registration_data'
=>
array
(
rand
(
0
,
59
),
rand
(
0
,
23
),
'*'
,
'*'
,
rand
(
0
,
6
)),
);
foreach
(
$cronjobs
as
$callfunction
=>
$times
)
{
$cron
=
new
StdClass
;
...
...
htdocs/lib/version.php
View file @
862af91d
...
...
@@ -27,7 +27,7 @@
defined
(
'INTERNAL'
)
||
die
();
$config
=
new
StdClass
;
$config
->
version
=
200902190
0
;
$config
->
version
=
200902190
1
;
$config
->
release
=
'1.1.0beta5dev'
;
$config
->
minupgradefrom
=
2008040200
;
$config
->
minupgraderelease
=
'1.0.0 (release tag 1.0.0_RELEASE)'
;
...
...
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