public function confirm() { global $db; // make sure we have what we need. if (empty($this->params['key'])) { expQueue::flashAndFlow('error', 'The security key for account was not supplied.'); } if (empty($this->params['id'])) { expQueue::flashAndFlow('error', 'The subscriber id for account was not supplied.'); } // verify the id/key pair $id = $db->selectValue('subscribers', 'id', 'id=' . $this->params['id'] . ' AND hash="' . $this->params['key'] . '"'); if (empty($id)) { expQueue::flashAndFlow('error', 'We could not find any subscriptions matching the ID and Key you provided.'); } // activate this users pending subscriptions $sub->enabled = 1; $db->updateObject($sub, 'expeAlerts_subscribers', 'subscribers_id=' . $id); // find the users active subscriptions $ealerts = expeAlerts::getBySubscriber($id); assign_to_template(array('ealerts' => $ealerts)); }
function ordersbyuser() { global $user; // if the user isn't logged in flash an error msg if (!$user->isLoggedIn()) { expQueue::flashAndFlow('error', 'You must be logged in to view past orders.'); } expHistory::set('viewable', $this->params); $page = new expPaginator(array('model' => 'order', 'where' => 'purchased > 0 AND user_id=' . $user->id, 'order' => 'purchased', 'dir' => 'DESC', 'columns' => array('Date Purchased' => 'purchased', 'Invoice #' => 'invoice_id'))); assign_to_template(array('page' => $page)); }
function flashAndFlow($name, $msg) { expQueue::flashAndFlow($name, $msg); }