本文整理汇总了PHP中AdminHandler::result方法的典型用法代码示例。如果您正苦于以下问题:PHP AdminHandler::result方法的具体用法?PHP AdminHandler::result怎么用?PHP AdminHandler::result使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类AdminHandler
的用法示例。
在下文中一共展示了AdminHandler::result方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: AdminHandler
$h = new AdminHandler();
if ($h->login($fUsername, $fPassword)) {
session_regenerate_id();
$_SESSION['sessid'] = array();
$_SESSION['sessid']['roles'] = array();
$_SESSION['sessid']['roles'][] = 'admin';
$_SESSION['sessid']['username'] = $fUsername;
$_SESSION['PFA_token'] = md5(uniqid(rand(), true));
# they've logged in, so see if they are a domain admin, as well.
if (!$h->init($fUsername)) {
flash_error($PALANG['pLogin_failed']);
}
if (!$h->view()) {
flash_error($PALANG['pLogin_failed']);
}
$adminproperties = $h->result();
if ($adminproperties['superadmin'] == 1) {
$_SESSION['sessid']['roles'][] = 'global-admin';
}
header("Location: main.php");
exit(0);
} else {
# $h->login failed
error_log("PostfixAdmin login failed (username: {$fUsername})");
flash_error($PALANG['pLogin_failed']);
}
}
$smarty->assign('language_selector', language_selector(), false);
$smarty->assign('smarty_template', 'login');
$smarty->assign('logintype', 'admin');
$smarty->display('index.tpl');
示例2: list_admins
function list_admins()
{
$handler = new AdminHandler();
$handler->getList('');
return $handler->result();
}