ILIAS  release_5-2 Revision v5.2.25-18-g3f80b828510
ilSessionReminder Class Reference
+ Collaboration diagram for ilSessionReminder:

Public Member Functions

 calculateSecondsUntilExpiration ()
 
 calculateSecondsUntilReminder ()
 
 isActive ()
 
 setUser ($user)
 
 getUser ()
 
 setCurrentTime ($current_time)
 
 getCurrentTime ()
 
 setExpirationTime ($expiration_time)
 
 getExpirationTime ()
 
 setLeadTime ($lead_time)
 
 getLeadTime ()
 
 setSecondsUntilExpiration ($seconds_until_expiration)
 
 getSecondsUntilExpiration ()
 
 setSecondsUntilReminder ($seconds_until_reminder)
 
 getSecondsUntilReminder ()
 

Data Fields

const MIN_LEAD_TIME = 2
 
const SUGGESTED_LEAD_TIME = 5
 

Protected Member Functions

 __construct ()
 Constructor. More...
 
 initWithUserContext ()
 
 isEnoughtTimeLeftForReminder ()
 

Protected Attributes

 $user
 
 $lead_time = 0
 
 $expiration_time = 0
 
 $current_time = 0
 
 $seconds_until_expiration = 0
 
 $seconds_until_reminder = 0
 

Detailed Description

Author
Michael Jansen mjans.nosp@m.en@d.nosp@m.ataba.nosp@m.y.de
Version
$Id$

Definition at line 9 of file class.ilSessionReminder.php.

Constructor & Destructor Documentation

◆ __construct()

ilSessionReminder::__construct ( )
protected

Constructor.

Definition at line 55 of file class.ilSessionReminder.php.

References $ilUser.

56  {
57  }

Member Function Documentation

◆ calculateSecondsUntilExpiration()

ilSessionReminder::calculateSecondsUntilExpiration ( )

Definition at line 98 of file class.ilSessionReminder.php.

References getCurrentTime(), getExpirationTime(), and setSecondsUntilExpiration().

Referenced by initWithUserContext().

99  {
100  $this->setSecondsUntilExpiration($this->getExpirationTime() - $this->getCurrentTime());
101  }
setSecondsUntilExpiration($seconds_until_expiration)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ calculateSecondsUntilReminder()

ilSessionReminder::calculateSecondsUntilReminder ( )

Definition at line 106 of file class.ilSessionReminder.php.

References getLeadTime(), getSecondsUntilExpiration(), and setSecondsUntilReminder().

Referenced by initWithUserContext().

107  {
109  }
setSecondsUntilReminder($seconds_until_reminder)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getCurrentTime()

ilSessionReminder::getCurrentTime ( )
Returns
int

Definition at line 178 of file class.ilSessionReminder.php.

References $current_time.

Referenced by calculateSecondsUntilExpiration().

179  {
180  return $this->current_time;
181  }
+ Here is the caller graph for this function:

◆ getExpirationTime()

ilSessionReminder::getExpirationTime ( )
Returns
int

Definition at line 196 of file class.ilSessionReminder.php.

References $expiration_time.

Referenced by calculateSecondsUntilExpiration().

197  {
198  return $this->expiration_time;
199  }
+ Here is the caller graph for this function:

◆ getLeadTime()

ilSessionReminder::getLeadTime ( )
Returns
int

Definition at line 214 of file class.ilSessionReminder.php.

References $lead_time.

Referenced by calculateSecondsUntilReminder(), and isEnoughtTimeLeftForReminder().

215  {
216  return $this->lead_time;
217  }
+ Here is the caller graph for this function:

◆ getSecondsUntilExpiration()

ilSessionReminder::getSecondsUntilExpiration ( )
Returns
int

Definition at line 232 of file class.ilSessionReminder.php.

References $seconds_until_expiration.

Referenced by calculateSecondsUntilReminder(), and isEnoughtTimeLeftForReminder().

+ Here is the caller graph for this function:

◆ getSecondsUntilReminder()

ilSessionReminder::getSecondsUntilReminder ( )
Returns
int

Definition at line 250 of file class.ilSessionReminder.php.

References $seconds_until_reminder.

251  {
253  }

◆ getUser()

ilSessionReminder::getUser ( )
Returns
ilObjUser

Definition at line 160 of file class.ilSessionReminder.php.

References $user.

Referenced by initWithUserContext(), and isActive().

161  {
162  return $this->user;
163  }
+ Here is the caller graph for this function:

◆ initWithUserContext()

ilSessionReminder::initWithUserContext ( )
protected
Todo:
: php7: done

Definition at line 80 of file class.ilSessionReminder.php.

References calculateSecondsUntilExpiration(), calculateSecondsUntilReminder(), ilSession\getIdleValue(), getUser(), setCurrentTime(), setExpirationTime(), setLeadTime(), and time.

81  {
82  $this->setLeadTime(max(self::MIN_LEAD_TIME, (float)$this->getUser()->getPref('session_reminder_lead_time')) * 60);
83 
87  include_once './Services/Authentication/classes/class.ilSession.php';
89  $this->setCurrentTime(time());
90 
93  }
setExpirationTime($expiration_time)
static getIdleValue($fixedMode=false)
Returns the idle time in seconds.
Add data(end) time
Method that wraps PHPs time in order to allow simulations with the workflow.
+ Here is the call graph for this function:

◆ isActive()

ilSessionReminder::isActive ( )
Returns
bool

Definition at line 122 of file class.ilSessionReminder.php.

References $ilSetting, getUser(), isEnoughtTimeLeftForReminder(), and ilSession\SESSION_HANDLING_FIXED.

123  {
124  return
125  self::isGloballyActivated() &&
126  $this->getUser()->getId() != ANONYMOUS_USER_ID &&
127  (int)$this->getUser()->getPref('session_reminder_enabled') &&
129  }
+ Here is the call graph for this function:

◆ isEnoughtTimeLeftForReminder()

ilSessionReminder::isEnoughtTimeLeftForReminder ( )
protected
Returns
bool

Definition at line 114 of file class.ilSessionReminder.php.

References getLeadTime(), and getSecondsUntilExpiration().

Referenced by isActive().

115  {
116  return $this->getLeadTime() < $this->getSecondsUntilExpiration();
117  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ setCurrentTime()

ilSessionReminder::setCurrentTime (   $current_time)
Parameters
int$current_time
Returns
ilSessionReminder

Definition at line 169 of file class.ilSessionReminder.php.

References $current_time.

Referenced by initWithUserContext().

170  {
171  $this->current_time = $current_time;
172  return $this;
173  }
+ Here is the caller graph for this function:

◆ setExpirationTime()

ilSessionReminder::setExpirationTime (   $expiration_time)
Parameters
int$expiration_time
Returns
ilSessionReminder

Definition at line 187 of file class.ilSessionReminder.php.

References $expiration_time.

Referenced by initWithUserContext().

188  {
189  $this->expiration_time = $expiration_time;
190  return $this;
191  }
+ Here is the caller graph for this function:

◆ setLeadTime()

ilSessionReminder::setLeadTime (   $lead_time)
Parameters
int$lead_time
Returns
ilSessionReminder

Definition at line 205 of file class.ilSessionReminder.php.

References $lead_time.

Referenced by initWithUserContext().

206  {
207  $this->lead_time = $lead_time;
208  return $this;
209  }
+ Here is the caller graph for this function:

◆ setSecondsUntilExpiration()

ilSessionReminder::setSecondsUntilExpiration (   $seconds_until_expiration)
Parameters
int$seconds_until_expiration
Returns
ilSessionReminder

Definition at line 223 of file class.ilSessionReminder.php.

References $seconds_until_expiration.

Referenced by calculateSecondsUntilExpiration().

224  {
225  $this->seconds_until_expiration = $seconds_until_expiration;
226  return $this;
227  }
+ Here is the caller graph for this function:

◆ setSecondsUntilReminder()

ilSessionReminder::setSecondsUntilReminder (   $seconds_until_reminder)
Parameters
int$seconds_until_reminder
Returns
ilSessionReminder

Definition at line 241 of file class.ilSessionReminder.php.

References $seconds_until_reminder.

Referenced by calculateSecondsUntilReminder().

242  {
243  $this->seconds_until_reminder = $seconds_until_reminder;
244  return $this;
245  }
+ Here is the caller graph for this function:

◆ setUser()

ilSessionReminder::setUser (   $user)
Parameters
ilObjUser$user
Returns
ilSessionReminder

Definition at line 151 of file class.ilSessionReminder.php.

References $user, and user().

152  {
153  $this->user = $user;
154  return $this;
155  }
user()
Definition: user.php:4
+ Here is the call graph for this function:

Field Documentation

◆ $current_time

ilSessionReminder::$current_time = 0
protected

Definition at line 40 of file class.ilSessionReminder.php.

Referenced by getCurrentTime(), and setCurrentTime().

◆ $expiration_time

ilSessionReminder::$expiration_time = 0
protected

Definition at line 35 of file class.ilSessionReminder.php.

Referenced by getExpirationTime(), and setExpirationTime().

◆ $lead_time

ilSessionReminder::$lead_time = 0
protected

Definition at line 30 of file class.ilSessionReminder.php.

Referenced by getLeadTime(), and setLeadTime().

◆ $seconds_until_expiration

ilSessionReminder::$seconds_until_expiration = 0
protected

◆ $seconds_until_reminder

ilSessionReminder::$seconds_until_reminder = 0
protected

Definition at line 50 of file class.ilSessionReminder.php.

Referenced by getSecondsUntilReminder(), and setSecondsUntilReminder().

◆ $user

ilSessionReminder::$user
protected

Definition at line 25 of file class.ilSessionReminder.php.

Referenced by getUser(), and setUser().

◆ MIN_LEAD_TIME

const ilSessionReminder::MIN_LEAD_TIME = 2

◆ SUGGESTED_LEAD_TIME

const ilSessionReminder::SUGGESTED_LEAD_TIME = 5

The documentation for this class was generated from the following file: