Exemplo n.º 1
0
if (!defined('IN_INSTALLER09_ADMIN')) {
    $HTMLOUT = '';
    $HTMLOUT .= "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\"\n\t\t\"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">\n\t\t<html xmlns='http://www.w3.org/1999/xhtml'>\n\t\t<head>\n\t\t<title>Error!</title>\n\t\t</head>\n\t\t<body>\n\t<div style='font-size:33px;color:white;background-color:red;text-align:center;'>Incorrect access<br />You cannot access this file directly.</div>\n\t</body></html>";
    echo $HTMLOUT;
    exit;
}
require_once INCL_DIR . 'user_functions.php';
require_once INCL_DIR . 'html_functions.php';
require_once CLASS_DIR . 'class_check.php';
class_check(UC_MAX);
$lang = array_merge($lang);
$rep_set_cache = "./cache/rep_settings_cache.php";
if ('POST' == $_SERVER['REQUEST_METHOD']) {
    unset($_POST['submit']);
    //print_r($_POST);
    rep_cache();
    exit;
}
/////////////////////////////
//	cache rep function
/////////////////////////////
function rep_cache()
{
    global $rep_set_cache, $INSTALLER09;
    $rep_out = "<" . "?php\n\n\$GVARS = array(\n";
    foreach ($_POST as $k => $v) {
        $rep_out .= $k == 'rep_undefined' ? "\t'{$k}' => '" . htmlsafechars($v, ENT_QUOTES) . "',\n" : "\t'{$k}' => " . intval($v) . ",\n";
    }
    $rep_out .= "\t'g_rep_negative' => TRUE,\n";
    $rep_out .= "\t'g_rep_seeown' => TRUE,\n";
    $rep_out .= "\t'g_rep_use' => \$CURUSER['class'] > UC_USER ? TRUE : FALSE\n";
Exemplo n.º 2
0
function do_delete()
{
    global $input;
    if (!isset($input['reputationlevelid']) || !is_valid_id($input['reputationlevelid'])) {
        stderr('', 'No valid ID.');
    }
    $levelid = intval($input['reputationlevelid']);
    // check the id is valid within db
    $query = sql_query("SELECT reputationlevelid FROM reputationlevel WHERE reputationlevelid={$levelid}");
    if (!mysql_num_rows($query)) {
        stderr('', 'Rep ID doesn\'t exist');
    }
    // if we here, we delete it!
    @sql_query("DELETE FROM reputationlevel WHERE reputationlevelid={$levelid}");
    rep_cache();
    redirect('reputation_ad.php?mode=done', 'Reputation deleted successfully', 5);
}
Exemplo n.º 3
0
function do_update($type = "")
{
    global $input;
    if ($type != "") {
        $level = strip_tags($input['level']);
        $level = trim($level);
        if (strlen($input['level']) < 2 || $level == "") {
            stderr('', 'The text you entered was too short.');
        }
        if (strlen($input['level']) > 250) {
            stderr('', 'The text entry is too long.');
        }
        $level = sqlesc($level);
        $minrep = sqlesc(intval($input['minimumreputation']));
        $redirect = 'Saved Reputation Level <i>' . htmlentities($input['level'], ENT_QUOTES) . '</i> Successfully.';
    }
    // what we gonna do?
    if ($type == 'new') {
        @mysql_query("INSERT INTO reputationlevel ( minimumreputation, level ) \r\n\t\t\t\t\t\t\tVALUES  ({$minrep}, {$level} )");
    } elseif ($type == 'edit') {
        $levelid = intval($input['reputationlevelid']);
        if (!is_valid_id($levelid)) {
            stderr('', 'Not a valid try');
        }
        // check it's a valid rep id
        $query = mysql_query("SELECT reputationlevelid FROM reputationlevel WHERE \r\n\t\t\t\t\t\t\t\t\treputationlevelid={$levelid}");
        if (!mysql_num_rows($query)) {
            stderr('', 'Not a valid ID.');
        }
        @mysql_query("UPDATE reputationlevel SET minimumreputation = {$minrep}, level = {$level} \r\n\t\t\t\t\t\t\tWHERE reputationlevelid = {$levelid}");
    } else {
        $ids = $input['reputation'];
        if (is_array($ids) && count($ids)) {
            foreach ($ids as $k => $v) {
                @mysql_query("UPDATE reputationlevel SET minimumreputation = " . intval($v) . " WHERE reputationlevelid = " . intval($k));
            }
        } else {
            stderr('', 'No valid ID.');
        }
        $redirect = "Saved Reputation Level Successfully.";
    }
    rep_cache();
    redirect('reputation_ad.php?mode=done', $redirect);
}
Exemplo n.º 4
0
function do_delete()
{
    global $input, $lang;
    if (!isset($input['reputationlevelid']) || !is_valid_id($input['reputationlevelid'])) {
        stderr('', 'No valid ID.');
    }
    $levelid = intval($input['reputationlevelid']);
    // check the id is valid within db
    $query = sql_query("SELECT reputationlevelid FROM reputationlevel WHERE reputationlevelid={$levelid}");
    if (!mysqli_num_rows($query)) {
        stderr('', $lang['rep_ad_delete_no']);
    }
    // if we here, we delete it!
    @sql_query("DELETE FROM reputationlevel WHERE reputationlevelid={$levelid}");
    rep_cache();
    redirect('staffpanel.php?tool=reputation_ad&amp;mode=done', $lang['rep_ad_delete_success'], 5);
}