本文整理汇总了PHP中Sentinel::isLogAnonymous方法的典型用法代码示例。如果您正苦于以下问题:PHP Sentinel::isLogAnonymous方法的具体用法?PHP Sentinel::isLogAnonymous怎么用?PHP Sentinel::isLogAnonymous使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Sentinel
的用法示例。
在下文中一共展示了Sentinel::isLogAnonymous方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: __
continue;
}
$display = $files[$file_id]['odisplay'];
if (isset($files[$file_id]['count'])) {
$remain = (int) $files[$file_id]['count'] - 1;
if ($remain === 1) {
$paths .= ' ' . __('and an other file defined by glob pattern');
} else {
if ($remain > 1) {
$paths .= ' ' . sprintf(__('and %s other possible files defined by glob pattern'), $remain);
}
}
}
$color = 'warning';
}
if (Sentinel::isLogAnonymous($file_id)) {
$e = 'active btn-success';
$d = 'btn-default';
$ec = ' checked="checked"';
$dc = '';
} else {
$e = 'btn-default';
$d = 'active btn-danger';
$ec = '';
$dc = ' checked="checked"';
}
$r .= '<div class="form-group" data-fileid="' . $fid . '">';
$r .= ' <label for="' . $fid . '" class="col-sm-4 control-label text-' . $color . '">' . $display . '</label>';
$r .= ' <div class="col-sm-8">';
$r .= ' <div class="btn-group" data-toggle="buttons">';
$r .= ' <label class="btn btn-xs logs-selector-yes ' . $e . '">';
示例2: config_load
//.........这里部分代码省略.........
$new_paths[$path] = filemtime($path);
}
// The most recent file will be the first
arsort($new_paths, SORT_NUMERIC);
// The first file id is the ID of the configuration file then others files are suffixed with _2, _3, etc...
foreach ($new_paths as $path => $lastmodified) {
$ext = $i > 1 ? '_' . $i : '';
$files[$fileid . $ext] = $file;
$files[$fileid . $ext]['oid'] = $fileid;
$files[$fileid . $ext]['odisplay'] = $files[$fileid . $ext]['display'];
$files[$fileid . $ext]['path'] = $path;
$files[$fileid . $ext]['display'] .= ' > ' . basename($path);
if ($i >= $count) {
break;
}
$i++;
}
}
}
}
// Remove forbidden files
if (Sentinel::isAuthSet()) {
// authentication is enabled on this instance
$username = Sentinel::getCurrentUsername();
$final = array();
// Anonymous access only
if (is_null($username)) {
foreach ($files as $fileid => $file) {
$a = $fileid;
// glob file
if (isset($files[$fileid]['oid'])) {
$a = $files[$fileid]['oid'];
}
if (Sentinel::isLogAnonymous($a)) {
$final[$fileid] = $file;
}
}
} else {
foreach ($files as $fileid => $file) {
$a = $fileid;
// glob file
if (isset($files[$fileid]['oid'])) {
$a = $files[$fileid]['oid'];
}
if (Sentinel::userCanOnLogs($a, 'r', true, $username) || Sentinel::isLogAnonymous($a)) {
$final[$fileid] = $file;
}
}
}
$files = $final;
}
// Fix missing values with defaults
foreach ($files as $fileid => $file) {
foreach (array('max' => LOGS_MAX, 'refresh' => LOGS_REFRESH, 'notify' => NOTIFICATION) as $fix => $value) {
if (!isset($file[$fix])) {
$files[$fileid][$fix] = $value;
}
}
}
// Finally sort files
if (!function_exists('display_asc')) {
function display_asc($a, $b)
{
return strcmp($a["display"], $b["display"]);
}
}