Ejemplo n.º 1
0
 /**
  * undocumented function
  *
  * @param string $authKey 
  * @return void
  * @access public
  */
 function _addAuthkeyToSession($tId)
 {
     App::import('Model', 'TimeZone');
     $userId = !User::is('guest') ? User::get('id') : $this->data['Contact']['email'];
     $authKeyTypeId = $this->AuthKeyType->lookup(array('name' => 'Transaction Receipt'), 'id', false);
     $authKey = AuthKey::generate(array('user_id' => $userId, 'auth_key_type_id' => $authKeyTypeId, 'foreign_id' => $tId, 'expires' => date('Y-m-d H:i:s', strtotime('+3 days'))));
     $keyData = array('user_id' => $userId, 'key' => $authKey, 'auth_key_type_id' => $authKeyTypeId, 'foreign_id' => $tId);
     $sessKey = 'gift_auth_keys';
     $authKeys = $this->Session->read($sessKey);
     $authKeys[] = $keyData;
     $this->Session->write($sessKey, $authKeys);
     return $keyData;
 }
Ejemplo n.º 2
0
 /**
  * undocumented function
  *
  * @param string $id 
  * @return void
  * @access public
  */
 function activationEmail($id, $data)
 {
     $authKey = AuthKey::generate(array('user_id' => $id, 'auth_key_type_id' => 'Account Activation'));
     $emailSettings = array('vars' => array('id' => $id, 'authKey' => $authKey), 'mail' => array('to' => $data['User']['login'], 'subject' => sprintf(__('Welcome to %s', true), Configure::read('App.name'))), 'store' => false);
     Mailer::deliver('register', $emailSettings);
 }