lock.php

来自「一款开源的sns系统源码 安装简单」· PHP 代码 · 共 101 行

PHP
101
字号
<?php// -----------------------------------------------------------------------// This file is part of AROUNDMe// // Copyright (C) 2003-2007 Barnraiser// http://www.barnraiser.org/// info@barnraiser.org// // This program is free software: you can redistribute it and/or modify// it under the terms of the GNU General Public License as published by// the Free Software Foundation, either version 3 of the License, or// (at your option) any later version.// // This program is distributed in the hope that it will be useful,// but WITHOUT ANY WARRANTY; without even the implied warranty of// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the// GNU General Public License for more details.// // You should have received a copy of the GNU General Public License// along with this program; see the file COPYING.txt.  If not, see// <http://www.gnu.org/licenses/>// -----------------------------------------------------------------------include_once($language_path . 'lock.lang.php');//create trusted root$trusted_root = "http://" . $_SERVER['HTTP_HOST'] . dirname ($_SERVER['PHP_SELF']);if (substr($trusted_root, -1, 1) != "/") {	$trusted_root .= "/";}//create return_to path$return_to = "http://" . $_SERVER['HTTP_HOST'] . dirname ($_SERVER['PHP_SELF']);if (substr($return_to, -1, 1) != "/") {	$return_to .= "/";}$return_to .= 'index.php?t=lock&ws=' . $output_webspace['webspace_id'];if (isset($_POST['commit'])) {		if (!empty($_POST['openid_login'])) {				include_once ('components/core/class/Openid.class.php');				$openid = new SimpleOpenID ($db, $core_config);		$openid->SetIdentity($_POST['openid_login']);		$openid->SetTrustRoot($trusted_root);		$openid->SetApprovedURL($return_to);		$openid->SetRequiredFields(array('nickname'));		$openid->SetOptionalFields(array('fullname', 'email', 'country', 'language'));		if ($openid->GetOpenIDServer()) {			$openid->SetApprovedURL($trusted_root);			$openid->SetApprovedURL($return_to);			$openid->Redirect();			exit;		}		else {			$error = $openid->GetError();			$GLOBALS['am_error_log'][] = array('login_failed');		}	}}elseif (isset($_GET['openid_mode'])) {			if ($_GET['openid_mode'] == 'id_res') {				include_once ('components/core/class/Openid.class.php');				$openid = new SimpleOpenID ($db, $core_config);		$openid->SetIdentity($_GET['openid_identity']);		if ($openid->ValidateWithServer()) {						if (empty($_GET['openid_sreg_nickname'])) {				$GLOBALS['am_error_log'][] = array('nickname_empty');			}			else {				$openid->setConnection($output_webspace);			}					}		elseif ($openid->IsError()) {			// something went wrong			$GLOBALS['am_error_log'][] = array('login_failed');		}		else {			// now allowed			$GLOBALS['am_error_log'][] = array('login_failed');		}	}}else {unset($_SESSION);}?>

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?