diff options
Diffstat (limited to 'core/helpers')
-rw-r--r-- | core/helpers/access.php | 8 | ||||
-rw-r--r-- | core/helpers/module.php | 16 |
2 files changed, 14 insertions, 10 deletions
diff --git a/core/helpers/access.php b/core/helpers/access.php index 95b9819c..e859b1d5 100644 --- a/core/helpers/access.php +++ b/core/helpers/access.php @@ -162,7 +162,7 @@ class access_Core { foreach (self::_get_all_groups() as $group) { self::_add_columns($perm_name, $group->id); } - self::_add_columns($perm_name, group::EVERYBODY); + self::_add_columns($perm_name, 0); } /** @@ -175,7 +175,7 @@ class access_Core { foreach (self::_get_all_groups() as $group) { self::_drop_columns($name, $group->id); } - self::_drop_columns($name, group::EVERYBODY); + self::_drop_columns($name, 0); ORM::factory("permission")->where("name", $name)->find()->delete(); } @@ -247,9 +247,9 @@ class access_Core { * @return ORM_Iterator */ private static function _get_all_groups() { - try { + if (module::is_installed("user")) { return ORM::factory("group")->find_all(); - } catch (Kohana_Database_Exception $e) { + } else { return array(); } } diff --git a/core/helpers/module.php b/core/helpers/module.php index 4d977268..ca5b5cfb 100644 --- a/core/helpers/module.php +++ b/core/helpers/module.php @@ -65,7 +65,8 @@ class module_Core { } } - public static function available($modules=array()) { + public static function available() { + $modules = array(); foreach (glob(MODPATH . "*/helpers/*_installer.php") as $file) { if (empty($modules[basename(dirname(dirname($file)))])) { $modules[basename(dirname(dirname($file)))] = 0; @@ -76,12 +77,15 @@ class module_Core { } public static function load_modules() { - $modules = Kohana::config('core.modules'); + try { + $modules = Kohana::config('core.modules'); - foreach (array_keys(self::available()) as $module_name) { - $modules[] = MODPATH . $module_name; - } + foreach (self::installed() as $module) { + $modules[] = MODPATH . $module->name; + } - Kohana::config_set('core.modules', $modules); + Kohana::config_set('core.modules', $modules); + } catch (Exception $e) { + } } } |