17 return (
bool) $DIC[
'ilSetting']->get(
'tos_status', 0);
27 $DIC[
'ilSetting']->set(
'tos_status', (
int) $status);
35 $entity = self::getEntityFactory()->getByName(
'ilTermsOfServiceAcceptanceEntity');
36 $data_gateway = self::getDataGatewayFactory()->getByName(
'ilTermsOfServiceAcceptanceDatabaseGateway');
37 $entity->setUserId($usr_id);
38 $data_gateway->deleteAcceptanceHistoryByUser($entity);
47 $entity = self::getEntityFactory()->getByName(
'ilTermsOfServiceAcceptanceEntity');
48 $data_gateway = self::getDataGatewayFactory()->getByName(
'ilTermsOfServiceAcceptanceDatabaseGateway');
49 $entity->setUserId($user->
getId());
50 return $data_gateway->loadCurrentAcceptanceOfUser($entity);
59 $entity = self::getEntityFactory()->getByName(
'ilTermsOfServiceAcceptanceEntity');
60 $data_gateway = self::getDataGatewayFactory()->getByName(
'ilTermsOfServiceAcceptanceDatabaseGateway');
62 return $data_gateway->loadById($entity);
71 if (self::isEnabled() && $document->
exists()) {
72 $entity = self::getEntityFactory()->getByName(
'ilTermsOfServiceAcceptanceEntity');
73 $data_gateway = self::getDataGatewayFactory()->getByName(
'ilTermsOfServiceAcceptanceDatabaseGateway');
74 $entity->setUserId($user->
getId());
75 $entity->setTimestamp(
time());
77 $entity->setSource($document->
getSource());
80 $entity->setHash(md5($document->
getContent()));
81 $data_gateway->trackAcceptance($entity);
94 require_once
'Services/TermsOfService/classes/class.ilTermsOfServiceEntityFactory.php';
105 require_once
'Services/TermsOfService/classes/class.ilTermsOfServiceDataGatewayFactory.php';
107 $factory->setDatabaseAdapter($DIC[
'ilDB']);
if(!array_key_exists('StateId', $_REQUEST)) $id
writeAccepted()
write accept date of user agreement to db
getId()
get object id public
static getCurrentAcceptanceForUser(ilObjUser $user)
static setStatus($status)
static trackAcceptance(ilObjUser $user, ilTermsOfServiceSignableDocument $document)
static getEntityFactory()
Add data(end) time
Method that wraps PHPs time in order to allow simulations with the workflow.
static getDataGatewayFactory()
static deleteAcceptanceHistoryByUser($usr_id)
hasToAcceptTermsOfServiceInSession($status=null)