ILIAS  release_5-3 Revision v5.3.23-19-g915713cf615
class.ilDiskQuotaChecker.php
Go to the documentation of this file.
1<?php
2/*
3 +-----------------------------------------------------------------------------+
4 | ILIAS open source |
5 +-----------------------------------------------------------------------------+
6 | Copyright (c) 1998-2001 ILIAS open source, University of Cologne |
7 | |
8 | This program is free software; you can redistribute it and/or |
9 | modify it under the terms of the GNU General Public License |
10 | as published by the Free Software Foundation; either version 2 |
11 | of the License, or (at your option) any later version. |
12 | |
13 | This program is distributed in the hope that it will be useful, |
14 | but WITHOUT ANY WARRANTY; without even the implied warranty of |
15 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
16 | GNU General Public License for more details. |
17 | |
18 | You should have received a copy of the GNU General Public License |
19 | along with this program; if not, write to the Free Software |
20 | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
21 +-----------------------------------------------------------------------------+
22*/
23
34{
35 public function __construct()
36 {
37 }
38
70 public static function _lookupDiskQuota($a_user_id)
71 {
72 $info = array();
73
74 global $DIC;
75 $ilDB = $DIC['ilDB'];
76
77 $res = $ilDB->queryf(
78 "SELECT keyword, value " .
79 "FROM usr_pref " .
80 "WHERE usr_id = %s " .
81 "AND keyword IN ('disk_quota', 'disk_quota_last_reminder')",
82 array('integer'),
83 array($a_user_id)
84 );
85
86 while ($row = $res->fetchRow(ilDBConstants::FETCHMODE_OBJECT)) {
87 switch ($row->keyword) {
88 case 'disk_quota':
89 $info['user_disk_quota'] = $row->value;
90 break;
91 case 'disk_quota_last_reminder':
92 $info['last_reminder'] = $row->value;
93 break;
94 }
95 }
96
97
98 // Note: we order by role_id ASC here, in the assumption that
99 // the system role has the lowest ID of all roles.
100 // this way, if a user has the system role, this role
101 // will always returned first.
102 $ilDB->setLimit(1);
103 $res = $ilDB->queryf(
104 "SELECT rd.role_id, rd.disk_quota, od.title " .
105 "FROM rbac_ua ua " .
106 "JOIN rbac_fa fa ON fa.rol_id=ua.rol_id AND fa.parent = %s " .
107 "JOIN role_data rd ON ua.rol_id=rd.role_id " .
108 "JOIN object_data od ON od.obj_id=rd.role_id " .
109 "WHERE ua.usr_id = %s " .
110 "ORDER BY disk_quota DESC, role_id ASC",
111 array('integer','integer'),
112 array(ROLE_FOLDER_ID, $a_user_id)
113 );
114
116 $info['role_id'] = $row->role_id;
117 $info['role_title'] = $row->title;
118
119 // Note: Users with the system role have an infinite disk quota
120 // We calculate positive infinity by negating the logarithm of 0.
121 $info['role_disk_quota'] = ($row->role_id == SYSTEM_ROLE_ID) ? -log(0) : $row->disk_quota;
122 $info['disk_quota'] = max($info['user_disk_quota'], $info['role_disk_quota']);
123
124 return $info;
125 }
126
144 public static function _lookupDiskUsage($a_user_id)
145 {
146 $info = array();
147 $details = array();
148
149 global $DIC;
150 $ilDB = $DIC['ilDB'];
151
152 $res = $ilDB->query(
153 "SELECT keyword, value " .
154 "FROM usr_pref " .
155 "WHERE usr_id = " . $ilDB->quote($a_user_id, 'integer') . " " .
156 "AND " . $ilDB->like("keyword", "text", 'disk\\_usage%')
157 );
158
159 while ($row = $res->fetchRow(ilDBConstants::FETCHMODE_OBJECT)) {
160 switch ($row->keyword) {
161 case 'disk_usage.last_update':
162 $info['last_update'] = $row->value;
163 break;
164
165 case 'disk_usage':
166 $info['disk_usage'] = $row->value;
167 break;
168
169 default:
170 // The following preg_match is used to extract the type
171 // and the keys 'count' and 'size' from the keywords:
172 // disk_usage.type.count
173 // disk_usage.type.size
174 $matches = array();
175 preg_match('/^disk_usage\\.([^.]+)\\.([^.]+)/', $row->keyword, $matches);
176 $type = $matches[1];
177 $key = $matches[2];
178 if ($type) {
179 $detail_data = $details[$type];
180 if ($detail_data == null) {
181 $detail_data = array('type'=>$type);
182 }
183 $detail_data[$key] = $row->value;
184 }
185 $details[$type] = $detail_data;
186 break;
187 }
188 }
189 $info['details'] = $details;
190
191
192 //ilDiskQuotaChecker::_updateDiskUsageReport();
193
194 return $info;
195 }
196
222 public static function _fetchDiskQuotaReport($a_usage_filter = 3, $a_access_filter = 1, $a_order_column='disk_usage', $a_order_by='desc')
223 {
224 $data = array();
225 global $DIC;
226 $ilDB = $DIC['ilDB'];
227
228 if (!$a_order_column) {
229 $a_order_column = 'disk_usage';
230 }
231
232 switch ($a_usage_filter) {
233 case 1: // all users
234 $where_clause = '';
235 break;
236 case 2: // only users who don't use disk space
237 $where_clause = 'WHERE (p2.value IS NULL) ';
238 break;
239 case 3: // only users who use disk space
240 default:
241 $where_clause = 'WHERE (p2.value+0 > 0) ';
242 break;
243 case 4: // only users who have exceeded their disk quota
244 // #8554 / #10301
245 $where_clause = 'WHERE (((p1.value+0 > rq.role_disk_quota OR rq.role_disk_quota IS NULL) AND p2.value+0 > p1.value+0) OR
246 ((rq.role_disk_quota > p1.value+0 OR p1.value IS NULL) AND p2.value+0 > rq.role_disk_quota)) ';
247 break;
248 }
249 switch ($a_access_filter) {
250 case 1: // all users
251 $where_clause .= '';
252 break;
253 case 2: // only users who have access
254 default:
255 $where_clause .= ($where_clause == '' ? 'WHERE ' : ' AND ') .
256 '(u.active=1 AND (u.time_limit_unlimited = 1 OR ' . $ilDB->unixTimestamp() . ' BETWEEN u.time_limit_from AND u.time_limit_until)) ';
257 break;
258 case 3: // only users who don't have access
259 $where_clause .= ($where_clause == '' ? 'WHERE ' : ' AND ') .
260 '(u.active=0 OR (u.time_limit_unlimited IS NULL AND ' . $ilDB->unixTimestamp() . ' NOT BETWEEN u.time_limit_from AND u.time_limit_until)) ';
261 break;
262 }
263
264 $res = $ilDB->queryf(
265 "SELECT u.usr_id,u.firstname,u.lastname,u.login,u.email,u.last_login,u.active," .
266 "u.time_limit_unlimited, " . $ilDB->fromUnixtime("u.time_limit_from") . ", " . $ilDB->fromUnixtime("u.time_limit_until") . "," .
267
268 // Inactive users get the date 0001-01-01 so that they appear
269 // first when the list is sorted by this field. Users with
270 // unlimited access get the date 9999-12-31 so that they appear
271 // last.
272 "CASE WHEN u.active = 0 THEN '0001-01-01' ELSE CASE WHEN u.time_limit_unlimited=1 THEN '9999-12-31' ELSE " . $ilDB->fromUnixtime("u.time_limit_until") . " END END access_until," .
273
274 "CASE WHEN " . $ilDB->unixTimestamp() . " BETWEEN u.time_limit_from AND u.time_limit_until THEN 0 ELSE 1 END expired," .
275 "rq.role_disk_quota, system_role.rol_id role_id, " .
276 "p1.value+0 user_disk_quota," .
277 "p2.value+0 disk_usage, " .
278 "p3.value last_update, " .
279 "p4.value last_reminder, " .
280
281 // We add 0 to some of the values to convert them into a number.
282 // This is needed for correct sorting.
283 "CASE WHEN rq.role_disk_quota>p1.value+0 OR p1.value IS NULL THEN rq.role_disk_quota ELSE p1.value+0 END disk_quota " .
284 "FROM usr_data u " .
285
286 // Fetch the role with the highest disk quota value.
287 "JOIN (SELECT u.usr_id usr_id,MAX(rd.disk_quota) role_disk_quota " .
288 "FROM usr_data u " .
289 "JOIN rbac_ua ua ON ua.usr_id=u.usr_id " .
290 "JOIN rbac_fa fa ON fa.rol_id=ua.rol_id AND fa.parent=%s " .
291 "JOIN role_data rd ON rd.role_id=ua.rol_id WHERE u.usr_id=ua.usr_id GROUP BY u.usr_id) rq ON rq.usr_id=u.usr_id " .
292
293 // Fetch the system role in order to determine whether the user has unlimited disk quota
294 "LEFT JOIN rbac_ua system_role ON system_role.usr_id=u.usr_id AND system_role.rol_id = %s " .
295
296 // Fetch the user disk quota from table usr_pref
297 "LEFT JOIN usr_pref p1 ON p1.usr_id=u.usr_id AND p1.keyword = 'disk_quota' " .
298
299 // Fetch the disk usage from table usr_pref
300 "LEFT JOIN usr_pref p2 ON p2.usr_id=u.usr_id AND p2.keyword = 'disk_usage' " .
301
302 // Fetch the last update from table usr_pref
303 "LEFT JOIN usr_pref p3 ON p3.usr_id=u.usr_id AND p3.keyword = 'disk_usage.last_update' " .
304
305 // Fetch the date when the last disk quota reminder was sent from table usr_pref
306 "LEFT JOIN usr_pref p4 ON p4.usr_id=u.usr_id AND p4.keyword = 'disk_quota_last_reminder' " .
307
308 $where_clause .
309 "ORDER BY " . $a_order_column . " " . ($a_order_by=='asc'?' ASC':' DESC') . ", " .
310 "lastname, firstname, login",
311 array('integer','integer'),
312 array(ROLE_FOLDER_ID, SYSTEM_ROLE_ID)
313 );
314 $previous_usr_id = null;
315 while ($row = $res->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) {
316 if ($previous_usr_id != $row['usr_id']) {
317 $data[] = $row;
318 $previous_usr_id = $row['usr_id'];
319 }
320 }
321 return $data;
322 }
323
334 public static function _updateDiskUsageReport()
335 {
336 global $DIC;
337 $ilDB = $DIC['ilDB'];
338
339 // delete old values
340 $ilDB->manipulate("DELETE FROM usr_pref " .
341 "WHERE " . $ilDB->like("keyword", "text", 'disk_usage%'));
342
343
344 require_once 'Modules/File/classes/class.ilObjFileAccess.php';
346
347 require_once 'Modules/Forum/classes/class.ilObjForumAccess.php';
349
350 require_once 'Modules/HTMLLearningModule/classes/class.ilObjFileBasedLMAccess.php';
352
353 require_once 'Modules/MediaCast/classes/class.ilObjMediaCastAccess.php';
355
356 require_once 'Modules/ScormAicc/classes/class.ilObjSAHSLearningModuleAccess.php';
358
359 require_once 'Services/Mail/classes/class.ilObjMailAccess.php';
361
362 // insert the sum of the disk usage of each user
363 // note: second % is needed to not fail on oracle char field
364 $ilDB->manipulate(
365 "INSERT INTO usr_pref " .
366 "(usr_id, keyword, value) " .
367 "SELECT usr_id, 'disk_usage', SUM(value) " .
368 "FROM usr_pref " .
369 "WHERE " . $ilDB->like("keyword", "text", 'disk_usage.%.size%') .
370 "GROUP BY usr_id"
371 );
372
373 // insert last update
374 $ilDB->manipulate("INSERT INTO usr_pref " .
375 "(usr_id, keyword, value) " .
376 "SELECT usr_id, 'disk_usage.last_update', " . $ilDB->now() . " " .
377 "FROM usr_data");
378 }
379
393 private static function __updateDiskUsageReportOfType($a_access_obj, $a_type)
394 {
395 $data = array();
396
397 // repository
400
401 // personal workspace
404
405 // saving result to DB
406 if ($data) {
407 foreach ($data as $owner => $item) {
408 self::__saveUserData($owner, $a_type, $item["size"], $item["count"]);
409 }
410 }
411 }
412
421 private static function __saveUserData($a_user_id, $a_type, $a_size, $a_count)
422 {
423 global $DIC;
424 $ilDB = $DIC['ilDB'];
425
426 if ($a_user_id && $a_size != null && $a_count != null) {
427 $ilDB->manipulate("INSERT INTO usr_pref " .
428 "(usr_id, keyword, value) " .
429 "VALUES " .
430 "(" . $ilDB->quote($a_user_id, 'integer') . ", " .
431 $ilDB->quote('disk_usage.' . $a_type . '.size') . ", " .
432 $ilDB->quote($a_size, 'integer') . ")");
433
434 $ilDB->manipulate(
435 "INSERT INTO usr_pref " .
436 "(usr_id, keyword, value) " .
437 "VALUES " .
438 "(" . $ilDB->quote($a_user_id, 'integer') . ", " .
439 $ilDB->quote('disk_usage.' . $a_type . '.count') . ", " .
440 $ilDB->quote($a_count, 'integer') . ")"
441 );
442 }
443 }
444
453 private static function __updateDiskUsageReportOfTypeHelper($a_access_obj, $a_objects, &$a_result)
454 {
455 while ($row = $a_objects->fetchRow(ilDBConstants::FETCHMODE_OBJECT)) {
456 if ($row->owner != null) {
457 if (!array_key_exists($row->owner, $a_result)) {
458 // initialize values
459 $a_result[$row->owner] = array("size" => 0, "count" => 0);
460 }
461
462 $a_result[$row->owner]["size"] += $a_access_obj->_lookupDiskUsage($row->obj_id);
463 $a_result[$row->owner]["count"]++;
464 }
465 }
466 }
467
475 private static function __getRepositoryObjectsByType($a_type)
476 {
477 global $DIC;
478 $ilDB = $DIC['ilDB'];
479
480 return $ilDB->query(
481 "SELECT DISTINCT d.obj_id, d.owner " .
482 "FROM object_data d " .
483 "JOIN object_reference r ON d.obj_id=r.obj_id " .
484 "JOIN tree t ON t.child=r.ref_id " .
485 "WHERE d.type = " . $ilDB->quote($a_type, "text") . " " .
486 "AND t.tree=1 " .
487 "ORDER BY d.owner"
488 );
489 }
490
498 private static function __getWorkspaceObjectsByType($a_type)
499 {
500 global $DIC;
501 $ilDB = $DIC['ilDB'];
502
503 return $ilDB->query(
504 "SELECT DISTINCT d.obj_id, d.owner " .
505 "FROM object_data d " .
506 "JOIN object_reference_ws r ON d.obj_id=r.obj_id " .
507 "JOIN tree_workspace t ON t.child=r.wsp_id " .
508 "WHERE d.type = " . $ilDB->quote($a_type, "text") . " " .
509 "AND t.tree=d.owner " .
510 "ORDER BY d.owner"
511 );
512 }
513
527 private static function __updateDiskUsageReportOfUsers($a_access_obj, $a_type)
528 {
529 global $DIC;
530 $ilDB = $DIC['ilDB'];
531
532 // get all users
533 $res = $ilDB->query("SELECT usr_id FROM usr_data");
534
535 // for each user count the number of objects and sum up the size
536 while ($row = $res->fetchRow(ilDBConstants::FETCHMODE_OBJECT)) {
537 $data = $a_access_obj->_lookupDiskUsageOfUser($row->usr_id);
538 self::__saveUserData($row->usr_id, $a_type, $data["size"], $data["count"]);
539 }
540 }
541
542 public static function _sendSummaryMails()
543 {
544 global $DIC;
545 $ilSetting = $DIC['ilSetting'];
546
547 $lastStart = $ilSetting->get('last_cronjob_disk_quota_sum_start_ts', 0);
548 if (!$lastStart || date('dmY', $lastStart) != date('dmY')) {
549 $ilSetting->set('last_cronjob_disk_quota_sum_start_ts', time());
550
551 include_once 'Services/Mail/classes/class.ilDiskQuotaSummaryNotification.php';
552 $dqsn = new ilDiskQuotaSummaryNotification();
553 $dqsn->send();
554 }
555 }
556
562 public static function _sendReminderMails()
563 {
564 global $DIC;
565 $ilDB = $DIC['ilDB'];
566
567 require_once 'Services/Mail/classes/class.ilDiskQuotaReminderMail.php';
568 $mail = new ilDiskQuotaReminderMail();
569
570 $res = $ilDB->queryf(
571 "SELECT u.usr_id,u.gender,u.firstname,u.lastname,u.login,u.email,u.last_login,u.active," .
572 "u.time_limit_unlimited, " . $ilDB->fromUnixtime("u.time_limit_from") . ", " . $ilDB->fromUnixtime("u.time_limit_until") . "," .
573
574 // Inactive users get the date 0001-01-01 so that they appear
575 // first when the list is sorted by this field. Users with
576 // unlimited access get the date 9999-12-31 so that they appear
577 // last.
578 "CASE WHEN u.active = 0 THEN '0001-01-01' ELSE CASE WHEN u.time_limit_unlimited=1 THEN '9999-12-31' ELSE " . $ilDB->fromUnixtime("u.time_limit_until") . " END END access_until," .
579
580 " CASE WHEN " . $ilDB->unixTimestamp() . " BETWEEN u.time_limit_from AND u.time_limit_until THEN 0 ELSE 1 END expired," .
581 "rq.role_disk_quota, system_role.rol_id role_id, " .
582 "p1.value+0 user_disk_quota," .
583 "p2.value+0 disk_usage, " .
584 "p3.value last_update, " .
585 "p4.value last_reminder, " .
586 "p5.value language, " .
587
588 // We add 0 to some of the values to convert them into a number.
589 // This is needed for correct sorting.
590 "CASE WHEN rq.role_disk_quota>p1.value+0 OR p1.value IS NULL THEN rq.role_disk_quota ELSE p1.value+0 END disk_quota " .
591 "FROM usr_data u " .
592
593 // Fetch the role with the highest disk quota value.
594 "JOIN (SELECT u.usr_id usr_id,MAX(rd.disk_quota) role_disk_quota " .
595 "FROM usr_data u " .
596 "JOIN rbac_ua ua ON ua.usr_id=u.usr_id " .
597 "JOIN rbac_fa fa ON fa.rol_id=ua.rol_id AND fa.parent=%s " .
598 "JOIN role_data rd ON rd.role_id=ua.rol_id WHERE u.usr_id=ua.usr_id GROUP BY u.usr_id) rq ON rq.usr_id=u.usr_id " .
599
600 // Fetch the system role in order to determine whether the user has unlimited disk quota
601 "LEFT JOIN rbac_ua system_role ON system_role.usr_id=u.usr_id AND system_role.rol_id = %s " .
602
603 // Fetch the user disk quota from table usr_pref
604 "LEFT JOIN usr_pref p1 ON p1.usr_id=u.usr_id AND p1.keyword = 'disk_quota' " .
605
606 // Fetch the disk usage from table usr_pref
607 "LEFT JOIN usr_pref p2 ON p2.usr_id=u.usr_id AND p2.keyword = 'disk_usage' " .
608
609 // Fetch the last update from table usr_pref
610 "LEFT JOIN usr_pref p3 ON p3.usr_id=u.usr_id AND p3.keyword = 'disk_usage.last_update' " .
611
612 // Fetch the date when the last disk quota reminder was sent from table usr_pref
613 "LEFT JOIN usr_pref p4 ON p4.usr_id=u.usr_id AND p4.keyword = 'disk_quota_last_reminder' " .
614
615 // Fetch the language of the user
616 "LEFT JOIN usr_pref p5 ON p5.usr_id=u.usr_id AND p5.keyword = 'language' " .
617
618 // Fetch only users who have exceeded their quota, and who have
619 // access, and who have not received a reminder in the past seven days
620 // #8554 / #10301
621 'WHERE (((p1.value+0 >= rq.role_disk_quota OR rq.role_disk_quota IS NULL) AND p2.value+0 > p1.value+0) OR
622 ((rq.role_disk_quota > p1.value+0 OR p1.value IS NULL) AND p2.value+0 > rq.role_disk_quota)) ' .
623 'AND (u.active=1 AND (u.time_limit_unlimited = 1 OR ' . $ilDB->unixTimestamp() . ' BETWEEN u.time_limit_from AND u.time_limit_until)) ' .
624 'AND (p4.value IS NULL OR p4.value < DATE_SUB(NOW(), INTERVAL 7 DAY)) ',
625 array('integer','integer'),
626 array(ROLE_FOLDER_ID, SYSTEM_ROLE_ID)
627 );
628
629 while ($row = $res->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) {
630 $details = self::_lookupDiskUsage($row['usr_id']);
631 $row['disk_usage_details'] = $details['details'];
632
633 // Send reminder e-mail
634 $mail->setData($row);
635 $mail->send();
636
637 // Store the date the last reminder was sent in the table usr_pref.
638 if ($row['last_reminder'] != null) {
639 $ilDB->manipulatef(
640 "UPDATE usr_pref SET value= " . $ilDB->now() . " " .
641 "WHERE usr_id=%s AND keyword = 'disk_quota_last_reminder'",
642 array('integer'),
643 array($row['usr_id'])
644 );
645 } else {
646 $ilDB->manipulatef(
647 "INSERT INTO usr_pref (usr_id, keyword, value) " .
648 "VALUES (%s, 'disk_quota_last_reminder', " . $ilDB->now() . ")",
649 array('integer'),
650 array($row['usr_id'])
651 );
652 }
653 }
654 }
655
660 public static function _lookupDiskUsageReportLastUpdate()
661 {
662 global $DIC;
663 $ilDB = $DIC['ilDB'];
664
665 require_once 'Services/Mail/classes/class.ilDiskQuotaReminderMail.php';
666 $mail = new ilDiskQuotaReminderMail();
667
668 $res = $ilDB->query("SELECT MAX(value) last_update " .
669 "FROM usr_pref WHERE keyword='disk_usage.last_update'");
671 return ($row != null) ? $row['last_update'] : null;
672 }
673
674 public static function _lookupPersonalWorkspaceDiskQuota($a_user_id)
675 {
676 global $DIC;
677 $ilDB = $DIC['ilDB'];
678
679 $info = array();
680
681 $res = $ilDB->queryf(
682 "SELECT keyword, value " .
683 "FROM usr_pref " .
684 "WHERE usr_id = %s " .
685 "AND keyword = %s ",
686 array('integer', 'text'),
687 array($a_user_id, "wsp_disk_quota")
688 );
689
691 $info['user_wsp_disk_quota'] = $row->value;
692
693
694 // Note: we order by role_id ASC here, in the assumption that
695 // the system role has the lowest ID of all roles.
696 // this way, if a user has the system role, this role
697 // will always returned first.
698 $ilDB->setLimit(1);
699 $res = $ilDB->queryf(
700 "SELECT rd.role_id, rd.wsp_disk_quota, od.title " .
701 "FROM rbac_ua ua " .
702 "JOIN rbac_fa fa ON fa.rol_id=ua.rol_id AND fa.parent = %s " .
703 "JOIN role_data rd ON ua.rol_id=rd.role_id " .
704 "JOIN object_data od ON od.obj_id=rd.role_id " .
705 "WHERE ua.usr_id = %s " .
706 "ORDER BY wsp_disk_quota DESC, role_id ASC",
707 array('integer','integer'),
708 array(ROLE_FOLDER_ID, $a_user_id)
709 );
710
712 $info['role_id'] = $row->role_id;
713 $info['role_title'] = $row->title;
714
715 // Note: Users with the system role have an infinite disk quota
716 // We calculate positive infinity by negating the logarithm of 0.
717 $info['role_wsp_disk_quota'] = ($row->role_id == SYSTEM_ROLE_ID) ? -log(0) : $row->wsp_disk_quota;
718 $info['disk_quota'] = max($info['user_wsp_disk_quota'], $info['role_wsp_disk_quota']);
719
720 return $info;
721 }
722}
date( 'd-M-Y', $objPHPExcel->getProperties() ->getCreated())
An exception for terminatinating execution or to throw for unit testing.
Class ilDiskQuotaChecker.
static __getRepositoryObjectsByType($a_type)
get all objects of the desired type which are in the repository ordered by owner
static __getWorkspaceObjectsByType($a_type)
get all objects of the desired type which are in the personal workspace ordered by owner
static __updateDiskUsageReportOfUsers($a_access_obj, $a_type)
Updates the disk usage report of the specified object type for all user accounts.
static _updateDiskUsageReport()
Updates the disk usage info of all user accounts.
static _lookupDiskUsage($a_user_id)
Gets the disk usage info for the specified user account.
static __updateDiskUsageReportOfType($a_access_obj, $a_type)
Updates the disk usage report of the specified object type for all user accounts.
static _lookupPersonalWorkspaceDiskQuota($a_user_id)
static _lookupDiskQuota($a_user_id)
Gets the disk quota info for the specified user account.
static __saveUserData($a_user_id, $a_type, $a_size, $a_count)
Save disk quota for user.
static __updateDiskUsageReportOfTypeHelper($a_access_obj, $a_objects, &$a_result)
for each objects of an owner, count the number of objects and sum up the size
static _lookupDiskUsageReportLastUpdate()
Returns the SQL datetime of the last update of the disk usage report.
static _fetchDiskQuotaReport($a_usage_filter=3, $a_access_filter=1, $a_order_column='disk_usage', $a_order_by='desc')
Reads disk quota/disk usage report of the user accounts.
static _sendReminderMails()
Sends reminder e-mails to all users who have access and who have exceeded their disk quota and who ha...
Class ilDiskQuotaReminderMail.
Access class for file objects.
Class ilFileBasedLMAccess.
Class ilObjForumAccess.
Class ilObjMailAccess.
Class ilObjMediaCastAccess.
$key
Definition: croninfo.php:18
$info
Definition: index.php:5
global $ilSetting
Definition: privfeed.php:17
$type
global $DIC
Definition: saml.php:7
foreach($_POST as $key=> $value) $res
global $ilDB
$a_type
Definition: workflow.php:92