Exemplo n.º 1
0
<?php

/// Copyright (c) 2004-2016, Needlworks  / Tatter Network Foundation
/// All rights reserved. Licensed under the GPL.
/// See the GNU General Public License for more details. (/documents/LICENSE, /documents/COPYRIGHT)
$IV = array('POST' => array('body' => array('string')));
require ROOT . '/library/preprocessor.php';
importlib('model.blog.service');
requireStrictRoute();
$result = writeHtaccess($_POST['body']);
if ($result === true) {
    Respond::PrintResult(array('error' => 0));
} else {
    Respond::PrintResult(array('error' => 1, 'msg' => $result));
}
Exemplo n.º 2
0
    }
} else {
    if (trim(addslashes($_POST["id"])) != "" && trim(addslashes($_POST["ip"])) != "") {
        $editStatement = "update exportServerDb.ipRules  set ip = '" . trim(addslashes($_POST["ip"])) . "',reason = '" . trim(addslashes($_POST["reason"])) . "' where id=" . trim(addslashes($_POST["id"]));
        if (mysql_query($editStatement)) {
            $paramToPass = array();
            $selectQry = "select * from ipRules where id=" . trim(addslashes($_POST['id']));
            $selectRes = mysql_query($selectQry);
            $selectRow = mysql_fetch_assoc($selectRes);
            if (mysql_num_rows($selectRes) > 0) {
                $paramToPass['id'] = $selectRow['id'];
                $paramToPass['ip'] = $selectRow['ip'];
                $paramToPass['reason'] = $selectRow['reason'];
            }
            showForm("Edit", "Edited Successfully!", $paramToPass);
            writeHtaccess();
            ?>
			<script>
				 parent.location.reload(true);
			</script>
		<?php 
        } else {
            $paramToPass = array();
            $selectQry = "select * from ipRules where id=" . trim(addslashes($_POST['id']));
            $selectRes = mysql_query($selectQry);
            $selectRow = mysql_fetch_assoc($selectRes);
            if (mysql_num_rows($selectRes) > 0) {
                $paramToPass['id'] = $selectRow['id'];
                $paramToPass['ip'] = $selectRow['ip'];
                $paramToPass['reason'] = $selectRow['reason'];
            }
Exemplo n.º 3
0
function rewrite()
{
    global $CMS_CONF;
    #!!!!!!!!!! mod_rewrite erst nach botton start starten oder mit botton notest übergehen
    #!!!!!!!!!! textaera für provider specifisches einbauen
    #if(isset($_POST['start_rewrite']))
    #if(isset($_POST['nostart_rewrite']))
    # rewrite anfrage von install.js
    if (isset($_POST['fromajax']) and $_POST['fromajax'] == "true") {
        if (isset($_POST['modconf'])) {
            writeHtaccess("test", $_POST['modconf']);
        }
        echo '<span id="return-modconf">&nbsp;</span>';
        exit;
    }
    # rewrite wurde schonn ausgeführt
    $rewrite_step = false;
    if (isset($_POST['rewrite']) and $_POST['rewrite'] != "false") {
        $rewrite_step = $_POST['rewrite'];
    }
    $status = true;
    $text_status = "";
    $input = "";
    if ($rewrite_step === false) {
        $status = false;
        $rewrite_step = "false";
        if (!is_dir(BASE_DIR . 'install')) {
            mkdir(BASE_DIR . 'install');
        }
        if (!is_file(BASE_DIR . 'install/test.php')) {
            $test_datei = '<?php sleep(2); if (isset($_GET["rewritetest"]) and $_GET["rewritetest"] == "true") echo \'<span id="mod-rewrite-true">&nbsp;</span>\'; ?>';
            file_put_contents(BASE_DIR . 'install/test.php', $test_datei);
        }
        $html = '<img style="margin-right:2em;" src="' . URL_BASE . CMS_DIR_NAME . '/jquery/ajax-loader.gif" />' . getLanguageValue("install_rewrite_test_text", '<span id="step-mod-conf">0</span>', writeHtaccess("test", 0, true)) . '<script language="Javascript" type="text/javascript">/*<![CDATA[*/' . 'var finish_test = false;' . 'var max_step = ' . writeHtaccess("test", 0, true) . ';' . '/*]]>*/</script>';
    } else {
        if (is_dir(BASE_DIR . 'install')) {
            if (is_file(BASE_DIR . 'install/test.php')) {
                unlink(BASE_DIR . 'install/test.php');
            }
            if (is_file(BASE_DIR . 'install/.htaccess')) {
                unlink(BASE_DIR . 'install/.htaccess');
            }
            rmdir(BASE_DIR . 'install');
        }
        if ($rewrite_step == "no_modrewrite") {
            $html = getLanguageValue("install_rewrite_no");
            $text_status = false;
            if (is_file(BASE_DIR . '.htaccess')) {
                $html .= '<br />' . getLanguageValue("install_rewrite_no_htaccess");
            }
            if (is_file(BASE_DIR_ADMIN . '.htaccess')) {
                unlink(BASE_DIR_ADMIN . '.htaccess');
            }
            $CMS_CONF->set("modrewrite", "false");
        } else {
            $html = getLanguageValue("install_rewrite_yes");
            $text_status = true;
            writeHtaccess("cms", $rewrite_step);
            $CMS_CONF->set("modrewrite", "true");
        }
        $input = '<input type="hidden" name="rewrite" value="' . $rewrite_step . '" />';
    }
    $help = contend_template(installHelp("install_rewrite_help"), "");
    $html_ret = contend_template($html, $text_status);
    return array($status, $help . $html_ret . $input);
}