Ejemplo n.º 1
0
        // Sprache löschen
        //collapse ist idclient
        $perm->check(21, 'clientlangs', $idlang);
        $clientname = getClientNameByIdclient($collapse);
        $langname = getLangByIdlang($lid);
        $errno = lang_delete_language($collapse, $lid);
        $errlog = $errno ? $errno : 0;
        //Log
        if ($errlog == 0) {
            $cms_log->info('user', 'clients_delete_lang', array('idclient' => $collapse, 'clientname' => $clientname, 'idlang' => $lid, 'name' => $langname));
        }
        // Event
        fire_event('clients_delete_lang', array('idclient' => $collapse, 'clientname' => $clientname, 'idlang' => $lid, 'name' => $langname, 'author' => $auth->auth['uid'], 'errno' => $errlog));
        break;
    case 'makestartlang':
        $clientname = getClientNameByIdclient((int) $_REQUEST['cid']);
        $langname = getLangByIdlang((int) $_REQUEST['lid']);
        $errno = lang_make_start_lang((int) $_REQUEST['cid'], (int) $_REQUEST['lid']);
        $errlog = $errno ? $errno : 0;
        //Log
        if ($errlog == 0) {
            $cms_log->info('user', 'clients_make_start_lang', array('idclient' => (int) $_REQUEST['cid'], 'clientname' => $clientname, 'idlang' => (int) $_REQUEST['lid'], 'name' => $langname));
        }
        // Event
        fire_event('clients_make_start_lang', array('idclient' => (int) $_REQUEST['cid'], 'clientname' => $clientname, 'idlang' => (int) $_REQUEST['lid'], 'name' => $langname, 'author' => $auth->auth['uid'], 'errno' => $errlog));
        break;
}
/******************************************************************************
 3. Eventuelle Dateien zur Darstellung includieren
******************************************************************************/
/******************************************************************************
Ejemplo n.º 2
0
function plug_delete($idplug, $idclient)
{
    global $db, $client, $cms_db, $cfg_cms, $rep, $perm, $cms_log;
    $ident = "idclient='" . $idclient . "'";
    $sql1 = "SELECT name, description, version, cat, author, created, lastmodified, repository_id, index_file, source_id, is_install, root_name from " . $cms_db['plug'] . " WHERE {$ident} AND idplug='{$idplug}'";
    $db->query($sql1);
    if ($db->next_record()) {
        $is_online = (bool) $db->f('is_install');
        $name = make_string_dump($db->f('name'));
        $description = make_string_dump($db->f('description'));
        $version = make_string_dump($db->f('version'));
        $cat = make_string_dump($db->f('cat'));
        $author = make_string_dump($db->f('author'));
        $created = make_string_dump($db->f('created'));
        $lastmodified = make_string_dump($db->f('lastmodified'));
        $repository_id = make_string_dump($db->f('repository_id'));
        $index_file = make_string_dump($db->f('index_file'));
        $author = make_string_dump($db->f('author'));
        $source = make_string_dump($db->f('source_id'));
        $root_dir = make_string_dump($db->f('root_name'));
        $is_multi = (bool) $rep->plug_execute($idplug, 'multi_client');
        if ($source >= 1) {
            $sql2 = "SELECT is_install, idclient from " . $cms_db['plug'] . " WHERE idplug='{$source}'";
            $db->query($sql2);
            if ($db->next_record()) {
                $is_online2 = (bool) $db->f('is_install');
                $idclient2 = $db->f('idclient');
                $is_multi2 = (bool) $rep->plug_execute($source, 'multi_client');
                $ident2 = "idclient='" . $idclient2 . "'";
                $is_online3 = $rep->plug_count('all', $source);
                $sql4 = "UPDATE " . $cms_db['plug'] . " SET is_install = '0' WHERE {$ident2} AND idplug = '{$source}'\n";
            }
        }
        $is_online4 = $rep->plug_count('all', $idplug);
        if ($is_online4 == 0) {
            $sql = "DELETE FROM " . $cms_db['plug'] . " WHERE {$ident} AND idplug='{$idplug}'";
            $db->query($sql);
            // Rechte l�schen
            $perm->delete_perms($idplug, 'plug', 0, 0, 0, true);
            // Uninstall Client
            if ($is_online && $is_multi2 && $is_online2) {
                $rep->plug_execute($source, 'uninstall', 'client', 'meta');
                //Log
                $cms_log->info('user', 'plug_uninstall_client', array('idplug' => $idplug, 'name' => $name, 'version' => $version, 'idclient' => $idclient, 'clientname' => getClientNameByIdclient($idclient)));
                // Event
                fire_event('plug_uninstall_client', array('idplug' => $idplug, 'name' => $name, 'description' => $description, 'version' => $version, 'cat' => $cat, 'idclient' => $idclient, 'author' => $author, 'created' => $created, 'lastmodified' => $lastmodified, 'repository_id' => $repository_id, 'source_id' => $source, 'root_name' => $root_dir, 'index_file' => $index_file, 'is_install' => $is_online, 'is_multi' => $is_multi));
                $return = '1607';
            } elseif ($is_online && $source == '') {
                $db->query($sql4);
                $rep->plug_execute($idplug, 'uninstall', '', 'meta');
                // Event
                fire_event('plug_uninstall_sql', array('idplug' => $idplug, 'name' => $name, 'description' => $description, 'version' => $version, 'cat' => $cat, 'repository_id' => $repository_id, 'source_id' => $source, 'root_name' => $root_dir, 'index_file' => $index_file, 'config' => $config, 'is_install' => $is_online, 'is_multi' => $is_multi));
                $return = '1607';
            } elseif ($idclient == 0 && $root_dir != '') {
                $rep->_remove($rep->_plugin_dir . $root_dir);
                // Event
                fire_event('plug_removed', array('idplug' => $idplug, 'name' => $name, 'description' => $description, 'version' => $version, 'cat' => $cat, 'idclient' => $idclient, 'author' => $author, 'created' => $created, 'lastmodified' => $lastmodified, 'repository_id' => $repository_id, 'source_id' => $source, 'root_name' => $root_dir, 'index_file' => $index_file, 'is_install' => $is_online, 'is_multi' => $is_multi));
            }
            // Uninstall Parent
            if ($is_online2 && $is_online3 == 1 && $sql4 != '') {
                $db->query($sql4);
                $rep->plug_execute($source, 'uninstall', '', 'meta');
                // Event
                fire_event('plug_uninstall_sql', array('idplug' => $idplug, 'name' => $name, 'description' => $description, 'version' => $version, 'cat' => $cat, 'repository_id' => $repository_id, 'source_id' => $source, 'root_name' => $root_dir, 'index_file' => $index_file, 'config' => $config, 'is_install' => $is_online, 'is_multi' => $is_multi));
            }
            //Log
            $cms_log->info('user', 'plug_delete', array('idplug' => $idplug, 'name' => $name, 'version' => $version));
            // Event
            fire_event('plug_delete', array('idplug' => $idplug, 'name' => $name, 'description' => $description, 'version' => $version, 'cat' => $cat, 'idclient' => $idclient, 'author' => $author, 'created' => $created, 'lastmodified' => $lastmodified, 'repository_id' => $repository_id, 'source_id' => $source, 'root_name' => $root_dir, 'index_file' => $index_file, 'is_install' => $is_online, 'is_multi' => $is_multi));
        } else {
            $return = '1601';
        }
    } else {
        $return = '1613';
    }
    return $return;
}