예제 #1
0
 /**
  * undocumented function
  *
  * @return void
  * @access public
  */
 function view($key)
 {
     $userId = $this->params['named']['user_id'];
     $authKeyTypeId = $this->params['named']['auth_key_type_id'];
     Assert::true(Common::isUuid($userId), '403');
     Assert::true(Common::isUuid($authKeyTypeId), '403');
     Assert::true(AuthKey::verify($key, $userId, $authKeyTypeId), '403');
     $authKeyType = $this->AuthKey->AuthKeyType->lookup(array('id' => $authKeyTypeId), 'name', false);
     User::login($userId);
     switch ($authKeyType) {
         case 'Lost Password':
             $this->Session->write('lost_password', true);
             $msg = __('Please go ahead and change your password now.', true);
             $this->Message->add($msg, 'ok', true, '/admin/users/edit_password/' . $userId);
     }
 }
예제 #2
0
 /**
  * undocumented function
  *
  * @param string $key
  * @param string $tId
  * @return void
  * @access public
  */
 function receipt($key, $tId)
 {
     $userId = $this->params['named']['user_id'];
     $authKeyTypeId = $this->params['named']['auth_key_type_id'];
     Assert::true(Common::isUuid($authKeyTypeId), '403');
     Assert::true(Common::isUuid($tId), '403');
     Assert::true(AuthKey::verify($key, $userId, $authKeyTypeId, $tId), '403');
     $transaction = $this->Transaction->find('first', array('conditions' => array('Transaction.id' => $tId), 'contain' => array('Gift.Contact.Address.Phone', 'Gift.Contact.Phone')));
     $this->set(compact('transaction'));
 }