13 public static function isEnabled()
20 return (
bool)$ilSetting->get(
'tos_status', 0);
26 public static function setStatus($status)
33 $ilSetting->set(
'tos_status', (
int)$status);
42 $data_gateway = self::getDataGatewayFactory()->getByName(
'ilTermsOfServiceAcceptanceDatabaseGateway');
43 $entity->setUserId($usr_id);
44 $data_gateway->deleteAcceptanceHistoryByUser($entity);
54 $data_gateway = self::getDataGatewayFactory()->getByName(
'ilTermsOfServiceAcceptanceDatabaseGateway');
55 $entity->setUserId($user->
getId());
56 return $data_gateway->loadCurrentAcceptanceOfUser($entity);
66 $data_gateway = self::getDataGatewayFactory()->getByName(
'ilTermsOfServiceAcceptanceDatabaseGateway');
68 return $data_gateway->loadById($entity);
80 $data_gateway = self::getDataGatewayFactory()->getByName(
'ilTermsOfServiceAcceptanceDatabaseGateway');
81 $entity->setUserId($user->
getId());
82 $entity->setTimestamp(time());
84 $entity->setSource($document->
getSource());
87 $entity->setHash(md5($document->
getContent()));
88 $data_gateway->trackAcceptance($entity);
101 require_once
'Services/TermsOfService/classes/class.ilTermsOfServiceEntityFactory.php';
108 private static function getDataGatewayFactory()
115 require_once
'Services/TermsOfService/classes/class.ilTermsOfServiceDataGatewayFactory.php';
117 $factory->setDatabaseAdapter($ilDB);