}
// We only allow a founder to install this MOD
if ($user->data['user_type'] != USER_FOUNDER) {
    if ($user->data['user_id'] == ANONYMOUS) {
        login_box('', 'LOGIN');
    }
    trigger_error('NOT_AUTHORISED');
}
if (!class_exists('umil')) {
    include $phpbb_root_path . 'umil/umil.' . $phpEx;
}
$umil = new umil(true);
$mod = array('name' => 'Legend Repositioning', 'version' => '1.0.3', 'config' => 'legend_repositioning_version', 'enable' => 'legend_repositioning_enable');
if (confirm_box(true)) {
    // Install the base 1.0.3 version
    if (!$umil->config_exists($mod['config'])) {
        // Lets add a config setting for enabling/disabling the MOD and set it to true
        $umil->config_add($mod['enable'], true);
        // We must handle the version number ourselves.
        $umil->config_add($mod['config'], $mod['version']);
        $umil->table_column_add('phpbb_groups', 'group_position', array('UINT', '0'));
        // Select all groups that have no set position
        $sql = 'SELECT group_id
			FROM ' . GROUPS_TABLE . '
			WHERE group_position = 0';
        $result = $db->sql_query($sql);
        // Set default positions for groups (so that all positions are not set to 0)
        $group_position = 0;
        while ($row = $db->sql_fetchrow($result)) {
            $group_position++;
            $sql = 'UPDATE ' . GROUPS_TABLE . '
Esempio n. 2
0
}
// We only allow a founder install this MOD
if ($user->data['user_type'] != USER_FOUNDER) {
    if ($user->data['user_id'] == ANONYMOUS) {
        login_box('', 'LOGIN');
    }
    trigger_error('NOT_AUTHORISED');
}
if (!class_exists('umil')) {
    include $phpbb_root_path . 'umil/umil.' . $phpEx;
}
// If you want a completely stand alone version (able to use UMIL without messing with any of the language stuff) send true, otherwise send false
$umil = new umil(true);
if (confirm_box(true)) {
    // Install the base 0.3.0 version
    if (!$umil->config_exists('test_version')) {
        // Lets add a config setting named test_enable and set it to true
        $umil->config_add('test_enable', true);
        // We must handle the version number ourselves.
        $umil->config_add('test_version', '0.3.0');
    }
    switch ($config['test_version']) {
        // Update to 0.3.1
        case '0.3.0':
            // Now to add some permission settings.  Showing both the one at a time and "multicall" options
            $umil->permission_add('a_test_mod', true);
            $umil->permission_add(array(array('f_test_mod', false), array('u_test_mod', true)));
            // How about we give some default permissions then as well?
            $umil->permission_set(array(array('ROLE_ADMIN_FULL', 'a_test_mod'), array('ROLE_USER_FULL', 'u_test_mod'), array('GUESTS', 'u_test_mod', 'group'), array('ROLE_FORUM_STANDARD', 'f_test_mod')));
            // No breaks
            // Update to 0.7.0
Esempio n. 3
0
/**
 * checks if there is an older install then quit
 * only updates from 1.2.8 are allowed...
 *   @package bbdkp
 */
function check_oldbbdkp()
{
    global $user, $umil, $config, $phpbb_root_path, $phpEx;
    include $phpbb_root_path . 'umil/umil.' . $phpEx;
    $umil = new umil();
    // check config
    if ($umil->config_exists('bbdkp_version')) {
        if (version_compare($config['bbdkp_version'], '1.2.8') == -1) {
            //stop here, the version is less than 1.2.8
            trigger_error($user->lang['UMIL_128MINIMUM'], E_USER_WARNING);
        }
    }
}