function search_finduser() { $design = new design('Finduser', '', 0); $design->header(); $tpl = new tpl('search_finduser'); $tpl->out(0); if (isset($_POST['sub']) and !empty($_POST['name'])) { $name = str_replace('*', "%", $_POST['name']); $name = escape($name, 'string'); $q = "SELECT `name`,`name` FROM `prefix_user` WHERE `name` LIKE '" . $name . "'"; $tpl->set('username', dbliste('', $tpl, 'username', $q)); $tpl->out(1); } $tpl->out(2); $design->footer(); }
function check_forum_failure($ar) { if (array_key_exists(0, $ar)) { $hmenu = '<a class="smalfont" href="?forum">Forum</a><b> » </b> Fehler aufgetreten'; $title = 'Forum : Fehler aufgetreten'; $design = new design($title, $hmenu); $design->header(); echo '<b>Es ist/sind folgende(r) Fehler aufgetreten</b><br />'; foreach ($ar as $v) { echo $v . '<br />'; } echo '<br /><a href="javascript:history.back(-1)">zurück</a>'; $design->footer(); exit; } return true; }
<?php # Copyright by: Manuel # Support: www.ilch.de defined('main') or die('no direct access'); $title = $allgAr['title'] . ' :: Logout'; $hmenu = $extented_forum_menu . 'Logout' . $extented_forum_menu_sufix; $design = new design($title, $hmenu, 0); # ausloggen user_logout(); $design->header(); wd('?' . $allgAr['smodul'], $lang['logoutsuccessful']); $design->footer();
// Text fuer den User wenn der Stutus geandert wurde $message3 = $lang['awaycalstatuschanged']; // function function away_sendpmtoleaders($m, $uid, $a) { $q = "SELECT\r\n DISTINCT `prefix_user`.`id` as `uid`\r\n FROM `prefix_user`\r\n LEFT JOIN `prefix_groupusers` ON `prefix_groupusers`.`uid` = " . $uid . "\r\n LEFT JOIN `prefix_groups` ON `prefix_groups`.`id` = `prefix_groupusers`.`gid`\r\n WHERE `recht` <= -7\r\n OR (`mod1` = `prefix_user`.`id` AND `uid` = " . $uid . ")\r\n OR (`mod2` = `prefix_user`.`id` AND `uid` = " . $uid . ")\r\n OR (`mod3` = `prefix_user`.`id` AND `uid` = " . $uid . ")\r\n OR (`mod4` = `prefix_user`.`id` AND `uid` = " . $uid . ")"; $erg = db_query($q); while ($r = db_fetch_assoc($erg)) { sendpm($_SESSION['authid'], $r['uid'], 'Away-Anfrage', $m, -1); } } $title = $allgAr['title'] . ' :: Awaycalender'; $hmenu = 'Awaycalender'; $design = new design($title, $hmenu); $header = array('jquery/jquery.validate.js', 'forms/awaycal.js'); $design->header($header); $tpl = new tpl('awaycal.htm'); if ($_SESSION['authright'] > -3) { // Pruefen ob der User ein TrialMember oder mehr ist echo $lang['nopermission']; $design->footer(1); } // status aendern if ($menu->getA(1) == 'c' and is_numeric($menu->getE(1)) and is_numeric($menu->get(2)) and is_siteadmin('awaycal')) { $uid = db_result(db_query("SELECT `uid` FROM `prefix_awaycal` WHERE `id` = " . $menu->getE(1)), 0); db_query("UPDATE `prefix_awaycal` SET `pruef` = " . $menu->get(2) . " WHERE `id` = " . $menu->getE(1)); sendpm($_SESSION['authid'], $uid, 'Away-Anfrage', $message3); } if ($menu->getA(1) == 'd' and is_numeric($menu->getE(1)) and is_siteadmin('awaycal')) { db_query("DELETE FROM `prefix_awaycal` WHERE `id` = " . $menu->getE(1)); }
function user_has_admin_right(&$menu, $sl = true) { if ($_SESSION['authright'] <= -8) { // co leader... return true; } else { $uri_to_check1 = $menu->get(0); $uri_to_check2 = $menu->get(1); if (count($_SESSION['authmod']) < 1 or !loggedin()) { if ($sl === true) { if (!loggedin()) { $design = new design('', '', 0); $menu->set_url(0, 'user'); load_modul_lang(); $tpl = new tpl('user/login.htm'); $design->addheader($tpl->get(0)); $design->header(); $tpl->set_out('WDLINK', 'admin.php', 1); $design->footer(); } else { echo '<strong>Keine Berechtigung!</strong> <a href="index.php">Startseite</a>'; } } return false; } elseif (isset($_SESSION['authmod'][$uri_to_check1]) and $_SESSION['authmod'][$uri_to_check1] == true or isset($_SESSION['authmod'][$uri_to_check1 . '-' . $uri_to_check2]) and $_SESSION['authmod'][$uri_to_check1 . '-' . $uri_to_check2] == true) { return true; } elseif (count($_SESSION['authmod']) > 0 and loggedin()) { if ($sl === true) { foreach ($_SESSION['authmod'] as $k => $v) { $x = $k; break; } $x = explode('-', $x); $menu->set_url(0, $x[0]); if (isset($x[1])) { $menu->set_url(1, $x[1]); } } return true; } } return false; }
$tpl = new tpl('forum/newtopic'); $name = ''; if (!loggedin()) { $name = '<tr><td class="Cmite"0><b>' . $lang['name'] . '</b></td>'; $name .= '<td class="Cnorm"><input type="text" value="' . unescape($xnn) . '" maxlength="15" name="Gname"></td></tr>'; } if (isset($_POST['priview'])) { $tpl->set_out('txt', bbcode(unescape($txt)), 0); } $ar = array('name' => $name, 'txt' => escape_for_fields(unescape($txt)), 'topic' => escape_for_fields(unescape($topic)), 'fid' => $fid, 'SMILIES' => getsmilies(), 'antispam' => get_antispam('newtopic', 1)); $tpl->set_ar_out($ar, 1); } else { // save toipc $_SESSION['klicktime'] = $dppk_time; $design = new design($title, $hmenu, 0); $design->header($load); if (loggedin()) { $uid = $_SESSION['authid']; $erst = escape($_SESSION['authname'], 'string'); db_query("UPDATE `prefix_user` SET `posts` = `posts`+1 WHERE `id` = " . $uid); } else { $erst = $xnn; $uid = 0; } db_query("INSERT INTO `prefix_topics` (`fid`, `name`, `erst`, `stat`) VALUES ( " . $fid . ", '" . $topic . "', '" . $erst . "', 1 )"); $tid = db_last_id(); // topic alert if (!empty($_POST['topic_alert']) and $_POST['topic_alert'] == 'yes' and loggedin()) { if (0 == db_result(db_query("SELECT COUNT(*) FROM `prefix_topic_alerts` WHERE `uid` = " . $_SESSION['authid'] . " AND `tid` = " . $tid), 0)) { db_query("INSERT INTO `prefix_topic_alerts` (`tid`,`uid`) VALUES (" . $tid . ", " . $_SESSION['authid'] . ")"); }
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ö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'; }
function get_url($w = 'contents') { global $allgAr; # startwert und pfad zum pruefen raustuefteln. if ($w == 'contents') { $pfad = 'include/contents'; $smod = $allgAr['smodul']; } 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 = false; if ($w == 'contents') { $where = "(path = '" . $this->get(0) . "' OR path = '" . $this->get(0) . "-" . $this->get(1) . "')"; if ($this->get(0) == 'self') { $where = "(path = '" . $this->get(0) . "-" . $this->get(1) . "' OR path = '" . $this->get(1) . "')"; } $r = @db_result(@db_query("SELECT recht FROM prefix_menu WHERE " . $where . " ORDER BY LENGTH(path) DESC"), 0); if ($r != '' and !has_right($r) or $r == '' and $allgAr['allg_menupoint_access'] == 0) { $exit = true; } } # 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); $design->header(); if (loggedin()) { echo 'Du hast leider nicht die nötigen Rechte... :-S'; } else { $tpl = new tpl('user/login'); $tpl->set_out('WDLINK', 'index.php', 0); } $design->footer(); exit; } return $this->get(0) . '.php'; }