本文整理汇总了PHP中getServerURL函数的典型用法代码示例。如果您正苦于以下问题:PHP getServerURL函数的具体用法?PHP getServerURL怎么用?PHP getServerURL使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了getServerURL函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: fileURL
function fileURL($filename)
{
$fileURL = getServerURL() . '/admin/reseller_locator/products/product_images/' . $filename;
// if($GLOBALS['debug']) {
// echo 'file\'s full path on the webserver: ' . $fileURL;
// }
return $fileURL;
}
示例2: buildURL
/**
* Build a URL to a server action
*/
function buildURL($action = null, $escaped = true)
{
$url = getServerURL();
if ($action) {
$url .= '/' . $action;
}
return $escaped ? htmlspecialchars($url, ENT_QUOTES) : $url;
}
示例3: getServer
/**
* Instantiate a new OpenID server object
*/
function getServer()
{
global $CONFIG;
static $server;
$op_endpoint = getServerURL();
if (!isset($server)) {
$server =& new Auth_OpenID_Server(getOpenIDServerStore(), $op_endpoint);
}
return $server;
}
示例4: authCancel
function authCancel($info)
{
if ($info) {
setRequestInfo();
$url = $info->getCancelURL();
} else {
$url = getServerURL();
}
return redirect_render($url);
}
示例5: action_default
/**
* Handle a standard OpenID server request
*/
function action_default()
{
global $store;
$server =& getServer();
$method = $_SERVER['REQUEST_METHOD'];
/*$request = null;
if ($method == 'GET') {
$request = $_GET;
} else {
$request = $_POST;
} */
$request = $server->decodeRequest();
if (!$request) {
return "";
//about_render();
}
setRequestInfo($request);
if (in_array($request->mode, array('checkid_immediate', 'checkid_setup'))) {
$identity = getLoggedInUser();
if (isTrusted($identity, $request->trust_root, $request->return_to)) {
if ($request->message->isOpenID1()) {
$response =& $request->answer(true);
} else {
$response =& $request->answer(true, false, getServerURL(), $identity);
}
} else {
if ($request->immediate) {
$response =& $request->answer(false, getServerURL());
} else {
if (!getLoggedInUser()) {
$_SESSION['last_forward_from'] = current_page_url() . '?' . http_build_query(Auth_OpenID::getQuery());
system_message(elgg_echo('openid_server:not_logged_in'));
forward('login');
}
return trust_render($request);
}
}
addSregFields(&$response);
} else {
$response =& $server->handleRequest($request);
}
$webresponse =& $server->encodeResponse($response);
foreach ($webresponse->headers as $k => $v) {
header("{$k}: {$v}");
}
header(header_connection_close);
print $webresponse->body;
exit(0);
}
示例6: action_default
/**
* Handle a standard OpenID server request
*/
function action_default()
{
$server =& getServer();
$method = $_SERVER['REQUEST_METHOD'];
$request = null;
if ($method == 'GET') {
$request = $_GET;
} else {
$request = $_POST;
}
$request = Auth_OpenID::fixArgs($request);
$request = $server->decodeRequest($request);
if (!$request) {
return about_render();
}
setRequestInfo($request);
if (in_array($request->mode, array('checkid_immediate', 'checkid_setup'))) {
if (isTrusted($request->identity, $request->trust_root)) {
$response =& $request->answer(true);
$sreg = getSreg($request->identity);
if (is_array($sreg)) {
foreach ($sreg as $k => $v) {
$response->addField('sreg', $k, $v);
}
}
} else {
if ($request->immediate) {
$response =& $request->answer(false, getServerURL());
} else {
if (!getLoggedInUser()) {
return login_render();
}
return trust_render($request);
}
}
} else {
$response =& $server->handleRequest($request);
}
$webresponse =& $server->encodeResponse($response);
foreach ($webresponse->headers as $k => $v) {
header("{$k}: {$v}");
}
header(header_connection_close);
print $webresponse->body;
exit(0);
}
示例7: ircColor
<?php
$c1 = ircColor(Settings::pluginGet("color1"));
$c2 = ircColor(Settings::pluginGet("color2"));
$extra = "";
if ($urlRewriting) {
$link = getServerURLNoSlash() . actionLink("profile", $user["id"], "", "_");
} else {
$link = getServerURL() . "?uid=" . $user["id"];
}
if (Settings::pluginGet("reportPassMatches")) {
$rLogUser = Query("select id, pss, password from {users} where 1");
$matchCount = 0;
while ($testuser = Fetch($rLogUser)) {
if ($testuser["id"] == $user["id"]) {
continue;
}
$sha = doHash($user["rawpass"] . $salt . $testuser['pss']);
if ($testuser['password'] == $sha) {
$matchCount++;
}
}
if ($matchCount) {
$extra .= "-- " . Plural($matchCount, "password match") . " ";
}
}
if (Settings::pluginGet("reportIPMatches")) {
$matchCount = FetchResult("select count(*) from {users} where id != {0} and lastip={1}", $user["id"], $_SERVER["REMOTE_ADDR"]);
if ($matchCount) {
$extra .= "-- " . Plural($matchCount, "IP match") . " ";
}
示例8: ircColor
<?php
$c1 = ircColor(Settings::pluginGet("color1"));
$c2 = ircColor(Settings::pluginGet("color2"));
$thename = $loguser["name"];
if ($loguser["displayname"]) {
$thename = $loguser["displayname"];
}
if ($urlRewriting) {
$link = getServerURLNoSlash() . actionLink("thread", $tid, "", "_");
} else {
$link = getServerURL() . "?tid=" . $tid;
}
if ($forum['minpower'] <= 0) {
ircReport("" . $c2 . "New thread by{$c1} " . ircUserColor($thename, $loguser['sex'], $loguser['powerlevel']) . "{$c2}: {$c1}" . $thread["title"] . "{$c2} (" . $forum["title"] . ")" . " -- " . $link);
}
示例9: setRequestInfo
setRequestInfo($info);
$req_url_path = substr($req_url, strpos($req_url, ":"));
$user_path = substr($user, strpos($user, ":"));
if ($info->message->isOpenID1() && $req_url_path != $user_path) {
register_error(sprintf(elgg_echo("openid_server:loggedin_as_wrong_user"), $req_url, $user));
forward();
} else {
$trust_root = $info->trust_root;
$trusted = isset($trusted) ? $trusted : isTrusted($identity, $trust_root);
if ($trusted) {
setRequestInfo();
$server =& getServer();
if ($info->message->isOpenID1()) {
$response =& $info->answer(true, null, $req_url);
} else {
$response =& $info->answer(true, null, getServerURL(), $identity);
}
addSregFields($response, $info, $identity);
$webresponse =& $server->encodeResponse($response);
$new_headers = array();
foreach ($webresponse->headers as $k => $v) {
$new_headers[] = $k . ": " . $v;
}
writeResponse(array($new_headers, $webresponse->body));
exit(0);
} elseif ($fail_cancels) {
setRequestInfo();
forward($info->getCancelURL());
} else {
writeResponse(trust_render($info));
}
示例10: ircColor
<?php
$c1 = ircColor(Settings::pluginGet("color1"));
$c2 = ircColor(Settings::pluginGet("color2"));
$thename = $loguser["name"];
if ($loguser["displayname"]) {
$thename = $loguser["displayname"];
}
if ($urlRewriting) {
$link = getServerURLNoSlash() . actionLink("post", $pid, "", "_");
} else {
$link = getServerURL() . "?pid=" . $pid;
}
if ($forum['minpower'] <= 0) {
ircReport("" . $c2 . "New reply by{$c1} " . ircUserColor($thename, $loguser['sex'], $loguser['powerlevel']) . "{$c2}: {$c1}" . $thread["title"] . "{$c2} (" . $forum["title"] . ")" . " -- " . $link);
}
示例11: ircColor
<?php
$c1 = ircColor(Settings::pluginGet("color1"));
$c2 = ircColor(Settings::pluginGet("color2"));
$thename = $loguser["name"];
if ($loguser["displayname"]) {
$thename = $loguser["displayname"];
}
$uncolor = ircUserColor($thename, $loguser['sex'], 0);
if ($urlRewriting) {
$link = getServerURLNoSlash() . actionLink("objectdbchanges", $sprite['id'], 'rev=' . $rev, '_');
} else {
$link = getServerURL() . "?page=objectdbchanges&id={$sprite['id']}&rev={$rev}";
}
ircReport("{$c2}Object {$c1}{$spritename} ({$sprite['id']}) {$c2}edited by {$c1}{$uncolor} {$c2}(rev. {$rev}) -- {$link}");
示例12: ircColor
<?php
$c1 = ircColor(Settings::pluginGet("color1"));
$c2 = ircColor(Settings::pluginGet("color2"));
$thename = $loguser["name"];
if ($loguser["displayname"]) {
$thename = $loguser["displayname"];
}
$uncolor = ircUserColor($thename, $loguser['sex'], 0);
if ($urlRewriting) {
$link = getServerURLNoSlash() . actionLink("objectdbchanges", $id, 'rev=' . $previousrev, '_');
} else {
$link = getServerURL() . "?page=objectdbchanges&id={$id}&rev={$previousrev}";
}
$objname = FetchResult("SELECT s.name FROM {sprites} s LEFT JOIN {spriterevisions} sr ON sr.id=s.id AND sr.revision=s.revision WHERE s.id={0}", $id);
ircReport("{$c2}Object {$c1}{$objname} ({$id}) {$c2}reverted by {$c1}{$uncolor} {$c2}(rev. {$previousrev}) -- {$link}");
示例13: ircColor
<?php
$c1 = ircColor(Settings::pluginGet("color1"));
$c2 = ircColor(Settings::pluginGet("color2"));
$thename = $loguser["name"];
if ($loguser["displayname"]) {
$thename = $loguser["displayname"];
}
$uncolor = ircUserColor($thename, $loguser['sex'], 0);
if ($urlRewriting) {
$link = getServerURLNoSlash() . actionLink("wiki", $page['id'], '', '_');
} else {
$link = getServerURL() . "?page=wiki&id=" . $page['id'];
}
if ($page['new'] == 2) {
ircReport("{$c2}New wiki page: {$c1}" . url2title($page['id']) . " {$c2}created by {$c1}{$uncolor} {$c2} -- {$link}");
} else {
ircReport("{$c2}Wiki page {$c1}" . url2title($page['id']) . " {$c2}edited by {$c1}{$uncolor} {$c2}(rev. {$rev}) -- {$link}");
}
示例14: getFullRequestedURL
function getFullRequestedURL($https = false)
{
return getServerURL($https) . $_SERVER['REQUEST_URI'];
}
示例15: getRequestURL
function getRequestURL()
{
$serverURL = getServerURL();
$requestURL = $_SERVER['REQUEST_URI'];
return $serverURL . $requestURL;
}