• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP getCurrentUrl函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了PHP中getCurrentUrl函数的典型用法代码示例。如果您正苦于以下问题:PHP getCurrentUrl函数的具体用法?PHP getCurrentUrl怎么用?PHP getCurrentUrl使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了getCurrentUrl函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。

示例1: view

	public function view()
	{
		$title = $this->params[0];
		$curl = getCurrentUrl();
		$extPath = '/app/ext/addtoany';

		$html=<<<HTML
<!-- AddToAny BEGIN -->
<a class="a2a_dd" href="#"><img src="$extPath/img/share_save.png" width="171" height="16" border="0" alt="Share"/></a>
<script type="text/javascript">
function my_addtoany_onready() { // A custom "onReady" function for AddToAny
    a2a_config.target = '.a2a_dd';
    a2a.init('page');
}
var a2a_config = { // Setup AddToAny "onReady" callback
    tracking_callback: ["ready", my_addtoany_onready]
};
a2a_config.linkname = "$title";
a2a_config.linkurl = "$curl";
(function(){ // Load AddToAny script asynchronously
    var a = document.createElement('script');
    a.type = 'text/javascript';
    a.async = true;
    a.src = '$extPath/js/page.js';
    var s = document.getElementsByTagName('script')[0];
    s.parentNode.insertBefore(a, s);
})();
</script>
<!-- AddToAny END -->
HTML;
		echo $html;
	}
开发者ID:ngduc,项目名称:Thin-PHP-Framework,代码行数:32,代码来源:AddToAny.php


示例2: sendEmailConfirmation

function sendEmailConfirmation($db, $email)
{
    $sql = 'SELECT * FROM users WHERE email = :email';
    $stmt = $db->prepare($sql);
    $stmt->bindValue('email', $email);
    $stmt->execute();
    if ($result = $stmt->fetch()) {
        $id = $result["id"];
        $key = $result["secret"];
        $url = getCurrentUrl() . "confirm.php?id=" . $id . '&key=' . $key;
        $subject = "Email de confirmation - mailinglist";
        $message = '<html><body>';
        $message .= '<h1>Veuillez cliquer sur le lien suivant pour valider votre inscription à la newsletter (mailinglist) :</h1>';
        $message .= '<a href="' . $url . '">' . $url . '</a>';
        $message .= '<br/><br/><br/><br/><br/>';
        $message .= '<a href="' . getCurrentUrl() . "unsubscribe.php?id=" . $id . '&key=' . $key . '" style="font-size: 10px; text-align: center;">Se désinscrire</a>';
        $message .= '</body></html>';
        $headers = "From: [email protected]\r\n";
        $headers .= "MIME-Version: 1.0\r\n";
        $headers .= "Content-Type: text/html; charset=UTF-8\r\n";
        $envoi = mail($email, $subject, $message, $headers);
        if ($envoi) {
            return true;
        }
    }
}
开发者ID:jeremiejacques,项目名称:mailinglist,代码行数:26,代码来源:functions.inc.php


示例3: getAuthSubUrl

function getAuthSubUrl()
{
    $next = getCurrentUrl();
    $scope = 'https://picasaweb.google.com/lh/myphotos?noredirect=1';
    $secure = 0;
    $session = 1;
    return Zend_Gdata_AuthSub::getAuthSubTokenUri($next, $scope, $secure, $session);
}
开发者ID:vaibhav734,项目名称:Facebook-Album,代码行数:8,代码来源:google_login.php


示例4: getAuthSubUrl

/**
 * Returns the AuthSub URL which the user must visit to authenticate requests 
 * from this application.
 *
 * Uses getCurrentUrl() to get the next URL which the user will be redirected
 * to after successfully authenticating with the Google service.
 *
 * @return string AuthSub URL
 */
function getAuthSubUrl()
{
    $next = getCurrentUrl();
    $scope = 'http://www.google.com/base/feeds/';
    $secure = false;
    $session = true;
    return Zend_Gdata_AuthSub::getAuthSubTokenUri($next, $scope, $secure, $session);
}
开发者ID:automatweb,项目名称:automatweb_dev,代码行数:17,代码来源:Gbase.php


示例5: getRedirectUrl

 function getRedirectUrl()
 {
     $currUrl = getCurrentUrl();
     if (!stristr($currUrl, '?')) {
         $currUrl .= "?";
     }
     $currUrl = preg_replace('/&lang_code=\\w{2}$|&lang_code=\\w{2}&/i', '', $currUrl, 1, $count);
     return $currUrl;
 }
开发者ID:codegooglecom,项目名称:seopanel,代码行数:9,代码来源:language.ctrl.php


示例6: __construct

 /**
  * Construct an abstract element with the given options
  * Sets the url property to the current url for convenience
  * @param array $options Array of key => value options to use with this element
  */
 public function __construct(array $options = array())
 {
     // Set the name of this button
     $this->name = strtolower(substr(get_called_class(), strrpos(get_called_class(), '\\') + 1));
     // Most buttons take a url, add it for convenience
     $options = array_merge(array('url' => getCurrentUrl()), $options);
     foreach ($options as $name => $value) {
         $this->{$name} = $value;
     }
     $this->templateDir = __DIR__ . '/../../../templates/' . strtolower(getClassName($this));
 }
开发者ID:faceleg,项目名称:php-socializer,代码行数:16,代码来源:AbstractElement.php


示例7: index

 /**
  * 系统主页
  */
 public function index()
 {
     //读取团购
     $deal_model = M("Deal");
     $deal = $deal_model->order("ctime")->find();
     $this->assign("deal", $deal);
     //分享处理
     $share['url'] = urlencode(getCurrentUrl());
     $share['content'] = urlencode($deal['title']);
     $this->assign("share", $share);
     $this->display();
 }
开发者ID:yunsite,项目名称:nuomituan,代码行数:15,代码来源:IndexAction.class.php


示例8: getPagination

/**
 * Created by PhpStorm.
 * User: caipeichao
 * Date: 14-3-10
 * Time: PM7:40
 */
function getPagination($totalCount, $countPerPage = 10)
{
    $pageKey = 'page';
    //获取当前页码
    $currentPage = intval($_REQUEST[$pageKey]) ? intval($_REQUEST[$pageKey]) : 1;
    //计算总页数
    $pageCount = ceil($totalCount / $countPerPage);
    //如果只有1页,就没必要翻页了
    if ($pageCount <= 1) {
        return '';
    }
    $Page = new \Think\Page($totalCount, $countPerPage);
    // 实例化分页类 传入总记录数和每页显示的记录数
    return $Page->show();
    //定义返回结果
    $html = '';
    //添加头部
    $html .= '<div class="pagination">';
    //添加上一页的按钮
    if ($currentPage > 1) {
        $prevUrl = addUrlParam(getCurrentUrl(), array($pageKey => $currentPage - 1));
        $html .= "<li><a class=\"\" href=\"{$prevUrl}\">&laquo;</a></li>";
    } else {
        $html .= "<li class=\"disabled\"><a>&laquo;</a></li>";
    }
    //添加各页面按钮
    for ($i = 1; $i <= $pageCount; $i++) {
        $pageUrl = addUrlParam(getCurrentUrl(), array($pageKey => $i));
        if ($i == $currentPage) {
            $html .= "<li class=\"active\"><a class=\"active\" href=\"{$pageUrl}\">{$i}</a></li>";
        } else {
            $html .= "<li><a class=\"\" href=\"{$pageUrl}\">{$i}</a></li>";
        }
    }
    //添加下一页按钮
    if ($currentPage < $pageCount) {
        $nextUrl = addUrlParam(getCurrentUrl(), array($pageKey => $currentPage + 1));
        $html .= "<li><a class=\"\" href=\"{$nextUrl}\">&raquo;</a></li>";
    } else {
        $html .= "<li class=\"disabled\"><a>&raquo;</a></li>";
    }
    //收尾
    $html .= '</div>';
    return $html;
}
开发者ID:fishling,项目名称:chatPro,代码行数:51,代码来源:pagination.php


示例9: logged_in

function logged_in()
{
    global $script_path;
    // If session is not found or IP has changed or the uid is not found the user is not logged in
    if (empty($_SESSION['uid']) || empty($_SESSION['ip']) || $_SESSION['ip'] != $_SERVER['REMOTE_ADDR'] || checkUid($_SESSION['uid']) == false) {
        setcookie("last_url", getCurrentUrl());
        // Save last url in a cookie
        if (getSetting("use_redirect_notloggedin", "text") == "true") {
            header('Location: ' . getSetting("redirect_notloggedin", "text"));
        } else {
            if (isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] != "off") {
                header('Location: https://www.' . getCurrentDomain() . $script_path . 'login.php?m=1');
            } else {
                header('Location: http://www.' . getCurrentDomain() . $script_path . 'login.php?m=1');
            }
        }
        exit;
    }
}
开发者ID:pikepa,项目名称:fitfasnfab,代码行数:19,代码来源:api.php


示例10: define

<?php

if (!defined('__URL__')) {
    define('__URL__', getCurrentUrl());
}
if (!defined('__PUBLIC__')) {
    define('__PUBLIC__', setPublicUrl('/Public'));
}
开发者ID:a1586256143,项目名称:MyClassPHP,代码行数:8,代码来源:template.php


示例11:

?>
',
			'text_editor':'<?php 
echo CONFIG_URL_TEXT_EDITOR;
?>
',
			'image_editor':'<?php 
echo CONFIG_URL_IMAGE_EDITOR;
?>
',
			'download':'<?php 
echo CONFIG_URL_DOWNLOAD;
?>
',
			'present':'<?php 
echo Tools::safeOutput(getCurrentUrl());
?>
',
			'home':'<?php 
echo CONFIG_URL_HOME;
?>
',
			'view':'<?php 
echo CONFIG_URL_LIST_LISTING;
?>
'			
		};
	var permits = {'del':<?php 
echo CONFIG_OPTIONS_DELETE ? 1 : 0;
?>
, 'cut':<?php 
开发者ID:toufikadfab,项目名称:PrestaShop-1.5,代码行数:31,代码来源:ajaxfilemanager.php


示例12: authenticate

function authenticate($singleUseToken = null)
{
    $sessionToken = isset($_SESSION['sessionToken']) ? $_SESSION['sessionToken'] : null;
    // If there is no AuthSub session or one-time token waiting for us,
    // redirect the user to Google Health's AuthSub handler to get one.
    if (!$sessionToken && !$singleUseToken) {
        $next = getCurrentUrl();
        $secure = 1;
        $session = 1;
        $authSubHandler = 'https://www.google.com/h9/authsub';
        $permission = 1;
        // 1 - allows reading of the profile && posting notices
        $authSubURL = Zend_Gdata_AuthSub::getAuthSubTokenUri($next, SCOPE, $secure, $session, $authSubHandler);
        $authSubURL .= '&permission=' . $permission;
        echo '<a href="' . $authSubURL . '">Link your Google Health Account</a>';
        exit;
    }
    $client = new Zend_Gdata_HttpClient();
    $client->setAuthSubPrivateKeyFile(HEALTH_PRIVATE_KEY, null, true);
    // Convert an AuthSub one-time token into a session token if needed
    if ($singleUseToken && !$sessionToken) {
        $sessionToken = Zend_Gdata_AuthSub::getAuthSubSessionToken($singleUseToken, $client);
        $_SESSION['sessionToken'] = $sessionToken;
    }
    $client->setAuthSubToken($sessionToken);
    return $client;
}
开发者ID:SustainableCoastlines,项目名称:loveyourwater,代码行数:27,代码来源:Health.php


示例13: getCurrentUrl

        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal"><span aria-hidden="true">&times;</span></button>
                <h4 class="modal-title" id="myModalLabel">アカウント修正</h4>
            </div>
            <div class="modal-body">
                Loading...
            </div>
        </div>
    </div>
</div>

<?php
$newSeminarStudentUrl = Yii::app()->createUrl('admin/student/NewStudentManagement');
$registeredStudentsUrl = $this->createUrl('admin/student/editStudentManagement');
$currentUrl = getCurrentUrl(array_merge($_GET,$searchParams?$searchParams:array(),array('page'=>$pages->currentPage+1)));
$baseUrl = Yii::app()->baseUrl;
$cs = Yii::app()->getClientScript();
$cs->registerScript(
    'toggleModel',
    '
        $("#new-registration").click(function() {
		    $("#myModalLabel").text("受講者アカウント登録");
            $(".modal-body").load("' . $newSeminarStudentUrl . '", function() {
                $("#myModal").modal("show").width(700).css("margin-left",-350);
                $(".datepicker").datepicker().on("changeDate", function() {$(this).datepicker("hide")});
            });
        });
       function newStudentManager() {
        $("#myModalLabel").text("アカウント登録");
            showLoading();
开发者ID:nguyenvanvu,项目名称:slu,代码行数:31,代码来源:studentManagement.php


示例14: pmxc_constructPageIndex

 /**
  * Handle a block pageindex
  */
 function pmxc_constructPageIndex($items, $pageitems, $addRestoreTop = true, $startpage = null)
 {
     // hide pageindex if only one page..
     if ($items > $pageitems) {
         if (!is_null($startpage)) {
             $this->startpage = $startpage;
         } else {
             $this->startpage = 0;
         }
         $cururl = preg_replace('~pgkey[a-zA-Z0-9_\\-\\;\\=\\/]+pg[0-9\\=\\/]+~', '', getCurrentUrl(true)) . 'pgkey=' . $this->cfg['uniID'] . ';pg=%1$d;';
         $this->postspage = $pageitems;
         $this->pageindex = constructPageIndex($cururl, $this->startpage, $items, $pageitems, true);
         $this->pageindex = preg_replace('/\\;start\\=([\\%\\$a-z0-9]+)/', '', $this->pageindex);
         if (!empty($addRestoreTop)) {
             $this->pageindex = str_replace('href="', 'onclick="pmxWinGetTop(\'' . $this->cfg['uniID'] . '\')" href="', $this->pageindex);
         }
     }
 }
开发者ID:thunderamur,项目名称:PortaMx-Virgo-2.0-Beta-2,代码行数:21,代码来源:PortaMx_BlocksClass.php


示例15: getCurrentUrl

					<label for="admin_email" class="col-sm-2 control-label">eMail Kontaktformulare / Main contact eMail-Address:</label>
					<div class="col-sm-10">
						<input class="form-control" type="email" name="contact_email" id="contact_email" value="" size="50" required="required" placeholder="eMail Kontaktformulare / Main contact eMail-Address">
						<small><span class="helpBlock" class="help-block">Die gewünschte eMail-Adresse für Kontaktformulare. / Main contact eMail-Address for forms.</span></small>
						<br><br><br>
					</div>
				</div>
				<div class="row">
					<div class="col-md-12" style="text-align:center;">
					  	<input class="btn btn-primary btn-lg" type="submit" value="ConstructrCMS installieren / Setup ConstructrCMS">
					</div>
				</div>
				</form>
				<br><br><br><br>
				<div class="row">
					<div class="col-md-12" style="text-align:center;">
				  		<p><small>ConstructrCMS | <a href="http://phaziz.com">phaziz.com</a></small></p>
					</div>
				</div>
			</div>
			<script src="<?php 
echo getCurrentUrl();
?>
/CONSTRUCTR-CMS/ASSETS/jquery/jquery-2.1.4.min.js"></script>
			<script src="<?php 
echo getCurrentUrl();
?>
/CONSTRUCTR-CMS/ASSETS/materialize/js/materialize.min.js"></script>
		</body>
	</html>
开发者ID:phaziz,项目名称:ConstructrCMS-3,代码行数:30,代码来源:index.php


示例16: getAuthSubUrl

/**
 * Returns the AuthSub URL which the user must visit to authenticate requests
 * from this application.
 *
 * Uses getCurrentUrl() to get the next URL which the user will be redirected
 * to after successfully authenticating with the Google service.
 *
 * @return string AuthSub URL
 */
function getAuthSubUrl()
{
    global $_authSubKeyFile;
    $next = getCurrentUrl();
    $scope = 'http://www.google.com/calendar/feeds/';
    $session = true;
    if ($_authSubKeyFile != null) {
        $secure = true;
    } else {
        $secure = false;
    }
    return Zend_Gdata_AuthSub::getAuthSubTokenUri($next, $scope, $secure, $session);
}
开发者ID:natureday1,项目名称:Life,代码行数:22,代码来源:Calendar.php


示例17: addEntry

 private function addEntry()
 {
     // Get parameters
     $acronym = isset($_POST['acronym']) ? $_POST['acronym'] : null;
     $name = isset($_POST['name']) ? $_POST['name'] : null;
     $password = isset($_POST['password']) ? $_POST['password'] : null;
     $confirm = isset($_POST['confim_password']) ? $_POST['confim_password'] : null;
     $image = isset($_POST['image']) ? $_POST['image'] : null;
     $type = isset($_POST['type']) ? $_POST['type'] : null;
     $image = CEditMovies::addFolder($image);
     if ($password !== $confirm) {
         header("Location: " . getCurrentUrl() . "&fail&error=Löseorden matchar inte.");
     }
     $sql = "SELECT acronym FROM rm_user;";
     $res = $this->db->ExecuteSelectQueryAndFetchAll($sql);
     $users = null;
     foreach ($res as $val) {
         $users[] = $val->acronym;
     }
     if (in_array($acronym, $users)) {
         header("Location: " . getCurrentUrl() . "&fail&error=Användarnamnet finns redan.");
     }
     $sql = "INSERT INTO rm_user (acronym, name, type, image, since, salt) VALUES\n    (?, ?, ?, ?, NOW(), unix_timestamp());";
     $params = array($acronym, $name, $type, $image);
     $res = $this->db->ExecuteQuery($sql, $params);
     if ($res) {
         $sql = "UPDATE rm_user SET password = md5(concat(?, salt)) WHERE acronym = ?;";
         $params = array($password, $acronym);
         $res = $this->db->ExecuteQuery($sql, $params);
         if ($res) {
             header("Location: edit_users.php");
         } else {
             header("Location: " . getCurrentUrl() . "&fail");
         }
     } else {
         header("Location: " . getCurrentUrl() . "&fail");
     }
 }
开发者ID:EmilSjunnesson,项目名称:rental,代码行数:38,代码来源:CUser.php


示例18: getCurrentUrl

 */
function getCurrentUrl()
{
    if (isset($_SERVER['HTTPS']) && ($_SERVER['HTTPS'] == 'on' || $_SERVER['HTTPS'] == 1) || isset($_SERVER['HTTP_X_FORWARDED_PROTO']) && $_SERVER['HTTP_X_FORWARDED_PROTO'] == 'https') {
        $protocol = 'https://';
    } else {
        $protocol = 'http://';
    }
    $url = $protocol . $_SERVER['HTTP_HOST'];
    // use port if non default
    $url .= isset($_SERVER['SERVER_PORT']) && ($protocol === 'http://' && $_SERVER['SERVER_PORT'] != 80 || $protocol === 'https://' && $_SERVER['SERVER_PORT'] != 443) ? ':' . $_SERVER['SERVER_PORT'] : '';
    $url .= $_SERVER['PHP_SELF'];
    // return current url
    return $url;
}
$GLOBAL_HYBRID_AUTH_URL_BASE = getCurrentUrl();
$GLOBAL_HYBRID_AUTH_URL_BASE = str_ireplace("install.php", "", $GLOBAL_HYBRID_AUTH_URL_BASE);
$GLOBAL_HYBRID_AUTH_PATH_BASE = realpath(dirname(__FILE__)) . "/";
$CONFIG_FILE_NAME = $GLOBAL_HYBRID_AUTH_PATH_BASE . "config.php";
// deault providers
$PROVIDERS_CONFIG = array(array("label" => "Facebook", "provider_name" => "Facebook", "require_client_id" => TRUE, "new_app_link" => "https://www.facebook.com/developers/", "userguide_section" => "http://hybridauth.sourceforge.net/userguide/IDProvider_info_Facebook.html"), array("label" => "Google", "provider_name" => "Google", "callback" => TRUE, "require_client_id" => TRUE, "new_app_link" => "https://code.google.com/apis/console/", "userguide_section" => "http://hybridauth.sourceforge.net/userguide/IDProvider_info_Google.html"), array("label" => "Twitter", "provider_name" => "Twitter", "new_app_link" => "https://dev.twitter.com/apps", "userguide_section" => "http://hybridauth.sourceforge.net/userguide/IDProvider_info_Twitter.html"), array("label" => "Live", "provider_name" => "Windows Live", "require_client_id" => TRUE, "new_app_link" => "https://manage.dev.live.com/ApplicationOverview.aspx", "userguide_section" => "http://hybridauth.sourceforge.net/userguide/IDProvider_info_Live.html"), array("label" => "MySpace", "provider_name" => "MySpace", "new_app_link" => "http://www.developer.myspace.com/", "userguide_section" => "http://hybridauth.sourceforge.net/userguide/IDProvider_info_MySpace.html"), array("label" => "Foursquare", "provider_name" => "Foursquare", "require_client_id" => TRUE, "callback" => TRUE, "new_app_link" => "https://www.foursquare.com/oauth/", "userguide_section" => "http://hybridauth.sourceforge.net/userguide/IDProvider_info_Foursquare.html"), array("label" => "LinkedIn", "provider_name" => "LinkedIn", "new_app_link" => "https://www.linkedin.com/secure/developer", "userguide_section" => "http://hybridauth.sourceforge.net/userguide/IDProvider_info_LinkedIn.html"), array("label" => "OpenID", "provider_name" => "OpenID", "new_app_link" => NULL, "userguide_section" => "http://hybridauth.sourceforge.net/userguide/IDProvider_info_OpenID.html"), array("label" => "Yahoo", "provider_name" => "Yahoo!", "new_app_link" => NULL, "userguide_section" => "http://hybridauth.sourceforge.net/userguide/IDProvider_info_Yahoo.html"), array("label" => "AOL", "provider_name" => "AOL", "new_app_link" => NULL, "userguide_section" => "http://hybridauth.sourceforge.net/userguide/IDProvider_info_AOL.html"));
if (count($_POST)) {
    $CONFIG_TEMPLATE = file_get_contents("Hybrid/resources/config.php.tpl");
    foreach ($_POST as $k => $v) {
        $v = strip_tags($v);
        $z = "#{$k}#";
        $CONFIG_TEMPLATE = str_replace($z, $v, $CONFIG_TEMPLATE);
    }
    $CONFIG_TEMPLATE = str_replace("<?php", "<?php\n\t#AUTOGENERATED BY HYBRIDAUTH {$HYBRIDAUTH_VERSION} INSTALLER - " . date("l jS \\of F Y h:i:s A") . "\n", $CONFIG_TEMPLATE);
    $is_installed = file_put_contents($GLOBAL_HYBRID_AUTH_PATH_BASE . "config.php", $CONFIG_TEMPLATE);
    if (!$is_installed) {
开发者ID:niQo,项目名称:hybridauth,代码行数:31,代码来源:install.php


示例19: foreach

            <nav class="mobile-menu">  
                <ul class="clearfix">
                    <?php 
//                                    $this->db->order_by('position asc,added desc');
$this->db->order_by('position asc,added desc');
$menus = $this->menu_model->find_all_by(array('status' => 1, 'department_ID' => $menu_D->ID, 'parent_ID' => 0));
if ($this->menu_model->count_by(array('status' => 1, 'department_ID' => $menu_D->ID, 'parent_ID' => 0)) > 0) {
    $i = 0;
    foreach ($menus as $menu) {
        ?>
                            <li class=" <?php 
        if ($this->menu_model->count_by(array('parent_ID' => $menu->id, 'status' => 1, 'department_ID' => $menu_D->ID)) > 0) {
            echo 'parent ';
        }
        if ($menu->id == $this->uri->segment(4) || getCurrentUrl() == $menu->url) {
            echo 'active';
        }
        $i++;
        ?>
" ><a  <?php 
        if (!is_numeric($menu->url)) {
            echo "target='blank_'";
        }
        ?>
 href="<?php 
        echo is_numeric($menu->url) ? base_url() . 'index.php/department/index/' . $this->uri->segment(3) . '/' . $menu->id : $menu->url;
        ?>
#jump-page"><?php 
        echo $menu->name;
        ?>
开发者ID:premsingh4github,项目名称:ipay,代码行数:30,代码来源:index.php


示例20: getCurrentUrl

    } else {
        $protocol = 'http://';
    }
    $host = $_SERVER['HTTP_HOST'];
    if ($_SERVER['HTTP_PORT'] != '' && ($protocol == 'http://' && $_SERVER['HTTP_PORT'] != '80' || $protocol == 'https://' && $_SERVER['HTTP_PORT'] != '443')) {
        $port = ':' . $_SERVER['HTTP_PORT'];
    } else {
        $port = '';
    }
    return $protocol . $host . $port . $php_request_uri;
}
// if there is no AuthSub session or one-time token waiting for us,
// redirect the user to the AuthSub server to get one.
if (!isset($_GET['token'])) {
    // Parameters to give to AuthSub server
    $next = getCurrentUrl();
    $scope = GoogleCalendarInterface::GCAL_INTEGRATION_SCOPE;
    $secure = false;
    $session = true;
    // Redirect the user to the AuthSub server to sign in
    $authSubUrl = Zend_Gdata_AuthSub::getAuthSubTokenUri($next, $scope, $secure, $session);
    header("HTTP/1.0 307 Temporary redirect");
    header("Location: " . $authSubUrl);
    exit;
} else {
    try {
        $client = new Zend_Gdata_HttpClient();
        $pathToKey = sfConfig::get('sf_root_dir') . '/' . sfConfig::get('app_googleCalendarIntegration_privateKeyPath');
        $client->setAuthSubPrivateKeyFile($pathToKey, null, true);
        $sessionToken = Zend_Gdata_AuthSub::getAuthSubSessionToken($_GET['token'], $client);
    } catch (Exception $e) {
开发者ID:ntemple,项目名称:intelli-plancake,代码行数:31,代码来源:google_calendar_init.php



注:本文中的getCurrentUrl函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP getCurrentUser函数代码示例发布时间:2022-05-15
下一篇:
PHP getCurrentURL函数代码示例发布时间:2022-05-15
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap