Esempio n. 1
0
require_once KUNENA_PATH_LIB . DS . "kunena.config.class.php";
// Get CKunanaUser and CKunenaUsers
require_once KUNENA_PATH_LIB . DS . "kunena.user.class.php";
global $fbConfig, $kunenaProfile;
// Get data about the current user - its ok to not have a userid = guest
$kunena_my =& JFactory::getUser();
$KunenaUser = new CKunenaUser($kunena_my->id);
// Load configuration and personal settings for current user
$fbConfig =& CKunenaConfig::getInstance();
// get right Language file
if (file_exists(KUNENA_FILE_LANGUAGE)) {
    include_once KUNENA_FILE_LANGUAGE;
} else {
    include_once KUNENA_FILE_LANGUAGE_DEFAULT;
}
$kn_tables =& CKunenaTables::getInstance();
if ($kn_tables->installed() === false) {
    $fbConfig->board_offline = 1;
}
// Permissions: Check for administrators and moderators
global $aro_group;
$kunena_acl =& JFactory::getACL();
if ($kunena_my->id != 0) {
    $aro_group = $kunena_acl->getAroGroup($kunena_my->id);
    $aro_group->id = $aro_group->id;
    $is_admin = strtolower($aro_group->name) == 'super administrator' || strtolower($aro_group->name) == 'administrator';
} else {
    $aro_group = new StdClass();
    $aro_group->id = 0;
    $is_admin = 0;
}
Esempio n. 2
0
 public function load($KunenaUser = null)
 {
     $tables = CKunenaTables::getInstance();
     if ($tables->check($this->GetConfigTableName())) {
         $this->_db->setQuery("SELECT * FROM " . $this->GetConfigTableName());
         $config = $this->_db->loadAssoc();
         check_dberror("Unable to load configuration table.");
         if ($config != null) {
             $this->bind($config);
         }
     }
     // Check for user specific overrides
     if (is_object($KunenaUser)) {
         // overload the settings with user specific ones
         $this->DoUserOverrides($KunenaUser);
         // Now the variables of the class contain the global settings
         // overloaded with the user specific ones
         // No other code changes required to support user specific settings.
     }
 }