Ejemplo n.º 1
0
 /**
  * Check whether or not the user is logged in
  */
 public static function checkUserStatus()
 {
     if ((!isset($_SESSION[Fabriq::siteTitle()]['FABMOD_USERS_roles']) || $_SESSION[Fabriq::siteTitle()]['FABMOD_USERS_roles'] == '') && Fabriq::installed()) {
         $role = FabriqModules::new_model('roles', 'Roles');
         $role->getRole('unauthenticated');
         $_SESSION[Fabriq::siteTitle()]['FABMOD_USERS_roles'] = serialize(array($role->id, $role->role));
     }
 }
Ejemplo n.º 2
0
 /**
  * Returns whether or the module is enabled
  * @param string $module
  * @return bool
  */
 public static function enabled($module)
 {
     // make sure that fabriq is installed
     if (!Fabriq::installed()) {
         return false;
     }
     global $db;
     $sql = "SELECT enabled FROM fabmods_modules WHERE module = ?";
     $data = $db->prepare_select($sql, array('enabled'), array($module));
     if (count($data) == 0) {
         return FALSE;
     }
     return $data[0]['enabled'] == 1 ? TRUE : FALSE;
 }
Ejemplo n.º 3
0
 * 
 * Copyright (c)2013, Ralivue.com
 * Licensed under the BSD license.
 * http://fabriqframework.com/license
 */
// set error displaying for testing purposes
ini_set('display_errors', 1);
error_reporting(E_ALL & ~E_NOTICE);
// start sessions
session_start();
// require core Fabriq base classes
require_once 'core/Fabriq.core.php';
// determine which site should be servied
FabriqStack::determineSite();
// check to make sure application has been configured
$installed = Fabriq::installed();
// register default __autoload function
spl_autoload_register('fabriq_default_autoload');
// include core files
if ($installed) {
    if (file_exists('config/config.inc.php') && FabriqStack::site() == 'default') {
        require_once 'config/config.inc.php';
    } else {
        require_once 'sites/' . FabriqStack::site() . '/config/config.inc.php';
    }
}
require_once 'core/FabriqModules.core.php';
if (file_exists('sites/' . FabriqStack::site() . '/app/PathMap.class.php')) {
    require_once 'sites/' . FabriqStack::site() . '/app/PathMap.class.php';
} else {
    require_once 'app/PathMap.class.php';