33 lines
796 B
PHP
33 lines
796 B
PHP
<?php defined('SYSPATH') or die('No direct access allowed.');
|
|
|
|
/**
|
|
* Redirection Engine
|
|
*
|
|
* @package lnApp
|
|
* @subpackage Page/Home
|
|
* @category Controllers
|
|
* @author Deon George
|
|
* @copyright (c) 2010 Deon George
|
|
* @license http://dev.leenooks.net/license.html
|
|
*/
|
|
class Controller_Redir extends Controller {
|
|
protected $auth_required = FALSE;
|
|
|
|
public function action_index() {
|
|
$ro = ORM::factory('redir',array('servername'=>$_SERVER['SERVER_NAME']));
|
|
|
|
if (! $ro->loaded())
|
|
$ro = ORM::factory('redir',0);
|
|
|
|
$ro->count++;
|
|
$ro->date_last_refer = time();
|
|
$ro->save();
|
|
|
|
if (! is_null($ro->redirect) AND trim($ro->redirect))
|
|
$this->request->redirect($ro->redirect);
|
|
else
|
|
$this->response->body(file_get_contents(Kohana::config('config.defaultfile')));
|
|
}
|
|
}
|
|
?>
|