Ejemplo n.º 1
0
 protected function run()
 {
     $config = ['o_cur_version' => Core::version(), 'o_board_title' => '', 'o_board_desc' => '', 'o_time_format' => 'H:i:s', 'o_date_format' => 'Y-m-d', 'o_show_version' => 0, 'o_default_user_group' => 4];
     foreach ($config as $name => $value) {
         $this->database->table('config')->insert(['conf_name' => $name, 'conf_value' => $value]);
     }
 }
Ejemplo n.º 2
0
 /**
  * Register the service provider.
  *
  * @return void
  */
 public function register()
 {
     $this->app->singleton('Illuminate\\Contracts\\Auth\\Guard', function () {
         $hasher = $this->app->make('Illuminate\\Contracts\\Hashing\\Hasher');
         $session = $this->app->make('Symfony\\Component\\HttpFoundation\\Session\\SessionInterface');
         $provider = new EloquentUserProvider($hasher, 'FluxBB\\Models\\User');
         $guard = new Guard($provider, $session);
         $guard->setCookieJar($this->app->make('Illuminate\\Contracts\\Cookie\\QueueingFactory'));
         $guard->setDispatcher($this->app->make('Illuminate\\Contracts\\Events\\Dispatcher'));
         $guard->setRequest($this->app->make('Symfony\\Component\\HttpFoundation\\Request'));
         return $guard;
     });
     if (Core::isInstalled()) {
         $this->app->extend('view', function ($view) {
             $view->share('user', $this->app->make('Illuminate\\Contracts\\Auth\\Guard')->user());
             return $view;
         });
     }
 }
Ejemplo n.º 3
0
<?php

use FluxBB\Models\Config;
use FluxBB\Core;
View::composer('fluxbb::layout.main', function ($view) {
    $view->with('language', trans('fluxbb::common.lang_identifier'))->with('direction', trans('fluxbb::common.lang_direction'))->with('charset', \Config::get('fluxbb.database.charset'))->with('head', '')->with('page', 'index')->with('board_title', Config::get('o_board_title'))->with('board_description', Config::get('o_board_desc'))->with('navlinks', '<ul><li><a href="#">Home</a></li></ul>')->with('status', 'You are not logged in.')->with('announcement', '');
});
View::composer('fluxbb::user.profile.menu', function ($view) {
    $items = array('essentials' => trans('fluxbb::profile.section_essentials'), 'personal' => trans('fluxbb::profile.section_personal'), 'personality' => trans('fluxbb::profile.section_personality'), 'display' => trans('fluxbb::profile.section_display'), 'privacy' => trans('fluxbb::profile.section_privacy'));
    if (Auth::check() && Auth::user()->isAdmin()) {
        $items['admin'] = trans('fluxbb::profile.section_admin');
    }
    // TODO: Determine current action
    $view->with('action', 'profile')->with('items', $items);
});
View::composer('fluxbb::admin.layout.main', function ($view) {
    $view->with('language', trans('fluxbb::common.lang_identifier'))->with('direction', trans('fluxbb::common.lang_direction'))->with('charset', \Config::get('fluxbb.database.charset'))->with('board_title', Config::get('o_board_title'))->with('board_description', Config::get('o_board_desc'))->with('version', Core::version());
});
Ejemplo n.º 4
0
 public function compose(ViewContract $view)
 {
     $view->with('language', trans('fluxbb::common.lang_identifier'))->with('direction', trans('fluxbb::common.lang_direction'))->with('charset', $this->appConfig->get('fluxbb.database.charset'))->with('head', '')->with('page', 'index')->with('board_title', $this->fluxbbConfig->get('o_board_title'))->with('board_description', $this->fluxbbConfig->get('o_board_desc'))->with('version', Core::version())->with('navlinks', '<ul><li><a href="#">Home</a></li></ul>')->with('status', 'You are not logged in.')->with('announcement', '');
 }
Ejemplo n.º 5
-1
 /**
  * Register the service provider.
  *
  * @return void
  */
 public function register()
 {
     $this->app->singleton('Illuminate\\Database\\ConnectionInterface', function () {
         $factory = new ConnectionFactory($this->app);
         $connection = $factory->make($this->app['config']->get('fluxbb.database'));
         $connection->setEventDispatcher($this->app->make('Illuminate\\Contracts\\Events\\Dispatcher'));
         $connection->setFetchMode(PDO::FETCH_CLASS);
         return $connection;
     });
     $this->app->singleton('Illuminate\\Database\\ConnectionResolverInterface', function () {
         $resolver = new ConnectionResolver(['fluxbb' => $this->app->make('Illuminate\\Database\\ConnectionInterface')]);
         $resolver->setDefaultConnection('fluxbb');
         return $resolver;
     });
     if (Core::isInstalled()) {
         $this->app->booting(function () {
             $resolver = $this->app->make('Illuminate\\Database\\ConnectionResolverInterface');
             Model::setConnectionResolver($resolver);
         });
     }
 }