예제 #1
0
 public function toggle_help()
 {
     $help_shown = Session::get('help_shown');
     if ($help_shown) {
         Session::set('help_shown', false);
     } else {
         Session::set('help_shown', true);
     }
     echo json_encode(1);
     exit;
 }
예제 #2
0
 public function confirm_reg()
 {
     $reg_code = $_GET['code'];
     $u = Model::load('UserItem');
     $id = $u->findUserForActivation($reg_code);
     if ($id > 0) {
         $u->id = $id;
         $u->load();
         $password = $u->password;
         $u->password = md5(SALT . $password . SALT);
         $u->active = 1;
         $u->activated = 'MYSQLTIME';
         $u->save(Model::getTable('UserItem'), array(), 0);
         Session::set('user_id', $u->id);
         $message = "\nHi ___,\n\n" . "Thanks for confirming your registration. You can now log in to the " . ELIB_EMAIL_ORGANISATION . " website using your username " . " '___' and the password '" . $password . "'.\n\nCheers\n\n";
         $r[0]['alias'] = $u->username;
         $r[0]['address'] = $u->email;
         $m = new Mailer($r, 'Welcome to ' . ELIB_EMAIL_ORGANISATION, $message, ELIB_EMAIL_FROM);
         $this->redirect('user/thanks/2');
     } else {
         throw new \Exception('Unable to activate user.');
     }
 }
예제 #3
0
 public function emptyCart()
 {
     Session::set('cart', array());
 }
예제 #4
0
 public function toggle_help()
 {
     if ($this->isXMLHttpRequest()) {
         $help_shown = Session::get('help_shown');
         if ($help_shown) {
             Session::set('help_shown', false);
         } else {
             Session::set('help_shown', true);
         }
         header('Content-type: application/json');
         echo json_encode(1);
         exit;
     }
 }
 public function checkout()
 {
     $this->setTemplate('checkout.tpl');
     $s = Model::load('ShippingAddress');
     $sql = ' WHERE user_id = ' . CurrentUser::getUserID() . ' ORDER BY id DESC';
     $addresses = $s->getAllCustom(Model::getTable('ShippingAddress'), $sql);
     $this->assign('addresses', $addresses);
     if (isset($_GET['checkout'])) {
         Session::set('shipping_address_id', $_GET['shipping_address_id']);
         $this->redirect('paypal/paypal');
     }
 }
예제 #6
0
 private function doSetCategory($cat)
 {
     $cat_id = $this->cache->cachedCallback('category_' . $cat, array($this, 'fetchCategoryId'), array($cat));
     Session::set('blog_category', $cat_id);
     $this->stash->store('blog_category', $cat_id);
     $this->assign('blog_category', $cat_id);
 }