Exemplo n.º 1
0
 /**
  * @param string $unit
  * @param string $value
  * @param integer $extend
  */
 public function setExpiration($unit, $value, $extend)
 {
     $now = (int) gmdate('U');
     if ($extend) {
         $current = strtotime($this->expiration);
         if ($current < $now) {
             $current = $now;
         }
     } else {
         $current = $now;
     }
     $this->expiration = AECToolbox::computeExpiration($value, $unit, $current);
 }
Exemplo n.º 2
0
 public function deleteTempTokens()
 {
     // Delete old token entries
     $query = 'DELETE' . ' FROM #__acctexp_temptoken' . ' WHERE `created_date` <= \'' . AECToolbox::computeExpiration("-3", 'H', (int) gmdate('U')) . '\'';
     $this->_db->setQuery($query);
     $this->_db->query();
 }