本文整理汇总了PHP中Sentinel::isAnonymousEnabled方法的典型用法代码示例。如果您正苦于以下问题:PHP Sentinel::isAnonymousEnabled方法的具体用法?PHP Sentinel::isAnonymousEnabled怎么用?PHP Sentinel::isAnonymousEnabled使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Sentinel
的用法示例。
在下文中一共展示了Sentinel::isAnonymousEnabled方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: foreach
| Anonymous list files
|--------------------------------------------------------------------------
|
*/
/*
|--------------------------------------------------------------------------
| Anonymous list files
|--------------------------------------------------------------------------
|
*/
case 'anonymous_list':
if (!Sentinel::isAdmin()) {
$return['error'] = 'vaffanculo';
break;
}
if (Sentinel::isAnonymousEnabled($files)) {
$r = '<div class="alert alert-info">' . __('<strong>Anonymous access is enabled</strong>. Genuine users have to click on the user menu to sign in and access more logs.') . '</div>';
} else {
$r = '<div class="alert alert-info">' . __('<strong>Anonymous access is disabled</strong>. All users have to sign in from the sign in screen.') . '</div>';
}
$r .= '<div class="form-group">';
$r .= ' <label class="col-sm-4 control-label"></label>';
$r .= ' <div class="col-sm-8">';
$r .= __("Select which log files can be viewed without being logged.");
$r .= ' (<a href="#" class="logs-selector-toggler">' . __('Toggle all log files') . '</a>)';
$r .= ' </div>';
$r .= '</div>';
foreach ($files as $file_id => $file) {
$fid = h($file_id);
$display = $files[$file_id]['display'];
$paths = $files[$file_id]['path'];
示例2: h
$d = $file['display'];
$i = h($file_id);
break;
}
?>
<ul class="nav navbar-nav"><li id="singlelog" data-file="<?php
echo $i;
?>
"><a href="#"><?php
echo $d;
?>
</a></li></ul><?php
}
?>
<form class="navbar-form navbar-right"><?php
if (is_null($current_user) && Sentinel::isAnonymousEnabled($files)) {
?>
<div class="form-group"><a href="?signin" class="btn-menu btn-primary btn-sm" title="<?php
_h('Sign in');
?>
"><?php
_e('Sign in');
?>
</a></div> <?php
}
?>
<div class="form-group" id="searchctn"><input type="text" class="form-control input-sm clearable" id="search" value="<?php
echo h(@$_GET['s']);
?>
" placeholder="<?php
_h('Search in logs');