public function __construct() { parent::__construct(); $this->session = Session::instance(); require Kohana::find_file('vendor', 'classTextile'); require Kohana::find_file('vendor', 'Markdown'); $this->auth = Auth::instance(); $this->access = Access::instance(); $this->filebrowser = Filebrowser::instance(); $this->filekind = FileKind::instance(); Subfolio::set_filebrowser($this->filebrowser); Subfolio::set_auth($this->auth); Subfolio::set_template($this->template); Subfolio::set_filekind($this->filekind); $this->template->site_title = Kohana::config('filebrowser.site_name'); $this->template->page_title = ""; }
/** * This function will set all the defaults for the base controllers * default template, page title, etc and set up each of the classes that * we might use later on, notification, breadcrumbs, navigation, security. * * @author Jamie Peake */ protected function init() { // initialise the default template data $this->template->title = ''; $this->template->content = ''; $this->notification = Notification::instance(); $this->breadcrumbs = new Breadcrumbs(); $this->breadcrumbs->add()->url('home')->title('Home'); // add the home location. $this->navigation = Navigation::instance('main'); $this->access = Access::instance(); $this->current = $this->access->get_user(); $this->i18n = Kohana::lang(url::area() . Router::$method); $this->post = Session::instance()->get('post'); // this is a simple way to build the css classes we will be using, it will check to see // if the method is index, and if the url requested didnt include an index then it will add it // this is a feeble way to do this, and needs to be looked into as there are cases where it will break // @todo test with edge cases, fix for edge cases. $this->css_classes = Router::$rsegments; if (Router::$method == 'index' && !in_array('index', Router::$rsegments)) { $this->css_classes[] = 'index'; } }
} \kksd\Sesi::$DB = new \DB\SQL("mysql:host=127.0.0.1;port=3306;dbname=kambeng_blog", "kambeng_blog", "kambeng"); \F3::set('db', \kksd\Sesi::$DB); /* PUBLIC SETTINGS~ :* :* */ \F3::route("GET /", 'Control\\App->indexer'); \F3::route("GET @blogread: /baca/@id-xyml", "Control\\Blog->Tampil"); \F3::route("GET @virtualasset: /img/@link/@size-@id-@type", "Control\\Imager->akses", 3600 * 24 * 7); // cache seminggu :3 /* ADMIN PANEL SETTINGS~ :* :* */ \Middleware::instance()->before('GET|POST|PUT|DELETE /admin*', function (\Base $f3, $param) { //cek apa dia login apa kagak, dan layak apa kagak. lel $access = \Access::instance(); $access->policy('deny'); $access->allow('/admin/*', 'admin'); $access->allow('GET|POST /admin/Auth*'); $access->allow('GET|POST /admin/auth*'); if (!$f3->exists('SESSION.user_type') && !$f3->exists('COOKIE.user')) { $f3->set('SESSION.user_type', 'guest'); } $access->authorize($f3->get('SESSION.user_type'), function ($route, $subject) { \F3::reroute('@admin_pack(@pack=Auth)'); }); /* Default settings for template #1 */ if ($f3->exists("COOKIE.user") or $f3->exists("SESSION.user")) { $userz = \User::createUser(\kksd\Sesi::$DB);