function echo_form()
{
    echo '<form name="doit" method="post" action="' . get_current_url() . '" />';
    echo '<input type="submit" name="verify" value="Run" />';
    echo '<input type="submit" name="verify" value="Test" />';
    echo '</form>';
}
 function run()
 {
     if (!reason_user_has_privs($this->admin_page->user_id, 'view_sensitive_data')) {
         echo '<p>Sorry; use of this module is restricted.</p>' . "\n";
         return;
     }
     if (!empty($this->admin_page->request['error_reporting_state'])) {
         switch ($this->admin_page->request['error_reporting_state']) {
             case 'on':
                 override_developer_status(true);
                 break;
             case 'off':
                 override_developer_status(false);
                 break;
         }
     }
     $status = is_developer();
     echo '<form method="post" action="' . htmlspecialchars(get_current_url()) . '">';
     if ($status) {
         echo '<h3>In-page error reporting is currently ON.</h3>' . "\n";
         echo '<input type="submit" value="Turn Error Reporting Off" /><input type="hidden" name="error_reporting_state" value="off" />';
     } else {
         echo '<h3>In-page error reporting is currently OFF.</h3>' . "\n";
         echo '<input type="submit" value="Turn Error Reporting On" /><input type="hidden" name="error_reporting_state" value="on" />';
     }
     echo '</form>';
     echo '<p>Note: changes made via this form only last for the duration of the current session.</p>';
 }
function echo_form2()
{
    echo '<p>This phase of the script will <strong>RESET ALL EXISTING RELATIONSHIP SORT ORDER DATA FOR THE minisite_page_to_text_blurb ALLOWABLE RELATIONSHIP</strong> - so do not run it unless ';
    echo 'this is what you actually intend to do. If you have never run this script before on this reason instance, you should run it in order to preserve the previous sort order of text blurbs on pages.</p>';
    echo '<form name="doit" method="post" action="' . get_current_url() . '" />';
    echo '<input type="submit" name="verify2" value="Run" />';
    echo '<input type="submit" name="verify2" value="Test" />';
    echo '</form>';
}
Example #4
0
/**
 * called to validate WP login form
 */
function secure_failtoban_validate_login_form($args)
{
    if (isset($_POST['log']) && isset($_POST['pwd'])) {
        if (secure_is_failtoban()) {
            header('Location: ' . get_current_url(true));
            exit;
        }
    }
}
 function init($args = array())
 {
     if ($this->params['force_secure'] && HTTPS_AVAILABLE && !on_secure_page()) {
         header('Location: ' . get_current_url(securest_available_protocol()));
         exit(0);
     }
     // Check for an existing database connection so we can restore it when we're done
     $this->db_conn = get_current_db_connection_name();
 }
function get_demo_url($page, $hash = null)
{
    $index = settings('interface_filename');
    $req = get_current_url();
    if (substr($req, -1) != '/') {
        $req = dirname($req);
    }
    return $req . '/' . $index . '?page=' . $page . (!is_null($hash) ? '#' . $hash : '');
}
 public function authenticate()
 {
     nocache_headers();
     $is_allowed = $this->isAllowed();
     if (!is_user_logged_in() && !$is_allowed) {
         $current_url = get_current_url();
         wp_redirect(add_query_arg('redirect_to', urlencode($current_url), $this->settings['logout_redirect']));
         exit;
     }
 }
Example #8
0
function show_navigation($start_with)
{
    start_form("", "get");
    if ($start_with > 0) {
        echo get_href("<p>Previous", set_var(get_current_url(), "start", max(0, $start_with - SHOW_ITEMS)));
    } else {
        echo "Previous";
    }
    echo " ";
    echo get_href("Next", set_var(get_current_url(), "start", $start_with + SHOW_ITEMS));
    end_form();
}
function force_login_to_site($redirect_url = NULL, $whitelist = array())
{
    // https://github.com/kevinvess/wp-force-login
    add_action('init', function () use($redirect_url, $whitelist) {
        if (!is_user_logged_in()) {
            $url = get_current_url();
            if (preg_replace('/\\?.*/', '', $url) != preg_replace('/\\?.*/', '', wp_login_url()) && !in_array($url, $whitelist)) {
                wp_safe_redirect(wp_login_url($redirect_url ? $redirect_url : $url), 302);
                exit;
            }
        }
    });
}
Example #10
0
/**
 * called to validate WP login form
 */
function secure_captcha_validate_login_form($args)
{
    if (isset($_POST['log']) && isset($_POST['pwd'])) {
        if (!secure_captcha_validate_result(SECURE_CAPTCHA_FIELD . '-login')) {
            $redirect_to = "";
            if (isset($_REQUEST['redirect_to'])) {
                $redirect_to = $_REQUEST['redirect_to'];
            }
            header('Location: ' . get_current_url() . "?redirect_to=" . urlencode($redirect_to));
            exit;
        }
    }
}
Example #11
0
 public static function init($token = false, $secret = false)
 {
     if (!$token || !$secret) {
         $_SESSION['TwitterRedirect'] = get_current_url();
         Controller::redirect('?q=twitter/request_auth');
         return false;
     } else {
         self::$auth_token = $token;
         self::$auth_secret = $secret;
         self::$started = true;
         self::$oauth = OAuth::getInstance('twitter');
         return true;
     }
 }
Example #12
0
 public static function template_redirect()
 {
     if (!self::is_page()) {
         return false;
     }
     if (theme_cache::is_user_logged_in()) {
         $account_navs = apply_filters('account_navs', []);
         if (!isset($account_navs[get_query_var('tab')])) {
             wp_redirect(add_query_arg('tab', 'dashboard', self::get_url()));
         }
     } else {
         wp_redirect(theme_custom_sign::get_tabs('login', get_current_url())['url']);
         die;
     }
 }
 function init($args = array())
 {
     parent::init($args);
     if (!$this->get_authentication()) {
         $extra_params = '';
         if (!empty($this->msg_uname)) {
             $extra_params .= '&msg_uname=' . $this->msg_uname;
         }
         if (!empty($this->redir_link_text)) {
             $extra_params .= '&redir_link_text=' . $this->redir_link_text;
         }
         $dest_page = urlencode(get_current_url());
         header('Location: ' . REASON_LOGIN_URL . '?dest_page=' . $dest_page . $extra_params);
         exit;
     }
 }
Example #14
0
 /**
  * template_include filter (allow to override template hierarchy)
 * @return template path
 */
 function private_template_include($template)
 {
     $post_id = get_the_id();
     if (is_home()) {
         $post_id = get_option('page_for_posts');
     }
     if (tool_private_is_private_post($post_id) && !is_user_logged_in()) {
         $private_template = locate_ressource(CUSTOM_PLUGIN_TOOLS_FOLDER . PRIVATE_TOOL_NAME . '/templates/tool-private-template.php');
         if (!empty($private_template)) {
             $template = $private_template;
         } else {
             wp_redirect(wp_login_url(get_current_url(true)));
         }
     }
     return $template;
 }
 function get_queried_page($depth = 0)
 {
     $curr_url = get_current_url();
     if ($depth != -1) {
         $curr_url = strtok($curr_url, '?');
     }
     $curr_uri = str_replace(get_bloginfo('url'), '', $curr_url);
     if ($depth) {
         $curr_uri_ary = array_filter(explode('/', $curr_uri));
         $curr_uri = trailingslashit(implode('/', array_splice($curr_uri_ary, 0, $depth)));
     }
     $page = get_page_by_path($curr_uri);
     if ($page) {
         return $page;
     }
     return null;
 }
Example #16
0
/**
 * Enqueue scripts for the front end.
*/
function tool_menu_custom_front_enqueue_scripts_tools($dependencies)
{
    /**
     * enqueue menu-hightlight javascript file
     */
    $js_tool_menu_hightlight = locate_web_ressource(CUSTOM_PLUGIN_TOOLS_FOLDER . MENU_TOOL_NAME . '/js/tool-menu-hightlight.js');
    if (!empty($js_tool_menu_hightlight)) {
        if (is_multisite()) {
            $home_url = get_site_url(BLOG_ID_CURRENT_SITE);
            $home_minisite_url = get_site_url(get_current_blog_id());
        } else {
            $home_url = home_url('/');
            $home_minisite_url = "";
        }
        $id_blog_page = get_option('page_for_posts');
        if (!empty($id_blog_page) && is_numeric($id_blog_page)) {
            $blog_url = get_permalink($id_blog_page);
        } else {
            $blog_url = "";
        }
        if (is_single() && get_post_type() == 'post') {
            $is_post = "1";
        } else {
            $is_post = "0";
        }
        $current_url = get_current_url();
        wp_enqueue_script('tool-menu-script-menu-hightlight', $js_tool_menu_hightlight, $dependencies, '1.0', true);
        wp_localize_script('tool-menu-script-menu-hightlight', 'ToolMenu', array('current_url' => $current_url, 'home_url' => $home_url, 'home_minisite_url' => $home_minisite_url, 'blog_url' => $blog_url, 'is_post' => $is_post));
    }
    /**
     * enqueue menu-toggle javascript file
     */
    $js_tool_menu_toggle = locate_web_ressource(CUSTOM_PLUGIN_TOOLS_FOLDER . MENU_TOOL_NAME . '/js/tool-menu-toggle.js');
    if (!empty($js_tool_menu_toggle)) {
        wp_enqueue_script('tool-menu-script-menu-toggle', $js_tool_menu_toggle, $dependencies, '1.0', true);
    }
    /**
     * enqueue menu-fixed-on-scroll javascript file
     */
    $js_tool_menu_fixed_on_scroll = locate_web_ressource(CUSTOM_PLUGIN_TOOLS_FOLDER . MENU_TOOL_NAME . '/js/tool-menu-fixed-on-scroll.js');
    if (!empty($js_tool_menu_fixed_on_scroll)) {
        wp_enqueue_script('tool-menu-script-fixed-on-scroll', $js_tool_menu_fixed_on_scroll, $dependencies, '1.0', true);
    }
}
 public function getAddressPackage()
 {
     $appId = $this->appId;
     //appID
     $scope = 'jsapi_address';
     //说明获取编辑地址权限
     $signType = 'SHA1';
     //加密方式为sha1
     $timeStamp = time();
     //时间戳
     $nonceStr = $this->_createNonceStr();
     //以下开始进行签名
     $url = get_current_url();
     $accessToken = get_access_token();
     $string = 'accesstoken=' . $accessToken . '&appid=' . $appId . '&noncestr=' . $nonceStr . '&timestamp=' . $timeStamp . '&url=' . $url;
     $addrSign = SHA1($string);
     $addressPage = array('appId' => $appId, 'scope' => $scope, 'signType' => $signType, 'addrSign' => $addrSign, 'timeStamp' => $timeStamp, 'nonceStr' => $nonceStr);
     return $addressPage;
 }
 /**
  * @return string|NULL Canonical url, NULL if current page is canonical
  */
 public function get_canonical_url()
 {
     foreach ($this->modules as $key => $module) {
         $this->data[$key]['non_canonical'] = $module->get_noncanonical_request_keys();
         $this->data[$key]['all'] = array_keys($module->get_cleanup_rules());
         $this->data[$key]['canonical'] = array_diff($this->data[$key]['non_canonical'], $this->data[$key]['all']);
     }
     $canonicalized_url = NULL;
     $non_cans_array = $this->get_non_canonical_url_params();
     $curr_url = get_current_url();
     $parsed_url = parse_url($curr_url);
     $non_cans_array = array_flip($non_cans_array);
     $canonicalized_url = $this->strip_non_canonical_url_params($non_cans_array, $parsed_url);
     if ($canonicalized_url == get_current_url()) {
         return;
     } else {
         return trim_slashes($canonicalized_url);
     }
 }
function ad_rtl()
{
    function get_current_url()
    {
        $protocol = !empty($_SERVER['HTTPS']) && $_SERVER['HTTPS'] !== 'off' || $_SERVER['SERVER_PORT'] == 443 ? "https://" : "http://";
        $domainName = $_SERVER['HTTP_HOST'];
        $currentPath = $_SERVER["REQUEST_URI"];
        return $protocol . $domainName . $currentPath;
    }
    function master_dashboard_url()
    {
        $master_dash_url = get_site_url('1', '/wp-admin/my-sites.php');
        return $master_dash_url;
    }
    $currentURL = get_current_url();
    $url = master_dashboard_url();
    if ($currentURL == $url) {
        wp_redirect(home_url('/login'));
        exit;
    }
}
Example #20
0
function get_locale_url($locale = 'ja')
{
    $full_url = get_current_url();
    $path = explode('?', $full_url);
    if (count($path) > 1) {
        $url = array_shift($path) . '?';
        $search = implode('', $path);
        $queries = explode('&', $search);
        foreach ($queries as $i => $query) {
            $q = explode('=', $query);
            if ($q[0] == 'locale') {
                $url .= $q[0] . '=' . $locale;
            } else {
                $url .= '&' . $query;
            }
        }
        return $url;
    } else {
        return $path[0] . '?locale=' . $locale;
    }
}
Example #21
0
 /**
  * Returns the html markup to simply display the media.
  * @return string
  */
 public function get_html_markup()
 {
     $markup = '';
     if ($this->media_work->get_value('entry_id')) {
         if (!empty($this->request['displayer_height'])) {
             $height = $this->request['displayer_height'];
         } else {
             $height = $this->av_module->params['default_video_height'];
         }
         $this->displayer->set_height($height);
         $embed_markup = $this->displayer->get_display_markup();
         $markup .= $embed_markup;
         $mwh = new media_work_helper($this->media_work);
         if ($mwh->user_has_access_to_media()) {
             $markup .= $this->size_selector->get_size_selector_html($this->media_work, $height);
             $markup .= '<div class="share_download_info">' . "\n";
             $markup .= '<div class="share">' . "\n";
             $markup .= '<h5 class="share_label">Share:</h5>' . "\n";
             $markup .= '<ul class="share_list">' . "\n";
             $facebook_url = 'http://www.facebook.com/sharer.php?u=' . urlencode(get_current_url()) . '&t=' . urlencode($this->media_work->get_value('name'));
             $markup .= '<li><a href="' . $facebook_url . '">Facebook</a></li>' . "\n";
             $twitter_url = 'https://twitter.com/share?url=' . urlencode(get_current_url()) . '&text=' . urlencode($this->media_work->get_value('name'));
             $markup .= '<li><a href="' . $twitter_url . '">Twitter</a></li>' . "\n";
             $markup .= '</ul>' . "\n";
             $markup .= '</div>' . "\n";
             if ($this->media_work->get_value('show_embed')) {
                 $markup .= '<div class="embed">' . "\n";
                 $markup .= '<h5 class="embed_label">Embed:</h5>' . "\n";
                 $markup .= '<textarea class="embed_code" rows="7" cols="75" readonly="readonly">' . "\n";
                 $markup .= htmlspecialchars($embed_markup, ENT_QUOTES);
                 $markup .= '</textarea>' . "\n";
                 $markup .= '</div>' . "\n";
             }
             $markup .= '</div>' . "\n";
         }
     } else {
         $markup .= '<p>Sorry, this media work cannot be displayed.</p>' . "\n";
     }
     return $markup;
 }
 /**
  * Overwrite the original session start to specify a path at root of the installation
  *
  * If you have several instances of PML on the same server with different paths,
  * authentication has to be managed distinctly
  *
  * @param   string   $path      the path of the cookie
  * @param   integer  $lifetime  the lifetime of the cookie
  *
  * @return bool
  */
 public static function start($path = '', $lifetime = 0)
 {
     if (self::$sessionState === self::SESSION_NOT_STARTED) {
         if (empty($path)) {
             $sub = array('inc');
             $url = parse_url(get_current_url());
             // we add a string on bottom to manage urls like these
             // - http://niania/blahblah/pimpmylog/
             // - http://niania/blahblah/pimpmylog/index.php
             // So they become
             // - http://niania/blahblah/pimpmylog/fake
             // - http://niania/blahblah/pimpmylog/index.phpfake
             $path = dirname($url['path'] . 'fake');
             // Now remove all identified subfolders
             if (in_array(basename($path), $sub)) {
                 $path = dirname($path);
             }
         }
         session_set_cookie_params($lifetime, $path);
         self::$sessionState = self::SESSION_STARTED;
         return session_start();
     }
     return true;
 }
Example #23
0
/**
 * load settings template
*/
function tool_private_settings_template()
{
    tool_private_settings_save();
    ?>
<form method="post" action="<?php 
    echo get_current_url(true);
    ?>
">
	<input type="hidden"
		name="<?php 
    echo TOOL_PRIVATE_OPTIONS_NONCE_ACTION;
    ?>
"
		value="<?php 
    echo wp_create_nonce(TOOL_PRIVATE_OPTIONS_NONCE_ACTION);
    ?>
" />
	<?php 
    require_once locate_ressource(CUSTOM_PLUGIN_TOOLS_FOLDER . PRIVATE_TOOL_NAME . '/inc/options-fields.php');
    submit_button();
    ?>
</form>
<?php 
}
}
$myusername = security($_POST['username']);
$mypassword = security($_POST['password']);
$myrepeat = security($_POST['repeat']);
$email = security($_POST['email']);
$email_repeat = security($_POST['email_repeat']);
$form_action = security($_POST['action']);
if ($form_action == "forgot") {
    if ($email) {
        $sql = "SELECT * FROM users WHERE email='{$email}' AND trade_id = '" . $my_coins->getTradeIdAccount() . "'";
        $result = mysql_query($sql);
        if ($result) {
            $count = mysql_num_rows($result);
            if ($count == 1) {
                $Row = mysql_fetch_assoc($result);
                $url = get_current_url();
                mail($email, "Passwort Recover for Werris/Zelles Exchange Service", "Please copy the url in your browser<br/>\n " . $url . "?recover=1&username="******"&id=" . md5(md5($email . $Row['username'] . $Row['password'])));
                $return_error = "Email with instructions details to the new password was sent to " . $email . "!";
            } else {
                $return_error = "No Email found!";
            }
        } else {
            $return_error = "System error";
        }
    } else {
        $return_error = "No Email was entered.";
    }
}
if ($form_action == "login") {
    $_SESSION['login_attempts'] = $login_attempts + 1;
    if ($login_attempts <= 5) {
Example #25
0
function carl_construct_query_string($new_request_vars, $preserve_request_vars = array(''))
{
    if (empty($preserve_request_vars)) {
        return carl_make_link($new_request_vars, '', 'qs_only', true, false);
    } else {
        $url = get_current_url();
        $preserve_array = '';
        $parts = parse_url($url);
        if (!empty($parts['query'])) {
            parse_str($parts['query'], $cur_request_vars);
        }
        if (isset($cur_request_vars)) {
            $cur_request_vars = conditional_stripslashes($cur_request_vars);
        }
        foreach ($preserve_request_vars as $key) {
            if (isset($cur_request_vars[$key])) {
                $preserve_array[$key] = $cur_request_vars[$key];
            }
        }
        $params = isset($preserve_array) ? array_merge((array) $preserve_array, (array) $new_request_vars) : $new_request_vars;
        return carl_make_link($params, '', 'qs_only', true, false);
    }
}
">
<input type="hidden" name="adg" value="<?php 
echo get_url_tag('adg');
?>
">
<input type="hidden" name="webad" value="<?php 
echo get_url_tag('webad');
?>
">

<input type="hidden" name="landing_page" value="<?php 
echo get_url_tag('landing_url');
?>
">
<input type="hidden" name="submit_page" value="<?php 
echo get_current_url();
?>
">

<input type="hidden" name="opt_in_text" value="<?php 
echo OPT_IN_TEXT;
?>
">

<input type="hidden" name="ip_addr" value="">
<input type="hidden" name="date_time" value="">

<input type="hidden" name="user_device" value="">

<input type="hidden" name="searchengine" value="">
Example #27
0
/**
 * 返回应用的url
 * @return string
 */
function get_app_url()
{
    // 因为所有的操作会跳转到 index.php,所以这一步会成功
    $dir = dirname($_SERVER['SCRIPT_NAME']);
    $url = get_current_url();
    if ($dir === '\\' || $dir === '/') {
        $dir = (@($_SERVER["HTTPS"] != 'on') ? 'http://' : 'https://') . $_SERVER['SERVER_NAME'] . '/';
    }
    $start = strpos($url, $dir) + strlen($dir);
    $url = substr($url, 0, $start);
    return $url;
}
Example #28
0
function output_atom($feed)
{
    global $luna_config;
    // Send XML/no cache headers
    header('Content-Type: application/atom+xml; charset=utf-8');
    header('Expires: ' . date('D, d M Y H:i:s') . ' GMT');
    header('Cache-Control: must-revalidate, post-check=0, pre-check=0');
    header('Pragma: public');
    echo '<?xml version="1.0" encoding="utf-8"?>' . "\n";
    echo '<feed xmlns="http://www.w3.org/2005/Atom">' . "\n";
    echo "\t" . '<title type="html"><![CDATA[' . escape_cdata($feed['title']) . ']]></title>' . "\n";
    echo "\t" . '<link rel="self" href="' . luna_htmlspecialchars(get_current_url()) . '"/>' . "\n";
    echo "\t" . '<link href="' . luna_htmlspecialchars($feed['link']) . '"/>' . "\n";
    echo "\t" . '<updated>' . date('Y-m-d\\TH:i:s\\Z', count($feed['items']) ? $feed['items'][0]['pubdate'] : time()) . '</updated>' . "\n";
    echo "\t" . '<generator version="' . $luna_config['o_cur_version'] . '">Luna</generator>' . "\n";
    echo "\t" . '<id>' . luna_htmlspecialchars($feed['link']) . '</id>' . "\n";
    $content_tag = $feed['type'] == 'comments' ? 'content' : 'summary';
    foreach ($feed['items'] as $item) {
        echo "\t" . '<entry>' . "\n";
        echo "\t\t" . '<title type="html"><![CDATA[' . escape_cdata($item['title']) . ']]></title>' . "\n";
        echo "\t\t" . '<link rel="alternate" href="' . luna_htmlspecialchars($item['link']) . '"/>' . "\n";
        echo "\t\t" . '<' . $content_tag . ' type="html"><![CDATA[' . escape_cdata($item['description']) . ']]></' . $content_tag . '>' . "\n";
        echo "\t\t" . '<author>' . "\n";
        echo "\t\t\t" . '<name><![CDATA[' . escape_cdata($item['author']['name']) . ']]></name>' . "\n";
        if (isset($item['author']['email'])) {
            echo "\t\t\t" . '<email><![CDATA[' . escape_cdata($item['author']['email']) . ']]></email>' . "\n";
        }
        if (isset($item['author']['uri'])) {
            echo "\t\t\t" . '<uri>' . luna_htmlspecialchars($item['author']['uri']) . '</uri>' . "\n";
        }
        echo "\t\t" . '</author>' . "\n";
        echo "\t\t" . '<updated>' . date('Y-m-d\\TH:i:s\\Z', $item['pubdate']) . '</updated>' . "\n";
        echo "\t\t" . '<id>' . luna_htmlspecialchars($item['link']) . '</id>' . "\n";
        echo "\t" . '</entry>' . "\n";
    }
    echo '</feed>' . "\n";
}
Example #29
0
function is_current_url($path)
{
    if (get_site_url($path) == rtrim(get_current_url(), '/')) {
        return true;
    } else {
        return false;
    }
}
Example #30
0
<?php
}
else
{
$cur_panel['title'] = $lang_common['Login'];
require_once FORUM_ROOT.'lang/'.$forum_user['language'].'/login.php';
$form_action = forum_link($forum_url['login']);
$forum_page['redirect_url'] = 'https://flazy.us/index.php';
?>

<div class="blocks">

<form method="post" action="<?php echo $form_action ?>">

            <input type="hidden" name="form_sent" value="1" />
            <input type="hidden" name="redirect_url" value="<?php echo forum_htmlencode($forum_page['redirect_url']) ?>" /><?get_current_url()?>
            <input type="hidden" name="csrf_token" value="<?php echo generate_form_token($form_action) ?>" />

		<div align="center" class="logform">
			<ul class="reset">
				<label for="login_name"><?php echo $lang_login['Username'] ?>:</label><br /><input type="text" name="req_username" id="login_name" size="23" />
				<label for="login_password"><?php echo $lang_login['Password'] ?> (<a href="forum/login.php?action=forget">Forgoten password</a>)</label><br /><input type="password" name="req_password" id="login_password" size="23" />
				<?php echo $lang_login['Remember me'] ?></span> <input type="checkbox"  size="3" id="fld-remember-me" name="save_pass" value="1" />
				<button class="fbutton" onclick="submit();" type="submit" title="Login"><span>Login</span></button>
			</ul>
			<input name="login" type="hidden" id="login" value="submit" />
		</div>
	</form>

<noindex></noindex>
</div>