Пример #1
0
/**
 * debug and die
 * outputs debuglog and dies
 * @since  3.4
 * @param  str $msg message to log
 */
function debugDie($msg)
{
    debugLog($msg);
    outputDebugLog();
    die;
}
Пример #2
0
/**
 * Redirect URL
 *
 * @since 3.0
 * @author schlex
 *
 * @param string $url
 * @param bool ajax force redirects if ajax
 */
function redirect($url, $ajax = false)
{
    global $i18n;
    $url = var_out($url, 'url');
    // filter url here since it can come from alot of places, specifically redirectto user input
    // handle expired sessions for ajax requests
    if (requestIsAjax()) {
        if (!cookie_check()) {
            header('HTTP/1.1 401 Unauthorized');
            header('WWW-Authenticate: FormBased');
            // @note this is not a security function for ajax, just a session timeout handler
            die;
        } else {
            if ($ajax) {
                header('HTTP/1.1 302 Redirect');
                echo $url;
                // header('Location: '.$url);
                // @note this is not a security function for ajax, just a session timeout handler
                die;
            }
        }
    }
    if (function_exists('exec_action')) {
        exec_action('redirect');
    }
    // @hook redirect a redirect is occuring
    $debugredirect = getDef('GSDEBUGREDIRECTS', true);
    if (!headers_sent($filename, $linenum) && !$debugredirect) {
        header('Location: ' . $url);
    } else {
        // @todo not sure this ever gets used or headers_sent is reliable ( turn output buffering off to test )
        echo "<html><head><title>" . i18n_r('REDIRECT') . "</title></head><body>";
        if (!isDebug()) {
            echo '<script type="text/javascript">';
            echo 'window.location.href="' . $url . '";';
            echo '</script>';
            echo '<noscript>';
            echo '<meta http-equiv="refresh" content="0;url=' . $url . '" />';
            echo '</noscript>';
        }
        if (headers_sent()) {
            echo i18n_r('ERROR') . ": Headers already sent in " . $filename . " on line " . $linenum . "<br/><br/>\n\n";
        }
        printf(i18n_r('REDIRECT_MSG'), $url);
        if (!isAuthPage()) {
            if (isDebug()) {
                debugLog(debug_backtrace());
                outputDebugLog();
            }
        }
        echo "</body></html>";
    }
    exit;
}
Пример #3
0
    echo $site_link_back_url;
    ?>
" target="_blank" ><img src="template/images/getsimple_logo.gif" alt="GetSimple Content Management System" /></a>
        </div>
        <div class="clear"></div>
        <?php 
    get_scripts_backend(true);
    exec_action('footer');
}
?>

        </div><!-- end #footer -->
        <?php 
if (!isAuthPage()) {
    if (isDebug()) {
        outputDebugLog();
    }
}
?>
    </div><!-- end .wrapper -->

<?php 
exec_action('footer-body-end');
// @hook footer-body-end before html body closing
?>
 
</body>
</html>
<?php 
exec_action('footer-end');
// @hook footer-end the end before php flushes its output