Beispiel #1
0
function db_check_error(&$r, $q)
{
    if (!$r and mysql_errno(CONN) != 0 and function_exists('is_coadmin') and is_coadmin()) {
        // var_export (debug_backtrace(), true)
        echo '<font color="#FF0000">MySQL Error:</font><br>' . mysql_errno(CONN) . ' : ' . mysql_error(CONN) . '<br>in Query:<br>' . $q . '<pre>' . debug_bt() . '</pre>';
    }
    return $r;
}
Beispiel #2
0
function user_remove($uid)
{
    $row = @db_fetch_object(db_query("SELECT `recht`,`avatar` FROM `prefix_user` WHERE `id` = " . $uid));
    if ($uid != 1 and ($_SESSION['authid'] == $uid or $_SESSION['authid'] == 1 or is_coadmin() and $_SESSION['authright'] < $row->recht)) {
        db_query("DELETE FROM `prefix_user` WHERE `id` = " . $uid);
        db_query("DELETE FROM `prefix_userfields` WHERE `uid` = " . $uid);
        db_query("DELETE FROM `prefix_groupusers` WHERE `uid` = " . $uid);
        db_query("DELETE FROM `prefix_modulerights` WHERE `uid` = " . $uid);
        db_query("DELETE FROM `prefix_pm` WHERE `eid` = " . $uid);
        db_query("DELETE FROM `prefix_online` WHERE `uid` = " . $uid);
        // Usergallery entfernen
        $sql = db_query("SELECT `id`,`endung` FROM `prefix_usergallery` WHERE `uid` = " . $uid);
        while ($r = db_fetch_object($sql)) {
            @unlink("include/images/usergallery/img_" . $r->id . "." . $r->endung);
            @unlink("include/images/usergallery/img_thumb_" . $r->id . "." . $r->endung);
        }
        db_query("DELETE FROM `prefix_usergallery` WHERE `uid` = " . $uid);
        // Avatar
        @unlink($row->avatar);
    }
}
Beispiel #3
0
<?php

/**
 * @license http://opensource.org/licenses/gpl-2.0.php The GNU General Public License (GPL)
 * @copyright (C) 2000-2010 ilch.de
 * @version $Id$
 */
defined('main') or die('no direct access');
$tpl = new tpl('adminmenu', 1);
$ma = $menu->get_string_ar();
arsort($ma);
if (is_coadmin()) {
    $kat = '';
    $class = '';
    $i = 1;
    $mg = 0;
    foreach ($menuAr as $key => $tab) {
        if ($kat != $tab['menu']) {
            if (!empty($kat)) {
                $tpl->set_ar_out(array('class' => $class, 'url' => $url, 'id' => $i++, 'title' => $kat), 0);
                $class = '';
            }
            $kat = $tab['menu'];
            $url = $key;
        }
        if ($mg == 0) {
            if (in_array($key, $ma)) {
                $class = ' id="activetab"';
                $mg = 1;
            }
        }
Beispiel #4
0
function icmail($mail, $bet, $txt, $from = '', $html = false)
{
    global $allgAr;
    include_once 'include/includes/libs/phpmailer/class.phpmailer.php';
    $mailer = new PHPMailer();
    if (empty($from)) {
        $mailer->From = $allgAr['adminMail'];
        $mailer->FromName = $allgAr['allg_default_subject'];
    } elseif (preg_match('%(.*) <([\\w\\.-]*@[\\w\\.-]*)>%i', $from, $tmp)) {
        $mailer->From = trim($tmp[2]);
        $mailer->FromName = trim($tmp[1]);
    } elseif (preg_match('%([\\w\\.-]*@[\\w\\.-]*)%i', $from, $tmp)) {
        $mailer->From = trim($tmp[1]);
        $mailer->FromName = '';
    }
    if ($allgAr['mail_smtp']) {
        // SMTP Versand
        $smtpser = @db_result(db_query('SELECT `t1` FROM `prefix_allg` WHERE `k` = "smtpconf"'));
        if (empty($smtpser)) {
            echo '<span style="font-size: 2em; color: red;">Mailversand muss konfiguriert werden!</span><br />';
        } else {
            $smtp = unserialize($smtpser);
            $mailer->IsSMTP();
            $mailer->Host = $smtp['smtp_host'];
            $mailer->SMTPAuth = $smtp['smtp_auth'] == 'no' ? false : true;
            if ($smtp['smtp_auth'] == 'ssl' or $smtp['smtp_auth'] == 'tls') {
                $mailer->SMTPSecure = $smtp['smtp_auth'];
            }
            if (!empty($smtp['smtp_port'])) {
                $mailer->Port = $smtp['smtp_port'];
            }
            $mailer->AddReplyTo($mailer->From, $mailer->FromName);
            if ($smtp['smtp_changesubject'] and $mailer->From != $smtp['smtp_email']) {
                $bet = '(For ' . $mailer->FromName . ' - ' . $mailer->From . ') ' . $bet;
                $mailer->From = $smtp['smtp_email'];
            }
            $mailer->Username = $smtp['smtp_login'];
            require_once 'include/includes/libs/AzDGCrypt.class.inc.php';
            $cr64 = new AzDGCrypt(DBDATE . DBUSER . DBPREF);
            $mailer->Password = $cr64->decrypt($smtp['smtp_pass']);
            if ($smtp['smtp_pop3beforesmtp'] == 1) {
                include_once 'include/includes/libs/phpmailer/class.pop3.php';
                $pop = new POP3();
                $pop3port = !empty($smpt['smtp_pop3port']) ? $smpt['smtp_pop3port'] : 110;
                $pop->Authorise($smpt['smtp_pop3host'], $pop3port, 5, $mailer->Username, $mailer->Password, 1);
            }
        }
        // $mailer->SMTPDebug = true;
    }
    if (is_array($mail)) {
        if ($mail[0] == 'bcc') {
            array_shift($mail);
            foreach ($mail as $m) {
                $mailer->AddBCC(escape_for_email($m));
            }
            $mailer->AddAddress($mailer->From);
        } else {
            foreach ($mail as $m) {
                $mailer->AddAddress(escape_for_email($mail));
            }
        }
    } else {
        $mailer->AddAddress(escape_for_email($mail));
    }
    $mailer->Subject = escape_for_email($bet, true);
    $txt = str_replace("\r", "\n", str_replace("\r\n", "\n", $txt));
    if ($html) {
        $mailer->IsHTML(true);
        $mailer->AltBody = strip_tags($txt);
    }
    $mailer->Body = $txt;
    if ($mailer->Send()) {
        return true;
    } else {
        if (is_coadmin()) {
            echo "<h2 style=\"color:red;\">Mailer Error: " . $mailer->ErrorInfo . '</h2>';
        }
        return false;
    }
}
Beispiel #5
0
    public function get_url($w = '')
    {
        global $allgAr;
        if ($w != '') {
            $this->type = $w;
        }
        // startwert und pfad zum pruefen raustuefteln.
        if ($this->type == 'contents') {
            $pfad = 'include/contents';
            $smod = $allgAr['smodul'];
        } elseif ($this->type == 'box') {
            $file = 'include/boxes/' . $this->get(0) . '.php';
            return (file_exists($file) and $this->check_rights()) ? $file : false;
        } else {
            $pfad = 'include/admin';
            $smod = 'admin';
        }
        // wennes also leer is wird das startmodul genommen
        if (empty($this->menu_ar[0])) {
            $this->set_url(0, $smod);
        }
        // diverse sachen geprueft zum zurueck geben,
        // is halt so dings wegen selfpages usw...
        if (!file_exists($pfad . '/' . $this->get(0) . '.php') and file_exists($pfad . '/selfbp/selfp/' . $this->get(0) . '.php')) {
            $this->set_url(1, $this->get(0));
            $this->set_url(0, 'self');
        } elseif (!file_exists($pfad . '/' . $this->get(0) . '.php')) {
            if (substr($smod, 0, 5) == 'self-') {
                $this->set_url(1, substr($smod, 5));
                $this->set_url(0, 'self');
            } elseif (file_exists($pfad . '/selfbp/selfp/' . $smod . '.php')) {
                $this->set_url(1, $smod);
                $this->set_url(0, 'self');
            } else {
                $this->set_url(0, $smod);
            }
        }
        // pruefen ob der client die noetigen rechte hat
        // das modul zu sehen.. bzw. den menupunkt zu sehen
        $exit = !$this->check_rights();
        // das usermodul kann aus eigener sicherheit nicht
        // gesperrt werden, sonst koennen sich member
        // usw. nicht mehr einloggen, bzw. es kann
        // sich sonst keiner registrieren. deshalb is das
        // user modul immer frei geschaltet
        $alwaysallowed = array('regist', 'login', '1', '2', 'confirm', 'remind', '13', '3', 'logout');
        if ($exit === true and $this->get(0) == 'user' and in_array($this->get(1), $alwaysallowed)) {
            $exit = false;
            debug('o');
        }
        if ($exit) {
            $title = $allgAr['title'] . ' :: Keine Berechtigung';
            $hmenu = 'Keine Berechtigung';
            $design = new design($title, $hmenu);
            if (loggedin()) {
                $design->header();
                if (is_coadmin()) {
                    echo 'Entweder diese Seite ist nicht in der Navigation verlinkt und die Option
<strong>Zugriff auf nicht im Menü verlinkte Module für alle?</strong> steht auf <strong>nein</strong> oder aber du hast kein Recht sie zu betrachten, deswegen kommt diese Meldung.<br />
Also entweder die Seite <strong>' . $this->get(0) . '</strong> in der <a href="admin.php?menu">Navigation</a> verlinken, oder die Option umstellen, ersteres wird empfohlen.';
                } else {
                    echo 'Du hast leider nicht die n&ouml;tigen Rechte, um diese Seite zu betrachten.';
                }
            } else {
                $tpl = new tpl('user/login');
                $design->addheader($tpl->get(0));
                $design->header();
                $tpl->set_out('WDLINK', 'index.php', 1);
            }
            $design->footer();
            exit;
        }
        return $this->get(0) . '.php';
    }
Beispiel #6
0
function user_remove($uid)
{
    $row = @db_fetch_object(db_query("SELECT recht,avatar FROM prefix_user WHERE id = " . $uid));
    if ($uid != 1 and ($_SESSION['authid'] == $uid or $_SESSION['authid'] == 1 or is_coadmin() and $_SESSION['authright'] < $row->recht)) {
        db_query("DELETE FROM prefix_user WHERE id = " . $uid);
        db_query("DELETE FROM prefix_userfields WHERE uid = " . $uid);
        db_query("DELETE FROM prefix_groupusers WHERE uid = " . $uid);
        db_query("DELETE FROM prefix_modulerights WHERE uid = " . $uid);
        db_query("DELETE FROM prefix_pm WHERE eid = " . $uid);
        db_query("DELETE FROM prefix_online WHERE uid = " . $uid);
        db_query("DELETE FROM prefix_friends WHERE uid = " . $uid . " OR fid = " . $uid);
        //Usergallery entfernen
        $sql = db_query("SELECT id,endung FROM prefix_usergallery WHERE uid = " . $uid);
        while ($r = db_fetch_object($sql)) {
            @unlink("include/images/usergallery/img_{$r->id}.{$r->endung}");
            @unlink("include/images/usergallery/img_thumb_{$r->id}.{$r->endung}");
        }
        db_query("DELETE FROM prefix_usergallery WHERE uid = " . $uid);
        //Avatar
        @unlink($row->avatar);
    }
}