本文整理汇总了PHP中checkLoggedIn函数的典型用法代码示例。如果您正苦于以下问题:PHP checkLoggedIn函数的具体用法?PHP checkLoggedIn怎么用?PHP checkLoggedIn使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了checkLoggedIn函数的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: mysqli_query
{
$q = "SELECT * FROM `current_buildings` WHERE `user` = '{$_SESSION['user_id']}' AND `building` = 3";
$result = mysqli_query(getConnection(), $q);
$farmlevel = mysqli_fetch_array($result)["level"];
$maxvillagers = $farmlevel * $farmlevel + 50;
return $maxvillagers;
}
function calcBuildCosts($building)
{
//select the current building
$loopquery = "SELECT * FROM `current_buildings` WHERE `building` = {$building['ID']}";
$loopresult = mysqli_query(getConnection(), $loopquery);
$currentBuilding = null;
if ($loopresult) {
$currentBuilding = mysqli_fetch_array($loopresult);
}
if ($currentBuilding && isset($currentBuilding['level'])) {
$newCostsWood = $building['costs_wood'] * ($currentBuilding['level'] + 1);
$newCostsIron = $building['costs_iron'] * ($currentBuilding['level'] + 1);
$newCostsClay = $building['costs_clay'] * ($currentBuilding['level'] + 1);
$newCostsVillagers = $building['costs_villagers'] * ($currentBuilding['level'] + 1);
} else {
$newCostsWood = $building['costs_wood'];
$newCostsIron = $building['costs_iron'];
$newCostsClay = $building['costs_clay'];
$newCostsVillagers = $building['costs_villagers'];
}
return array("wood" => $newCostsWood, "iron" => $newCostsIron, "clay" => $newCostsClay, "villagers" => $newCostsVillagers);
}
$user = checkLoggedIn();
示例2: checkLoggedIn
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 2 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; if not, write to the *
* Free Software Foundation, Inc., *
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
***************************************************************************/
include_once "includes/sp-load.php";
checkLoggedIn();
include_once SP_CTRLPATH . "/website.ctrl.php";
include_once SP_CTRLPATH . "/keyword.ctrl.php";
$controller = new WebsiteController();
$controller->view->menu = 'seotools';
$controller->layout = 'ajax';
$controller->set('sectionHead', 'Websites');
if ($_SERVER['REQUEST_METHOD'] == 'POST') {
switch ($_POST['sec']) {
case "create":
$controller->createWebsite($_POST);
break;
case "update":
$controller->updateWebsite($_POST);
break;
}
示例3: __construct
public function __construct()
{
parent::__construct();
checkLoggedIn();
}
示例4: checkLoggedIn
<?php
require_once 'functions.php';
checkLoggedIn(Page::INDEX);
?>
<html>
<body>
<form name="logout" method="post" action="login.php">
<input type="hidden" name="action" value="logout" />
<input type="submit" value="Logout" />
</form>
</body>
</html>
示例5: die
$obj = $entityManager->getRepository('WhitelistEntry')->findOneBy(array('domain' => $domain, 'business' => $business));
} else {
// domain + res
$obj = $entityManager->getRepository('WhitelistEntryRes')->findOneBy(array('domain' => $domain, 'res' => $res, 'business' => $business));
}
// If No Record (with suitable business) Retrieved & Not a Browser Team Account --> FAIL
if ($business != "Browser Team" && $obj == NULL) {
die(json_encode(array('error' => 'not authorized to delete entries of another business')));
}
// Commit Remove
$result = SitesXMLManager::commitRemove($entityManager, $url);
echo json_encode($result);
});
/** For API Compatibility **/
$app->post('/deleteWhitelist', function () use($app, $entityManager) {
checkLoggedIn($app, $entityManager);
$url = $app->request->params('url');
$business = $_SESSION['user_business'];
if ($url == NULL) {
die(json_encode(array('error' => 'insufficient parameters')));
}
if ($business == NULL) {
die(json_encode(array('error' => 'invalid session')));
}
// match with current business
// Permission Check!
// Parse for domain & res
$parts = explode('/', $url, 2);
$domain = trim($parts[0]);
$res = isset($parts[1]) && strlen(trim($parts[1])) > 0 ? trim('/' . $parts[1]) : NULL;
$obj = NULL;
示例6: checkLoggedIn
<?php
require_once 'functions.php';
// Check to see if we're already logged in or if we have a special status div to report
$loginDiv = checkLoggedIn(Page::LOGIN);
?>
<html>
<body>
<h2>Sign in</h2>
<form name="login" method="post" action="login.php">
<input type="hidden" name="action" value="login" />
<label for="login-username">Username:</label><br />
<input id="login-username" name="login-username" type="text" /><br />
<label for="password">Password:</label><br />
<input name="password" type="password" /><br />
<input id="remember" name="remember" type="checkbox" />
<label for="remember">Remember me</label><br />
<?php
echo $loginDiv;
?>
<input type="submit" value="Login" />
</form>
</body>
</html>
示例7: session_start
<?php
session_start();
include_once "classes.php";
include_once "../billing/config.php";
checkLoggedIn("yes");
?>
<!DOCTYPE html>
<html>
<head>
<title><?php
echo $SiteTitle;
?>
[Личный Кабинет]</title>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=no">
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="apple-mobile-web-app-status-bar-style" content="black-translucent">
<link rel="stylesheet" href="../css/style.css">
<link rel="apple-touch-icon" href="../img/ios.png">
<script type="text/javascript" src="../js/jquery-1.11.0.min.js"></script>
<script type="text/javascript" src="../js/dvigaem.js"></script>
</head>
<body>
<div id="bg"></div>
<div id="bgg"></div>