本文整理汇总了PHP中SessionUtil::isLoggedIn方法的典型用法代码示例。如果您正苦于以下问题:PHP SessionUtil::isLoggedIn方法的具体用法?PHP SessionUtil::isLoggedIn怎么用?PHP SessionUtil::isLoggedIn使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SessionUtil
的用法示例。
在下文中一共展示了SessionUtil::isLoggedIn方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: generateHTML
public function generateHTML()
{
if (!SessionUtil::isLoggedIn() && $this->layout->getBody() instanceof LoginBody) {
return $this->layout->generateHTML();
} else {
if (SessionUtil::isLoggedIn() && SessionUtil::getUserlevel() >= $this->getMinimumUserLevel()) {
return $this->layout->generateHTML();
} else {
return $this->userLevelErrorLayout->generateHTML();
}
}
}
示例2: generateHTML
public function generateHTML()
{
if (SessionUtil::isLoggedIn()) {
$userlevel = SessionUtil::getUserlevel();
$navi = "";
if ($userlevel == RES_USERLEVEL_NOLOGIN) {
$navi = $navi . "<tr><td class=\"navi\">\n\t\t\t\t\t\t\t<a href=\"./index.php?pageid=logout\" class=\"navi\">Logout</a>\n\t\t\t\t\t\t</td></tr>";
}
if ($userlevel > RES_USERLEVEL_NOLOGIN) {
$navi = $navi . "<tr><td class=\"navi\">\n\t\t\t\t\t\t\t<a href=\"./index.php?pageid=home\" class=\"navi\">Home</a> - \n\t\t\t\t\t\t\t<a href=\"./index.php?pageid=ourEquip\" class=\"navi\">Our Equipment</a> - \n\t\t\t\t\t\t\t<a href=\"./index.php?pageid=myAccount\" class=\"navi\">My Account</a> - \n\t\t\t\t\t\t\t<a href=\"./index.php?pageid=logout\" class=\"navi\">Logout</a>\n\t\t\t\t\t\t</td></tr>";
}
if ($userlevel == 3) {
$navi = $navi . "<tr>\n\t\t\t\t\t\t<td class=\"adminnaviouter\">\n\t\t\t\t\t\t\t<table cellpadding=0 cellspacing=0 border=0 class=\"adminnavi\">\n\t\t\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t\t\t<td class=\"adminnaviinner\">\n\t\t\t\t\t\t\t\t\t\t  <a href=\"./index.php?pageid=browseres\" class=\"navi\">Browse Reservations</a>  \n\t\t\t\t\t\t\t\t\t</td>\n\t\t\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t\t</table>\n\t\t\t\t\t\t</td>";
}
if ($userlevel >= RES_USERLEVEL_ADMIN) {
$navi = $navi . "<tr>\n\t\t\t\t\t\n\t\t\t\t\t\t<td class=\"adminnaviouter\">\n\t\t\t\t\t\t\t<table cellpadding=0 cellspacing=0 border=0 class=\"adminnavi\">\n\t\t\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t\t\t<td class=\"adminnaviinner\">\n\t\t\t\t\t\t\t\t\t\t <a href=\"./index.php?pageid=userAdmin\" class=\"navi\">Users</a> - \n\t\t\t\t\t\t\t\t\t\t<a href=\"./index.php?pageid=manageequip\" class=\"navi\">Equipment</a> - \n\t\t\t\t\t\t\t\t\t\t<a href=\"./index.php?pageid=browseres\" class=\"navi\">Browse Reservations</a> - \n\t\t\t\t\t\t\t\t\t\t<a href=\"./index.php?pageid=makeres\" class=\"navi\">Make Reservation</a> - \n\t\t\t\t\t\t\t\t\t\t<a href=\"./index.php?pageid=manageblackouts\" class=\"navi\">Blackouts</a> - \n\t\t\t\t\t\t\t\t\t\t<a href=\"./index.php?pageid=messages\" class=\"navi\">Messages</a> \n\t\t\t\t\t\t\t\t\t</td>\n\t\t\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t\t</table>\n\t\t\t\t\t\t</td>\n\t\t\t\t\t\t\n\t\t\t\t\t</tr>";
}
return $navi;
}
}
示例3: generateHTML
public function generateHTML()
{
if (SessionUtil::isLoggedIn()) {
$homeSelected = false;
$createInsertSelected = false;
$myInsertsSelected = false;
$myAccountSelected = false;
if ($this->context->getPageID() == "home") {
$homeSelected = true;
} else {
if ($this->context->getPageID() == "createInsertion") {
$createInsertSelected = true;
} else {
if ($this->context->getPageID() == "myInserts") {
$myInsertsSelected = true;
} else {
if ($this->context->getPageID() == "myAccount") {
$myAccountSelected = true;
}
}
}
}
$homeButton = new NaviButton("Home", "./index.php?pageid=home", $homeSelected);
$createInsertButton = new NaviButton("Create Insertion", "./index.php?pageid=createInsertion", $createInsertSelected);
$myInsertsButton = new NaviButton("My Insertions", "./index.php?pageid=myInserts", $myInsertsSelected);
$myAccountButton = new NaviButton("My Account", "./index.php?pageid=myAccount", $myAccountSelected);
$logoutButton = new NaviButton("Logout", "./index.php?pageid=logout", false);
return $homeButton->generateHTML() . " " . $createInsertButton->generateHTML() . " " . $myInsertsButton->generateHTML() . " " . $myAccountButton->generateHTML() . " " . $logoutButton->generateHTML();
} else {
if ($this->context->getPageID() == "login") {
return "<div class=\"centered\">\n\t\t\t\t\t<form action=\"index.php?pageid=login\" method=\"POST\">\n\t\t\t\t\t\t<input type=\"hidden\" name=\"action\" value=\"login\" />\n\t\t\t\t\t\t<input name=\"username\" type=\"text\" placeholder=\"Username\" class=\"text bluefocus\" />\n\t\t\t\t\t\t<input name=\"password\" type=\"password\" placeholder=\"Password\" class=\"text bluefocus\" />\n\t\t\t\t\t\t<input type=\"submit\" value=\"Login\" class=\"stdbutton bluefocus\" />\n\t\t\t\t\t\t<input type=\"button\" value=\"Register\" onclick=\"location.href='./index.php?pageid=register'\" class=\"altbutton bluefocus\" />\n\t\t\t\t\t</form>\n\t\t\t\t</div>";
} else {
return "";
}
}
}
示例4: generateHTML
public function generateHTML()
{
if (SessionUtil::isLoggedIn()) {
$homeSelected = false;
$createAdSelected = false;
$viewAdsSelected = false;
$accountsSelected = false;
if ($this->context->getPageID() == "home") {
$homeSelected = true;
} else {
if ($this->context->getPageID() == "createAd") {
$createAdSelected = true;
} else {
if ($this->context->getPageID() == "viewAds") {
$viewAdsSelected = true;
} else {
if ($this->context->getPageID() == "accounts") {
$accountsSelected = true;
}
}
}
}
$homeButton = new NaviButton("Home", "./index.php?pageid=home", $homeSelected);
$createAdButton = new NaviButton("Create Ad", "./index.php?pageid=createAd", $createAdSelected);
$viewAdsButton = new NaviButton("View Ads", "./index.php?pageid=viewAds", $viewAdsSelected);
$accountsButton = new NaviButton("Accounts", "./index.php?pageid=accounts", $accountsSelected);
$logoutButton = new NaviButton("Logout", "./index.php?pageid=logout", false);
return $homeButton->generateHTML() . " " . $createAdButton->generateHTML() . " " . $viewAdsButton->generateHTML() . " " . $accountsButton->generateHTML() . " " . $logoutButton->generateHTML();
} else {
if ($this->context->getPageID() == "login") {
return "<div class=\"centered\">\r\n\t\t\t\t\t<form action=\"index.php?pageid=login\" method=\"POST\">\r\n\t\t\t\t\t\t<input type=\"hidden\" name=\"action\" value=\"login\" />\r\n\t\t\t\t\t\t<input name=\"username\" type=\"text\" placeholder=\"Username\" class=\"text bluefocus\" />\r\n\t\t\t\t\t\t<input name=\"password\" type=\"password\" placeholder=\"Password\" class=\"text bluefocus\" />\r\n\t\t\t\t\t\t<input type=\"submit\" value=\"Login\" class=\"stdbutton bluefocus\" />\r\n\t\t\t\t\t</form>\r\n\t\t\t\t</div>";
} else {
return "";
}
}
}
示例5: CreateInsertionHandler
} else {
if ($context->getPageID() == "createInsertion") {
require_once './lib/Form/CreateInsertionHandler.php';
$createInsertionHandler = new CreateInsertionHandler();
$createInsertionHandler->handleForm($context, $action);
} else {
if ($context->getPageID() == "myAccount") {
require_once './lib/Form/MyAccountHandler.php';
$myAccountHandler = new MyAccountHandler();
$myAccountHandler->handleForm($context, $action);
}
}
}
}
}
if (!SessionUtil::isLoggedIn() && $context->getPageID() != "register") {
$context->setPageID("login");
}
$pageBody;
if ($context->getPageID() == "home") {
require_once './lib/Site/HomeBody.php';
$pageBody = new HomeBody();
} else {
if ($context->getPageID() == "login") {
require_once './lib/Site/LoginBody.php';
$pageBody = new LoginBody($context);
} else {
if ($context->getPageID() == "register") {
require_once './lib/Site/RegisterBody.php';
$pageBody = new RegisterBody($context);
} else {
示例6: WarnUserHandler
$adminWarningHandler->handleForm($context, $action);
} else {
if ($context->getPageID() == "warnUser") {
require_once './lib/Form/Admin/WarnUserHandler.php';
$warnUserHandler = new WarnUserHandler();
$warnUserHandler->handleForm($context, $action);
}
}
}
}
}
}
}
}
}
if (!SessionUtil::isLoggedIn()) {
$context->setPageID("login");
}
$pageBody;
if ($context->getPageID() == "home") {
require_once './lib/Site/HomeBody.php';
$pageBody = new HomeBody();
} else {
if ($context->getPageID() == "login") {
require_once './lib/Site/LoginBody.php';
$pageBody = new LoginBody($context);
} else {
if ($context->getPageID() == "logout") {
SessionUtil::restart();
$context->setPageID("login");
require_once './lib/Site/LoginBody.php';