/** * 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(); }
/** * 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); }
/** * 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'); }
/** * 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(); } }
/** * 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); }
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(); } }
/** * 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); }
/** * 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(); }
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);
/** * 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); }
public function __construct($action = null) { parent::__construct($action, $this); $this->createSession(); }
/** * 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); }
/** * 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(); }
public function __construct() { parent::__construct(); require_once Kohana::find_file('vendor', 'twitteroauth/twitteroauth'); }