ILIAS  release_5-1 Revision 5.0.0-5477-g43f3e3fab5f
class.ilObjTermsOfService.php
Go to the documentation of this file.
1<?php
2/* Copyright (c) 1998-2012 ILIAS open source, Extended GPL, see docs/LICENSE */
3
4require_once 'Services/Object/classes/class.ilObject2.php';
5require_once 'Services/TermsOfService/classes/class.ilTermsOfServiceHelper.php';
6
12{
17 public function __construct($a_id = 0, $a_reference = true)
18 {
19
20 parent::__construct($a_id, $a_reference);
21 }
22
26 protected function initType()
27 {
28 $this->type = 'tos';
29 }
30
34 public function resetAll()
35 {
40 global $ilDB, $ilSetting;
41
42 // @todo: Delegate
43
44 $in = $ilDB->in('usr_id', array(ANONYMOUS_USER_ID, SYSTEM_USER_ID), true, 'integer');
45 $ilDB->manipulate("UPDATE usr_data SET agree_date = NULL WHERE $in");
46
47 $ilSetting->set('tos_last_reset', time());
48 }
49
53 public function getLastResetDate()
54 {
58 global $ilSetting;
59
60 // @todo: Delegate
61
62 return new ilDateTime($ilSetting->get('tos_last_reset'), IL_CAL_UNIX);
63 }
64
68 public function saveStatus($status)
69 {
70 ilTermsOfServiceHelper::setStatus((bool)$status);
71 }
72
76 public function getStatus()
77 {
78 return ilTermsOfServiceHelper::isEnabled();
79 }
80}
const IL_CAL_UNIX
@classDescription Date and time handling
__construct($a_id=0, $a_reference=true)
Class ilObject2 This is an intermediate progress of ilObject class.
global $ilSetting
Definition: privfeed.php:40
global $ilDB