Beispiel #1
0
 function allowed()
 {
     global $_allowed_;
     if (!session('id')) {
         if (!in_array(implode("-", module()) . func(), $_allowed_)) {
             $Base = new Base();
             $Base->type(ERROR);
             $Base->title(ERROR_MUST_LOGIN);
             $Base->header();
             $Base->footer();
             return false;
         } else {
             return true;
         }
     } else {
         return true;
     }
 }
Beispiel #2
0
function login_post()
{
    global $DB, $Security;
    if (!$Security->login(post('name'), post('pass'))) {
        $Base = new Base();
        $Base->type(ERROR);
        $Base->title(ERROR_AUTH);
        $Base->header();
        $Base->footer();
        return;
    } else {
        $to = false;
        if (isset($_SERVER['HTTP_REFERER'])) {
            $to = $_SERVER['HTTP_REFERER'];
        }
        if (substr($to, -12) == "/main/login/") {
            $to = "/";
        }
        return to_index($to);
    }
}
Beispiel #3
0
            break;
        case "textarea":
            $Form->add_textarea($pref['field'], "{$pref['display']}:");
            break;
        case "checkbox":
            $Form->add_checkbox($pref['field'], "{$pref['display']}:");
            break;
    }
}
$Form->add_submit("Save Changes");
$Form->fieldset_close();
$Form->footer();
$Form->header_validate();
$Form->add_notnull("postalcode", "Please enter a postal code.");
$Form->footer_validate();
$Base->footer();
print "</div>";
?>
<script type="text/javascript">
function completed() { $('.submit').attr('disabled',false); }
function change_password()
{
  if($('#password').css('display') != "block")
  {
    $('#_change').val('Cancel');
  }
  else
  {
    $('#_change').val('Change Password');
    $('#_current,#_pass,#_pass_confirm').val('');
  }
Beispiel #4
0
function status_get()
{
    global $DB, $Core, $Parse;
    if (!session('id')) {
        return;
    }
    $active = $Core->active_members();
    $posting = array_keys($Core->posting_members());
    $lurking = array_keys($Core->lurking_members());
    $chatting = array_keys($Core->chatting_members());
    $Base = new Base();
    $Base->type(MISC);
    $Base->title("Board Status");
    $Base->header();
    $output = "";
    $output .= "key:<br/>\n";
    $output .= "&nbsp;normal - viewing<br />";
    $output .= "&nbsp;<strong>bold</strong> - posting<br/>";
    $output .= "&nbsp;<u>underline</u> - lurking<br/>";
    $output .= "&nbsp;<strike>strikethrough</strike> - chatting<br/><br/>";
    print "<div class=\"box clear\">\n";
    $name_output = "";
    foreach ($active as $id => $name) {
        $name = $Core->member_link($name);
        if (in_array($id, $posting)) {
            $name = "<strong>{$name}</strong>";
        }
        if (in_array($id, $lurking)) {
            $name = "<span class=\"lurker\">{$name}</span>";
        }
        if (in_array($id, $chatting)) {
            $name = "<strike>{$name}</strike>";
        }
        $name_output .= "{$name}, ";
    }
    print $output;
    print substr($name_output, 0, -2);
    if (IGNORE_ENABLED && IGNORE_PUBLIC) {
        $DB->query("SELECT\r\n                  count(*) as num,\r\n                  m.name\r\n                FROM\r\n                  member_ignore mi\r\n                LEFT JOIN\r\n                  member m\r\n                ON\r\n                  m.id = mi.ignore_member_id\r\n                GROUP BY\r\n                  m.name\r\n                ORDER BY num DESC\r\n                LIMIT 25");
        print "<br/><br/><strong>top 25 ignored posters:</strong><br/><br/>";
        print "<ol style=\"padding-left:30px\">\n";
        while ($row = $DB->load_array()) {
            print "  <li>" . $Core->member_link($row['name']) . " ({$row['num']})</li>\n";
        }
        print "</ol>\n";
        $DB->query("SELECT\r\n                  count(*) as num,\r\n                  m.name\r\n                FROM\r\n                  member_ignore mi\r\n                LEFT JOIN\r\n                  member m\r\n                ON\r\n                  m.id = mi.member_id\r\n                GROUP BY\r\n                  m.name\r\n                ORDER BY num DESC\r\n                LIMIT 25");
        print "<br/><br/><strong>top 25 posters using ignore:</strong><br/><br/>";
        print "<ol style=\"padding-left:30px\">\n";
        while ($row = $DB->load_array()) {
            print "  <li>" . $Core->member_link($row['name']) . " ({$row['num']})</li>\n";
        }
        print "</ol>\n";
    }
    $DB->query("SELECT\r\n                count(*) as num,\r\n                (SELECT subject FROM thread WHERE id=f.thread_id) as subject,\r\n                f.thread_id as id\r\n              FROM\r\n                favorite f\r\n              GROUP BY\r\n                f.thread_id\r\n              ORDER BY num DESC\r\n              LIMIT 25");
    print "<br/><br/><strong>top 25 favorited threads:</strong><br/><br/>";
    print "<ol style=\"padding-left:30px\">\n";
    while ($row = $DB->load_array()) {
        print "  <li><a href=\"/thread/view/{$row['id']}/\">" . strip_tags($row['subject']) . "</a> ({$row['num']})</li>\n";
    }
    print "</ol>\n";
    print "</div>";
    $Base->footer();
}
Beispiel #5
0
function listen_get()
{
    global $Security, $Core, $DB;
    if (cmd(3) != MD5(session_id())) {
        return to_index();
    }
    if (!($listen = $Core->idfromname(id()))) {
        $Base = new Base();
        $Base->type(ERROR);
        $Base->title(ERROR_MEMBER_NOTFOUND);
        $Base->header();
        $Base->footer();
        return;
    }
    if ($Security->is_admin($listen) || !session('id')) {
        return to_index();
    }
    if ($DB->query("DELETE FROM member_ignore WHERE member_id=\$1 AND ignore_member_id=\$2", array(session('id'), $listen))) {
        return to_index();
    } else {
        print "<h3>Something got f****d.</h3>\n";
    }
}