Esempio n. 1
0
            $this->load->helper('security');
        }
        $salt = $this->generate_salt();
        $pass = do_hash($salt . $old);
        return array($pass, $salt);
    }
    //--------------------------------------------------------------------
    private function generate_salt()
    {
        if (!function_exists('random_string')) {
            $this->load->helper('string');
        }
        return random_string('alnum', 7);
    }
    //--------------------------------------------------------------------
    private function get_module_versions()
    {
        $mod_versions = array();
        $modules = module_files(null, 'migrations');
        if ($modules === false) {
            return false;
        }
        foreach ($modules as $module => $migrations) {
            $mod_versions[$module] = array('installed_version' => $this->migrations->get_schema_version($module . '_'), 'latest_version' => $this->migrations->get_latest_version($module . '_'), 'migrations' => $migrations['migrations']);
        }
        return $mod_versions;
    }
}
/* get module locations from config settings or use the default module location and offset */
Install::$locations = array(APPPATH . '../bonfire/modules/' => '../modules/');