ilch Forum » Ilch Clan 1.1 » Allgemein » Anpassung Userverwaltung

Geschlossen
  1. #1
    User Pic
    ---Doc--- Mitglied
    Registriert seit
    05.08.2011
    Beitrge
    218
    Beitragswertungen
    4 Beitragspunkte
    Da unsere Seite recht viele User haben wird, ist die Verwaltung recht umständlich.
    Soll heißen, viele Mitglieder bei 20-30 Clanmitglieder.

    Da suche ich nach einer Möglichkeit im Backend bei der Userverwaltung der Filterung.
    Ich stelle es mir so vor, daß man im Backend auswählen kann ob nur User (Rechtelevel User/Superuser), nur Mitglieder (Rechtelevel Trial aufwärts) oder alle angezeigt werden sollen.

    Kann mir dabei jemand helfen? Leider übersteigt das meine Fähigkeiten nämlich bei weitem.

    Vielen Dank.
    0 Mitglieder finden den Beitrag gut.
  2. #2
    User Pic
    s4sch4 Mitglied
    Registriert seit
    09.12.2007
    Beitrge
    183
    Beitragswertungen
    5 Beitragspunkte
    also klar könnte man das machen, aber ganz ehrlich? ich hab auch nen clan und ich halte das für unnütz, weil ja rechts neben dem usernamen die drop-down mit aktuellem recht zu sehen ist, oder geht es dir darum das du auf anhieb die anzahl siehst?
    Visit me on: www.ITRoyal.de
    Visit my Clan: www.United-SportZ.de
    Mein ilch Modul: Höhrercharts v0.8 für OnlineRadios
    0 Mitglieder finden den Beitrag gut.
  3. #3
    User Pic
    ---Doc--- Mitglied
    Registriert seit
    05.08.2011
    Beitrge
    218
    Beitragswertungen
    4 Beitragspunkte
    Neben den 20-30 Membern haben wir 100-200 User.
    Man erreicht einfach den zu editierenden User/Member schneller, wenn man nur die eine Kategorie anzeigen läßt.

    Noch schneller wäre es natürlich, wenn man wie bei der Gruppeverwaltung ein Suchmodul hätte.

    Wir arbeiten mit Sonderrängen die man aufsteigt, daher greifen wir öfters auf die Backendverwaltung zurück.
    0 Mitglieder finden den Beitrag gut.
  4. #4
    User Pic
    s4sch4 Mitglied
    Registriert seit
    09.12.2007
    Beitrge
    183
    Beitragswertungen
    5 Beitragspunkte
    aha, also würdest du dann einfach nach den rängen filtern wollen um dann den einzelnen user schneller zu finden, ok...

    hab ihr ne standart include/admin/user.php oder is die schon modifiziert?
    Visit me on: www.ITRoyal.de
    Visit my Clan: www.United-SportZ.de
    Mein ilch Modul: Höhrercharts v0.8 für OnlineRadios
    0 Mitglieder finden den Beitrag gut.
  5. #5
    User Pic
    ---Doc--- Mitglied
    Registriert seit
    05.08.2011
    Beitrge
    218
    Beitragswertungen
    4 Beitragspunkte
    Sie ist modifziert, aber nur ein klein wenig. In der Richtung, daß die User nach Rängen sortiert dargestellt werden.
    0 Mitglieder finden den Beitrag gut.
  6. #6
    User Pic
    s4sch4 Mitglied
    Registriert seit
    09.12.2007
    Beitrge
    183
    Beitragswertungen
    5 Beitragspunkte
    ok dann poste sie mir mal bitte ich bau dir das eben ein...
    Visit me on: www.ITRoyal.de
    Visit my Clan: www.United-SportZ.de
    Mein ilch Modul: Höhrercharts v0.8 für OnlineRadios
    0 Mitglieder finden den Beitrag gut.
  7. #7
    User Pic
    ---Doc--- Mitglied
    Registriert seit
    05.08.2011
    Beitrge
    218
    Beitragswertungen
    4 Beitragspunkte
    user.php aus admin:

    <?php
    // Copyright by: Manuel
    // Support: www.ilch.de
    defined ('main') or die ('no direct access');
    defined ('admin') or die ('only admin access');
    
    function user_get_group_list ($uid) {
        $l = 'Mitglied in Gruppen:<br />';
        $erg = db_query("SELECT xic_groups.name FROM xic_groupusers LEFT JOIN xic_groups ON xic_groups.id = xic_groupusers.gid WHERE xic_groupusers.uid = " . $uid);
        while ($r = db_fetch_assoc($erg)) {
            $l .= '- ' . $r['name'] . '<br />';
        }
        return ($l);
    }
    
    function user_get_all_mod_list () {
        $l = '';
        $erg = db_query("SELECT DISTINCT name FROM xic_modules WHERE fright = 1 ORDER BY xic_modules.name");
        while ($r = db_fetch_assoc($erg)) {
            $x = $r['name'];
            $l .= '<th style="font-size: 9px; font-weight: normal;" title="' . $r['name'] . '" valign="bottom">' . $x . '</th>';
        }
        return ($l);
    }
    
    function user_get_mod_change_list ($uid) {
        $l = '';
        $erg = db_query("SELECT xic_modules.id, uid FROM xic_modules LEFT JOIN xic_modulerights ON xic_modulerights.mid = xic_modules.id AND xic_modulerights.uid = " . $uid . " WHERE fright = 1 ORDER BY xic_modules.name");
        while ($r = db_fetch_assoc($erg)) {
            if ($r['uid'] == '') {
                $c = '';
            } else {
                $c = ' checked';
            }
            $l .= '<td align="center"><input onclick="changeModulRecht(' . $r['id'] . ',' . $uid . ')" type="checkbox" id="MN' . $r['id'] . '-' . $uid . '" name="MN' . $r['id'] . '-' . $uid . '" ' . $c . ' /></td>';
        }
        return ($l);
    }
    
    function user_get_mod_list ($uid) {
        $l = 'Modulrechte:<br />';
        $erg = db_query("SELECT DISTINCT module FROM xic_modulerights WHERE uid = " . $uid);
        while ($r = db_fetch_assoc($erg)) {
            $l .= '- ' . $r['module'] . '<br />';
        }
        return ($l);
    }
    
    function getfl($gid) {
        $liste = '';
        $erg = db_query("SELECT view,name,reply,start,mods FROM xic_forums WHERE view = " . $gid . " OR reply = " . $gid . " OR start = " . $gid . " OR mods = " . $gid);
        while ($row = db_fetch_assoc($erg)) {
            $v = ($row['view'] == $gid ? 'sehen/lesen,' : '');
            $r = ($row['reply'] == $gid ? 'antworten,' : '');
            $s = ($row['start'] == $gid ? 'Themen starten,' : '');
            $m = ($row['mods'] == $gid ? 'Moderieren,' : '');
            $liste .= $row['name'] . '<span class="smalfont">(' . $v . $r . $s . $m . ')</span>&nbsp;';
        }
        return($liste);
    }
    
    if (isset($_POST['action'])) {
    	$design = new design ('Admins Area', 'Admins Area', 0);
    	$design->header();
    	$wdtext = 'Es ist ein Fehler aufgetreten.';
    	if (chk_antispam('adminuser_action', true) and isset($_POST['uid'])) {
    		$uid = escape($_POST['uid'], 'integer');
    		switch($_POST['action']){
    			// einen user komplett loeschen
    			case 'deleteUser':
    				$name = get_n($uid);
    				if ($uid != 1 and !empty($name)) {
    					user_remove($uid);
    					$wdtext = 'Der User ' . $name . ' wurde erfolgreich gel&ouml;scht.';
    				}
    				break;
    			// das recht eines users aendern
    			case 'changeRight' :
    				$altes_recht = db_result(db_query("SELECT recht FROM xic_user WHERE id = " . $uid), 0);
    				$neues_recht = escape($_POST['newright'], 'integer');
    				if (($neues_recht > $_SESSION['authright'] AND $altes_recht > $_SESSION['authright']) OR ($_SESSION['authid'] == 1 AND $uid != 1)) {
    					$q = "UPDATE xic_user SET recht = " . $neues_recht . " WHERE id = " . $uid;
    					db_query($q);
    				}
    				$wdtext = false;
    			break;
    			// modulrechte fuer einen user aendern
    			case 'changeModulRight' :
    				$modul = escape($_POST['modul'], 'integer');
    				$aktion = $_POST['giveremove'];
    				if ($aktion == 'give' AND 0 == db_result(db_query("SELECT COUNT(*) FROM xic_modulerights WHERE mid = '" . $modul . "' AND uid = " . $uid), 0)) {
    					db_query("INSERT INTO xic_modulerights (mid,uid) VALUES ('" . $modul . "'," . $uid . ")");
    				} elseif ($aktion == 'remove' AND 1 == db_result(db_query("SELECT COUNT(*) FROM xic_modulerights WHERE mid = '" . $modul . "' AND uid = " . $uid), 0)) {
    					db_query("DELETE FROM xic_modulerights WHERE mid = '" . $modul . "' AND uid = " . $uid);
    				}
    				$wdtext = false;
    			break;
    		}
    	}
    	if ($wdtext === false) {
    		$antispam = get_antispam('adminuser_action', 0, true);
    		?><script type="text/javascript"><!--
    		    function updateParent() { parent.setNewAntispam(document.getElementById('tmp').childNodes[0]);}
    		    window.onload = function() { updateParent(); };
    		    //--></script>
    		    <div id="tmp"><?php echo $antispam; ?></div>
    		<?php
    		exit;
    	}
    	wd('admin.php?' . $menu->get_complete(), $wdtext, 5);
    	$design->footer(1);
    }
    
    $um = $menu->get(1);
    switch ($um) {
        default :
            $design = new design ('Admins Area', 'Admins Area', 2);
            $design->header();
            $q = '';
            if (isset($_REQUEST['q'])) {
                $q = escape($_REQUEST['q'], 'string');
            }
            $tpl = new tpl ('user/user', 1);
            $tpl->set('modlall', user_get_all_mod_list());
            $tpl->set('anzmods', db_result(db_query("SELECT COUNT(*) FROM xic_modules WHERE fright = 1"), 0));
            $tpl->set('action_antispam', get_antispam('adminuser_action', 0, true));
            $tpl->set_out('q', unescape($q), 0);
    
            $q = str_replace('*', '%', $q);
            if (strpos($q, '%') === false) {
                $q = $q . '%';
            }
    
            $limit = 30; // Limit
            $page = ($menu->getA(1) == 'p' ? $menu->getE(1) : 1);
            $MPL = db_make_sites ($page , "WHERE name LIKE '" . $q . "'" , $limit , '?user' , 'user');
            $anfang = ($page - 1) * $limit;
            $class = '';
            $q = "SELECT name,recht,id FROM `xic_user` WHERE name LIKE '" . $q . "' ORDER by recht,name ASC LIMIT " . $anfang . "," . $limit;
            $erg = db_query($q);
            while ($row = db_fetch_object($erg)) {
                if ($class == 'Cmite') {
                    $class = 'Cnorm';
                } else {
                    $class = 'Cmite';
                }
                $ar = array ('name' => $row->name,
                    'class' => $class,
                    'id' => $row->id,
                    'grouplist' => user_get_group_list($row->id),
                    'recht' => dblistee($row->recht, "SELECT id,name FROM xic_grundrechte ORDER BY id ASC"),
                    'modslist' => user_get_mod_change_list($row->id),
                    );
    
                $tpl->set_ar_out($ar, 1);
            }
            $tpl->set_out('MPL', $MPL, 2);
            $design->footer();
            break;
    
        // gruppen zugehoerigkeiten eines users aendern
        case 'gruppen' :
            $uid = $menu->get(2);
            if (isset($_POST['usergroups'])) {
                $erg = db_query("SELECT id FROM xic_groups");
                while ($row = db_fetch_assoc($erg)) {
                    $ck = db_count_query("SELECT COUNT(uid) FROM xic_groupusers WHERE uid = " . $uid . " AND gid = " . $row['id']);
                    if ($ck == 0 AND isset ($_POST['grprhave'][$row['id']][$uid])) {
                        db_query("INSERT INTO xic_groupusers (uid,gid,fid) VALUES ( " . $uid . ", " . $row['id'] . ", 3 )");
                    } elseif ($ck == 1 AND !isset ($_POST['grprhave'][$row['id']][$uid])) {
                        db_query("DELETE FROM xic_groupusers WHERE uid = " . $uid . " AND gid = " . $row['id']);
                    }
                }
            }
    
            $user_name = db_result(db_query("SELECT name FROM xic_user WHERE id = " . $uid), 0);
            $tpl = new tpl ('user/gruppen', 1);
            $tpl->set_ar_out(array('username' => $user_name, 'userid' => $uid), 0);
            $class = 'Cnorm';
            $erg = db_query("SELECT name,id FROM xic_groups");
            while ($row = db_fetch_assoc($erg)) {
                $ck = db_count_query("SELECT COUNT(uid) FROM xic_groupusers WHERE uid = " . $uid . " AND gid = " . $row['id']);
                $row['ck'] = ($ck == 0 ? '' : 'checked');
                $class = ($class == 'Cnorm' ? 'Cmite' : 'Cnorm');
                $row['class'] = $class;
                $tpl->set_ar_out($row, 1);
            }
            $tpl->out(2);
            break;
    
        // details eines users anzeigen
        case 1 :
            $design = new design ('Admins Area', 'Admins Area', 2);
            $design->header();
            if (isset ($_REQUEST['uID'])) {
                $uid = $_REQUEST['uID'];
            } else {
                $uid = $menu->get(2);
            }
            $erg = db_query("SELECT name,email,id,recht,wohnort,homepage,aim,msn,icq,yahoo,status,staat,gebdatum,sig,opt_pm,opt_pm_popup,opt_mail,geschlecht,spezrank,game,spielerfahrungen,clan,map,waffe,essen,trinken,film,musik,sport,cpu,mainboard,ram,monitor,grafikkarte,soundkarte,festplatte,i_net_verbindung,tastatur,maus,jappy,facebook,wkw,studivz,myspace,youtube,avatar FROM xic_user WHERE id = '" . $uid . "'");
            if (db_num_rows($erg) == 0) {
                die ('Fehler: Username nicht gefunden <a href="?user">zur&uuml;ck</a>');
            } else {
                $row = db_fetch_assoc($erg);
    
                $tpl = new tpl ('user/details', 1);
                $row['recht'] = dbliste ($row['recht'] , $tpl, 'recht', "SELECT id,name FROM xic_grundrechte ORDER BY id ASC");
                $row['staat'] = '<option></option>' . arliste ($row['staat'] , get_nationality_array() , $tpl , 'staat');
                $row['spezrank'] = '<option></option>' . dbliste ($row['spezrank'], $tpl, 'spezrank', "SELECT id, bez FROM xic_ranks WHERE spez = 1 ORDER BY id");
    
                $row['geschlecht0'] = ($row['geschlecht'] < 1 ? 'checked' : '');
                $row['geschlecht1'] = ($row['geschlecht'] == 1 ? 'checked' : '');
                $row['geschlecht2'] = ($row['geschlecht'] == 2 ? 'checked' : '');
                if ($row['status'] == 1) {
                    $row['status1'] = 'checked';
                    $row['status0'] = '';
                } else {
                    $row['status1'] = '';
                    $row['status0'] = 'checked';
                }
                if ($row['opt_mail'] == 1) {
                    $row['opt_mail1'] = 'checked';
                    $row['opt_mail0'] = '';
                } else {
                    $row['opt_mail1'] = '';
                    $row['opt_mail0'] = 'checked';
                }
                if ($row['opt_pm'] == 1) {
                    $row['opt_pm1'] = 'checked';
                    $row['opt_pm0'] = '';
                } else {
                    $row['opt_pm1'] = '';
                    $row['opt_pm0'] = 'checked';
                }
                if ($row['opt_pm_popup'] == 1) {
                    $row['opt_pm_popup1'] = 'checked';
                    $row['opt_pm_popup0'] = '';
                } else {
                    $row['opt_pm_popup1'] = '';
                    $row['opt_pm_popup0'] = 'checked';
                }
                if (@file_exists($row['avatar'])) {
                    $row['avatar'] = '<img src="' . $row['avatar'] . '" border="0" /><br />' ;
                }else {
                    $row['avatar'] = '';
                }
                $row['antispam'] = get_antispam('adminuser', 0, true);
                $tpl->set_ar_out ($row, 0);
    
                profilefields_change ($row['id']);
    
                $tpl->out(1);
            }
            $design->footer();
            break;
        // details des users aendern
        case 2 :
            $design = new design ('Admins Area', 'Admins Area', 2);
            $design->header();
            $changeok = true;
            $uid = escape($_POST['uID'], 'integer');
    
            $altes_recht = db_result(db_query("SELECT recht FROM xic_user WHERE id = " . $uid), 0);
            $neues_recht = escape($_POST['urecht'], 'integer');
            if (($neues_recht <= $_SESSION['authright'] OR $altes_recht <= $_SESSION['authright']) AND $_SESSION['authid'] > 1) {
                $changeok = false;
            }
    
            if ($changeok and chk_antispam('adminuser', true)) {
                if (isset($_POST['userdel'])) {
                    user_remove($uid);
                    wd ('?user', 'User wurde erfolgreich gel&ouml;scht');
                } else {
                    $abf = "SELECT * FROM xic_user WHERE id = '" . $uid . "'";
                    $erg = db_query($abf);
                    $row = db_fetch_object($erg);
    
                    if (isset($_POST['passw'])) {
                        $newPass = genkey (8);
                        $newPassMD5 = md5($newPass);
                        icmail ($row->email , 'neues Password' , "Hallo\n\nDein Password wurde soeben von einem Administrator gendert es ist nun:\n\n$newPass\n\nGru der Administrator");
                        db_query('UPDATE `xic_user` SET pass = "' . $newPassMD5 . '" WHERE id = "' . escape($_POST['uID'], 'integer') . '"');
                    }
                    // avatar speichern START
                    $avatar_sql_update = '';
                    if (!empty ($_FILES['avatarfile']['name'])) {
                        $file_tmpe = $_FILES['avatarfile']['tmp_name'];
                        $rile_type = ic_mime_type ($_FILES['avatarfile']['tmp_name']);
                        $file_type = $_FILES['avatarfile']['type'];
                        $file_size = $_FILES['avatarfile']['size'];
                        $fmsg = $lang['avatarisnopicture'];
                        $size = @getimagesize ($file_tmpe);
                        $endar = array (1 => 'gif', 2 => 'jpg', 3 => 'png');
                        if (($size[2] == 1 OR $size[2] == 2 OR $size[2] == 3) AND $size[0] > 10 AND $size[1] > 10 AND substr ($file_type , 0 , 6) == 'image/' AND substr ($rile_type , 0 , 6) == 'image/') {
                            $endung = $endar[$size[2]];
                            $breite = $size[0];
                            $hoehe = $size[1];
                            $neuer_name = 'include/images/avatars/' . $uid . '.' . $endung;
                            @unlink (db_result(db_query("SELECT avatar FROM xic_user WHERE id = " . $uid), 0));
                            move_uploaded_file ($file_tmpe , $neuer_name);
                            @chmod($neuer_name, 0777);
                            $avatar_sql_update = ', avatar = "' . $neuer_name . '"';
                            $fmsg = $lang['pictureuploaded'];
                        }
                    } elseif (isset($_POST['avatardel'])) {
                        $fmsg = $lang['picturedelete'];
                        @unlink (db_result(db_query("SELECT avatar FROM xic_user WHERE id = " . $uid), 0));
                        $avatar_sql_update = ', avatar = ""';
                    }
                    // avatar speichern ENDE
                    profilefields_change_save (escape($_POST['uID'], 'integer'));
                    $usaName1 = escape($_POST['usaName1'], 'string');
                    $email = escape($_POST['email'], 'string');
                    $homepage = escape($_POST['homepage'], 'string');
                    $wohnort = escape($_POST['wohnort'], 'string');
                    $icq = escape($_POST['icq'], 'string');
                    $msn = escape($_POST['msn'], 'string');
                    $yahoo = escape($_POST['yahoo'], 'string');
                    $aim = escape($_POST['aim'], 'string');
                    $staat = escape($_POST['staat'], 'string');
                    $spezrank = escape($_POST['spezrank'], 'integer');
                    $geschlecht = escape($_POST['geschlecht'], 'integer');
                    $status = escape($_POST['status'], 'integer');
                    $opt_mail = escape($_POST['opt_mail'], 'integer');
                    $opt_pm = escape($_POST['opt_pm'], 'integer');
                    $opt_pm_popup = escape($_POST['opt_pm_popup'], 'integer');
                    $gebdatum = escape($_POST['gebdatum'], 'string');
                    $game = escape($_POST['game'], 'string');
                    $spielerfahrungen = escape($_POST['spielerfahrungen'], 'string');
                    $clan = escape($_POST['clan'], 'string');
                    $map = escape($_POST['map'], 'string');
                    $waffe = escape($_POST['waffe'], 'string');
                    $essen = escape($_POST['essen'], 'string');
                    $trinken = escape($_POST['trinken'], 'string');
                    $film = escape($_POST['film'], 'string');
                    $musik = escape($_POST['musik'], 'string');
                    $sport = escape($_POST['sport'], 'string');
                    $cpu = escape($_POST['cpu'], 'string');
                    $mainboard = escape($_POST['mainboard'], 'string');
                    $ram = escape($_POST['ram'], 'string');
                    $monitor = escape($_POST['monitor'], 'string');
                    $grafikkarte = escape($_POST['grafikkarte'], 'string');
                    $soundkarte = escape($_POST['soundkarte'], 'string');
                    $festplatte = escape($_POST['festplatte'], 'string');
                    $i_net_verbindung = escape($_POST['i_net_verbindung'], 'string');
                    $tastatur= escape($_POST['tastatur'], 'string');
                    $maus = escape($_POST['maus'], 'string');
                    $jappy = escape($_POST['jappy'], 'string');
                    $facebook = escape($_POST['facebook'], 'string');
                    $wkw = escape($_POST['wkw'], 'string');
                    $studivz = escape($_POST['studivz'], 'string');
                    $myspace = escape($_POST['myspace'], 'string');
                    $youtube = escape($_POST['youtube'], 'string');
                    $sig = escape($_POST['sig'], 'string');
                    // Name im Forum ndern
                    if ($_POST['forumname'] == 'on') {
                        $oldname = db_count_query("SELECT name FROM `xic_user` WHERE id =" . $uid);
                        if ($oldname != $usaName1) {
                            db_query("UPDATE `xic_posts` SET erst = '$usaName1' WHERE erstid = " . $uid);
                            db_query("UPDATE `xic_topics` SET erst = '$usaName1' WHERE erst = '$oldname'");
                        }
                    }
                    db_query('UPDATE xic_user
    			  SET
    					name  = "' . $usaName1 . '",
    					recht = "' . $neues_recht . '",
    					email = "' . $email . '",
              homepage = "' . $homepage . '",
              wohnort = "' . $wohnort . '",
              icq = "' . $icq . '",
              msn = "' . $msn . '",
              yahoo = "' . $yahoo . '",
              aim = "' . $aim . '",
              staat = "' . $staat . '",
              spezrank = "' . $spezrank . '",
              geschlecht = "' . $geschlecht . '",
              status = "' . $status . '",
              opt_mail = "' . $opt_mail . '",
              opt_pm = "' . $opt_pm . '",
              opt_pm_popup = "' . $opt_pm_popup . '",
              gebdatum = "' . $gebdatum . '",
              game = "' . $game . '",
              spielerfahrungen = "' . $spielerfahrungen . '",
              clan = "' . $clan . '",
              map = "' . $map . '",
              waffe = "' . $waffe . '",
              essen = "' . $essen . '",
              trinken = "' . $trinken . '",
              film = "' . $film . '",
              musik = "' . $musik . '",
              sport = "' . $sport . '",
              cpu = "' . $cpu . '",
              mainboard = "' . $mainboard . '",
              ram = "' . $ram . '",
              monitor = "' . $monitor . '",
              grafikkarte = "' . $grafikkarte . '",
              soundkarte = "' . $soundkarte . '",
              festplatte = "' . $festplatte . '",
              i_net_verbindung = "' . $i_net_verbindung . '",
              tastatur = "' . $tastatur . '",
              maus = "' . $maus . '",
              jappy = "' . $jappy . '",
              facebook = "' . $facebook . '",
              wkw = "' . $wkw . '",
              studivz = "' . $studivz . '",
              myspace = "' . $myspace . '",
              youtube = "' . $youtube . '",
              sig = "' . $sig . '"
              ' . $avatar_sql_update . '
    				WHERE id = "' . $uid . '"');
                }
            }
            wd('admin.php?user-1-' . $uid, 'Das Profil wurde erfolgreich geaendert', 2);
            $design->footer();
            break;
        // mal kurz nen neuen user anlegen
        case 'createNewUser' :
            $msg = '';
            if (!empty($_POST['name']) AND !empty($_POST['pass']) AND !empty($_POST['email']) and chk_antispam('adminuser_create', true)) {
                $_POST['name'] = escape($_POST['name'], 'string');
                $_POST['recht'] = escape($_POST['recht'], 'integer');
                $_POST['email'] = escape($_POST['email'], 'string');
                $erg = db_query("SELECT id FROM xic_user WHERE name = BINARY '" . $_POST['name'] . "'");
                if (db_num_rows($erg) > 0) {
                    $msg = 'Der Name ist leider schon vorhanden!';
                } else {
                    $new_pass = $_POST['pass'];
                    $md5_pass = md5($new_pass);
                    db_query("INSERT INTO xic_user (name,pass,recht,regist,llogin,email)
    		    VALUES('" . $_POST['name'] . "','" . $md5_pass . "'," . $_POST['recht'] . ",'" . time() . "','" . time() . "','" . $_POST['email'] . "')");
                    $userid = db_last_id();
                    db_query("INSERT INTO xic_userfields (uid,fid,val) VALUES (" . $userid . ",2,'1')");
                    db_query("INSERT INTO xic_userfields (uid,fid,val) VALUES (" . $userid . ",3,'1')");
    
                    if (isset($_POST['info'])) {
                        $page = $_SERVER["HTTP_HOST"] . $_SERVER["SCRIPT_NAME"];
                        $page = str_replace('admin.php', 'index.php', $page);
                        $tpl = new tpl ('user/new_user_email', 1);
                        $tpl->set('name', $_POST['name']);
                        $tpl->set('pass', $_POST['pass']);
                        $tpl->set('page', $page);
                        $txt = $tpl->get(0);
                        unset($tpl);
                        icmail ($_POST['email'], 'Admin hat dich angelegt', $txt);
                    }
                    $msg = 'Benutzer angelegt <a href="javascript:closeThisWindow()">Fenster schlieen</a>';
                }
            }
            $pass = '';
            $email = '';
            $recht = '';
            if (isset($_POST['pass'])) {
                $pass = $_POST['pass'];
            }
            if (isset($_POST['email'])) {
                $email = $_POST['email'];
            }
            if (isset($_POST['recht'])) {
                $recht = $_POST['recht'];
            } else {
                $recht = '-1';
            }
            $tpl = new tpl ('user/new_user', 1);
            $tpl->set('msg', $msg);
            $tpl->set('pass', $pass);
            $tpl->set('email', $email);
            $tpl->set('recht', dblistee($recht, "SELECT id,name FROM xic_grundrechte ORDER BY id ASC"));
        	$tpl->set('antispam', get_antispam('adminuser_create', 0, true));
            $tpl->out(0);
            break;
    }
    
    ?>


    Vielen Dank.
    0 Mitglieder finden den Beitrag gut.
  8. #8
    User Pic
    s4sch4 Mitglied
    Registriert seit
    09.12.2007
    Beitrge
    183
    Beitragswertungen
    5 Beitragspunkte
    aso sry deine include/admin/template/user/user.htm brauch ich auch noch
    Visit me on: www.ITRoyal.de
    Visit my Clan: www.United-SportZ.de
    Mein ilch Modul: Höhrercharts v0.8 für OnlineRadios
    0 Mitglieder finden den Beitrag gut.
  9. #9
    User Pic
    ---Doc--- Mitglied
    Registriert seit
    05.08.2011
    Beitrge
    218
    Beitragswertungen
    4 Beitragspunkte
    Hätte mir eigentlich auch bewußt sein müssen. Hier ist sie:

    <script language="JavaScript" type="text/javascript">
    <!--
    function createNamedElement(type, name) {
       var element = null;
       // Try the IE way; this fails on standards-compliant browsers
       try {
          element = document.createElement('<'+type+' name="'+name+'">');
       } catch (e) {
       }
       if (!element || element.nodeName != type.toUpperCase()) {
          // Non-IE browser; use canonical method to create named element
          element = document.createElement(type);
          element.name = name;
       }
       return element;
    }
    
      function setufocus() {
        document.f.q.focus();
      }
      // manage div ...
      document.onmousemove = checkPosition;
      function checkPosition(e) {
        if(document.all) {
          mausX = event.clientX + document.body.scrollLeft;
          mausY = event.clientY + document.body.scrollTop;
        } else {
          mausX = e.pageX;
          mausY = e.pageY;
        }
    
      }
      function alertpos(dname) {
      if (document.layers) {
        document.layers[0].left = mausX;
        document.layers[0].top = mausY;
      } else if (document.getElementById) {
        document.getElementById(dname).style.left = (mausX + 10) + "px";
        document.getElementById(dname).style.top = (mausY + 50 ) + "px";
      }
      document.getElementById(dname).style.display = "inline";
      }
      function hiddpos(dname) {
        document.getElementById(dname).style.display = "none";
      }
      function changeUserRight (id1) {
        var x = confirm ( 'Das Recht dieses Users wirklich aendern?' );
        if (x) {
          var options = {
            'action' : 'changeRight',
          	'uid' : id1,
          	'newright' : document.getElementById('recht'+id1).value
          };
    	  var frm = setIframe(options);
    	  frm.submit();
        }
      }
      function changeGruppen (id1) {
        var Fenster = window.open ('admin.php?user-gruppen-' + id1, 'changeGruppen', 'status=yes,scrollbars=yes,height=500,width=250,left=300,top=50');
        Fenster.focus();
      }
      function changeModulrecht (id1) {
        var Fenster = window.open ('admin.php?user-modulrecht-' + id1, 'changeModulrecht', 'status=yes,scrollbars=yes,height=500,width=250,left=300,top=50');
        Fenster.focus();
      }
      function deleteUser (id1) {
        var x = confirm ( 'Diesen User wirklich komplett entfernen?' );
        if (x) {
        	document.getElementById('af_action').value = 'deleteUser';
    		document.getElementById('af_uid').value = id1;
    		document.getElementById('actionForm').submit();
        }
      }
      function changeModulRecht ( modul, uid ) {
          var action = ( document.getElementById("MN" + modul + "-" + uid).checked == true ) ? 'give' : 'remove';
          var options = {
            'action' : 'changeModulRight',
          	'uid' : uid,
          	'giveremove' : action,
          	'modul' : modul
          };
    	  var frm = setIframe(options);
    	  frm.submit();
      }
      function setIframe(fields){
      	var ifrm = window.frames['ifrm']; //document.getElementById('ifrm');
    	var frm2 = document.getElementById('actionForm').cloneNode(true);
    	frm2.setAttribute('action', 'admin.php?user');
    	for (var f in fields){
    		if (frm2.elements[f] != undefined) {
    			frm2.elements[f].value = fields[f];
    		} else {
    		    var i = createNamedElement('input', f);
    		    i.setAttribute('type', 'hidden');
    		    i.setAttribute('value', fields[f]);
    		    frm2.appendChild(i);
    		}
    	}
    	if (document.all) {
    		ifrm.document.write(frm2.outerHTML);
    		frm2 = ifrm.document.all.actionForm;
    	} else {
    		ifrm.document.body.appendChild(frm2);
    	}
    	return frm2;
      }
      function setNewAntispam(element){
      	document.getElementById('actionForm').elements['antispam_id'].value = element.value;
      }
    //-->
    </script>
    <div style="float:right"><a href="admin.php?puser">Noch nicht best&auml;tigte Registrierungen verwalten</a></div>
    <form id="actionForm" id="actionForm" method="post">
    {action_antispam}
    <input type="hidden" name="action" id="af_action" value="" />
    <input type="hidden" name="uid" id="af_uid" value="0" />
    </form>
    <iframe name="ifrm" id="ifrm" style="display:none;"></iframe>
    <body onload="setufocus()">
    <form action="admin.php" name="f" method="GET" style="padding: 0px; margin:0px 0px 0px 0px;" >
      <input type="hidden" name="user" value="" />
    <table cellpadding="3" cellspacing="1" border="0" class="border" style="float:left">
      <tr>
        <td class="Cmite"><input name="q" value="{q}" /></td>
        <td class="Cdark"><input type="submit" value="Suchen" /></td>
      </tr>
    </table>
    </form>
    <br />
    <br />
    <br />
    <table cellpadding="3" cellspacing="1" border="0" class="border">
      <tr>
        <td colspan="6"></td>
        <td class="Cmite" colspan="{anzmods}"><b>Modulrechte:</b></td>
      </tr>
      <tr class="Chead">
        <th>Name</th>
        <th>Recht</th>
        <th>Gruppe</th>
        <th></th>
        <th></th>
        <th class="border">&nbsp;&nbsp;</th>
        {modlall}
      </tr>
     {EXPLODE}
    
    
    
      <tr class="{class}">
        <td><div onmouseover="hiddpos('groupdiv{id}')" id="groupdiv{id}" style="position:absolute; top:50px; left:50px; display:none; width:200px;">
    <table width="100%" class="border" border="0" cellspacing="1" cellpadding="4">
      <tr>
        <td class="{class}" align="left">{grouplist}</td>
      </tr>
    </table>
    </div><strong>{name}</strong></td>
        <td><select id="recht{id}" onChange="changeUserRight({id})">{recht}</select></td>
        <td style="text-align: center;"><a onmouseout="hiddpos('groupdiv{id}')" onmouseover="alertpos('groupdiv{id}')" href="javascript:changeGruppen({id})" title="hier die Gruppenzugeh&ouml;rigkeit &auml;ndern">Gruppen</a></td>
        <td>&nbsp;<a href="admin.php?user-1-{id}"><img src="include/images/icons/edit.gif" border="0" title="&auml;ndern" alt="&auml;ndern" /></a>&nbsp;</td>
        <td>&nbsp;<a href="javascript:deleteUser({id})"><img src="include/images/icons/del.gif" border="0" title="l&ouml;schen" alt="l&ouml;schen" /></a>&nbsp;</td>
        <td class="border"></td>
        {modslist}
      </tr>
     {EXPLODE}
    </table>
    {MPL}
    0 Mitglieder finden den Beitrag gut.
  10. #10
    User Pic
    s4sch4 Mitglied
    Registriert seit
    09.12.2007
    Beitrge
    183
    Beitragswertungen
    5 Beitragspunkte
    einmal die .php:

    <?php
    // Copyright by: Manuel
    // Support: www.ilch.de
    defined ('main') or die ('no direct access');
    defined ('admin') or die ('only admin access');
    
    function user_get_group_list ($uid) {
        $l = 'Mitglied in Gruppen:<br />';
        $erg = db_query("SELECT xic_groups.name FROM xic_groupusers LEFT JOIN xic_groups ON xic_groups.id = xic_groupusers.gid WHERE xic_groupusers.uid = " . $uid);
        while ($r = db_fetch_assoc($erg)) {
            $l .= '- ' . $r['name'] . '<br />';
        }
        return ($l);
    }
    
    function user_get_all_mod_list () {
        $l = '';
        $erg = db_query("SELECT DISTINCT name FROM xic_modules WHERE fright = 1 ORDER BY xic_modules.name");
        while ($r = db_fetch_assoc($erg)) {
            $x = $r['name'];
            $l .= '<th style="font-size: 9px; font-weight: normal;" title="' . $r['name'] . '" valign="bottom">' . $x . '</th>';
        }
        return ($l);
    }
    
    function user_get_mod_change_list ($uid) {
        $l = '';
        $erg = db_query("SELECT xic_modules.id, uid FROM xic_modules LEFT JOIN xic_modulerights ON xic_modulerights.mid = xic_modules.id AND xic_modulerights.uid = " . $uid . " WHERE fright = 1 ORDER BY xic_modules.name");
        while ($r = db_fetch_assoc($erg)) {
            if ($r['uid'] == '') {
                $c = '';
            } else {
                $c = ' checked';
            }
            $l .= '<td align="center"><input onclick="changeModulRecht(' . $r['id'] . ',' . $uid . ')" type="checkbox" id="MN' . $r['id'] . '-' . $uid . '" name="MN' . $r['id'] . '-' . $uid . '" ' . $c . ' /></td>';
        }
        return ($l);
    }
    
    function user_get_mod_list ($uid) {
        $l = 'Modulrechte:<br />';
        $erg = db_query("SELECT DISTINCT module FROM xic_modulerights WHERE uid = " . $uid);
        while ($r = db_fetch_assoc($erg)) {
            $l .= '- ' . $r['module'] . '<br />';
        }
        return ($l);
    }
    
    function getfl($gid) {
        $liste = '';
        $erg = db_query("SELECT view,name,reply,start,mods FROM xic_forums WHERE view = " . $gid . " OR reply = " . $gid . " OR start = " . $gid . " OR mods = " . $gid);
        while ($row = db_fetch_assoc($erg)) {
            $v = ($row['view'] == $gid ? 'sehen/lesen,' : '');
            $r = ($row['reply'] == $gid ? 'antworten,' : '');
            $s = ($row['start'] == $gid ? 'Themen starten,' : '');
            $m = ($row['mods'] == $gid ? 'Moderieren,' : '');
            $liste .= $row['name'] . '<span class="smalfont">(' . $v . $r . $s . $m . ')</span>&nbsp;';
        }
        return($liste);
    }
    
    if (isset($_POST['action'])) {
    	$design = new design ('Admins Area', 'Admins Area', 0);
    	$design->header();
    	$wdtext = 'Es ist ein Fehler aufgetreten.';
    	if (chk_antispam('adminuser_action', true) and isset($_POST['uid'])) {
    		$uid = escape($_POST['uid'], 'integer');
    		switch($_POST['action']){
    			// einen user komplett loeschen
    			case 'deleteUser':
    				$name = get_n($uid);
    				if ($uid != 1 and !empty($name)) {
    					user_remove($uid);
    					$wdtext = 'Der User ' . $name . ' wurde erfolgreich gel&ouml;scht.';
    				}
    				break;
    			// das recht eines users aendern
    			case 'changeRight' :
    				$altes_recht = db_result(db_query("SELECT recht FROM xic_user WHERE id = " . $uid), 0);
    				$neues_recht = escape($_POST['newright'], 'integer');
    				if (($neues_recht > $_SESSION['authright'] AND $altes_recht > $_SESSION['authright']) OR ($_SESSION['authid'] == 1 AND $uid != 1)) {
    					$q = "UPDATE xic_user SET recht = " . $neues_recht . " WHERE id = " . $uid;
    					db_query($q);
    				}
    				$wdtext = false;
    			break;
    			// modulrechte fuer einen user aendern
    			case 'changeModulRight' :
    				$modul = escape($_POST['modul'], 'integer');
    				$aktion = $_POST['giveremove'];
    				if ($aktion == 'give' AND 0 == db_result(db_query("SELECT COUNT(*) FROM xic_modulerights WHERE mid = '" . $modul . "' AND uid = " . $uid), 0)) {
    					db_query("INSERT INTO xic_modulerights (mid,uid) VALUES ('" . $modul . "'," . $uid . ")");
    				} elseif ($aktion == 'remove' AND 1 == db_result(db_query("SELECT COUNT(*) FROM xic_modulerights WHERE mid = '" . $modul . "' AND uid = " . $uid), 0)) {
    					db_query("DELETE FROM xic_modulerights WHERE mid = '" . $modul . "' AND uid = " . $uid);
    				}
    				$wdtext = false;
    			break;
    		}
    	}
    	if ($wdtext === false) {
    		$antispam = get_antispam('adminuser_action', 0, true);
    		?><script type="text/javascript"><!--
    		    function updateParent() { parent.setNewAntispam(document.getElementById('tmp').childNodes[0]);}
    		    window.onload = function() { updateParent(); };
    		    //--></script>
    		    <div id="tmp"><?php echo $antispam; ?></div>
    		<?php
    		exit;
    	}
    	wd('admin.php?' . $menu->get_complete(), $wdtext, 5);
    	$design->footer(1);
    }
    $filter22 = '';
    $que22 = db_query("SELECT * FROM xic_grundrechte");
    
    	$filter22 .= '<select name="filter22"><option value="">Recht whlen</option>';
    	
    	while($wor22 = db_fetch_object($que22)) {
    	$filter22 .= '<option value="'.$wor22->id.'">'.$wor22->name.'</option>';
    	}
    	
    	$filter22 .= '</select><input type="checkbox" value="1" name="check"> Suche mit einbeziehen? (falls recht gewhlt)';
    	
    $um = $menu->get(1);
    switch ($um) {
        default :
    	
    
    	
    	
    	
            $design = new design ('Admins Area', 'Admins Area', 2);
            $design->header();
            $q = '';
            if (isset($_REQUEST['q'])) {
                $q = escape($_REQUEST['q'], 'string');
            } 
            $tpl = new tpl ('user/user', 1);
            $tpl->set('modlall', user_get_all_mod_list());
            $tpl->set('anzmods', db_result(db_query("SELECT COUNT(*) FROM xic_modules WHERE fright = 1"), 0));
            $tpl->set('action_antispam', get_antispam('adminuser_action', 0, true));
    		$tpl->set('filter22', $filter22, 0);
            $tpl->set_out('q', unescape($q), 0);
    
            $q = str_replace('*', '%', $q);
            if (strpos($q, '%') === false) {
                $q = $q . '%';
            }
    
            $limit = 30; // Limit
            $page = ($menu->getA(1) == 'p' ? $menu->getE(1) : 1);
    		$MPL = db_make_sites ($page , "WHERE name LIKE '" . $q . "'" , $limit , '?user' , 'user');
    		if(isset($_GET['filter22'])) {
    		$gid = escape($_GET['filter22'], 'integer');
            $MPL = db_make_sites ($page , "WHERE name LIKE '" . $q . "' AND recht = '" . $gid . "'" , $limit , '?user' , 'user');
    		}
    		
            $anfang = ($page - 1) * $limit;
            $class = '';
    		
    		$que = "SELECT name,recht,id FROM `xic_user` WHERE name LIKE '" . $q . "' ORDER by recht,posts DESC LIMIT " . $anfang . "," . $limit;
    		
    		if (isset($_REQUEST['check'])) {
    		$gid = escape($_REQUEST['filter22'], 'string');
    		$que = "SELECT name,recht,id FROM `xic_user` WHERE name LIKE '" . $q . "' AND recht = '" . $gid . "' ORDER by recht,posts DESC LIMIT " . $anfang . "," . $limit;
    		} elseif($_REQUEST['filter22']) {
    		$gid = escape($_REQUEST['filter22'], 'string');
    		$que = "SELECT name,recht,id FROM `xic_user` WHERE recht = '" . $gid . "' ORDER by recht,posts DESC LIMIT " . $anfang . "," . $limit;
    		}
    		
    		
            $erg = db_query($que);
            while ($row = db_fetch_object($erg)) {
                if ($class == 'Cmite') {
                    $class = 'Cnorm';
                } else {
                    $class = 'Cmite';
                }
                $ar = array ('name' => $row->name,
                    'class' => $class,
                    'id' => $row->id,
                    'grouplist' => user_get_group_list($row->id),
                    'recht' => dblistee($row->recht, "SELECT id,name FROM xic_grundrechte ORDER BY id ASC"),
                    'modslist' => user_get_mod_change_list($row->id),
                    );
    
                $tpl->set_ar_out($ar, 1);
            }
            $tpl->set_out('MPL', $MPL, 2);
            $design->footer();
            break;
    		
    		
    	case 'filter' :
            $gid = escape($_POST['filter22'], 'string');
            
    		
    		$design = new design ('Admins Area', 'Admins Area', 2);
            $design->header();
            $q = '';
            if (isset($_REQUEST['q'])) {
                $q = escape($_REQUEST['q'], 'string');
            }
            $tpl = new tpl ('user/user', 1);
            $tpl->set('modlall', user_get_all_mod_list());
            $tpl->set('anzmods', db_result(db_query("SELECT COUNT(*) FROM xic_modules WHERE fright = 1"), 0));
            $tpl->set('action_antispam', get_antispam('adminuser_action', 0, true));
    		$tpl->set('filter22', $filter22, 0);
            $tpl->set_out('q', unescape($q), 0);
    
            $q = str_replace('*', '%', $q);
            if (strpos($q, '%') === false) {
                $q = $q . '%';
            }
    
            $limit = 30; // Limit
            $page = ($menu->getA(1) == 'p' ? $menu->getE(1) : 1);
            $MPL = db_make_sites ($page , "WHERE name LIKE '" . $q . "' AND recht = '" . $gid . "'" , $limit , '?user' , 'user');
            $anfang = ($page - 1) * $limit;
            $class = '';
            $q = "SELECT name,recht,id FROM `xic_user` WHERE name LIKE '" . $q . "' AND recht = '$gid' ORDER by recht,posts DESC LIMIT " . $anfang . "," . $limit;
            $erg = db_query($q);
            while ($row = db_fetch_object($erg)) {
                if ($class == 'Cmite') {
                    $class = 'Cnorm';
                } else {
                    $class = 'Cmite';
                }
                $ar = array ('name' => $row->name,
                    'class' => $class,
                    'id' => $row->id,
                    'grouplist' => user_get_group_list($row->id),
                    'recht' => dblistee($row->recht, "SELECT id,name FROM xic_grundrechte ORDER BY id ASC"),
                    'modslist' => user_get_mod_change_list($row->id),
                    );
    
                $tpl->set_ar_out($ar, 1);
            }
            $tpl->set_out('MPL', $MPL, 2);
            $design->footer();
    		
            break;	
    		
    		
    
        // gruppen zugehoerigkeiten eines users aendern
        case 'gruppen' :
            $uid = $menu->get(2);
            if (isset($_POST['usergroups'])) {
                $erg = db_query("SELECT id FROM xic_groups");
                while ($row = db_fetch_assoc($erg)) {
                    $ck = db_count_query("SELECT COUNT(uid) FROM xic_groupusers WHERE uid = " . $uid . " AND gid = " . $row['id']);
                    if ($ck == 0 AND isset ($_POST['grprhave'][$row['id']][$uid])) {
                        db_query("INSERT INTO xic_groupusers (uid,gid,fid) VALUES ( " . $uid . ", " . $row['id'] . ", 3 )");
                    } elseif ($ck == 1 AND !isset ($_POST['grprhave'][$row['id']][$uid])) {
                        db_query("DELETE FROM xic_groupusers WHERE uid = " . $uid . " AND gid = " . $row['id']);
                    }
                }
            }
    
            $user_name = db_result(db_query("SELECT name FROM xic_user WHERE id = " . $uid), 0);
            $tpl = new tpl ('user/gruppen', 1);
            $tpl->set_ar_out(array('username' => $user_name, 'userid' => $uid), 0);
            $class = 'Cnorm';
            $erg = db_query("SELECT name,id FROM xic_groups");
            while ($row = db_fetch_assoc($erg)) {
                $ck = db_count_query("SELECT COUNT(uid) FROM xic_groupusers WHERE uid = " . $uid . " AND gid = " . $row['id']);
                $row['ck'] = ($ck == 0 ? '' : 'checked');
                $class = ($class == 'Cnorm' ? 'Cmite' : 'Cnorm');
                $row['class'] = $class;
                $tpl->set_ar_out($row, 1);
            }
            $tpl->out(2);
            break;
    
        // details eines users anzeigen
        case 1 :
            $design = new design ('Admins Area', 'Admins Area', 2);
            $design->header();
            if (isset ($_REQUEST['uID'])) {
                $uid = $_REQUEST['uID'];
            } else {
                $uid = $menu->get(2);
            }
            $erg = db_query("SELECT name,email,id,recht,wohnort,homepage,aim,msn,icq,yahoo,status,staat,gebdatum,sig,opt_pm,opt_pm_popup,opt_mail,geschlecht,spezrank,avatar FROM xic_user WHERE id = '" . $uid . "'");
            if (db_num_rows($erg) == 0) {
                die ('Fehler: Username nicht gefunden <a href="?user">zur&uuml;ck</a>');
            } else {
                $row = db_fetch_assoc($erg);
    
                $tpl = new tpl ('user/details', 1);
                $row['recht'] = dbliste ($row['recht'] , $tpl, 'recht', "SELECT id,name FROM xic_grundrechte ORDER BY id ASC");
                $row['staat'] = '<option></option>' . arliste ($row['staat'] , get_nationality_array() , $tpl , 'staat');
                $row['spezrank'] = '<option></option>' . dbliste ($row['spezrank'], $tpl, 'spezrank', "SELECT id, bez FROM xic_ranks WHERE spez = 1");
    
                $row['geschlecht0'] = ($row['geschlecht'] < 1 ? 'checked' : '');
                $row['geschlecht1'] = ($row['geschlecht'] == 1 ? 'checked' : '');
                $row['geschlecht2'] = ($row['geschlecht'] == 2 ? 'checked' : '');
                if ($row['status'] == 1) {
                    $row['status1'] = 'checked';
                    $row['status0'] = '';
                } else {
                    $row['status1'] = '';
                    $row['status0'] = 'checked';
                }
                if ($row['opt_mail'] == 1) {
                    $row['opt_mail1'] = 'checked';
                    $row['opt_mail0'] = '';
                } else {
                    $row['opt_mail1'] = '';
                    $row['opt_mail0'] = 'checked';
                }
                if ($row['opt_pm'] == 1) {
                    $row['opt_pm1'] = 'checked';
                    $row['opt_pm0'] = '';
                } else {
                    $row['opt_pm1'] = '';
                    $row['opt_pm0'] = 'checked';
                }
                if ($row['opt_pm_popup'] == 1) {
                    $row['opt_pm_popup1'] = 'checked';
                    $row['opt_pm_popup0'] = '';
                } else {
                    $row['opt_pm_popup1'] = '';
                    $row['opt_pm_popup0'] = 'checked';
                }
                if (@file_exists($row['avatar'])) {
                    $row['avatar'] = '<img src="' . $row['avatar'] . '" border="0" /><br />' ;
                }else {
                    $row['avatar'] = '';
                }
                $row['antispam'] = get_antispam('adminuser', 0, true);
                $tpl->set_ar_out ($row, 0);
    
                profilefields_change ($row['id']);
    
                $tpl->out(1);
            }
            $design->footer();
            break;
        // details des users aendern
        case 2 :
            $design = new design ('Admins Area', 'Admins Area', 2);
            $design->header();
            $changeok = true;
            $uid = escape($_POST['uID'], 'integer');
    
            $altes_recht = db_result(db_query("SELECT recht FROM xic_user WHERE id = " . $uid), 0);
            $neues_recht = escape($_POST['urecht'], 'integer');
            if (($neues_recht <= $_SESSION['authright'] OR $altes_recht <= $_SESSION['authright']) AND $_SESSION['authid'] > 1) {
                $changeok = false;
            }
    
            if ($changeok and chk_antispam('adminuser', true)) {
                if (isset($_POST['userdel'])) {
                    user_remove($uid);
                    wd ('?user', 'User wurde erfolgreich gel&ouml;scht');
                } else {
                    $abf = "SELECT * FROM xic_user WHERE id = '" . $uid . "'";
                    $erg = db_query($abf);
                    $row = db_fetch_object($erg);
    
                    if (isset($_POST['passw'])) {
                        $newPass = genkey (8);
                        $newPassMD5 = md5($newPass);
                        icmail ($row->email , 'neues Password' , "Hallo\n\nDein Password wurde soeben von einem Administrator gendert es ist nun:\n\n$newPass\n\nGru der Administrator");
                        db_query('UPDATE `xic_user` SET pass = "' . $newPassMD5 . '" WHERE id = "' . escape($_POST['uID'], 'integer') . '"');
                    }
                    // avatar speichern START
                    $avatar_sql_update = '';
                    if (!empty ($_FILES['avatarfile']['name'])) {
                        $file_tmpe = $_FILES['avatarfile']['tmp_name'];
                        $rile_type = ic_mime_type ($_FILES['avatarfile']['tmp_name']);
                        $file_type = $_FILES['avatarfile']['type'];
                        $file_size = $_FILES['avatarfile']['size'];
                        $fmsg = $lang['avatarisnopicture'];
                        $size = @getimagesize ($file_tmpe);
                        $endar = array (1 => 'gif', 2 => 'jpg', 3 => 'png');
                        if (($size[2] == 1 OR $size[2] == 2 OR $size[2] == 3) AND $size[0] > 10 AND $size[1] > 10 AND substr ($file_type , 0 , 6) == 'image/' AND substr ($rile_type , 0 , 6) == 'image/') {
                            $endung = $endar[$size[2]];
                            $breite = $size[0];
                            $hoehe = $size[1];
                            $neuer_name = 'include/images/avatars/' . $uid . '.' . $endung;
                            @unlink (db_result(db_query("SELECT avatar FROM xic_user WHERE id = " . $uid), 0));
                            move_uploaded_file ($file_tmpe , $neuer_name);
                            @chmod($neuer_name, 0777);
                            $avatar_sql_update = ', avatar = "' . $neuer_name . '"';
                            $fmsg = $lang['pictureuploaded'];
                        }
                    } elseif (isset($_POST['avatardel'])) {
                        $fmsg = $lang['picturedelete'];
                        @unlink (db_result(db_query("SELECT avatar FROM xic_user WHERE id = " . $uid), 0));
                        $avatar_sql_update = ', avatar = ""';
                    }
                    // avatar speichern ENDE
                    profilefields_change_save (escape($_POST['uID'], 'integer'));
                    $usaName1 = escape($_POST['usaName1'], 'string');
                    $email = escape($_POST['email'], 'string');
                    $homepage = escape($_POST['homepage'], 'string');
                    $wohnort = escape($_POST['wohnort'], 'string');
                    $icq = escape($_POST['icq'], 'string');
                    $msn = escape($_POST['msn'], 'string');
                    $yahoo = escape($_POST['yahoo'], 'string');
                    $aim = escape($_POST['aim'], 'string');
                    $staat = escape($_POST['staat'], 'string');
                    $spezrank = escape($_POST['spezrank'], 'integer');
                    $geschlecht = escape($_POST['geschlecht'], 'integer');
                    $status = escape($_POST['status'], 'integer');
                    $opt_mail = escape($_POST['opt_mail'], 'integer');
                    $opt_pm = escape($_POST['opt_pm'], 'integer');
                    $opt_pm_popup = escape($_POST['opt_pm_popup'], 'integer');
                    $gebdatum = escape($_POST['gebdatum'], 'string');
                    $sig = escape($_POST['sig'], 'string');
                    // Name im Forum ndern
                    if ($_POST['forumname'] == 'on') {
                        $oldname = db_count_query("SELECT name FROM `xic_user` WHERE id =" . $uid);
                        if ($oldname != $usaName1) {
                            db_query("UPDATE `xic_posts` SET erst = '$usaName1' WHERE erstid = " . $uid);
                            db_query("UPDATE `xic_topics` SET erst = '$usaName1' WHERE erst = '$oldname'");
                        }
                    }
                    db_query('UPDATE xic_user
    			  SET
    					name  = "' . $usaName1 . '",
    					recht = "' . $neues_recht . '",
    					email = "' . $email . '",
              homepage = "' . $homepage . '",
              wohnort = "' . $wohnort . '",
              icq = "' . $icq . '",
              msn = "' . $msn . '",
              yahoo = "' . $yahoo . '",
              aim = "' . $aim . '",
              staat = "' . $staat . '",
              spezrank = "' . $spezrank . '",
              geschlecht = "' . $geschlecht . '",
              status = "' . $status . '",
              opt_mail = "' . $opt_mail . '",
              opt_pm = "' . $opt_pm . '",
              opt_pm_popup = "' . $opt_pm_popup . '",
              gebdatum = "' . $gebdatum . '",
              sig = "' . $sig . '"
              ' . $avatar_sql_update . '
    				WHERE id = "' . $uid . '"');
                }
            }
            wd('admin.php?user-1-' . $uid, 'Das Profil wurde erfolgreich geaendert', 2);
            $design->footer();
            break;
        // mal kurz nen neuen user anlegen
        case 'createNewUser' :
            $msg = '';
            if (!empty($_POST['name']) AND !empty($_POST['pass']) AND !empty($_POST['email']) and chk_antispam('adminuser_create', true)) {
                $_POST['name'] = escape($_POST['name'], 'string');
                $_POST['recht'] = escape($_POST['recht'], 'integer');
                $_POST['email'] = escape($_POST['email'], 'string');
                $erg = db_query("SELECT id FROM xic_user WHERE name = BINARY '" . $_POST['name'] . "'");
                if (db_num_rows($erg) > 0) {
                    $msg = 'Der Name ist leider schon vorhanden!';
                } else {
                    $new_pass = $_POST['pass'];
                    $md5_pass = md5($new_pass);
                    db_query("INSERT INTO xic_user (name,pass,recht,regist,llogin,email)
    		    VALUES('" . $_POST['name'] . "','" . $md5_pass . "'," . $_POST['recht'] . ",'" . time() . "','" . time() . "','" . $_POST['email'] . "')");
                    $userid = db_last_id();
                    db_query("INSERT INTO xic_userfields (uid,fid,val) VALUES (" . $userid . ",2,'1')");
                    db_query("INSERT INTO xic_userfields (uid,fid,val) VALUES (" . $userid . ",3,'1')");
    
                    if (isset($_POST['info'])) {
                        $page = $_SERVER["HTTP_HOST"] . $_SERVER["SCRIPT_NAME"];
                        $page = str_replace('admin.php', 'index.php', $page);
                        $tpl = new tpl ('user/new_user_email', 1);
                        $tpl->set('name', $_POST['name']);
                        $tpl->set('pass', $_POST['pass']);
                        $tpl->set('page', $page);
                        $txt = $tpl->get(0);
                        unset($tpl);
                        icmail ($_POST['email'], 'Admin hat dich angelegt', $txt);
                    }
                    $msg = 'Benutzer angelegt <a href="javascript:closeThisWindow()">Fenster schlieen</a>';
                }
            }
            $pass = '';
            $email = '';
            $recht = '';
            if (isset($_POST['pass'])) {
                $pass = $_POST['pass'];
            }
            if (isset($_POST['email'])) {
                $email = $_POST['email'];
            }
            if (isset($_POST['recht'])) {
                $recht = $_POST['recht'];
            } else {
                $recht = '-1';
            }
            $tpl = new tpl ('user/new_user', 1);
            $tpl->set('msg', $msg);
            $tpl->set('pass', $pass);
            $tpl->set('email', $email);
            $tpl->set('recht', dblistee($recht, "SELECT id,name FROM xic_grundrechte ORDER BY id ASC"));
        	$tpl->set('antispam', get_antispam('adminuser_create', 0, true));
            $tpl->out(0);
            break;
    }
    
    ?>


    und einmal die .htm:

    <script language="JavaScript" type="text/javascript">
    <!--
    function createNamedElement(type, name) {
       var element = null;
       // Try the IE way; this fails on standards-compliant browsers
       try {
          element = document.createElement('<'+type+' name="'+name+'">');
       } catch (e) {
       }
       if (!element || element.nodeName != type.toUpperCase()) {
          // Non-IE browser; use canonical method to create named element
          element = document.createElement(type);
          element.name = name;
       }
       return element;
    }
     
      function setufocus() {
        document.f.q.focus();
      }
      // manage div ...
      document.onmousemove = checkPosition;
      function checkPosition(e) {
        if(document.all) {
          mausX = event.clientX + document.body.scrollLeft;
          mausY = event.clientY + document.body.scrollTop;
        } else {
          mausX = e.pageX;
          mausY = e.pageY;
        }
     
      }
      function alertpos(dname) {
      if (document.layers) {
        document.layers[0].left = mausX;
        document.layers[0].top = mausY;
      } else if (document.getElementById) {
        document.getElementById(dname).style.left = (mausX + 10) + "px";
        document.getElementById(dname).style.top = (mausY + 50 ) + "px";
      }
      document.getElementById(dname).style.display = "inline";
      }
      function hiddpos(dname) {
        document.getElementById(dname).style.display = "none";
      }
      function changeUserRight (id1) {
        var x = confirm ( 'Das Recht dieses Users wirklich aendern?' );
        if (x) {
          var options = {
            'action' : 'changeRight',
            'uid' : id1,
            'newright' : document.getElementById('recht'+id1).value
          };
          var frm = setIframe(options);
          frm.submit();
        }
      }
      function changeGruppen (id1) {
        var Fenster = window.open ('admin.php?user-gruppen-' + id1, 'changeGruppen', 'status=yes,scrollbars=yes,height=500,width=250,left=300,top=50');
        Fenster.focus();
      }
      function changeModulrecht (id1) {
        var Fenster = window.open ('admin.php?user-modulrecht-' + id1, 'changeModulrecht', 'status=yes,scrollbars=yes,height=500,width=250,left=300,top=50');
        Fenster.focus();
      }
      function deleteUser (id1) {
        var x = confirm ( 'Diesen User wirklich komplett entfernen?' );
        if (x) {
            document.getElementById('af_action').value = 'deleteUser';
            document.getElementById('af_uid').value = id1;
            document.getElementById('actionForm').submit();
        }
      }
      function changeModulRecht ( modul, uid ) {
          var action = ( document.getElementById("MN" + modul + "-" + uid).checked == true ) ? 'give' : 'remove';
          var options = {
            'action' : 'changeModulRight',
            'uid' : uid,
            'giveremove' : action,
            'modul' : modul
          };
          var frm = setIframe(options);
          frm.submit();
      }
      function setIframe(fields){
        var ifrm = window.frames['ifrm']; //document.getElementById('ifrm');
        var frm2 = document.getElementById('actionForm').cloneNode(true);
        frm2.setAttribute('action', 'admin.php?user');
        for (var f in fields){
            if (frm2.elements[f] != undefined) {
                frm2.elements[f].value = fields[f];
            } else {
                var i = createNamedElement('input', f);
                i.setAttribute('type', 'hidden');
                i.setAttribute('value', fields[f]);
                frm2.appendChild(i);
            }
        }
        if (document.all) {
            ifrm.document.write(frm2.outerHTML);
            frm2 = ifrm.document.all.actionForm;
        } else {
            ifrm.document.body.appendChild(frm2);
        }
        return frm2;
      }
      function setNewAntispam(element){
        document.getElementById('actionForm').elements['antispam_id'].value = element.value;
      }
    //-->
    </script>
    <div style="float:right"><a href="admin.php?puser">Noch nicht best&auml;tigte Registrierungen verwalten</a></div>
    <form id="actionForm" id="actionForm" method="post">
    {action_antispam}
    <input type="hidden" name="action" id="af_action" value="" />
    <input type="hidden" name="uid" id="af_uid" value="0" />
    </form>
    <iframe name="ifrm" id="ifrm" style="display:none;"></iframe>
    <body onload="setufocus()">
    <form action="admin.php" name="f" method="GET" style="padding: 0px; margin:0px 0px 0px 0px;" >
      <input type="hidden" name="user" value="" />
    <table cellpadding="3" cellspacing="1" border="0" class="border" style="float:left">
      <tr>
        <td class="Cmite"><input name="q" value="{q}" /></td>
        
        <td class="Cnorm" colspan="2">und / oder Filtern nach Rechten: {filter22}</td>
        <td class="Cdark"><input type="submit" value="Suchen" /></td>
      </tr>
    </table>
    </form>
    <br />
    <br />
    <br />
    <table cellpadding="3" cellspacing="1" border="0" class="border">
      <tr>
        <td colspan="6"></td>
        <td class="Cmite" colspan="{anzmods}"><b>Modulrechte:</b></td>
      </tr>
      <tr class="Chead">
        <th>Name</th>
        <th>Recht</th>
        <th>Gruppe</th>
        <th></th>
        <th></th>
        <th class="border">&nbsp;&nbsp;</th>
        {modlall}
      </tr>
     {EXPLODE}
     
     
     
      <tr class="{class}">
        <td><div onmouseover="hiddpos('groupdiv{id}')" id="groupdiv{id}" style="position:absolute; top:50px; left:50px; display:none; width:200px;">
    <table width="100%" class="border" border="0" cellspacing="1" cellpadding="4">
      <tr>
        <td class="{class}" align="left">{grouplist}</td>
      </tr>
    </table>
    </div><strong>{name}</strong></td>
        <td><select id="recht{id}" onChange="changeUserRight({id})">{recht}</select></td>
        <td style="text-align: center;"><a onmouseout="hiddpos('groupdiv{id}')" onmouseover="alertpos('groupdiv{id}')" href="javascript:changeGruppen({id})" title="hier die Gruppenzugeh&ouml;rigkeit &auml;ndern">Gruppen</a></td>
        <td>&nbsp;<a href="admin.php?user-1-{id}"><img src="include/images/icons/edit.gif" border="0" title="&auml;ndern" alt="&auml;ndern" /></a>&nbsp;</td>
        <td>&nbsp;<a href="javascript:deleteUser({id})"><img src="include/images/icons/del.gif" border="0" title="l&ouml;schen" alt="l&ouml;schen" /></a>&nbsp;</td>
        <td class="border"></td>
        {modslist}
      </tr>
     {EXPLODE}
    </table>
    {MPL}


    müsste so klappen, wenn ich nix vergessen hab lcheln
    gruß Sascha
    Visit me on: www.ITRoyal.de
    Visit my Clan: www.United-SportZ.de
    Mein ilch Modul: Höhrercharts v0.8 für OnlineRadios
    0 Mitglieder finden den Beitrag gut.
  11. #11
    User Pic
    ---Doc--- Mitglied
    Registriert seit
    05.08.2011
    Beitrge
    218
    Beitragswertungen
    4 Beitragspunkte
    Puh, das hagelt Fehler:

    MySQL Error:
    1146 : Tabelle 'usr_web1483_2.xic_grundrechte' existiert nicht
    in Query:
    SELECT * FROM xic_grundrechte
    
    Debug backtrace:
    	@ mysql.php:32 -- debug_bt()
    	@ mysql.php:50 -- db_check_error(...)
    	@ user.php:114 -- db_query(...)
    	@ admin.php:36 -- require_once(...)
    
    
    Warning: mysql_fetch_object(): supplied argument is not a valid MySQL result resource in /var/www/web1483/html/ilch/include/includes/func/db/mysql.php on line 69
    
    Warning: Cannot modify header information - headers already sent by (output started at /var/www/web1483/html/ilch/include/includes/func/db/mysql.php:32) in /var/www/web1483/html/ilch/include/includes/class/design.php on line 23
    Seite	Admin	User	Eigene Box/Page	Clanbox	Content	Module
    		
    		
    		
    		
    		
    		
    		
    		
    		
    		
    		
    		
    		
    		
    		
    		
    		
    		
    		
    		
    		
    		
    		
    		
    		
    		
    		
    		
    		
    		
    		
    		
    		
    		
    		
    		
    		
    		
    		
    		
    		
    		
    		
    		
    		
    		
    		
    MySQL Error:
    1146 : Tabelle 'usr_web1483_2.xic_modules' existiert nicht
    in Query:
    SELECT DISTINCT name FROM xic_modules WHERE fright = 1 ORDER BY xic_modules.name
    
    Debug backtrace:
    	@ mysql.php:32 -- debug_bt()
    	@ mysql.php:50 -- db_check_error()
    	@ user.php:18 -- db_query()
    	@ user.php:139 -- user_get_all_mod_list()
    	@ admin.php:36 -- require_once(...)
    
    MySQL Error:
    1146 : Tabelle 'usr_web1483_2.xic_modules' existiert nicht
    in Query:
    SELECT COUNT(*) FROM xic_modules WHERE fright = 1
    
    Debug backtrace:
    	@ mysql.php:32 -- debug_bt()
    	@ mysql.php:50 -- db_check_error()
    	@ user.php:140 -- db_query()
    	@ admin.php:36 -- require_once(...)
    
    
    Warning: mysql_result(): supplied argument is not a valid MySQL result resource in /var/www/web1483/html/ilch/include/includes/func/db/mysql.php on line 54
    Noch nicht besttigte Registrierungen verwalten
    	und / oder Filtern nach Rechten: Suche mit einbeziehen? (falls recht gewhlt) 	
    
    
    
    MySQL Error:
    1146 : Tabelle 'usr_web1483_2.xic_user' existiert nicht
    in Query:
    SELECT name,recht,id FROM `xic_user` WHERE name LIKE '%' ORDER by recht,posts DESC LIMIT 0,30
    
    Debug backtrace:
    	@ mysql.php:32 -- debug_bt()
    	@ mysql.php:50 -- db_check_error(...)
    	@ user.php:172 -- db_query(...)
    	@ admin.php:36 -- require_once(...)
    
    
    Warning: mysql_fetch_object(): supplied argument is not a valid MySQL result resource in /var/www/web1483/html/ilch/include/includes/func/db/mysql.php on line 69
    0 Mitglieder finden den Beitrag gut.
  12. #12
    User Pic
    s4sch4 Mitglied
    Registriert seit
    09.12.2007
    Beitrge
    183
    Beitragswertungen
    5 Beitragspunkte
    hm, bei mir funtzt die, mom ich teste mal deine bei mir und mach den fehler weg...

    ich nehm aber gleich erstmal nen erkältungsbad lcheln kann n bissl was dauern, also nich wundern...


    EDIT:

    Also bei mir funktioniert die, fehlerlos

    ersetz mal alle xic_ gegen prefix_


    Zuletzt modifiziert von s4sch4 am 27.11.2011 - 21:32:48
    Visit me on: www.ITRoyal.de
    Visit my Clan: www.United-SportZ.de
    Mein ilch Modul: Höhrercharts v0.8 für OnlineRadios
    0 Mitglieder finden den Beitrag gut.
  13. #13
    User Pic
    ---Doc--- Mitglied
    Registriert seit
    05.08.2011
    Beitrge
    218
    Beitragswertungen
    4 Beitragspunkte
    Oh, dann gute Besserung erst einmal.

    Ich werde auch bald in die Falle springen, morgen muß ich früh raus, komme also eh erst morgen zum erneuten Testen.

    Vielen Dank für die Mühen.
    0 Mitglieder finden den Beitrag gut.
  14. #14
    User Pic
    s4sch4 Mitglied
    Registriert seit
    09.12.2007
    Beitrge
    183
    Beitragswertungen
    5 Beitragspunkte
    aso wenn du alle ersetz hast musst du ggf. in deiner confix dort euer prefix noch angeben

    dann müsste es eigendlich laufen...
    Visit me on: www.ITRoyal.de
    Visit my Clan: www.United-SportZ.de
    Mein ilch Modul: Höhrercharts v0.8 für OnlineRadios
    0 Mitglieder finden den Beitrag gut.
  15. #15
    User Pic
    s4sch4 Mitglied
    Registriert seit
    09.12.2007
    Beitrge
    183
    Beitragswertungen
    5 Beitragspunkte
    achso, den case 'filter' kannste übrigends rausnehmen, der wird nicht mehr gebraucht weil ich das dann anders gemacht habe, hab nämlich die suche gleich miteinbezogen, so kannst du die suche und den filter nutzen...

    also deine tabelle grundrechte macht iwie faxxen, kp warum, versuch das mal mit dem prefix, dafür is das ja auch gemacht, das ihr euer eigenes prefix nutzen könnt aber über prefix_ druaf zugreifen könnt, also einfach in der include/includes/config.php den prefix xic setzen...

    EDIT:

    probier diese jetzt mal:

    <?php
    // Copyright by: Manuel
    // Support: www.ilch.de
    defined ('main') or die ('no direct access');
    defined ('admin') or die ('only admin access');
     
    function user_get_group_list ($uid) {
        $l = 'Mitglied in Gruppen:<br />';
        $erg = db_query("SELECT prefix_groups.name FROM prefix_groupusers LEFT JOIN prefix_groups ON prefix_groups.id = prefix_groupusers.gid WHERE prefix_groupusers.uid = " . $uid);
        while ($r = db_fetch_assoc($erg)) {
            $l .= '- ' . $r['name'] . '<br />';
        }
        return ($l);
    }
     
    function user_get_all_mod_list () {
        $l = '';
        $erg = db_query("SELECT DISTINCT name FROM prefix_modules WHERE fright = 1 ORDER BY prefix_modules.name");
        while ($r = db_fetch_assoc($erg)) {
            $x = $r['name'];
            $l .= '<th style="font-size: 9px; font-weight: normal;" title="' . $r['name'] . '" valign="bottom">' . $x . '</th>';
        }
        return ($l);
    }
     
    function user_get_mod_change_list ($uid) {
        $l = '';
        $erg = db_query("SELECT prefix_modules.id, uid FROM prefix_modules LEFT JOIN prefix_modulerights ON prefix_modulerights.mid = prefix_modules.id AND prefix_modulerights.uid = " . $uid . " WHERE fright = 1 ORDER BY prefix_modules.name");
        while ($r = db_fetch_assoc($erg)) {
            if ($r['uid'] == '') {
                $c = '';
            } else {
                $c = ' checked';
            }
            $l .= '<td align="center"><input onclick="changeModulRecht(' . $r['id'] . ',' . $uid . ')" type="checkbox" id="MN' . $r['id'] . '-' . $uid . '" name="MN' . $r['id'] . '-' . $uid . '" ' . $c . ' /></td>';
        }
        return ($l);
    }
     
    function user_get_mod_list ($uid) {
        $l = 'Modulrechte:<br />';
        $erg = db_query("SELECT DISTINCT module FROM prefix_modulerights WHERE uid = " . $uid);
        while ($r = db_fetch_assoc($erg)) {
            $l .= '- ' . $r['module'] . '<br />';
        }
        return ($l);
    }
     
    function getfl($gid) {
        $liste = '';
        $erg = db_query("SELECT view,name,reply,start,mods FROM prefix_forums WHERE view = " . $gid . " OR reply = " . $gid . " OR start = " . $gid . " OR mods = " . $gid);
        while ($row = db_fetch_assoc($erg)) {
            $v = ($row['view'] == $gid ? 'sehen/lesen,' : '');
            $r = ($row['reply'] == $gid ? 'antworten,' : '');
            $s = ($row['start'] == $gid ? 'Themen starten,' : '');
            $m = ($row['mods'] == $gid ? 'Moderieren,' : '');
            $liste .= $row['name'] . '<span class="smalfont">(' . $v . $r . $s . $m . ')</span>&nbsp;';
        }
        return($liste);
    }
     
    if (isset($_POST['action'])) {
        $design = new design ('Admins Area', 'Admins Area', 0);
        $design->header();
        $wdtext = 'Es ist ein Fehler aufgetreten.';
        if (chk_antispam('adminuser_action', true) and isset($_POST['uid'])) {
            $uid = escape($_POST['uid'], 'integer');
            switch($_POST['action']){
                // einen user komplett loeschen
                case 'deleteUser':
                    $name = get_n($uid);
                    if ($uid != 1 and !empty($name)) {
                        user_remove($uid);
                        $wdtext = 'Der User ' . $name . ' wurde erfolgreich gel&ouml;scht.';
                    }
                    break;
                // das recht eines users aendern
                case 'changeRight' :
                    $altes_recht = db_result(db_query("SELECT recht FROM prefix_user WHERE id = " . $uid), 0);
                    $neues_recht = escape($_POST['newright'], 'integer');
                    if (($neues_recht > $_SESSION['authright'] AND $altes_recht > $_SESSION['authright']) OR ($_SESSION['authid'] == 1 AND $uid != 1)) {
                        $q = "UPDATE prefix_user SET recht = " . $neues_recht . " WHERE id = " . $uid;
                        db_query($q);
                    }
                    $wdtext = false;
                break;
                // modulrechte fuer einen user aendern
                case 'changeModulRight' :
                    $modul = escape($_POST['modul'], 'integer');
                    $aktion = $_POST['giveremove'];
                    if ($aktion == 'give' AND 0 == db_result(db_query("SELECT COUNT(*) FROM prefix_modulerights WHERE mid = '" . $modul . "' AND uid = " . $uid), 0)) {
                        db_query("INSERT INTO prefix_modulerights (mid,uid) VALUES ('" . $modul . "'," . $uid . ")");
                    } elseif ($aktion == 'remove' AND 1 == db_result(db_query("SELECT COUNT(*) FROM prefix_modulerights WHERE mid = '" . $modul . "' AND uid = " . $uid), 0)) {
                        db_query("DELETE FROM prefix_modulerights WHERE mid = '" . $modul . "' AND uid = " . $uid);
                    }
                    $wdtext = false;
                break;
            }
        }
        if ($wdtext === false) {
            $antispam = get_antispam('adminuser_action', 0, true);
            ?><script type="text/javascript"><!--
                function updateParent() { parent.setNewAntispam(document.getElementById('tmp').childNodes[0]);}
                window.onload = function() { updateParent(); };
                //--></script>
                <div id="tmp"><?php echo $antispam; ?></div>
            <?php
            exit;
        }
        wd('admin.php?' . $menu->get_complete(), $wdtext, 5);
        $design->footer(1);
    }
    
    
    
    $um = $menu->get(1);
    switch ($um) {
        default :
    	
    	// FILTER FORM
    $filter22 = '';
    $que22 = db_query("SELECT * FROM prefix_grundrechte");
    
    	$filter22 .= '<select name="filter22"><option value="">Recht whlen</option>';
    	
    	while($wor22 = db_fetch_object($que22)) {
    	$filter22 .= '<option value="'.$wor22->id.'">'.$wor22->name.'</option>';
    	}
    	
    	$filter22 .= '</select>';
    // END FILTER FORM
    
            $design = new design ('Admins Area', 'Admins Area', 2);
            $design->header();
            $q = '';
            if (isset($_REQUEST['q'])) {
                $q = escape($_REQUEST['q'], 'string');
            }
            $tpl = new tpl ('user/user', 1);
            $tpl->set('modlall', user_get_all_mod_list());
            $tpl->set('anzmods', db_result(db_query("SELECT COUNT(*) FROM prefix_modules WHERE fright = 1"), 0));
            $tpl->set('action_antispam', get_antispam('adminuser_action', 0, true));
    		$tpl->set('filter22', $filter22, 0);
            $tpl->set_out('q', unescape($q), 0);
     
            $q = str_replace('*', '%', $q);
            if (strpos($q, '%') === false) {
                $q = $q . '%';
            }
     
            $limit = 30; // Limit
    		
            $page = ($menu->getA(1) == 'p' ? $menu->getE(1) : 1);
    		
            $MPL = db_make_sites ($page , "WHERE name LIKE '" . $q . "'" , $limit , '?user' , 'user');
    		
            $anfang = ($page - 1) * $limit;
            $class = '';
    		
            $que = "SELECT name,recht,id FROM `prefix_user` WHERE name LIKE '" . $q . "' ORDER by recht,name ASC LIMIT " . $anfang . "," . $limit;
    		
    		if (isset($_REQUEST['q']) && empty($_GET['filter22'])) {
    		
    		$que = "SELECT name,recht,id FROM `prefix_user` WHERE name LIKE '" . $q . "' ORDER by recht,posts DESC";
    		$que2 = db_query("SELECT COUNT(id) as ges FROM `prefix_user` WHERE name LIKE '" . $q . "' ORDER by recht,posts DESC");
    		$rowq = db_fetch_object($que2);
    		$ges = $rowq->ges;
    		$MPL = "Gesamt: ".$ges;
    		
    		} 
    		
    		elseif(isset($_GET['filter22']) && !empty($_GET['filter22'])) {
    		
    		$gid = escape($_GET['filter22'], 'string');
    		
    		$que = "SELECT name,recht,id FROM `prefix_user` WHERE name LIKE '" . $q . "' AND recht = '" . $gid . "' ORDER by recht,posts DESC";
    		$que2 = db_query("SELECT COUNT(id) as ges FROM `prefix_user` WHERE name LIKE '" . $q . "' AND recht = '" . $gid . "' ORDER by recht,posts DESC");
    		$rowq = db_fetch_object($que2);
    		$ges = $rowq->ges;
    		$MPL = "Gesamt: ".$ges;
    		} 
    		
            $erg = db_query($que);
            while ($row = db_fetch_object($erg)) {
                if ($class == 'Cmite') {
                    $class = 'Cnorm';
                } else {
                    $class = 'Cmite';
                }
                $ar = array ('name' => $row->name,
                    'class' => $class,
                    'id' => $row->id,
                    'grouplist' => user_get_group_list($row->id),
                    'recht' => dblistee($row->recht, "SELECT id,name FROM prefix_grundrechte ORDER BY id ASC"),
                    'modslist' => user_get_mod_change_list($row->id),
                    );
     
                $tpl->set_ar_out($ar, 1);
            }
            $tpl->set_out('MPL', $MPL, 2);
            $design->footer();
            break;
     
        // gruppen zugehoerigkeiten eines users aendern
        case 'gruppen' :
            $uid = $menu->get(2);
            if (isset($_POST['usergroups'])) {
                $erg = db_query("SELECT id FROM prefix_groups");
                while ($row = db_fetch_assoc($erg)) {
                    $ck = db_count_query("SELECT COUNT(uid) FROM prefix_groupusers WHERE uid = " . $uid . " AND gid = " . $row['id']);
                    if ($ck == 0 AND isset ($_POST['grprhave'][$row['id']][$uid])) {
                        db_query("INSERT INTO prefix_groupusers (uid,gid,fid) VALUES ( " . $uid . ", " . $row['id'] . ", 3 )");
                    } elseif ($ck == 1 AND !isset ($_POST['grprhave'][$row['id']][$uid])) {
                        db_query("DELETE FROM prefix_groupusers WHERE uid = " . $uid . " AND gid = " . $row['id']);
                    }
                }
            }
     
            $user_name = db_result(db_query("SELECT name FROM prefix_user WHERE id = " . $uid), 0);
            $tpl = new tpl ('user/gruppen', 1);
            $tpl->set_ar_out(array('username' => $user_name, 'userid' => $uid), 0);
            $class = 'Cnorm';
            $erg = db_query("SELECT name,id FROM prefix_groups");
            while ($row = db_fetch_assoc($erg)) {
                $ck = db_count_query("SELECT COUNT(uid) FROM prefix_groupusers WHERE uid = " . $uid . " AND gid = " . $row['id']);
                $row['ck'] = ($ck == 0 ? '' : 'checked');
                $class = ($class == 'Cnorm' ? 'Cmite' : 'Cnorm');
                $row['class'] = $class;
                $tpl->set_ar_out($row, 1);
            }
            $tpl->out(2);
            break;
     
        // details eines users anzeigen
        case 1 :
            $design = new design ('Admins Area', 'Admins Area', 2);
            $design->header();
            if (isset ($_REQUEST['uID'])) {
                $uid = $_REQUEST['uID'];
            } else {
                $uid = $menu->get(2);
            }
            $erg = db_query("SELECT name,email,id,recht,wohnort,homepage,aim,msn,icq,yahoo,status,staat,gebdatum,sig,opt_pm,opt_pm_popup,opt_mail,geschlecht,spezrank,game,spielerfahrungen,clan,map,waffe,essen,trinken,film,musik,sport,cpu,mainboard,ram,monitor,grafikkarte,soundkarte,festplatte,i_net_verbindung,tastatur,maus,jappy,facebook,wkw,studivz,myspace,youtube,avatar FROM prefix_user WHERE id = '" . $uid . "'");
            if (db_num_rows($erg) == 0) {
                die ('Fehler: Username nicht gefunden <a href="?user">zur&uuml;ck</a>');
            } else {
                $row = db_fetch_assoc($erg);
     
                $tpl = new tpl ('user/details', 1);
                $row['recht'] = dbliste ($row['recht'] , $tpl, 'recht', "SELECT id,name FROM prefix_grundrechte ORDER BY id ASC");
                $row['staat'] = '<option></option>' . arliste ($row['staat'] , get_nationality_array() , $tpl , 'staat');
                $row['spezrank'] = '<option></option>' . dbliste ($row['spezrank'], $tpl, 'spezrank', "SELECT id, bez FROM prefix_ranks WHERE spez = 1 ORDER BY id");
     
                $row['geschlecht0'] = ($row['geschlecht'] < 1 ? 'checked' : '');
                $row['geschlecht1'] = ($row['geschlecht'] == 1 ? 'checked' : '');
                $row['geschlecht2'] = ($row['geschlecht'] == 2 ? 'checked' : '');
                if ($row['status'] == 1) {
                    $row['status1'] = 'checked';
                    $row['status0'] = '';
                } else {
                    $row['status1'] = '';
                    $row['status0'] = 'checked';
                }
                if ($row['opt_mail'] == 1) {
                    $row['opt_mail1'] = 'checked';
                    $row['opt_mail0'] = '';
                } else {
                    $row['opt_mail1'] = '';
                    $row['opt_mail0'] = 'checked';
                }
                if ($row['opt_pm'] == 1) {
                    $row['opt_pm1'] = 'checked';
                    $row['opt_pm0'] = '';
                } else {
                    $row['opt_pm1'] = '';
                    $row['opt_pm0'] = 'checked';
                }
                if ($row['opt_pm_popup'] == 1) {
                    $row['opt_pm_popup1'] = 'checked';
                    $row['opt_pm_popup0'] = '';
                } else {
                    $row['opt_pm_popup1'] = '';
                    $row['opt_pm_popup0'] = 'checked';
                }
                if (@file_exists($row['avatar'])) {
                    $row['avatar'] = '<img src="' . $row['avatar'] . '" border="0" /><br />' ;
                }else {
                    $row['avatar'] = '';
                }
                $row['antispam'] = get_antispam('adminuser', 0, true);
                $tpl->set_ar_out ($row, 0);
     
                profilefields_change ($row['id']);
     
                $tpl->out(1);
            }
            $design->footer();
            break;
        // details des users aendern
        case 2 :
            $design = new design ('Admins Area', 'Admins Area', 2);
            $design->header();
            $changeok = true;
            $uid = escape($_POST['uID'], 'integer');
     
            $altes_recht = db_result(db_query("SELECT recht FROM prefix_user WHERE id = " . $uid), 0);
            $neues_recht = escape($_POST['urecht'], 'integer');
            if (($neues_recht <= $_SESSION['authright'] OR $altes_recht <= $_SESSION['authright']) AND $_SESSION['authid'] > 1) {
                $changeok = false;
            }
     
            if ($changeok and chk_antispam('adminuser', true)) {
                if (isset($_POST['userdel'])) {
                    user_remove($uid);
                    wd ('?user', 'User wurde erfolgreich gel&ouml;scht');
                } else {
                    $abf = "SELECT * FROM prefix_user WHERE id = '" . $uid . "'";
                    $erg = db_query($abf);
                    $row = db_fetch_object($erg);
     
                    if (isset($_POST['passw'])) {
                        $newPass = genkey (8);
                        $newPassMD5 = md5($newPass);
                        icmail ($row->email , 'neues Password' , "Hallo\n\nDein Password wurde soeben von einem Administrator gendert es ist nun:\n\n$newPass\n\nGru der Administrator");
                        db_query('UPDATE `prefix_user` SET pass = "' . $newPassMD5 . '" WHERE id = "' . escape($_POST['uID'], 'integer') . '"');
                    }
                    // avatar speichern START
                    $avatar_sql_update = '';
                    if (!empty ($_FILES['avatarfile']['name'])) {
                        $file_tmpe = $_FILES['avatarfile']['tmp_name'];
                        $rile_type = ic_mime_type ($_FILES['avatarfile']['tmp_name']);
                        $file_type = $_FILES['avatarfile']['type'];
                        $file_size = $_FILES['avatarfile']['size'];
                        $fmsg = $lang['avatarisnopicture'];
                        $size = @getimagesize ($file_tmpe);
                        $endar = array (1 => 'gif', 2 => 'jpg', 3 => 'png');
                        if (($size[2] == 1 OR $size[2] == 2 OR $size[2] == 3) AND $size[0] > 10 AND $size[1] > 10 AND substr ($file_type , 0 , 6) == 'image/' AND substr ($rile_type , 0 , 6) == 'image/') {
                            $endung = $endar[$size[2]];
                            $breite = $size[0];
                            $hoehe = $size[1];
                            $neuer_name = 'include/images/avatars/' . $uid . '.' . $endung;
                            @unlink (db_result(db_query("SELECT avatar FROM prefix_user WHERE id = " . $uid), 0));
                            move_uploaded_file ($file_tmpe , $neuer_name);
                            @chmod($neuer_name, 0777);
                            $avatar_sql_update = ', avatar = "' . $neuer_name . '"';
                            $fmsg = $lang['pictureuploaded'];
                        }
                    } elseif (isset($_POST['avatardel'])) {
                        $fmsg = $lang['picturedelete'];
                        @unlink (db_result(db_query("SELECT avatar FROM prefix_user WHERE id = " . $uid), 0));
                        $avatar_sql_update = ', avatar = ""';
                    }
                    // avatar speichern ENDE
                    profilefields_change_save (escape($_POST['uID'], 'integer'));
    
                    $usaName1 = escape($_POST['usaName1'], 'string');
                    $email = escape($_POST['email'], 'string');
                    $homepage = escape($_POST['homepage'], 'string');
                    $wohnort = escape($_POST['wohnort'], 'string');
                    $icq = escape($_POST['icq'], 'string');
                    $msn = escape($_POST['msn'], 'string');
                    $yahoo = escape($_POST['yahoo'], 'string');
                    $aim = escape($_POST['aim'], 'string');
                    $staat = escape($_POST['staat'], 'string');
                    $spezrank = escape($_POST['spezrank'], 'integer');
                    $geschlecht = escape($_POST['geschlecht'], 'integer');
                    $status = escape($_POST['status'], 'integer');
                    $opt_mail = escape($_POST['opt_mail'], 'integer');
                    $opt_pm = escape($_POST['opt_pm'], 'integer');
                    $opt_pm_popup = escape($_POST['opt_pm_popup'], 'integer');
                    $gebdatum = escape($_POST['gebdatum'], 'string');
                    $game = escape($_POST['game'], 'string');
                    $spielerfahrungen = escape($_POST['spielerfahrungen'], 'string');
                    $clan = escape($_POST['clan'], 'string');
                    $map = escape($_POST['map'], 'string');
                    $waffe = escape($_POST['waffe'], 'string');
                    $essen = escape($_POST['essen'], 'string');
                    $trinken = escape($_POST['trinken'], 'string');
                    $film = escape($_POST['film'], 'string');
                    $musik = escape($_POST['musik'], 'string');
                    $sport = escape($_POST['sport'], 'string');
                    $cpu = escape($_POST['cpu'], 'string');
                    $mainboard = escape($_POST['mainboard'], 'string');
                    $ram = escape($_POST['ram'], 'string');
                    $monitor = escape($_POST['monitor'], 'string');
                    $grafikkarte = escape($_POST['grafikkarte'], 'string');
                    $soundkarte = escape($_POST['soundkarte'], 'string');
                    $festplatte = escape($_POST['festplatte'], 'string');
                    $i_net_verbindung = escape($_POST['i_net_verbindung'], 'string');
                    $tastatur= escape($_POST['tastatur'], 'string');
                    $maus = escape($_POST['maus'], 'string');
                    $jappy = escape($_POST['jappy'], 'string');
                    $facebook = escape($_POST['facebook'], 'string');
                    $wkw = escape($_POST['wkw'], 'string');
                    $studivz = escape($_POST['studivz'], 'string');
                    $myspace = escape($_POST['myspace'], 'string');
                    $youtube = escape($_POST['youtube'], 'string');
                    $sig = escape($_POST['sig'], 'string');
                    // Name im Forum ndern
                    if ($_POST['forumname'] == 'on') {
                        $oldname = db_count_query("SELECT name FROM `prefix_user` WHERE id =" . $uid);
                        if ($oldname != $usaName1) {
                            db_query("UPDATE `prefix_posts` SET erst = '$usaName1' WHERE erstid = " . $uid);
                            db_query("UPDATE `prefix_topics` SET erst = '$usaName1' WHERE erst = '$oldname'");
                        }
                    }
                    db_query('UPDATE prefix_user
                  SET
                        name  = "' . $usaName1 . '",
                        recht = "' . $neues_recht . '",
                        email = "' . $email . '",
              homepage = "' . $homepage . '",
              wohnort = "' . $wohnort . '",
              icq = "' . $icq . '",
              msn = "' . $msn . '",
              yahoo = "' . $yahoo . '",
              aim = "' . $aim . '",
              staat = "' . $staat . '",
              spezrank = "' . $spezrank . '",
              geschlecht = "' . $geschlecht . '",
              status = "' . $status . '",
              opt_mail = "' . $opt_mail . '",
              opt_pm = "' . $opt_pm . '",
              opt_pm_popup = "' . $opt_pm_popup . '",
              gebdatum = "' . $gebdatum . '",
              game = "' . $game . '",
              spielerfahrungen = "' . $spielerfahrungen . '",
              clan = "' . $clan . '",
              map = "' . $map . '",
              waffe = "' . $waffe . '",
              essen = "' . $essen . '",
              trinken = "' . $trinken . '",
              film = "' . $film . '",
              musik = "' . $musik . '",
              sport = "' . $sport . '",
              cpu = "' . $cpu . '",
              mainboard = "' . $mainboard . '",
              ram = "' . $ram . '",
              monitor = "' . $monitor . '",
              grafikkarte = "' . $grafikkarte . '",
              soundkarte = "' . $soundkarte . '",
              festplatte = "' . $festplatte . '",
              i_net_verbindung = "' . $i_net_verbindung . '",
              tastatur = "' . $tastatur . '",
              maus = "' . $maus . '",
              jappy = "' . $jappy . '",
              facebook = "' . $facebook . '",
              wkw = "' . $wkw . '",
              studivz = "' . $studivz . '",
              myspace = "' . $myspace . '",
              youtube = "' . $youtube . '",
              sig = "' . $sig . '"
              ' . $avatar_sql_update . '
                    WHERE id = "' . $uid . '"');
                }
            }
            wd('admin.php?user-1-' . $uid, 'Das Profil wurde erfolgreich geaendert', 2);
            $design->footer();
            break;
        // mal kurz nen neuen user anlegen
        case 'createNewUser' :
            $msg = '';
            if (!empty($_POST['name']) AND !empty($_POST['pass']) AND !empty($_POST['email']) and chk_antispam('adminuser_create', true)) {
                $_POST['name'] = escape($_POST['name'], 'string');
                $_POST['recht'] = escape($_POST['recht'], 'integer');
                $_POST['email'] = escape($_POST['email'], 'string');
                $erg = db_query("SELECT id FROM prefix_user WHERE name = BINARY '" . $_POST['name'] . "'");
                if (db_num_rows($erg) > 0) {
                    $msg = 'Der Name ist leider schon vorhanden!';
                } else {
                    $new_pass = $_POST['pass'];
                    $md5_pass = md5($new_pass);
                    db_query("INSERT INTO prefix_user (name,pass,recht,regist,llogin,email)
                VALUES('" . $_POST['name'] . "','" . $md5_pass . "'," . $_POST['recht'] . ",'" . time() . "','" . time() . "','" . $_POST['email'] . "')");
                    $userid = db_last_id();
                    db_query("INSERT INTO prefix_userfields (uid,fid,val) VALUES (" . $userid . ",2,'1')");
                    db_query("INSERT INTO prefix_userfields (uid,fid,val) VALUES (" . $userid . ",3,'1')");
     
                    if (isset($_POST['info'])) {
                        $page = $_SERVER["HTTP_HOST"] . $_SERVER["SCRIPT_NAME"];
                        $page = str_replace('admin.php', 'index.php', $page);
                        $tpl = new tpl ('user/new_user_email', 1);
                        $tpl->set('name', $_POST['name']);
                        $tpl->set('pass', $_POST['pass']);
                        $tpl->set('page', $page);
                        $txt = $tpl->get(0);
                        unset($tpl);
                        icmail ($_POST['email'], 'Admin hat dich angelegt', $txt);
                    }
                    $msg = 'Benutzer angelegt <a href="javascript:closeThisWindow()">Fenster schlieen</a>';
                }
            }
            $pass = '';
            $email = '';
            $recht = '';
            if (isset($_POST['pass'])) {
                $pass = $_POST['pass'];
            }
            if (isset($_POST['email'])) {
                $email = $_POST['email'];
            }
            if (isset($_POST['recht'])) {
                $recht = $_POST['recht'];
            } else {
                $recht = '-1';
            }
            $tpl = new tpl ('user/new_user', 1);
            $tpl->set('msg', $msg);
            $tpl->set('pass', $pass);
            $tpl->set('email', $email);
            $tpl->set('recht', dblistee($recht, "SELECT id,name FROM prefix_grundrechte ORDER BY id ASC"));
            $tpl->set('antispam', get_antispam('adminuser_create', 0, true));
            $tpl->out(0);
            break;
    }
     
    ?>


    an der .htm muss nix mehr getan werden...

    leider kann ich die db_make_sites function bei der filteranwendung nicht zum einsatz bringen, da die ganze function sonst auch noch umgebaut werden müsste lcheln dafür steht dann jetzt die gesamtanzahl der gefilterten user unten drunter...


    Zuletzt modifiziert von s4sch4 am 28.11.2011 - 02:57:07
    Visit me on: www.ITRoyal.de
    Visit my Clan: www.United-SportZ.de
    Mein ilch Modul: Höhrercharts v0.8 für OnlineRadios
    0 Mitglieder finden den Beitrag gut.
  16. #16
    User Pic
    ---Doc--- Mitglied
    Registriert seit
    05.08.2011
    Beitrge
    218
    Beitragswertungen
    4 Beitragspunkte
    Super. Vielen Dank. Jetzt klappt es.

    Das mit dem Prefix habe ich nicht verstanden, also was Du damit meintest.
    Ih hab zwar die Position gefunden, nur was ändert es? Verändert hatte ich da nichts. Ich dachte eh, damit werden nur die Tabellen in der Datenbank bezeichnet.
    Kann man es denn im Nachhinein gefahrlos ändern?
    0 Mitglieder finden den Beitrag gut.
  17. #17
    User Pic
    Lord|Schirmer Administrator
    Registriert seit
    21.03.2007
    Beitrge
    7.509
    Beitragswertungen
    1165 Beitragspunkte
    Bei Ilch.de wird aktuell noch prefix_ zu xic_ geändert! Der Fehler ist bekannt und wird mit dem nächsten Update behoben! Da bedeutet, dass jeder gepostete Code automtisch zu xic_ geändert wird, erst beim Edit wird prefix_ akzeptiert.

    Also immer schauen das prefix_ steht, dieses wird vom eigenen Script mit dem ersetzt, was in der config.php steht.
    rules :: doku :: faq :: linkus
    0 Mitglieder finden den Beitrag gut.
  18. #18
    User Pic
    ---Doc--- Mitglied
    Registriert seit
    05.08.2011
    Beitrge
    218
    Beitragswertungen
    4 Beitragspunkte
    Hm, Datenbanken sind für mich absolutes Neuland.
    Also sorry für die vielleicht dummen Fragen.

    Ist es dann ratsam es zu ändern?
    Is es gefahrlos? Also in Bezug darauf, weil ja zuvor ic als Prefix genommen wurde. Was passiert mit den alten Datenbankeinträgen? Werden sie automatisch angepaßt?

    Vielen Dank.
    0 Mitglieder finden den Beitrag gut.
  19. #19
    User Pic
    s4sch4 Mitglied
    Registriert seit
    09.12.2007
    Beitrge
    183
    Beitragswertungen
    5 Beitragspunkte
    ja, das ist gefahrlos, ihr greift ja normalerweise immer dierekt mit prefix auf die db zu, das geht natürlich auch, aber man kann auch das prefix in der config angeben und dann prefix_ verwenden, das ist absolut gefahrlos lcheln

    Aber vergess das mal, daran kann es eigendlich nicht liegen, es muss ein anderes Problem sein, ich denke es hängt evtl. mit euren erweiterungen / änderungen zusammen, hast du schon die letzte version probiert?
    Visit me on: www.ITRoyal.de
    Visit my Clan: www.United-SportZ.de
    Mein ilch Modul: Höhrercharts v0.8 für OnlineRadios
    0 Mitglieder finden den Beitrag gut.
  20. #20
    User Pic
    ---Doc--- Mitglied
    Registriert seit
    05.08.2011
    Beitrge
    218
    Beitragswertungen
    4 Beitragspunkte
    Also ich bin mit Version 1.1 O eingestiegen. Das ist doch die aktuellste.

    Was für Faxen macht den die Tabelle Grundrechte? Mir waren bislang keine Probleme aufgefallen.

    Am besten schaue ich später mal nach all den Erweiterungen, die installiert sind.
    0 Mitglieder finden den Beitrag gut.
  21. #21
    User Pic
    s4sch4 Mitglied
    Registriert seit
    09.12.2007
    Beitrge
    183
    Beitragswertungen
    5 Beitragspunkte
    probier erstmal diese hier:

    <?php
    // Copyright by: Manuel
    // Support: www.ilch.de
    defined ('main') or die ('no direct access');
    defined ('admin') or die ('only admin access');
      
    function user_get_group_list ($uid) {
        $l = 'Mitglied in Gruppen:<br />';
        $erg = db_query("SELECT xic_groups.name FROM xic_groupusers LEFT JOIN xic_groups ON xic_groups.id = xic_groupusers.gid WHERE xic_groupusers.uid = " . $uid);
        while ($r = db_fetch_assoc($erg)) {
            $l .= '- ' . $r['name'] . '<br />';
        }
        return ($l);
    }
      
    function user_get_all_mod_list () {
        $l = '';
        $erg = db_query("SELECT DISTINCT name FROM xic_modules WHERE fright = 1 ORDER BY xic_modules.name");
        while ($r = db_fetch_assoc($erg)) {
            $x = $r['name'];
            $l .= '<th style="font-size: 9px; font-weight: normal;" title="' . $r['name'] . '" valign="bottom">' . $x . '</th>';
        }
        return ($l);
    }
      
    function user_get_mod_change_list ($uid) {
        $l = '';
        $erg = db_query("SELECT xic_modules.id, uid FROM xic_modules LEFT JOIN xic_modulerights ON xic_modulerights.mid = xic_modules.id AND xic_modulerights.uid = " . $uid . " WHERE fright = 1 ORDER BY xic_modules.name");
        while ($r = db_fetch_assoc($erg)) {
            if ($r['uid'] == '') {
                $c = '';
            } else {
                $c = ' checked';
            }
            $l .= '<td align="center"><input onclick="changeModulRecht(' . $r['id'] . ',' . $uid . ')" type="checkbox" id="MN' . $r['id'] . '-' . $uid . '" name="MN' . $r['id'] . '-' . $uid . '" ' . $c . ' /></td>';
        }
        return ($l);
    }
      
    function user_get_mod_list ($uid) {
        $l = 'Modulrechte:<br />';
        $erg = db_query("SELECT DISTINCT module FROM xic_modulerights WHERE uid = " . $uid);
        while ($r = db_fetch_assoc($erg)) {
            $l .= '- ' . $r['module'] . '<br />';
        }
        return ($l);
    }
      
    function getfl($gid) {
        $liste = '';
        $erg = db_query("SELECT view,name,reply,start,mods FROM xic_forums WHERE view = " . $gid . " OR reply = " . $gid . " OR start = " . $gid . " OR mods = " . $gid);
        while ($row = db_fetch_assoc($erg)) {
            $v = ($row['view'] == $gid ? 'sehen/lesen,' : '');
            $r = ($row['reply'] == $gid ? 'antworten,' : '');
            $s = ($row['start'] == $gid ? 'Themen starten,' : '');
            $m = ($row['mods'] == $gid ? 'Moderieren,' : '');
            $liste .= $row['name'] . '<span class="smalfont">(' . $v . $r . $s . $m . ')</span>&nbsp;';
        }
        return($liste);
    }
      
    if (isset($_POST['action'])) {
        $design = new design ('Admins Area', 'Admins Area', 0);
        $design->header();
        $wdtext = 'Es ist ein Fehler aufgetreten.';
        if (chk_antispam('adminuser_action', true) and isset($_POST['uid'])) {
            $uid = escape($_POST['uid'], 'integer');
            switch($_POST['action']){
                // einen user komplett loeschen
                case 'deleteUser':
                    $name = get_n($uid);
                    if ($uid != 1 and !empty($name)) {
                        user_remove($uid);
                        $wdtext = 'Der User ' . $name . ' wurde erfolgreich gel&ouml;scht.';
                    }
                    break;
                // das recht eines users aendern
                case 'changeRight' :
                    $altes_recht = db_result(db_query("SELECT recht FROM xic_user WHERE id = " . $uid), 0);
                    $neues_recht = escape($_POST['newright'], 'integer');
                    if (($neues_recht > $_SESSION['authright'] AND $altes_recht > $_SESSION['authright']) OR ($_SESSION['authid'] == 1 AND $uid != 1)) {
                        $q = "UPDATE xic_user SET recht = " . $neues_recht . " WHERE id = " . $uid;
                        db_query($q);
                    }
                    $wdtext = false;
                break;
                // modulrechte fuer einen user aendern
                case 'changeModulRight' :
                    $modul = escape($_POST['modul'], 'integer');
                    $aktion = $_POST['giveremove'];
                    if ($aktion == 'give' AND 0 == db_result(db_query("SELECT COUNT(*) FROM xic_modulerights WHERE mid = '" . $modul . "' AND uid = " . $uid), 0)) {
                        db_query("INSERT INTO xic_modulerights (mid,uid) VALUES ('" . $modul . "'," . $uid . ")");
                    } elseif ($aktion == 'remove' AND 1 == db_result(db_query("SELECT COUNT(*) FROM xic_modulerights WHERE mid = '" . $modul . "' AND uid = " . $uid), 0)) {
                        db_query("DELETE FROM xic_modulerights WHERE mid = '" . $modul . "' AND uid = " . $uid);
                    }
                    $wdtext = false;
                break;
            }
        }
        if ($wdtext === false) {
            $antispam = get_antispam('adminuser_action', 0, true);
            ?><script type="text/javascript"><!--
                function updateParent() { parent.setNewAntispam(document.getElementById('tmp').childNodes[0]);}
                window.onload = function() { updateParent(); };
                //--></script>
                <div id="tmp"><?php echo $antispam; ?></div>
            <?php
            exit;
        }
        wd('admin.php?' . $menu->get_complete(), $wdtext, 5);
        $design->footer(1);
    }
     
     
     
    $um = $menu->get(1);
    switch ($um) {
        default :
         
        // FILTER FORM
    $filter22 = '';
    $que22 = db_query("SELECT * FROM xic_grundrechte");
     
        $filter22 .= '<select name="filter22"><option value="">Recht whlen</option>';
         
        while($wor22 = db_fetch_object($que22)) {
        $filter22 .= '<option value="'.$wor22->id.'">'.$wor22->name.'</option>';
        }
         
        $filter22 .= '</select>';
    // END FILTER FORM
     
            $design = new design ('Admins Area', 'Admins Area', 2);
            $design->header();
            $q = '';
            if (isset($_REQUEST['q'])) {
                $q = escape($_REQUEST['q'], 'string');
            }
            $tpl = new tpl ('user/user', 1);
            $tpl->set('modlall', user_get_all_mod_list());
            $tpl->set('anzmods', db_result(db_query("SELECT COUNT(*) FROM xic_modules WHERE fright = 1"), 0));
            $tpl->set('action_antispam', get_antispam('adminuser_action', 0, true));
            $tpl->set('filter22', $filter22, 0);
            $tpl->set_out('q', unescape($q), 0);
      
            $q = str_replace('*', '%', $q);
            if (strpos($q, '%') === false) {
                $q = $q . '%';
            }
      
            $limit = 30; // Limit
             
            $page = ($menu->getA(1) == 'p' ? $menu->getE(1) : 1);
             
            $MPL = db_make_sites ($page , "WHERE name LIKE '" . $q . "'" , $limit , '?user' , 'user');
             
            $anfang = ($page - 1) * $limit;
            $class = '';
             
            $que = "SELECT name,recht,id FROM `xic_user` WHERE name LIKE '" . $q . "' ORDER by recht,posts DESC LIMIT " . $anfang . "," . $limit;
    		
    		if(isset($_GET['filter22']) && !empty($_GET['q']) && $_GET['filter22'] != "0") {
    		
    		$grid = escape($_GET['filter22'], 'integer');
    		
    		$que = "SELECT name,recht,id FROM `xic_user` WHERE name LIKE '" . $q . "' AND recht = '" . $grid . "' ORDER by recht,posts DESC";
    		$que2 = db_query("SELECT COUNT(id) as ges FROM `xic_user` WHERE name LIKE '" . $q . "' AND recht = '" . $grid . "' ORDER by recht,posts DESC");
    		$rowq = db_fetch_object($que2);
    		$ges = $rowq->ges;
    		$MPL = "Gesamt: ".$ges;
    		} elseif(isset($_GET['filter22']) && empty($_GET['q']) && $_GET['filter22'] != "0") {
    		
    		$grid = escape($_GET['filter22'], 'integer');
    		
    		$que = "SELECT name,recht,id FROM `xic_user` WHERE recht = '" . $grid . "' ORDER by recht,posts DESC";
    		$que2 = db_query("SELECT COUNT(id) as ges FROM `xic_user` WHERE recht = '" . $grid . "' ORDER by recht,posts DESC");
    		$rowq = db_fetch_object($que2);
    		$ges = $rowq->ges;
    		$MPL = "Gesamt: ".$ges;
    		
    		} elseif(isset($_GET['filter22']) && empty($_GET['q']) && $_GET['filter22'] == "0") {
    		
    		$grid = escape($_GET['filter22'], 'integer');
    		
    		$que = "SELECT name,recht,id FROM `xic_user` WHERE recht = 0 ORDER by recht,posts DESC";
    		$que2 = db_query("SELECT COUNT(id) as ges FROM `xic_user` WHERE recht = 0 ORDER by recht,posts DESC");
    		$rowq = db_fetch_object($que2);
    		$ges = $rowq->ges;
    		$MPL = "Gesamt: ".$ges;
    		
    		} elseif(!empty($_GET['q']) && $_GET['filter22'] == "0") {
    		
    		$grid = escape($_GET['filter22'], 'integer');
    		
    		$que = "SELECT name,recht,id FROM `xic_user` WHERE name LIKE '" . $q . "' AND recht = 0 ORDER by recht,posts DESC";
    		$que2 = db_query("SELECT COUNT(id) as ges FROM `xic_user` WHERE name LIKE '" . $q . "' AND recht = 0 ORDER by recht,posts DESC");
    		$rowq = db_fetch_object($que2);
    		$ges = $rowq->ges;
    		$MPL = "Gesamt: ".$ges;
    		
    		} elseif(empty($_GET['filter22']) && empty($_GET['q'])) {
    		
    		$que = "SELECT name,recht,id FROM `xic_user` WHERE name LIKE '" . $q . "' ORDER by recht,posts DESC LIMIT " . $anfang . "," . $limit;
    		
    		}
             
            $erg = db_query($que);
            while ($row = db_fetch_object($erg)) {
                if ($class == 'Cmite') {
                    $class = 'Cnorm';
                } else {
                    $class = 'Cmite';
                }
                $ar = array ('name' => $row->name,
                    'class' => $class,
                    'id' => $row->id,
                    'grouplist' => user_get_group_list($row->id),
                    'recht' => dblistee($row->recht, "SELECT id,name FROM xic_grundrechte ORDER BY id ASC"),
                    'modslist' => user_get_mod_change_list($row->id),
                    );
      
                $tpl->set_ar_out($ar, 1);
            }
            $tpl->set_out('MPL', $MPL, 2);
            $design->footer();
            break;
      
        // gruppen zugehoerigkeiten eines users aendern
        case 'gruppen' :
            $uid = $menu->get(2);
            if (isset($_POST['usergroups'])) {
                $erg = db_query("SELECT id FROM xic_groups");
                while ($row = db_fetch_assoc($erg)) {
                    $ck = db_count_query("SELECT COUNT(uid) FROM xic_groupusers WHERE uid = " . $uid . " AND gid = " . $row['id']);
                    if ($ck == 0 AND isset ($_POST['grprhave'][$row['id']][$uid])) {
                        db_query("INSERT INTO xic_groupusers (uid,gid,fid) VALUES ( " . $uid . ", " . $row['id'] . ", 3 )");
                    } elseif ($ck == 1 AND !isset ($_POST['grprhave'][$row['id']][$uid])) {
                        db_query("DELETE FROM xic_groupusers WHERE uid = " . $uid . " AND gid = " . $row['id']);
                    }
                }
            }
      
            $user_name = db_result(db_query("SELECT name FROM xic_user WHERE id = " . $uid), 0);
            $tpl = new tpl ('user/gruppen', 1);
            $tpl->set_ar_out(array('username' => $user_name, 'userid' => $uid), 0);
            $class = 'Cnorm';
            $erg = db_query("SELECT name,id FROM xic_groups");
            while ($row = db_fetch_assoc($erg)) {
                $ck = db_count_query("SELECT COUNT(uid) FROM xic_groupusers WHERE uid = " . $uid . " AND gid = " . $row['id']);
                $row['ck'] = ($ck == 0 ? '' : 'checked');
                $class = ($class == 'Cnorm' ? 'Cmite' : 'Cnorm');
                $row['class'] = $class;
                $tpl->set_ar_out($row, 1);
            }
            $tpl->out(2);
            break;
      
        // details eines users anzeigen
        case 1 :
            $design = new design ('Admins Area', 'Admins Area', 2);
            $design->header();
            if (isset ($_REQUEST['uID'])) {
                $uid = $_REQUEST['uID'];
            } else {
                $uid = $menu->get(2);
            }
            $erg = db_query("SELECT name,email,id,recht,wohnort,homepage,aim,msn,icq,yahoo,status,staat,gebdatum,sig,opt_pm,opt_pm_popup,opt_mail,geschlecht,spezrank,game,spielerfahrungen,clan,map,waffe,essen,trinken,film,musik,sport,cpu,mainboard,ram,monitor,grafikkarte,soundkarte,festplatte,i_net_verbindung,tastatur,maus,jappy,facebook,wkw,studivz,myspace,youtube,avatar FROM xic_user WHERE id = '" . $uid . "'");
            if (db_num_rows($erg) == 0) {
                die ('Fehler: Username nicht gefunden <a href="?user">zur&uuml;ck</a>');
            } else {
                $row = db_fetch_assoc($erg);
      
                $tpl = new tpl ('user/details', 1);
                $row['recht'] = dbliste ($row['recht'] , $tpl, 'recht', "SELECT id,name FROM xic_grundrechte ORDER BY id ASC");
                $row['staat'] = '<option></option>' . arliste ($row['staat'] , get_nationality_array() , $tpl , 'staat');
                $row['spezrank'] = '<option></option>' . dbliste ($row['spezrank'], $tpl, 'spezrank', "SELECT id, bez FROM xic_ranks WHERE spez = 1 ORDER BY id");
      
                $row['geschlecht0'] = ($row['geschlecht'] < 1 ? 'checked' : '');
                $row['geschlecht1'] = ($row['geschlecht'] == 1 ? 'checked' : '');
                $row['geschlecht2'] = ($row['geschlecht'] == 2 ? 'checked' : '');
                if ($row['status'] == 1) {
                    $row['status1'] = 'checked';
                    $row['status0'] = '';
                } else {
                    $row['status1'] = '';
                    $row['status0'] = 'checked';
                }
                if ($row['opt_mail'] == 1) {
                    $row['opt_mail1'] = 'checked';
                    $row['opt_mail0'] = '';
                } else {
                    $row['opt_mail1'] = '';
                    $row['opt_mail0'] = 'checked';
                }
                if ($row['opt_pm'] == 1) {
                    $row['opt_pm1'] = 'checked';
                    $row['opt_pm0'] = '';
                } else {
                    $row['opt_pm1'] = '';
                    $row['opt_pm0'] = 'checked';
                }
                if ($row['opt_pm_popup'] == 1) {
                    $row['opt_pm_popup1'] = 'checked';
                    $row['opt_pm_popup0'] = '';
                } else {
                    $row['opt_pm_popup1'] = '';
                    $row['opt_pm_popup0'] = 'checked';
                }
                if (@file_exists($row['avatar'])) {
                    $row['avatar'] = '<img src="' . $row['avatar'] . '" border="0" /><br />' ;
                }else {
                    $row['avatar'] = '';
                }
                $row['antispam'] = get_antispam('adminuser', 0, true);
                $tpl->set_ar_out ($row, 0);
      
                profilefields_change ($row['id']);
      
                $tpl->out(1);
            }
            $design->footer();
            break;
        // details des users aendern
        case 2 :
            $design = new design ('Admins Area', 'Admins Area', 2);
            $design->header();
            $changeok = true;
            $uid = escape($_POST['uID'], 'integer');
      
            $altes_recht = db_result(db_query("SELECT recht FROM xic_user WHERE id = " . $uid), 0);
            $neues_recht = escape($_POST['urecht'], 'integer');
            if (($neues_recht <= $_SESSION['authright'] OR $altes_recht <= $_SESSION['authright']) AND $_SESSION['authid'] > 1) {
                $changeok = false;
            }
      
            if ($changeok and chk_antispam('adminuser', true)) {
                if (isset($_POST['userdel'])) {
                    user_remove($uid);
                    wd ('?user', 'User wurde erfolgreich gel&ouml;scht');
                } else {
                    $abf = "SELECT * FROM xic_user WHERE id = '" . $uid . "'";
                    $erg = db_query($abf);
                    $row = db_fetch_object($erg);
      
                    if (isset($_POST['passw'])) {
                        $newPass = genkey (8);
                        $newPassMD5 = md5($newPass);
                        icmail ($row->email , 'neues Password' , "Hallo\n\nDein Password wurde soeben von einem Administrator gendert es ist nun:\n\n$newPass\n\nGru der Administrator");
                        db_query('UPDATE `xic_user` SET pass = "' . $newPassMD5 . '" WHERE id = "' . escape($_POST['uID'], 'integer') . '"');
                    }
                    // avatar speichern START
                    $avatar_sql_update = '';
                    if (!empty ($_FILES['avatarfile']['name'])) {
                        $file_tmpe = $_FILES['avatarfile']['tmp_name'];
                        $rile_type = ic_mime_type ($_FILES['avatarfile']['tmp_name']);
                        $file_type = $_FILES['avatarfile']['type'];
                        $file_size = $_FILES['avatarfile']['size'];
                        $fmsg = $lang['avatarisnopicture'];
                        $size = @getimagesize ($file_tmpe);
                        $endar = array (1 => 'gif', 2 => 'jpg', 3 => 'png');
                        if (($size[2] == 1 OR $size[2] == 2 OR $size[2] == 3) AND $size[0] > 10 AND $size[1] > 10 AND substr ($file_type , 0 , 6) == 'image/' AND substr ($rile_type , 0 , 6) == 'image/') {
                            $endung = $endar[$size[2]];
                            $breite = $size[0];
                            $hoehe = $size[1];
                            $neuer_name = 'include/images/avatars/' . $uid . '.' . $endung;
                            @unlink (db_result(db_query("SELECT avatar FROM xic_user WHERE id = " . $uid), 0));
                            move_uploaded_file ($file_tmpe , $neuer_name);
                            @chmod($neuer_name, 0777);
                            $avatar_sql_update = ', avatar = "' . $neuer_name . '"';
                            $fmsg = $lang['pictureuploaded'];
                        }
                    } elseif (isset($_POST['avatardel'])) {
                        $fmsg = $lang['picturedelete'];
                        @unlink (db_result(db_query("SELECT avatar FROM xic_user WHERE id = " . $uid), 0));
                        $avatar_sql_update = ', avatar = ""';
                    }
                    // avatar speichern ENDE
                    profilefields_change_save (escape($_POST['uID'], 'integer'));
     
                    $usaName1 = escape($_POST['usaName1'], 'string');
                    $email = escape($_POST['email'], 'string');
                    $homepage = escape($_POST['homepage'], 'string');
                    $wohnort = escape($_POST['wohnort'], 'string');
                    $icq = escape($_POST['icq'], 'string');
                    $msn = escape($_POST['msn'], 'string');
                    $yahoo = escape($_POST['yahoo'], 'string');
                    $aim = escape($_POST['aim'], 'string');
                    $staat = escape($_POST['staat'], 'string');
                    $spezrank = escape($_POST['spezrank'], 'integer');
                    $geschlecht = escape($_POST['geschlecht'], 'integer');
                    $status = escape($_POST['status'], 'integer');
                    $opt_mail = escape($_POST['opt_mail'], 'integer');
                    $opt_pm = escape($_POST['opt_pm'], 'integer');
                    $opt_pm_popup = escape($_POST['opt_pm_popup'], 'integer');
                    $gebdatum = escape($_POST['gebdatum'], 'string');
                    $game = escape($_POST['game'], 'string');
                    $spielerfahrungen = escape($_POST['spielerfahrungen'], 'string');
                    $clan = escape($_POST['clan'], 'string');
                    $map = escape($_POST['map'], 'string');
                    $waffe = escape($_POST['waffe'], 'string');
                    $essen = escape($_POST['essen'], 'string');
                    $trinken = escape($_POST['trinken'], 'string');
                    $film = escape($_POST['film'], 'string');
                    $musik = escape($_POST['musik'], 'string');
                    $sport = escape($_POST['sport'], 'string');
                    $cpu = escape($_POST['cpu'], 'string');
                    $mainboard = escape($_POST['mainboard'], 'string');
                    $ram = escape($_POST['ram'], 'string');
                    $monitor = escape($_POST['monitor'], 'string');
                    $grafikkarte = escape($_POST['grafikkarte'], 'string');
                    $soundkarte = escape($_POST['soundkarte'], 'string');
                    $festplatte = escape($_POST['festplatte'], 'string');
                    $i_net_verbindung = escape($_POST['i_net_verbindung'], 'string');
                    $tastatur= escape($_POST['tastatur'], 'string');
                    $maus = escape($_POST['maus'], 'string');
                    $jappy = escape($_POST['jappy'], 'string');
                    $facebook = escape($_POST['facebook'], 'string');
                    $wkw = escape($_POST['wkw'], 'string');
                    $studivz = escape($_POST['studivz'], 'string');
                    $myspace = escape($_POST['myspace'], 'string');
                    $youtube = escape($_POST['youtube'], 'string');
                    $sig = escape($_POST['sig'], 'string');
                    // Name im Forum ndern
                    if ($_POST['forumname'] == 'on') {
                        $oldname = db_count_query("SELECT name FROM `xic_user` WHERE id =" . $uid);
                        if ($oldname != $usaName1) {
                            db_query("UPDATE `xic_posts` SET erst = '$usaName1' WHERE erstid = " . $uid);
                            db_query("UPDATE `xic_topics` SET erst = '$usaName1' WHERE erst = '$oldname'");
                        }
                    }
                    db_query('UPDATE xic_user
                  SET
                        name  = "' . $usaName1 . '",
                        recht = "' . $neues_recht . '",
                        email = "' . $email . '",
              homepage = "' . $homepage . '",
              wohnort = "' . $wohnort . '",
              icq = "' . $icq . '",
              msn = "' . $msn . '",
              yahoo = "' . $yahoo . '",
              aim = "' . $aim . '",
              staat = "' . $staat . '",
              spezrank = "' . $spezrank . '",
              geschlecht = "' . $geschlecht . '",
              status = "' . $status . '",
              opt_mail = "' . $opt_mail . '",
              opt_pm = "' . $opt_pm . '",
              opt_pm_popup = "' . $opt_pm_popup . '",
              gebdatum = "' . $gebdatum . '",
              game = "' . $game . '",
              spielerfahrungen = "' . $spielerfahrungen . '",
              clan = "' . $clan . '",
              map = "' . $map . '",
              waffe = "' . $waffe . '",
              essen = "' . $essen . '",
              trinken = "' . $trinken . '",
              film = "' . $film . '",
              musik = "' . $musik . '",
              sport = "' . $sport . '",
              cpu = "' . $cpu . '",
              mainboard = "' . $mainboard . '",
              ram = "' . $ram . '",
              monitor = "' . $monitor . '",
              grafikkarte = "' . $grafikkarte . '",
              soundkarte = "' . $soundkarte . '",
              festplatte = "' . $festplatte . '",
              i_net_verbindung = "' . $i_net_verbindung . '",
              tastatur = "' . $tastatur . '",
              maus = "' . $maus . '",
              jappy = "' . $jappy . '",
              facebook = "' . $facebook . '",
              wkw = "' . $wkw . '",
              studivz = "' . $studivz . '",
              myspace = "' . $myspace . '",
              youtube = "' . $youtube . '",
              sig = "' . $sig . '"
              ' . $avatar_sql_update . '
                    WHERE id = "' . $uid . '"');
                }
            }
            wd('admin.php?user-1-' . $uid, 'Das Profil wurde erfolgreich geaendert', 2);
            $design->footer();
            break;
        // mal kurz nen neuen user anlegen
        case 'createNewUser' :
            $msg = '';
            if (!empty($_POST['name']) AND !empty($_POST['pass']) AND !empty($_POST['email']) and chk_antispam('adminuser_create', true)) {
                $_POST['name'] = escape($_POST['name'], 'string');
                $_POST['recht'] = escape($_POST['recht'], 'integer');
                $_POST['email'] = escape($_POST['email'], 'string');
                $erg = db_query("SELECT id FROM xic_user WHERE name = BINARY '" . $_POST['name'] . "'");
                if (db_num_rows($erg) > 0) {
                    $msg = 'Der Name ist leider schon vorhanden!';
                } else {
                    $new_pass = $_POST['pass'];
                    $md5_pass = md5($new_pass);
                    db_query("INSERT INTO xic_user (name,pass,recht,regist,llogin,email)
                VALUES('" . $_POST['name'] . "','" . $md5_pass . "'," . $_POST['recht'] . ",'" . time() . "','" . time() . "','" . $_POST['email'] . "')");
                    $userid = db_last_id();
                    db_query("INSERT INTO xic_userfields (uid,fid,val) VALUES (" . $userid . ",2,'1')");
                    db_query("INSERT INTO xic_userfields (uid,fid,val) VALUES (" . $userid . ",3,'1')");
      
                    if (isset($_POST['info'])) {
                        $page = $_SERVER["HTTP_HOST"] . $_SERVER["SCRIPT_NAME"];
                        $page = str_replace('admin.php', 'index.php', $page);
                        $tpl = new tpl ('user/new_user_email', 1);
                        $tpl->set('name', $_POST['name']);
                        $tpl->set('pass', $_POST['pass']);
                        $tpl->set('page', $page);
                        $txt = $tpl->get(0);
                        unset($tpl);
                        icmail ($_POST['email'], 'Admin hat dich angelegt', $txt);
                    }
                    $msg = 'Benutzer angelegt <a href="javascript:closeThisWindow()">Fenster schlieen</a>';
                }
            }
            $pass = '';
            $email = '';
            $recht = '';
            if (isset($_POST['pass'])) {
                $pass = $_POST['pass'];
            }
            if (isset($_POST['email'])) {
                $email = $_POST['email'];
            }
            if (isset($_POST['recht'])) {
                $recht = $_POST['recht'];
            } else {
                $recht = '-1';
            }
            $tpl = new tpl ('user/new_user', 1);
            $tpl->set('msg', $msg);
            $tpl->set('pass', $pass);
            $tpl->set('email', $email);
            $tpl->set('recht', dblistee($recht, "SELECT id,name FROM xic_grundrechte ORDER BY id ASC"));
            $tpl->set('antispam', get_antispam('adminuser_create', 0, true));
            $tpl->out(0);
            break;
    }
      
    ?>


    hier gibs zwar noch ein problem wenn man gäste sucht aber darum gehts erstmal net, hauptsächlich müssen wir schauen wos bei dir hapert...

    Also teste mal Bitte und poste die fehlermeldungen...


    EDIT: hab die jetzt nochmal geändert, der bug bei den gästen ist jetzt raus...


    Zuletzt modifiziert von s4sch4 am 28.11.2011 - 11:51:47
    Visit me on: www.ITRoyal.de
    Visit my Clan: www.United-SportZ.de
    Mein ilch Modul: Höhrercharts v0.8 für OnlineRadios
    0 Mitglieder finden den Beitrag gut.
  22. #22
    User Pic
    ---Doc--- Mitglied
    Registriert seit
    05.08.2011
    Beitrge
    218
    Beitragswertungen
    4 Beitragspunkte
    Die php aus www.ilch.de/index.php?forum-showposts-46614-p1#331637 funktioniert ja ohne Fehler.

    Die aus dem letzten Post ergibt diese Meldung:

    MySQL Error:
    1146 : Tabelle 'usr_web1483_2.xic_grundrechte' existiert nicht
    in Query:
    SELECT * FROM xic_grundrechte
    
    Debug backtrace:
    	@ mysql.php:32 -- debug_bt()
    	@ mysql.php:50 -- db_check_error(...)
    	@ user.php:122 -- db_query(...)
    	@ admin.php:36 -- require_once(...)
    
    
    Warning: mysql_fetch_object(): supplied argument is not a valid MySQL result resource in /var/www/web1483/html/ilch/include/includes/func/db/mysql.php on line 69
    
    Warning: Cannot modify header information - headers already sent by (output started at /var/www/web1483/html/ilch/include/includes/func/db/mysql.php:32) in /var/www/web1483/html/ilch/include/includes/class/design.php on line 23
    Seite	Admin	User	Eigene Box/Page	Clanbox	Content	Module
    			
    MySQL Error:
    1146 : Tabelle 'usr_web1483_2.xic_modules' existiert nicht
    in Query:
    SELECT DISTINCT name FROM xic_modules WHERE fright = 1 ORDER BY xic_modules.name
    
    Debug backtrace:
    	@ mysql.php:32 -- debug_bt()
    	@ mysql.php:50 -- db_check_error()
    	@ user.php:18 -- db_query()
    	@ user.php:140 -- user_get_all_mod_list()
    	@ admin.php:36 -- require_once(...)
    
    MySQL Error:
    1146 : Tabelle 'usr_web1483_2.xic_modules' existiert nicht
    in Query:
    SELECT COUNT(*) FROM xic_modules WHERE fright = 1
    
    Debug backtrace:
    	@ mysql.php:32 -- debug_bt()
    	@ mysql.php:50 -- db_check_error()
    	@ user.php:141 -- db_query()
    	@ admin.php:36 -- require_once(...)
    
    
    Warning: mysql_result(): supplied argument is not a valid MySQL result resource in /var/www/web1483/html/ilch/include/includes/func/db/mysql.php on line 54
    Noch nicht besttigte Registrierungen verwalten
    	und / oder Filtern nach Rechten: 	
    
    
    
    MySQL Error:
    1146 : Tabelle 'usr_web1483_2.xic_user' existiert nicht
    in Query:
    SELECT name,recht,id FROM `xic_user` WHERE name LIKE '%' ORDER by recht,posts DESC LIMIT 0,30
    
    Debug backtrace:
    	@ mysql.php:32 -- debug_bt()
    	@ mysql.php:50 -- db_check_error(...)
    	@ user.php:207 -- db_query(...)
    	@ admin.php:36 -- require_once(...)
    
    
    Warning: mysql_fetch_object(): supplied argument is not a valid MySQL result resource in /var/www/web1483/html/ilch/include/includes/func/db/mysql.php on line 69



    Zuletzt modifiziert von ---Doc--- am 28.11.2011 - 12:52:54
    0 Mitglieder finden den Beitrag gut.
  23. #23
    User Pic
    Lord|Schirmer Administrator
    Registriert seit
    21.03.2007
    Beitrge
    7.509
    Beitragswertungen
    1165 Beitragspunkte
    Wie schon oben im meinem Post erwähnt ... manuell xic_ zu prefix_ im Code ändern!


    Zuletzt modifiziert von Lord|Schirmer am 28.11.2011 - 15:47:07
    rules :: doku :: faq :: linkus
    0 Mitglieder finden den Beitrag gut.
  24. #24
    User Pic
    ---Doc--- Mitglied
    Registriert seit
    05.08.2011
    Beitrge
    218
    Beitragswertungen
    4 Beitragspunkte
    Ah, sehe auch gerade warum. Dann werde ich das heute abend mach machen. Im Moment habe ich keinen Zugriff auf die Datenbank.

    Ich hoffe nur, daß icht in den anderen Erweiterungen soetwas ähnliches wie SELECT ic_modules.id steht (und es nach der prefix Anpassung SELECT xic_modules.id heißen muß), sonst muß ich das ja händisch in den phps anpassen, oder sehe ich das falsch?

    Wobei ich ehrlich sein muß, das mit dem ic bzw. xic verstehe ich nicht wirklich, da ic in der 1.1O ja standardäßig geschrieben ist. Da wäre es doch sinniger, wenn Erweiterungen da nicht selbstständig xic verwenden.
    0 Mitglieder finden den Beitrag gut.
  25. #25
    User Pic
    Lord|Schirmer Administrator
    Registriert seit
    21.03.2007
    Beitrge
    7.509
    Beitragswertungen
    1165 Beitragspunkte
    Nein Doc ... nochmal zum mitschreiben. Im Code muss es immer prefix_tabellenname heißen. Hier im Forum auf Ilch.de, wird aufgrund eines Fehler momentan noch immer das prefix_ zu xic_ umgewandelt, was natürlich dann Fehler verursacht.

    ALSO: Bei Dir muss es immer prefix_ heißen, was dann evtl. im Script angepasst werden muss!


    Zuletzt modifiziert von Lord|Schirmer am 28.11.2011 - 16:45:16
    rules :: doku :: faq :: linkus
    0 Mitglieder finden den Beitrag gut.
  26. #26
    User Pic
    ---Doc--- Mitglied
    Registriert seit
    05.08.2011
    Beitrge
    218
    Beitragswertungen
    4 Beitragspunkte
    ZitatZitat
    ALSO: Bei Dir muss es immer prefix_ heißen, was dann evtl. im Script angepasst werden muss!


    Das meinte ich damit.
    In der config.php muß das ic, das bei der Erstinstallation vom cms eingetragen wurde in xic geändert werden. In der config.php hatte ich nur den Datenbanknamen eingetragen, aber das Prefix unangetastet gelassen.
    Scripte, die auf den Standard angepaßt sind, müssen dann auch geändert werden. Ich muß also die Stellen suchen, bei denen ic_ steht und diese auch anpassen.

    Ich finde es nur seltsam, daß man nicht beim ic_ geblieben ist (ilch hatte ich vor ca. einem halben Jahr heruntergeladen und installiert, da war also immer noch ic eingetragen, was dann hätte angepaßt oder darauf hingewiesen werden müssen.)
    0 Mitglieder finden den Beitrag gut.
  27. #27
    User Pic
    Tr3icio gelschter User
    Hat Ilch immer noch? Oo
    Die Codebox auf Ilch.de ist verbuggt. Die ersetzt prefix_ in xic_ .
    Man muss nur wenn man Code von hier kopiert das xic_ in prefix_ ersetzen

    Sollten die mal bald fixen


    Zuletzt modifiziert von Tr3icio am 28.11.2011 - 17:19:34
    0 Mitglieder finden den Beitrag gut.
  28. #28
    User Pic
    ---Doc--- Mitglied
    Registriert seit
    05.08.2011
    Beitrge
    218
    Beitragswertungen
    4 Beitragspunkte
    Also dann werde ich doch viel lieber beim kopieren code aus dem Forum xic wieder zurück in ic1 ersetzen.
    Testweise habe ich die config gerade angepaßt. Ergebnis war, es hagelt Fehlermeldung beim Aufruf der Seite.

    Jedes von mir installierte Modul funktioniert einwandfrei mit ic1. Ich denke, da bin ich auch nicht der einzige. Da solle doch lieber die Codebox angepaßt werden als daß jeder Nutzer von ilch seine gesamten Scripte durchwühlen muß um ic1 durch xic zu ersetzen.

    Im Moment fehlt mir die Zeit um genau das für unsere Seite zu machen, ich komme nur hin und wieder dazu daran zu arbeiten. Die Prefix Änderung muß aber ja komplett gemacht werden, sonst funktioniert einiges nicht.
    Der vorletzte Code von Dir funktioniert ja einwandfrei bis auf das Gästeproblem, daß Du erwähnt hast. Das ist aber kein Problem. Ich belasse es erst einmal dabei anstatt alles nach ic1 zu durchsuchen und hole das nach, sobald ich etwas Luft habe.

    Vielen Dank für die Mühen. Hoffe Deine Erkältung ist auf dem Weg der Besserung.
    0 Mitglieder finden den Beitrag gut.
  29. #29
    User Pic
    s4sch4 Mitglied
    Registriert seit
    09.12.2007
    Beitrge
    183
    Beitragswertungen
    5 Beitragspunkte
    So, hab die nochmal verändert, da war noch nen kleiner bug wenn man gäste anzeigen lassen will...

    <?php
    // Copyright by: Manuel
    // Support: www.ilch.de
    defined ('main') or die ('no direct access');
    defined ('admin') or die ('only admin access');
     
    function user_get_group_list ($uid) {
        $l = 'Mitglied in Gruppen:<br />';
        $erg = db_query("SELECT xic_groups.name FROM xic_groupusers LEFT JOIN xic_groups ON xic_groups.id = xic_groupusers.gid WHERE xic_groupusers.uid = " . $uid);
        while ($r = db_fetch_assoc($erg)) {
            $l .= '- ' . $r['name'] . '<br />';
        }
        return ($l);
    }
     
    function user_get_all_mod_list () {
        $l = '';
        $erg = db_query("SELECT DISTINCT name FROM xic_modules WHERE fright = 1 ORDER BY xic_modules.name");
        while ($r = db_fetch_assoc($erg)) {
            $x = $r['name'];
            $l .= '<th style="font-size: 9px; font-weight: normal;" title="' . $r['name'] . '" valign="bottom">' . $x . '</th>';
        }
        return ($l);
    }
     
    function user_get_mod_change_list ($uid) {
        $l = '';
        $erg = db_query("SELECT xic_modules.id, uid FROM xic_modules LEFT JOIN xic_modulerights ON xic_modulerights.mid = xic_modules.id AND xic_modulerights.uid = " . $uid . " WHERE fright = 1 ORDER BY xic_modules.name");
        while ($r = db_fetch_assoc($erg)) {
            if ($r['uid'] == '') {
                $c = '';
            } else {
                $c = ' checked';
            }
            $l .= '<td align="center"><input onclick="changeModulRecht(' . $r['id'] . ',' . $uid . ')" type="checkbox" id="MN' . $r['id'] . '-' . $uid . '" name="MN' . $r['id'] . '-' . $uid . '" ' . $c . ' /></td>';
        }
        return ($l);
    }
     
    function user_get_mod_list ($uid) {
        $l = 'Modulrechte:<br />';
        $erg = db_query("SELECT DISTINCT module FROM xic_modulerights WHERE uid = " . $uid);
        while ($r = db_fetch_assoc($erg)) {
            $l .= '- ' . $r['module'] . '<br />';
        }
        return ($l);
    }
     
    function getfl($gid) {
        $liste = '';
        $erg = db_query("SELECT view,name,reply,start,mods FROM xic_forums WHERE view = " . $gid . " OR reply = " . $gid . " OR start = " . $gid . " OR mods = " . $gid);
        while ($row = db_fetch_assoc($erg)) {
            $v = ($row['view'] == $gid ? 'sehen/lesen,' : '');
            $r = ($row['reply'] == $gid ? 'antworten,' : '');
            $s = ($row['start'] == $gid ? 'Themen starten,' : '');
            $m = ($row['mods'] == $gid ? 'Moderieren,' : '');
            $liste .= $row['name'] . '<span class="smalfont">(' . $v . $r . $s . $m . ')</span>&nbsp;';
        }
        return($liste);
    }
     
    if (isset($_POST['action'])) {
        $design = new design ('Admins Area', 'Admins Area', 0);
        $design->header();
        $wdtext = 'Es ist ein Fehler aufgetreten.';
        if (chk_antispam('adminuser_action', true) and isset($_POST['uid'])) {
            $uid = escape($_POST['uid'], 'integer');
            switch($_POST['action']){
                // einen user komplett loeschen
                case 'deleteUser':
                    $name = get_n($uid);
                    if ($uid != 1 and !empty($name)) {
                        user_remove($uid);
                        $wdtext = 'Der User ' . $name . ' wurde erfolgreich gel&ouml;scht.';
                    }
                    break;
                // das recht eines users aendern
                case 'changeRight' :
                    $altes_recht = db_result(db_query("SELECT recht FROM xic_user WHERE id = " . $uid), 0);
                    $neues_recht = escape($_POST['newright'], 'integer');
                    if (($neues_recht > $_SESSION['authright'] AND $altes_recht > $_SESSION['authright']) OR ($_SESSION['authid'] == 1 AND $uid != 1)) {
                        $q = "UPDATE xic_user SET recht = " . $neues_recht . " WHERE id = " . $uid;
                        db_query($q);
                    }
                    $wdtext = false;
                break;
                // modulrechte fuer einen user aendern
                case 'changeModulRight' :
                    $modul = escape($_POST['modul'], 'integer');
                    $aktion = $_POST['giveremove'];
                    if ($aktion == 'give' AND 0 == db_result(db_query("SELECT COUNT(*) FROM xic_modulerights WHERE mid = '" . $modul . "' AND uid = " . $uid), 0)) {
                        db_query("INSERT INTO xic_modulerights (mid,uid) VALUES ('" . $modul . "'," . $uid . ")");
                    } elseif ($aktion == 'remove' AND 1 == db_result(db_query("SELECT COUNT(*) FROM xic_modulerights WHERE mid = '" . $modul . "' AND uid = " . $uid), 0)) {
                        db_query("DELETE FROM xic_modulerights WHERE mid = '" . $modul . "' AND uid = " . $uid);
                    }
                    $wdtext = false;
                break;
            }
        }
        if ($wdtext === false) {
            $antispam = get_antispam('adminuser_action', 0, true);
            ?><script type="text/javascript"><!--
                function updateParent() { parent.setNewAntispam(document.getElementById('tmp').childNodes[0]);}
                window.onload = function() { updateParent(); };
                //--></script>
                <div id="tmp"><?php echo $antispam; ?></div>
            <?php
            exit;
        }
        wd('admin.php?' . $menu->get_complete(), $wdtext, 5);
        $design->footer(1);
    }
    
    
    
    $um = $menu->get(1);
    switch ($um) {
        default :
    	
    	// FILTER FORM
    $filter22 = '';
    $que22 = db_query("SELECT * FROM xic_grundrechte");
    $filter22 .= '<select name="filter22"><option value="">Recht whlen</option>';
    while($wor22 = db_fetch_object($que22)) {
    $filter22 .= '<option value="'.$wor22->id.'">'.$wor22->name.'</option>';
    }
    $filter22 .= '</select>';
    // END FILTER FORM
    
            $design = new design ('Admins Area', 'Admins Area', 2);
            $design->header();
            $q = '';
            if (isset($_REQUEST['q'])) {
                $q = escape($_REQUEST['q'], 'string');
            }
    		
            if (isset($_REQUEST['filter22'])) {
    		    $r = escape($_REQUEST['filter22'], 'string');
    		}
    		
            $tpl = new tpl ('user/user', 1);
            $tpl->set('modlall', user_get_all_mod_list());
            $tpl->set('anzmods', db_result(db_query("SELECT COUNT(*) FROM xic_modules WHERE fright = 1"), 0));
            $tpl->set('action_antispam', get_antispam('adminuser_action', 0, true));
    		$tpl->set('filter22', $filter22, 0);
            $tpl->set_out('q', unescape($q), 0);
     
            $q = str_replace('*', '%', $q);
            if (strpos($q, '%') === false) {
                $q = $q . '%';
            }
     
            $limit = 30; // Limit
    		
            $page = ($menu->getA(1) == 'p' ? $menu->getE(1) : 1);
    		
            $MPL = db_make_sites ($page , "WHERE name LIKE '" . $q . "'" , $limit , '?user' , 'user');
    		
            $anfang = ($page - 1) * $limit;
            $class = '';
    		
            $que = "SELECT name,recht,id FROM `xic_user` WHERE name LIKE '" . $q . "' ORDER by recht,posts DESC LIMIT " . $anfang . "," . $limit;
    		
    		if(!empty($r)) {
    		echo 'FALL 1';
    		$que = "SELECT name,recht,id FROM `xic_user` WHERE name LIKE '" . $q . "' AND recht = '" . $r . "' ORDER by recht,posts DESC";
    		$que2 = db_query("SELECT COUNT(id) as ges FROM `xic_user` WHERE name LIKE '" . $q . "' AND recht = '" . $r . "' ORDER by recht,posts DESC");
    		$rowq = db_fetch_object($que2);
    		$ges = $rowq->ges;
    		$MPL = "Gesamt: ".$ges;
    		} elseif($r == "0") {
    		echo 'FALL 2';
    		$que = "SELECT name,recht,id FROM `xic_user` WHERE name LIKE '" . $q . "' AND recht = 0 ORDER by recht,posts DESC";
    		$que2 = db_query("SELECT COUNT(id) as ges FROM `xic_user` WHERE name LIKE '" . $q . "' AND recht = 0 ORDER by recht,posts DESC");
    		$rowq = db_fetch_object($que2);
    		$ges = $rowq->ges;
    		$MPL = "Gesamt: ".$ges;
    		} elseif(empty($r)) {
    		echo 'FALL 3';
    		$que = "SELECT name,recht,id FROM `xic_user` WHERE name LIKE '" . $q . "' ORDER by recht,posts DESC";
    		$que2 = db_query("SELECT COUNT(id) as ges FROM `xic_user` WHERE name LIKE '" . $q . "' ORDER by recht,posts DESC");
    		$rowq = db_fetch_object($que2);
    		$ges = $rowq->ges;
    		$MPL = "Gesamt: ".$ges;
    		} 
    		
    		
            $erg = db_query($que);
            while ($row = db_fetch_object($erg)) {
                if ($class == 'Cmite') {
                    $class = 'Cnorm';
                } else {
                    $class = 'Cmite';
                }
                $ar = array ('name' => $row->name,
                    'class' => $class,
                    'id' => $row->id,
                    'grouplist' => user_get_group_list($row->id),
                    'recht' => dblistee($row->recht, "SELECT id,name FROM xic_grundrechte ORDER BY id ASC"),
                    'modslist' => user_get_mod_change_list($row->id),
                    );
     
                $tpl->set_ar_out($ar, 1);
            }
            $tpl->set_out('MPL', $MPL, 2);
            $design->footer();
            break;
     
        // gruppen zugehoerigkeiten eines users aendern
        case 'gruppen' :
            $uid = $menu->get(2);
            if (isset($_POST['usergroups'])) {
                $erg = db_query("SELECT id FROM xic_groups");
                while ($row = db_fetch_assoc($erg)) {
                    $ck = db_count_query("SELECT COUNT(uid) FROM xic_groupusers WHERE uid = " . $uid . " AND gid = " . $row['id']);
                    if ($ck == 0 AND isset ($_POST['grprhave'][$row['id']][$uid])) {
                        db_query("INSERT INTO xic_groupusers (uid,gid,fid) VALUES ( " . $uid . ", " . $row['id'] . ", 3 )");
                    } elseif ($ck == 1 AND !isset ($_POST['grprhave'][$row['id']][$uid])) {
                        db_query("DELETE FROM xic_groupusers WHERE uid = " . $uid . " AND gid = " . $row['id']);
                    }
                }
            }
     
            $user_name = db_result(db_query("SELECT name FROM xic_user WHERE id = " . $uid), 0);
            $tpl = new tpl ('user/gruppen', 1);
            $tpl->set_ar_out(array('username' => $user_name, 'userid' => $uid), 0);
            $class = 'Cnorm';
            $erg = db_query("SELECT name,id FROM xic_groups");
            while ($row = db_fetch_assoc($erg)) {
                $ck = db_count_query("SELECT COUNT(uid) FROM xic_groupusers WHERE uid = " . $uid . " AND gid = " . $row['id']);
                $row['ck'] = ($ck == 0 ? '' : 'checked');
                $class = ($class == 'Cnorm' ? 'Cmite' : 'Cnorm');
                $row['class'] = $class;
                $tpl->set_ar_out($row, 1);
            }
            $tpl->out(2);
            break;
     
        // details eines users anzeigen
        case 1 :
            $design = new design ('Admins Area', 'Admins Area', 2);
            $design->header();
            if (isset ($_REQUEST['uID'])) {
                $uid = $_REQUEST['uID'];
            } else {
                $uid = $menu->get(2);
            }
            $erg = db_query("SELECT name,email,id,recht,wohnort,homepage,aim,msn,icq,yahoo,status,staat,gebdatum,sig,opt_pm,opt_pm_popup,opt_mail,geschlecht,spezrank,game,spielerfahrungen,clan,map,waffe,essen,trinken,film,musik,sport,cpu,mainboard,ram,monitor,grafikkarte,soundkarte,festplatte,i_net_verbindung,tastatur,maus,jappy,facebook,wkw,studivz,myspace,youtube,avatar FROM xic_user WHERE id = '" . $uid . "'");
            if (db_num_rows($erg) == 0) {
                die ('Fehler: Username nicht gefunden <a href="?user">zur&uuml;ck</a>');
            } else {
                $row = db_fetch_assoc($erg);
     
                $tpl = new tpl ('user/details', 1);
                $row['recht'] = dbliste ($row['recht'] , $tpl, 'recht', "SELECT id,name FROM xic_grundrechte ORDER BY id ASC");
                $row['staat'] = '<option></option>' . arliste ($row['staat'] , get_nationality_array() , $tpl , 'staat');
                $row['spezrank'] = '<option></option>' . dbliste ($row['spezrank'], $tpl, 'spezrank', "SELECT id, bez FROM xic_ranks WHERE spez = 1 ORDER BY id");
     
                $row['geschlecht0'] = ($row['geschlecht'] < 1 ? 'checked' : '');
                $row['geschlecht1'] = ($row['geschlecht'] == 1 ? 'checked' : '');
                $row['geschlecht2'] = ($row['geschlecht'] == 2 ? 'checked' : '');
                if ($row['status'] == 1) {
                    $row['status1'] = 'checked';
                    $row['status0'] = '';
                } else {
                    $row['status1'] = '';
                    $row['status0'] = 'checked';
                }
                if ($row['opt_mail'] == 1) {
                    $row['opt_mail1'] = 'checked';
                    $row['opt_mail0'] = '';
                } else {
                    $row['opt_mail1'] = '';
                    $row['opt_mail0'] = 'checked';
                }
                if ($row['opt_pm'] == 1) {
                    $row['opt_pm1'] = 'checked';
                    $row['opt_pm0'] = '';
                } else {
                    $row['opt_pm1'] = '';
                    $row['opt_pm0'] = 'checked';
                }
                if ($row['opt_pm_popup'] == 1) {
                    $row['opt_pm_popup1'] = 'checked';
                    $row['opt_pm_popup0'] = '';
                } else {
                    $row['opt_pm_popup1'] = '';
                    $row['opt_pm_popup0'] = 'checked';
                }
                if (@file_exists($row['avatar'])) {
                    $row['avatar'] = '<img src="' . $row['avatar'] . '" border="0" /><br />' ;
                }else {
                    $row['avatar'] = '';
                }
                $row['antispam'] = get_antispam('adminuser', 0, true);
                $tpl->set_ar_out ($row, 0);
     
                profilefields_change ($row['id']);
     
                $tpl->out(1);
            }
            $design->footer();
            break;
        // details des users aendern
        case 2 :
            $design = new design ('Admins Area', 'Admins Area', 2);
            $design->header();
            $changeok = true;
            $uid = escape($_POST['uID'], 'integer');
     
            $altes_recht = db_result(db_query("SELECT recht FROM xic_user WHERE id = " . $uid), 0);
            $neues_recht = escape($_POST['urecht'], 'integer');
            if (($neues_recht <= $_SESSION['authright'] OR $altes_recht <= $_SESSION['authright']) AND $_SESSION['authid'] > 1) {
                $changeok = false;
            }
     
            if ($changeok and chk_antispam('adminuser', true)) {
                if (isset($_POST['userdel'])) {
                    user_remove($uid);
                    wd ('?user', 'User wurde erfolgreich gel&ouml;scht');
                } else {
                    $abf = "SELECT * FROM xic_user WHERE id = '" . $uid . "'";
                    $erg = db_query($abf);
                    $row = db_fetch_object($erg);
     
                    if (isset($_POST['passw'])) {
                        $newPass = genkey (8);
                        $newPassMD5 = md5($newPass);
                        icmail ($row->email , 'neues Password' , "Hallo\n\nDein Password wurde soeben von einem Administrator gendert es ist nun:\n\n$newPass\n\nGru der Administrator");
                        db_query('UPDATE `xic_user` SET pass = "' . $newPassMD5 . '" WHERE id = "' . escape($_POST['uID'], 'integer') . '"');
                    }
                    // avatar speichern START
                    $avatar_sql_update = '';
                    if (!empty ($_FILES['avatarfile']['name'])) {
                        $file_tmpe = $_FILES['avatarfile']['tmp_name'];
                        $rile_type = ic_mime_type ($_FILES['avatarfile']['tmp_name']);
                        $file_type = $_FILES['avatarfile']['type'];
                        $file_size = $_FILES['avatarfile']['size'];
                        $fmsg = $lang['avatarisnopicture'];
                        $size = @getimagesize ($file_tmpe);
                        $endar = array (1 => 'gif', 2 => 'jpg', 3 => 'png');
                        if (($size[2] == 1 OR $size[2] == 2 OR $size[2] == 3) AND $size[0] > 10 AND $size[1] > 10 AND substr ($file_type , 0 , 6) == 'image/' AND substr ($rile_type , 0 , 6) == 'image/') {
                            $endung = $endar[$size[2]];
                            $breite = $size[0];
                            $hoehe = $size[1];
                            $neuer_name = 'include/images/avatars/' . $uid . '.' . $endung;
                            @unlink (db_result(db_query("SELECT avatar FROM xic_user WHERE id = " . $uid), 0));
                            move_uploaded_file ($file_tmpe , $neuer_name);
                            @chmod($neuer_name, 0777);
                            $avatar_sql_update = ', avatar = "' . $neuer_name . '"';
                            $fmsg = $lang['pictureuploaded'];
                        }
                    } elseif (isset($_POST['avatardel'])) {
                        $fmsg = $lang['picturedelete'];
                        @unlink (db_result(db_query("SELECT avatar FROM xic_user WHERE id = " . $uid), 0));
                        $avatar_sql_update = ', avatar = ""';
                    }
                    // avatar speichern ENDE
                    profilefields_change_save (escape($_POST['uID'], 'integer'));
    
                    $usaName1 = escape($_POST['usaName1'], 'string');
                    $email = escape($_POST['email'], 'string');
                    $homepage = escape($_POST['homepage'], 'string');
                    $wohnort = escape($_POST['wohnort'], 'string');
                    $icq = escape($_POST['icq'], 'string');
                    $msn = escape($_POST['msn'], 'string');
                    $yahoo = escape($_POST['yahoo'], 'string');
                    $aim = escape($_POST['aim'], 'string');
                    $staat = escape($_POST['staat'], 'string');
                    $spezrank = escape($_POST['spezrank'], 'integer');
                    $geschlecht = escape($_POST['geschlecht'], 'integer');
                    $status = escape($_POST['status'], 'integer');
                    $opt_mail = escape($_POST['opt_mail'], 'integer');
                    $opt_pm = escape($_POST['opt_pm'], 'integer');
                    $opt_pm_popup = escape($_POST['opt_pm_popup'], 'integer');
                    $gebdatum = escape($_POST['gebdatum'], 'string');
                    $game = escape($_POST['game'], 'string');
                    $spielerfahrungen = escape($_POST['spielerfahrungen'], 'string');
                    $clan = escape($_POST['clan'], 'string');
                    $map = escape($_POST['map'], 'string');
                    $waffe = escape($_POST['waffe'], 'string');
                    $essen = escape($_POST['essen'], 'string');
                    $trinken = escape($_POST['trinken'], 'string');
                    $film = escape($_POST['film'], 'string');
                    $musik = escape($_POST['musik'], 'string');
                    $sport = escape($_POST['sport'], 'string');
                    $cpu = escape($_POST['cpu'], 'string');
                    $mainboard = escape($_POST['mainboard'], 'string');
                    $ram = escape($_POST['ram'], 'string');
                    $monitor = escape($_POST['monitor'], 'string');
                    $grafikkarte = escape($_POST['grafikkarte'], 'string');
                    $soundkarte = escape($_POST['soundkarte'], 'string');
                    $festplatte = escape($_POST['festplatte'], 'string');
                    $i_net_verbindung = escape($_POST['i_net_verbindung'], 'string');
                    $tastatur= escape($_POST['tastatur'], 'string');
                    $maus = escape($_POST['maus'], 'string');
                    $jappy = escape($_POST['jappy'], 'string');
                    $facebook = escape($_POST['facebook'], 'string');
                    $wkw = escape($_POST['wkw'], 'string');
                    $studivz = escape($_POST['studivz'], 'string');
                    $myspace = escape($_POST['myspace'], 'string');
                    $youtube = escape($_POST['youtube'], 'string');
                    $sig = escape($_POST['sig'], 'string');
                    // Name im Forum ndern
                    if ($_POST['forumname'] == 'on') {
                        $oldname = db_count_query("SELECT name FROM `xic_user` WHERE id =" . $uid);
                        if ($oldname != $usaName1) {
                            db_query("UPDATE `xic_posts` SET erst = '$usaName1' WHERE erstid = " . $uid);
                            db_query("UPDATE `xic_topics` SET erst = '$usaName1' WHERE erst = '$oldname'");
                        }
                    }
                    db_query('UPDATE xic_user
                  SET
                        name  = "' . $usaName1 . '",
                        recht = "' . $neues_recht . '",
                        email = "' . $email . '",
              homepage = "' . $homepage . '",
              wohnort = "' . $wohnort . '",
              icq = "' . $icq . '",
              msn = "' . $msn . '",
              yahoo = "' . $yahoo . '",
              aim = "' . $aim . '",
              staat = "' . $staat . '",
              spezrank = "' . $spezrank . '",
              geschlecht = "' . $geschlecht . '",
              status = "' . $status . '",
              opt_mail = "' . $opt_mail . '",
              opt_pm = "' . $opt_pm . '",
              opt_pm_popup = "' . $opt_pm_popup . '",
              gebdatum = "' . $gebdatum . '",
              game = "' . $game . '",
              spielerfahrungen = "' . $spielerfahrungen . '",
              clan = "' . $clan . '",
              map = "' . $map . '",
              waffe = "' . $waffe . '",
              essen = "' . $essen . '",
              trinken = "' . $trinken . '",
              film = "' . $film . '",
              musik = "' . $musik . '",
              sport = "' . $sport . '",
              cpu = "' . $cpu . '",
              mainboard = "' . $mainboard . '",
              ram = "' . $ram . '",
              monitor = "' . $monitor . '",
              grafikkarte = "' . $grafikkarte . '",
              soundkarte = "' . $soundkarte . '",
              festplatte = "' . $festplatte . '",
              i_net_verbindung = "' . $i_net_verbindung . '",
              tastatur = "' . $tastatur . '",
              maus = "' . $maus . '",
              jappy = "' . $jappy . '",
              facebook = "' . $facebook . '",
              wkw = "' . $wkw . '",
              studivz = "' . $studivz . '",
              myspace = "' . $myspace . '",
              youtube = "' . $youtube . '",
              sig = "' . $sig . '"
              ' . $avatar_sql_update . '
                    WHERE id = "' . $uid . '"');
                }
            }
            wd('admin.php?user-1-' . $uid, 'Das Profil wurde erfolgreich geaendert', 2);
            $design->footer();
            break;
        // mal kurz nen neuen user anlegen
        case 'createNewUser' :
            $msg = '';
            if (!empty($_POST['name']) AND !empty($_POST['pass']) AND !empty($_POST['email']) and chk_antispam('adminuser_create', true)) {
                $_POST['name'] = escape($_POST['name'], 'string');
                $_POST['recht'] = escape($_POST['recht'], 'integer');
                $_POST['email'] = escape($_POST['email'], 'string');
                $erg = db_query("SELECT id FROM xic_user WHERE name = BINARY '" . $_POST['name'] . "'");
                if (db_num_rows($erg) > 0) {
                    $msg = 'Der Name ist leider schon vorhanden!';
                } else {
                    $new_pass = $_POST['pass'];
                    $md5_pass = md5($new_pass);
                    db_query("INSERT INTO xic_user (name,pass,recht,regist,llogin,email)
                VALUES('" . $_POST['name'] . "','" . $md5_pass . "'," . $_POST['recht'] . ",'" . time() . "','" . time() . "','" . $_POST['email'] . "')");
                    $userid = db_last_id();
                    db_query("INSERT INTO xic_userfields (uid,fid,val) VALUES (" . $userid . ",2,'1')");
                    db_query("INSERT INTO xic_userfields (uid,fid,val) VALUES (" . $userid . ",3,'1')");
     
                    if (isset($_POST['info'])) {
                        $page = $_SERVER["HTTP_HOST"] . $_SERVER["SCRIPT_NAME"];
                        $page = str_replace('admin.php', 'index.php', $page);
                        $tpl = new tpl ('user/new_user_email', 1);
                        $tpl->set('name', $_POST['name']);
                        $tpl->set('pass', $_POST['pass']);
                        $tpl->set('page', $page);
                        $txt = $tpl->get(0);
                        unset($tpl);
                        icmail ($_POST['email'], 'Admin hat dich angelegt', $txt);
                    }
                    $msg = 'Benutzer angelegt <a href="javascript:closeThisWindow()">Fenster schlieen</a>';
                }
            }
            $pass = '';
            $email = '';
            $recht = '';
            if (isset($_POST['pass'])) {
                $pass = $_POST['pass'];
            }
            if (isset($_POST['email'])) {
                $email = $_POST['email'];
            }
            if (isset($_POST['recht'])) {
                $recht = $_POST['recht'];
            } else {
                $recht = '-1';
            }
            $tpl = new tpl ('user/new_user', 1);
            $tpl->set('msg', $msg);
            $tpl->set('pass', $pass);
            $tpl->set('email', $email);
            $tpl->set('recht', dblistee($recht, "SELECT id,name FROM xic_grundrechte ORDER BY id ASC"));
            $tpl->set('antispam', get_antispam('adminuser_create', 0, true));
            $tpl->out(0);
            break;
    }
     
    ?>


    das ersetzen des prefix kannst du auch von einem programm erledigen lassen lcheln zB editor

    Gruß Sascha
    Visit me on: www.ITRoyal.de
    Visit my Clan: www.United-SportZ.de
    Mein ilch Modul: Höhrercharts v0.8 für OnlineRadios
    0 Mitglieder finden den Beitrag gut.
  30. #30
    User Pic
    ---Doc--- Mitglied
    Registriert seit
    05.08.2011
    Beitrge
    218
    Beitragswertungen
    4 Beitragspunkte
    Super, danke.

    Am Wochenende werde ich die Einträge anpassen, vorher klappt es leider nicht.

    Als Editor nehme ich Editira auf dem Mac und Notepad++ auf Windows. Also suchen und ersetzen lcheln
    0 Mitglieder finden den Beitrag gut.
Geschlossen

Zurck zu Allgemein

Optionen: Bei einer Antwort zu diesem Thema eine eMail erhalten