コード例 #1
0
ファイル: sessions.php プロジェクト: ready4god2513/scs
 /**
  * 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
ファイル: users.php プロジェクト: ready4god2513/Journal
 /**
  * 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
ファイル: sessions.php プロジェクト: ready4god2513/Journal
 /**
  * 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
ファイル: topics.php プロジェクト: ready4god2513/Journal
 /**
  * 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
ファイル: products.php プロジェクト: ready4god2513/scs
 /**
  * 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
ファイル: blogs.php プロジェクト: ready4god2513/Journal
 /**
  * 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
ファイル: statics.php プロジェクト: ready4god2513/Journal
 /**
  * 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
ファイル: journals.php プロジェクト: ready4god2513/Journal
 /**
  * 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');
 }