ILIAS  release_5-3 Revision v5.3.23-19-g915713cf615
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 
4 require_once 'Services/Object/classes/class.ilObject2.php';
5 require_once 'Services/TermsOfService/classes/class.ilTermsOfServiceHelper.php';
6 
12 {
16  protected $db;
17 
21  protected $settings;
22 
27  public function __construct($a_id = 0, $a_reference = true)
28  {
29  global $DIC;
30 
31  parent::__construct($a_id, $a_reference);
32 
33  $this->db = $DIC['ilDB'];
34  $this->settings = $DIC['ilSetting'];
35  }
36 
40  protected function initType()
41  {
42  $this->type = 'tos';
43  }
44 
48  public function resetAll()
49  {
50  $in = $this->db->in('usr_id', array(ANONYMOUS_USER_ID, SYSTEM_USER_ID), true, 'integer');
51  $this->db->manipulate("UPDATE usr_data SET agree_date = NULL WHERE $in");
52 
53  $this->settings->set('tos_last_reset', time());
54  }
55 
59  public function getLastResetDate()
60  {
61  return new ilDateTime($this->settings->get('tos_last_reset'), IL_CAL_UNIX);
62  }
63 
67  public function saveStatus($status)
68  {
69  ilTermsOfServiceHelper::setStatus((bool) $status);
70  }
71 
75  public function getStatus()
76  {
78  }
79 }
__construct($a_id=0, $a_reference=true)
global $DIC
Definition: saml.php:7
const IL_CAL_UNIX
Date and time handling
Create styles array
The data for the language used.
if(php_sapi_name() !='cli') $in
Definition: Utf8Test.php:37
settings()
Definition: settings.php:2
Class ilObject2 This is an intermediate progress of ilObject class.
Add data(end) time
Method that wraps PHPs time in order to allow simulations with the workflow.