예제 #1
0
 /**
  * Don't let the customer on the login page if they are already authenticated
  * @Developer brandon
  * @Date Oct 12, 2010
  */
 public function new_one()
 {
     if (customer::logged_in()) {
         url::redirect(url::site());
     }
     parent::new_one();
 }
예제 #2
0
 /**
  * Update the user
  * @Developer brandon
  * @Date May 19, 2010
  */
 public function update()
 {
     user::require_login();
     if (!$this->input->post('password')) {
         unset($_POST['password']);
     }
     parent::update(user::current()->id);
 }
예제 #3
0
 /**
  * Show the login page
  * @Developer brandon
  * @Date May 19, 2010
  */
 public function new_one()
 {
     if (user::logged_in()) {
         url::redirect('');
     }
     parent::new_one();
     layout::add(View::factory('shared/mentions')->render(), 'pre_footer');
     meta::set_title('Login');
 }
예제 #4
0
 /**
  * Clear the cache on an constructive/destructive action
  * Also, make sure only admins can get here
  * @Developer brandon
  * @Date May 27, 2010
  */
 public function __construct()
 {
     parent::__construct();
     if (in_array(Router::$method, array('new_one', 'edit', 'create', 'update', 'delete'))) {
         if (!user::is_admin()) {
             url::redirect('topics');
         }
         Cache::instance()->delete_all();
     }
 }
예제 #5
0
파일: blogs.php 프로젝트: ready4god2513/scs
 /**
  * Clean up the show page URL
  * @Developer brandon
  * @Date Oct 11, 2010
  */
 public function show($name = NULL)
 {
     $blog = ORM::factory('blog')->where('name', format::dash_to_space($name))->find();
     // Set the title
     meta::set_title(ucwords($blog->name));
     // Set the description
     meta::set_description($blog->synopsis);
     // Show the page
     parent::show($blog);
 }
예제 #6
0
파일: list.php 프로젝트: jmhobbs/MkLst
 public function __construct()
 {
     parent::__construct();
     if (!isset($_SESSION['can_edit']) || !is_array($_SESSION['can_edit'])) {
         $_SESSION['can_edit'] = array();
     }
     if (!isset($_SESSION['can_view']) || !is_array($_SESSION['can_view'])) {
         $_SESSION['can_view'] = array();
     }
 }
예제 #7
0
 /**
  * Clean up the show page URL
  * @Developer brandon
  * @Date Oct 11, 2010
  */
 public function show($id = NULL)
 {
     // Find the product that we are trying to access
     $product = ORM::factory('product', $id);
     // Set the title
     meta::set_title(ucwords($product->name));
     // Set the description
     meta::set_description($product->description);
     // Show the page
     parent::show($product);
 }
예제 #8
0
파일: carts.php 프로젝트: ready4god2513/scs
 /**
  * Set the title for the cart
  * @Developer brandon
  * @Date Oct 11, 2010
  */
 public function __construct()
 {
     parent::__construct();
     meta::set_title('Shopping Cart');
     $this->cart = cart::get();
 }
예제 #9
0
파일: index.php 프로젝트: jkinner/ringside
require_once "app/controllers/application_controller.php";
require_once "app/controllers/ringside_controller.php";
require_once "app/controllers/apps.php";
require_once "app/controllers/communities.php";
require_once "app/controllers/welcome.php";
// Automatically find controllers
// spl_autoload_register('admin_autoload');
// function admin_autoload($class_name)
// {
//   $_path = "app/controllers/" . strtolower($class_name) . '.php';
//   if(file_exists($_path))
//     require_once $_path;
// }
//require_once "app/controllers/welcome.php";
if (isset($_GET['apps'])) {
    $action = new Apps();
} elseif (isset($_GET['communities'])) {
    $action = new Communities();
} else {
    $action = new Welcome();
}
Application_Controller::$controllers = array("Apps", "Communities", "Welcome");
//$action->setLocalClient( true );
//$user = $action->client->require_login();
$action->render();
?>

<br><br>

<?php 
//print_r(Application_Controller::$controllers);
예제 #10
0
 /**
  * Set the title for the blog entry that the user is viewing
  * @Developer brandon
  * @Date May 27, 2010
  */
 public function show($id = NULL)
 {
     parent::show($id);
     $blog = ORM::factory('blog', $id);
     meta::set_title($blog->title);
 }
예제 #11
0
 public function __construct($action = null)
 {
     parent::__construct($action, $this);
     $this->createSession();
 }
예제 #12
0
 /**
  * Show
  * @Developer brandon
  * @Date May 19, 2010
  */
 public function show($title = NULL)
 {
     $page = ORM::factory('static')->where('title', $title)->find();
     meta::set_title($page->title);
     parent::show($page->id);
 }
예제 #13
0
 /**
  * Delete a journal, but only if it belongs to the user
  * @Developer brandon
  * @Date May 17, 2010
  */
 public function delete()
 {
     $journal = ORM::factory($this->model_name, $this->input->post('id'));
     if ($journal->user->id != user::current()->id) {
         url::redirect('');
     }
     parent::delete();
 }
예제 #14
0
파일: twitter.php 프로젝트: jmhobbs/q-aargh
 public function __construct()
 {
     parent::__construct();
     require_once Kohana::find_file('vendor', 'twitteroauth/twitteroauth');
 }