forked from openenergymonitor/emoncms3
-
Notifications
You must be signed in to change notification settings - Fork 0
/
cron.php
37 lines (30 loc) · 1017 Bytes
/
cron.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
<?php
define('EMONCMS_EXEC', 1);
if ($_GET['key'] == "xTC7005d") // IMPORTANT SET THIS TO A UNIQUE PASSWORD OF YOUR CHOICE
{ // Ensures no one else can run cron
ini_set('display_errors','on');
error_reporting(E_ALL ^ E_NOTICE);
require "Models/notify_model.php";
require "Models/feed_model.php";
require "Models/mail_model.php";
require "Includes/db.php";
$e = db_connect();
$users = get_notify_users();
foreach ($users as $user)
{
run_notify($user['userid']);
}
//---------------------------------------------------------------------------------------------
// Calculates and updates user total memory use
require "Models/user_model.php";
require "Models/statistics_model.php";
$userlist = get_user_list();
$i=0; $total_memuse = 0;
foreach ($userlist as $user) {
$userlist[$i]['memuse'] = get_user_feeds_size($user['userid']);
$total_memuse += $userlist[$i]['memuse'];
set_memory_statistics($user['userid'],$userlist[$i]['memuse']);
$i++;
}
}
?>