Example #1
0
 public function __construct()
 {
     parent::__construct();
     is_installed();
     #defined in auth helper
     $this->active_theme = get_active_theme();
 }
 /**
  * Handle an incoming request.
  *
  * @param  \Illuminate\Http\Request $request
  * @param  \Closure $next
  * @param  string|null $guard
  * @return mixed
  */
 public function handle($request, Closure $next, $guard = null)
 {
     if (!is_installed() && !is_request_install()) {
         return redirect()->route('install-welcome');
     }
     return $next($request);
 }
 /**
  * Register any application authentication / authorization services.
  *
  * @param  \Illuminate\Contracts\Auth\Access\Gate $gate
  * @return void
  */
 public function boot(GateContract $gate)
 {
     $this->registerPolicies($gate);
     if (is_installed()) {
         $this->registerReactorPolicies($gate);
     }
 }
Example #4
0
 public function __construct()
 {
     parent::__construct();
     is_installed();
     #defined in auth helper
     remove_featured_if_expired();
     $this->PER_PAGE = get_per_page_value();
     #defined in auth helper
     $this->active_theme = get_active_theme();
     $this->load->model('show_model');
     $this->load->model('user/user_model');
     $this->load->library('encrypt');
     $this->load->helper('text');
     $this->output->enable_profiler($this->config->item('debug_site'));
     if (isset($_POST['view_orderby'])) {
         $this->session->set_userdata('view_orderby', $this->input->post('view_orderby'));
     }
     if (isset($_POST['view_ordertype'])) {
         $this->session->set_userdata('view_ordertype', $this->input->post('view_ordertype'));
     }
     $system_currency_type = get_settings('realestate_settings', 'system_currency_type', 0);
     if ($system_currency_type == 0) {
         $system_currency = get_currency_icon(get_settings('realestate_settings', 'system_currency', 'USD'));
     } else {
         $system_currency = get_settings('realestate_settings', 'system_currency', 'USD');
     }
     $this->session->set_userdata('system_currency', $system_currency);
     $this->form_validation->set_error_delimiters('<div class="alert alert-danger">', '</div>');
 }
Example #5
0
 public static function installation()
 {
     if (!is_installed()) {
         echo View::create('intro')->render();
         exit(0);
     }
 }
Example #6
0
 public function __construct()
 {
     parent::__construct();
     $curr_lang = $this->uri->segment(1) != '' ? $this->uri->segment(1) : 'en';
     if ($curr_lang == 'ar') {
         $this->config->set_item('language', 'arabic');
     }
     is_installed();
     #defined in auth helper
     remove_featured_if_expired();
     checksavedlogin();
     #defined in auth helper
     if (!is_admin() && !is_agent()) {
         if (count($_POST) <= 0) {
             $this->session->set_userdata('req_url', current_url());
         }
         redirect(site_url('admin/auth'));
     }
     $this->per_page = get_per_page_value();
     #defined in auth helper
     $this->load->helper('text');
     $this->load->model('show/show_model');
     $this->load->model('admin/realestate_model');
     $this->form_validation->set_error_delimiters('<div class="alert alert-danger">', '</div>');
 }
Example #7
0
 function default_lang()
 {
     if (is_installed('return') != 'no') {
         if (defined('DEFAULT_LANG')) {
             return constant('DEFAULT_LANG');
         } else {
             $CI = get_instance();
             $CI->load->database();
             $query = $CI->db->get_where('options', array('key' => 'site_settings'));
             if ($query->num_rows() > 0) {
                 $row = $query->row();
                 $settings = json_decode($row->values);
                 $default_lang = $settings->site_lang;
             } else {
                 $default_lang = 'en';
             }
             if (!defined('DEFAULT_LANG')) {
                 define('DEFAULT_LANG', $default_lang);
             }
             return $default_lang;
         }
     } else {
         return 'en';
     }
 }
Example #8
0
 public function __construct()
 {
     parent::__construct();
     is_installed();
     #defined in bookit helper
     $this->load->model('auth_model');
     $this->load->library('form_validation');
     $this->form_validation->set_error_delimiters('<div class="alert alert-danger">', '</div>');
 }
Example #9
0
 public function __construct()
 {
     parent::__construct();
     if (is_installed()) {
         header("Content-type:text/html;charset=utf-8");
         echo 'DiliCMS已经安装过,要重新安装请先删除install.lock';
         exit($this->output->get_output());
     }
 }
Example #10
0
 public function __construct()
 {
     parent::__construct();
     //$this->output->enable_profiler(TRUE);
     //check if config file is empty or it's not empty but script is not installed
     if ((is_db_conf_empty() || !is_installed()) && !defined('CS_EXTERNAL')) {
         redirect("setup/index");
     }
     //load database, datamapper and login manager
     $this->load->database();
     $this->load->library('datamapper');
     $this->load->library('translate');
     $this->load->library('loginmanager');
     //hack for datamapper prefix
     DataMapper::$config['prefix'] = $this->db->dbprefix;
     //set web site name in title
     $this->templatemanager->set_title(Setting::value('website_title', CS_PRODUCT_NAME));
     //test if should save uri
     $should = true;
     if ($this instanceof Process) {
         $uri = $path = trim($this->uri->uri_string());
         $file = new File();
         $file->path = $path;
         $mime = $file->mime_type();
         if ($mime !== 'text/html') {
             $should = false;
         }
     }
     //set current url for auth controller to know where to redirect
     if (!$this instanceof Auth && !$this instanceof JS && !$this->is_ajax_request() && $should) {
         $this->loginmanager->set_redirect(current_url());
     }
     //set time zone
     date_default_timezone_set(Setting::value('default_time_zone', 'Europe/Belgrade'));
     //set language
     $sess_lang = $this->session->userdata('lang');
     if (!empty($sess_lang)) {
         if (is_numeric($sess_lang)) {
             $lang = Language::factory()->get_by_id((int) $sess_lang)->name;
         } else {
             $lang = $sess_lang;
         }
     } else {
         $lang = Setting::value('default_language', 'English');
     }
     $this->translate->set_language($lang);
     //fetch user from the database if logged in
     if ($this->loginmanager->is_logged_in()) {
         $this->user = User::factory($this->loginmanager->user->id);
         $this->templatemanager->assign('user', $this->user);
     }
     $this->templatemanager->set_template_name($this->in_admin() ? "administration" : "");
     if ($this->in_admin() && isset($_GET['iu-popup'])) {
         $this->templatemanager->popup();
     }
 }
Example #11
0
 function index()
 {
     if (is_installed()) {
         return info_page(__('INSTALL_FINISHED'));
     } elseif (intval(v('do')) == 1) {
         db_init();
     } else {
         $data['title'] = $data['top_title'] = __('INSTALL_PAGE_TITLE');
         return render($data, 'web', 'fullwidth');
     }
 }
 public function __construct()
 {
     parent::__construct();
     is_installed();
     #defined in auth helper
     //$this->PER_PAGE = get_per_page_value();#defined in auth helper
     $this->PER_PAGE = get_settings('business_settings', 'posts_per_page', 6);
     $this->active_theme = get_active_theme();
     $this->load->model('review_model');
     $this->form_validation->set_error_delimiters('<div class="alert alert-danger">', '</div>');
 }
Example #13
0
 function index()
 {
     if (is_installed()) {
         return info_page('API Server 已初始化完成,<a href="?c=guest">请使用管理账号登入</a>');
     } elseif (intval(v('do')) == 1) {
         db_init();
     } else {
         $data['title'] = $data['top_title'] = 'TeamToy安装页面';
         return render($data, 'web', 'fullwidth');
     }
 }
Example #14
0
 public function __construct()
 {
     parent::__construct();
     is_installed();
     #defined in auth helper
     $this->load->database();
     $this->active_theme = get_active_theme();
     $this->load->model('ajax_model');
     //$this->load->model('show/post_model');
     $this->load->helper('dbcvote');
     $this->form_validation->set_error_delimiters('<label class="col-lg-2 control-label">&nbsp;</label><div class="col-lg-8"><div class="alert alert-danger" style="margin-bottom:0;">', '</div></div>');
     //$this->output->enable_profiler(TRUE);
 }
 /**
  * Define the "web" routes for the application.
  *
  * These routes all receive session state, CSRF protection, etc.
  *
  * @param  \Illuminate\Routing\Router $router
  * @return void
  */
 protected function mapWebRoutes(Router $router)
 {
     $router->group(['namespace' => $this->namespace, 'middleware' => 'web'], function ($router) {
         // Common routes
         require routes_path('common.php');
         // Reactor routes
         require routes_path(config('themes.active_reactor') . '.php');
         // Site routes
         require routes_path(config('themes.active') . '.php');
         // Install routes
         if (!is_installed()) {
             require routes_path('install.php');
         }
     });
 }
Example #16
0
 public function fire()
 {
     if (is_installed()) {
         $this->error('Arastta is already installed');
         exit;
     }
     $this->loadModel('main', 'install');
     if ($requirements = $this->install->model_main->checkRequirements()) {
         $this->error('You do not meet the requirements to install Arastta');
         foreach ($requirements as $requirement) {
             $this->info($requirement);
         }
         exit;
     }
     $this->loadModel('database', 'install');
     $this->loadModel('setting', 'install');
     if ($errors = $this->validateInputs()) {
         $this->error('Please ensure the input is correct:');
         foreach ($errors as $error) {
             $this->info($error);
         }
         exit;
     }
     $options = $this->option();
     if ($this->option('install_demo_data')) {
         $options['install_demo_data'] = true;
     } else {
         unset($options['install_demo_data']);
         //the model checks if it isset
     }
     if (!$this->install->model_database->saveConfig($options)) {
         $this->comment('There was an issue saving the config file, you may have to create it manually');
     }
     //we can now load the config file to get the constants
     if (file_exists(DIR_ROOT . 'config.php') && filesize(DIR_ROOT . 'config.php') > 0) {
         require_once DIR_ROOT . 'config.php';
     }
     //before we create the database tables we need to add language data to the session
     $this->install->session->data['lang_name'] = 'English';
     $this->install->session->data['lang_code'] = 'en';
     $this->install->session->data['lang_image'] = 'gb.png';
     $this->install->session->data['lang_directory'] = 'en-GB';
     $this->install->model_setting->createDatabaseTables($options);
     //now clean up the installation directory
     $this->loadModel('finish', 'install');
     $this->install->model_finish->removeInstall();
     $this->info('Success, Arastta should now be installed');
 }
Example #17
0
 public function __construct()
 {
     parent::__construct();
     is_installed();
     #defined in auth helper
     checksavedlogin();
     #defined in auth helper
     if (!is_loggedin()) {
         if (count($_POST) <= 0) {
             $this->session->set_userdata('req_url', current_url());
         }
         redirect(site_url('admin/auth'));
     }
     $this->load->model('media_model');
     $this->load->library('form_validation');
     $this->form_validation->set_error_delimiters('<div class="alert alert-error input-xxlarge"">', '</div>');
 }
 public function __construct()
 {
     parent::__construct();
     is_installed();
     #defined in auth helper
     // if(!is_loggedin())
     // {
     // 	if(count($_POST)<=0)
     // 	$this->session->set_userdata('req_url',current_url());
     // 	redirect(site_url('account/trylogin'));
     // }
     $this->per_page = get_per_page_value();
     $this->load->database();
     $this->active_theme = get_active_theme();
     $this->load->model('user/payment_model');
     $this->form_validation->set_error_delimiters('<div class="alert alert-danger form-error">', '</div>');
 }
Example #19
0
 public function __construct()
 {
     parent::__construct();
     is_installed();
     #defined in auth helper
     checksavedlogin();
     #defined in auth helper
     if (!is_admin()) {
         if (count($_POST) <= 0) {
             $this->session->set_userdata('req_url', current_url());
         }
         redirect(site_url('admin/auth'));
     }
     $this->per_page = get_per_page_value();
     #defined in auth helper
     $this->load->model('admin/plugins_model');
 }
Example #20
0
 public function __construct()
 {
     parent::__construct();
     is_installed();
     #defined in auth helper
     checksavedlogin();
     #defined in auth helper
     if (!is_admin() && !is_agent()) {
         if (count($_POST) <= 0) {
             $this->session->set_userdata('req_url', current_url());
         }
         redirect(site_url('admin/auth'));
     }
     $this->per_page = get_per_page_value();
     #defined in auth helper
     $this->load->model('admin_model');
     $this->form_validation->set_error_delimiters('<div class="alert alert-danger">', '</div>');
 }
/**
 * Run any php upgrade scripts which are required
 *
 * @param int $version Version upgrading from.
 * @param bool $quiet Suppress errors.  Don't use this.
 */
function upgrade_code($version, $quiet = FALSE)
{
    global $CONFIG;
    // Elgg and its database must be installed to upgrade it!
    if (!is_db_installed() || !is_installed()) {
        return FALSE;
    }
    $version = (int) $version;
    if ($handle = opendir($CONFIG->path . 'engine/lib/upgrades/')) {
        $upgrades = array();
        while ($updatefile = readdir($handle)) {
            // Look for upgrades and add to upgrades list
            if (!is_dir($CONFIG->path . 'engine/lib/upgrades/' . $updatefile)) {
                if (preg_match('/^([0-9]{10})\\.(php)$/', $updatefile, $matches)) {
                    $core_version = (int) $matches[1];
                    if ($core_version > $version) {
                        $upgrades[] = $updatefile;
                    }
                }
            }
        }
        // Sort and execute
        asort($upgrades);
        if (sizeof($upgrades) > 0) {
            foreach ($upgrades as $upgrade) {
                // hide all errors.
                if ($quiet) {
                    // hide include errors as well as any exceptions that might happen
                    try {
                        if (!@(include $CONFIG->path . 'engine/lib/upgrades/' . $upgrade)) {
                            error_log($e->getmessage());
                        }
                    } catch (Exception $e) {
                        error_log($e->getmessage());
                    }
                } else {
                    include $CONFIG->path . 'engine/lib/upgrades/' . $upgrade;
                }
            }
        }
        return TRUE;
    }
    return FALSE;
}
 /**
  * Registers view bindings
  *
  * @param NodeRepository $nodeRepository
  */
 protected function registerViewBindings(NodeRepository $nodeRepository)
 {
     if (!is_installed()) {
         return;
     }
     if (!is_request_reactor()) {
         $home = $nodeRepository->getHome(false);
         view()->share('home', $home);
     }
     view()->composer('*', function ($view) {
         $view->with('currentUser', auth()->user());
     });
     if (is_request_reactor()) {
         view()->composer('partials.navigation.nodes', function ($view) {
             $leafs = empty($id = auth()->user()->home) ? Node::whereIsRoot()->defaultOrder()->get() : [Node::find($id)];
             $view->with('leafs', $leafs);
         });
     }
 }
 public function __construct()
 {
     parent::__construct();
     is_installed();
     #defined in auth helper
     expiration_cron();
     //$this->PER_PAGE = get_per_page_value();#defined in auth helper
     $this->PER_PAGE = get_settings('business_settings', 'posts_per_page', 6);
     $this->active_theme = get_active_theme();
     $this->load->model('show_model');
     $system_currency_type = get_settings('business_settings', 'system_currency_type', 0);
     if ($system_currency_type == 0) {
         $system_currency = get_currency_icon(get_settings('business_settings', 'system_currency', 'USD'));
     } else {
         $system_currency = get_settings('business_settings', 'system_currency', 'USD');
     }
     $this->session->set_userdata('system_currency', $system_currency);
     $this->form_validation->set_error_delimiters('<div class="alert alert-danger">', '</div>');
 }
Example #24
0
 public function __construct()
 {
     parent::__construct();
     is_installed();
     #defined in auth helper
     if (!is_loggedin()) {
         if (count($_POST) <= 0) {
             $this->session->set_userdata('req_url', current_url());
         }
         redirect(site_url('account/trylogin'));
     }
     //$this->per_page = get_per_page_value();
     $this->load->database();
     $this->active_theme = get_active_theme();
     $this->load->model('user_model');
     $this->load->model('show/post_model');
     $this->load->helper('dbcvote');
     $this->form_validation->set_error_delimiters('<label class="col-lg-2 control-label">&nbsp;</label><div class="col-lg-8"><div class="alert alert-danger" style="margin-bottom:0;">', '</div></div>');
     //$this->output->enable_profiler(TRUE);
 }
Example #25
0
 public function initialise()
 {
     // File System
     $filesystem = new Filesystem();
     $this->registry->set('filesystem', $filesystem);
     // Config
     $this->registry->set('config', new Config());
     // Loader
     $loader = new Loader($this->registry);
     $this->registry->set('load', $loader);
     // Trigger
     $trigger = new Trigger($this->registry);
     $this->registry->set('trigger', $trigger);
     // Url
     $url = new Url(HTTP_SERVER, HTTPS_SERVER, $this->registry);
     $this->registry->set('url', $url);
     // Uri
     $uri = new Uri();
     $this->registry->set('uri', $uri);
     // Security
     $security = new Security($this->registry);
     $this->registry->set('security', $security);
     // Session
     $session = new Session();
     $this->registry->set('session', $session);
     // Config
     if (is_installed()) {
         require_once DIR_ROOT . 'config.php';
         $this->registry->set('db', new DB(DB_DRIVER, DB_HOSTNAME, DB_USERNAME, DB_PASSWORD, DB_DATABASE));
         // Utility
         $utility = new Utility($this->registry);
         $this->registry->set('utility', $utility);
         // Language
         $lang = 'en-GB';
         $language = new Language($lang, $this->registry);
         $this->registry->set('language', $language);
     }
     $cache = new Cache($this->config->get('config_cache_storage', 'file'), $this->config->get('config_cache_lifetime', 86400));
     $this->registry->set('cache', $cache);
     $this->addCommandsToConsole();
 }
Example #26
0
 public function __construct()
 {
     parent::__construct();
     is_installed();
     #defined in auth helper
     remove_featured_if_expired();
     checksavedlogin();
     #defined in auth helper
     if (!is_admin() && $this->session->userdata('user_type') != 2) {
         if (count($_POST) <= 0) {
             $this->session->set_userdata('req_url', current_url());
         }
         redirect(site_url('admin/auth'));
     }
     $this->per_page = get_per_page_value();
     #defined in auth helper
     $this->load->helper('text');
     $this->load->model('show/show_model');
     $this->load->model('admin/realestate_model');
     $this->form_validation->set_error_delimiters('<div class="alert alert-danger">', '</div>');
 }
Example #27
0
 public function __construct()
 {
     parent::__construct();
     is_installed();
     #defined in auth helper
     if (!is_loggedin()) {
         $this->load->helper("url_helper");
         if ($this->uri->segment(2) == "post-ad" or $this->uri->segment(2) == "create-ad") {
         } else {
             if (count($_POST) <= 0) {
                 $this->session->set_userdata('req_url', current_url());
             }
             redirect(site_url('account/trylogin'));
         }
     }
     $this->per_page = get_per_page_value();
     $this->load->database();
     $this->active_theme = get_active_theme();
     $this->load->model('user/post_model');
     $this->form_validation->set_error_delimiters('<div class="alert alert-danger form-error">', '</div>');
 }
Example #28
0
/**
 * Run any php upgrade scripts which are required
 *
 * @param unknown_type $version
 */
function upgrade_code($version)
{
    global $CONFIG;
    // Elgg and its database must be installed to upgrade it!
    if (!is_db_installed() || !is_installed()) {
        return false;
    }
    $version = (int) $version;
    if ($handle = opendir($CONFIG->path . 'engine/lib/upgrades/')) {
        $upgrades = array();
        while ($updatefile = readdir($handle)) {
            // Look for upgrades and add to upgrades list
            if (!is_dir($CONFIG->path . 'engine/lib/upgrades/' . $updatefile)) {
                if (preg_match('/([0-9]*)\\.php/', $updatefile, $matches)) {
                    $core_version = (int) $matches[1];
                    if ($core_version > $version) {
                        $upgrades[] = $updatefile;
                    }
                }
            }
        }
        // Sort and execute
        asort($upgrades);
        if (sizeof($upgrades) > 0) {
            foreach ($upgrades as $upgrade) {
                try {
                    @(include $CONFIG->path . 'engine/lib/upgrades/' . $upgrade);
                } catch (Exception $e) {
                    error_log($e->getmessage());
                }
            }
        }
        return true;
    }
    return false;
}
Example #29
0
/**
 * Returns whether or not the user is currently logged in and that they are an admin user.
 *
 * @uses isloggedin()
 * @return true|false
 */
function isadminloggedin()
{
    if (!is_installed()) {
        return false;
    }
    $user = get_loggedin_user();
    if (isloggedin() && ($user->admin || $user->siteadmin)) {
        return true;
    }
    return false;
}
Example #30
0
<?php

include_once dirname(__FILE__) . "/frame.class.inc";
include_once dirname(__FILE__) . "/class.unix.inc";
include_once dirname(__FILE__) . "/class.hd.inc";
include_once dirname(__FILE__) . "/class.postfix.inc";
if (isset($_GET["service-status"])) {
    service_status();
    exit;
}
if (isset($_GET["install-tgz"])) {
    install_tgz();
    exit;
}
if (isset($_GET["is-installed"])) {
    is_installed();
    exit;
}
if (isset($_GET["install"])) {
    install();
    exit;
}
if (isset($_GET["installv1"])) {
    installv1();
    exit;
}
if (isset($_GET["InfluxDBPassword"])) {
    InfluxDBPassword();
    exit;
}
if (isset($_GET["backup"])) {