本文整理汇总了PHP中AIOWPSecurity_Utility_File::is_file_permission_secure方法的典型用法代码示例。如果您正苦于以下问题:PHP AIOWPSecurity_Utility_File::is_file_permission_secure方法的具体用法?PHP AIOWPSecurity_Utility_File::is_file_permission_secure怎么用?PHP AIOWPSecurity_Utility_File::is_file_permission_secure使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类AIOWPSecurity_Utility_File
的用法示例。
在下文中一共展示了AIOWPSecurity_Utility_File::is_file_permission_secure方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: show_wp_filesystem_permission_status
function show_wp_filesystem_permission_status($name, $path, $recommended)
{
$fix = false;
$configmod = AIOWPSecurity_Utility_File::get_file_permission($path);
if ($configmod == "0777") {
$trclass = "aio_table_row_red";
//Display a red background if permissions are set as least secure ("777")
$fix = true;
} else {
if ($configmod != $recommended) {
//$res = $this->is_file_permission_secure($recommended, $configmod);
$res = AIOWPSecurity_Utility_File::is_file_permission_secure($recommended, $configmod);
if ($res) {
$trclass = "aio_table_row_green";
//If the current permissions are even tighter than recommended then display a green row
$fix = true;
} else {
$trclass = "aio_table_row_yellow";
//Display a yellow background if permissions are set to something different than recommended
$fix = true;
}
} else {
$trclass = "aio_table_row_green";
}
}
echo "<tr class=" . $trclass . ">";
echo '<td>' . $name . "</td>";
echo '<td>' . $path . "</td>";
echo '<td>' . $configmod . '</td>';
echo '<td>' . $recommended . '</td>';
if ($fix) {
echo '<td>
<input type="submit" name="aiowps_fix_permissions" value="' . __('Set Recommended Permissions', 'aiowpsecurity') . '" class="button-secondary" />
<input type="hidden" name="aiowps_permission_chg_file" value="' . $path . '"/>
<input type="hidden" name="aiowps_recommended_permissions" value="' . $recommended . '"/>
</td>';
} else {
echo '<td>' . __('No Action Required', 'aiowpsecurity') . '</td>';
}
echo "</tr>";
}
示例2: check_filesystem_permissions_feature
function check_filesystem_permissions_feature($item)
{
//TODO
$is_secure = 1;
$util = new AIOWPSecurity_Utility_File();
$files_dirs_to_check = $util->files_and_dirs_to_check;
foreach ($files_dirs_to_check as $file_or_dir) {
$actual_perm = AIOWPSecurity_Utility_File::get_file_permission($file_or_dir['path']);
$is_secure = $is_secure * AIOWPSecurity_Utility_File::is_file_permission_secure($file_or_dir['permissions'], $actual_perm);
}
//Only if all of the files' permissions are deemed secure give this a thumbs up
if ($is_secure == 1) {
$item->set_feature_status($this->feature_active);
} else {
$item->set_feature_status($this->feature_inactive);
}
}