本文整理汇总了PHP中Main::isAdminLoggedIn方法的典型用法代码示例。如果您正苦于以下问题:PHP Main::isAdminLoggedIn方法的具体用法?PHP Main::isAdminLoggedIn怎么用?PHP Main::isAdminLoggedIn使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Main
的用法示例。
在下文中一共展示了Main::isAdminLoggedIn方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: handle
function handle()
{
if (key_exists('CATEGORY', $this->comp)) {
$cat = strtolower($this->comp["CATEGORY"]);
} else {
$cat = 'home';
}
if (!isset($_SESSION)) {
session_start();
}
if (!isset($_SESSION['admin'])) {
$cat = 'login';
} else {
if ($cat == 'login') {
$cat = 'home';
}
}
switch ($cat) {
case 'add':
Main::includeClass('AddHandler');
$ah = new AddHandler($this->comp);
break;
case 'remove':
Main::includeClass('RemoveHandler');
$rh = new RemoveHandler($this->comp);
break;
case 'update':
Main::includeClass('UpdateHandler');
$uh = new UpdateHandler($this->comp);
break;
case 'login':
Main::includeClass('LoginHandler');
$lh = new LoginHandler();
Main::includeClass('TemplateData');
$td = new TemplateData($lh);
case 'logout':
if (Main::isAdminLoggedIn()) {
if (!isset($_SESSION)) {
@session_start();
}
$_SESSION['admin'] = NULL;
unset($_SESSION['admin']);
echo header("Location: " . Settings::SITEURL . "admin/");
}
break;
case 'details':
Main::includeClass('DetailsHandler');
$dh = new DetailsHandler($this->comp);
break;
case 'home':
default:
Main::includeClass('AdminHomeData');
$adh = new AdminHomeData();
Main::includeClass('TemplateData');
$td = new TemplateData($adh);
break;
}
}
示例2: __construct
function __construct($comp)
{
$this->content = array();
$this->banner = '';
$this->admin = Main::isAdminLoggedIn();
$this->comp = $comp;
if (isset($_GET['p']) && $_GET['p'] > 0) {
$this->page = $_GET['p'];
} else {
$this->page = 1;
}
$this->parse();
}
示例3: menu
//.........这里部分代码省略.........
?>
publication">Publication</a></li>
<li><a href="<?php
echo Settings::SITEURL;
?>
link">Link</a></li>
<li><a href="<?php
echo Settings::SITEURL;
?>
biofert">Bio Fertilizer</a></li>
<li><a href="<?php
echo Settings::SITEURL;
?>
insurance">Insurance</a></li>
<li><a href="<?php
echo Settings::SITEURL;
?>
prevactivity">Previous Year Activity</a></li>
<li><a href="<?php
echo Settings::SITEURL;
?>
patent">Patent</a></li>
</ul>
</li>
<li><a href="<?php
echo Settings::SITEURL;
?>
remove">Remove</a>
<ul>
<li><a href="<?php
echo Settings::SITEURL;
?>
crop">Crops</a></li>
<li><a href="<?php
echo Settings::SITEURL;
?>
croptype">Crop Type</a></li>
<li><a href="<?php
echo Settings::SITEURL;
?>
contact">Contact Info</a></li>
<li><a href="<?php
echo Settings::SITEURL;
?>
news">News</a></li>
<li><a href="<?php
echo Settings::SITEURL;
?>
map">Map</a></li>
<li><a href="<?php
echo Settings::SITEURL;
?>
magazine">Magazine</a></li>
<li><a href="<?php
echo Settings::SITEURL;
?>
awards">Award</a></li>
<li><a href="<?php
echo Settings::SITEURL;
?>
location">Location</a></li>
<li><a href="<?php
echo Settings::SITEURL;
?>
publication">Publication</a></li>
<li><a href="<?php
echo Settings::SITEURL;
?>
link">Link</a></li>
<li><a href="<?php
echo Settings::SITEURL;
?>
biofert">Bio Fertilizer</a></li>
<li><a href="<?php
echo Settings::SITEURL;
?>
insurance">Insurance</a></li>
<li><a href="<?php
echo Settings::SITEURL;
?>
prevactivity">Previous Year Activity</a></li>
<li><a href="<?php
echo Settings::SITEURL;
?>
patent">Patent</a></li>
</ul>
</li>
<?php
if (Main::isAdminLoggedIn()) {
?>
<li><a href='<?php
echo Settings::SITEURL;
?>
admin/logout/'>Logout</a></li>
<?php
}
?>
</ul>
<?php
}
示例4: __construct
function __construct($details, $section)
{
$this->content = $details;
$this->admin = Main::isAdminLoggedIn();
$this->section = $section;
}