本文整理汇总了PHP中ITSEC_Lib::get_ssl方法的典型用法代码示例。如果您正苦于以下问题:PHP ITSEC_Lib::get_ssl方法的具体用法?PHP ITSEC_Lib::get_ssl怎么用?PHP ITSEC_Lib::get_ssl使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ITSEC_Lib
的用法示例。
在下文中一共展示了ITSEC_Lib::get_ssl方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: plugin_init
/**
* Calls lib function to determine whether ssl is available.
*
* @since 4.0
*
* @return void
*/
public function plugin_init()
{
if (isset(get_current_screen()->id) && strpos(get_current_screen()->id, 'security_page_toplevel_page_itsec_settings') !== false) {
$this->has_ssl = ITSEC_Lib::get_ssl();
}
}
示例2: render_settings
protected function render_settings($form)
{
$has_ssl = ITSEC_Lib::get_ssl();
$frontend_modes = array(0 => __('Off', 'better-wp-security'), 1 => __('Per Content', 'better-wp-security'), 2 => __('Whole Site', 'better-wp-security'));
?>
<p><?php
_e('Note: While this plugin does give you the option of encrypting everything, SSL may not be for you. SSL does add overhead to your site which will increase download times slightly. Therefore we recommend you enable SSL at a minimum on the login page, then on the whole admin section and finally on individual pages or posts with forms that require sensitive information.', 'better-wp-security');
?>
</p>
<?php
if ($has_ssl) {
?>
<div class="itsec-warning-message"><?php
_e('<strong>WARNING:</strong> Your server does appear to support SSL. Using these features without SSL support on your server or host will cause some or all of your site to become unavailable.', 'better-wp-security');
?>
</div>
<?php
} else {
?>
<div class="itsec-warning-message"><?php
_e('<strong>WARNING:</strong> Your server does not appear to support SSL. Your server MUST support SSL to use these features. Using these features without SSL support on your server or host will cause some or all of your site to become unavailable.', 'better-wp-security');
?>
</div>
<?php
}
?>
<p><?php
_e('Note: When turning SSL on you will be logged out and you will have to log back in. This is to prevent possible cookie conflicts that could make it more difficult to get in otherwise.', 'better-wp-security');
?>
</p>
<table class="form-table itsec-settings-section">
<tr>
<th scope="row"><label for="itsec-ssl-frontend"><?php
_e('Front End SSL Mode', 'better-wp-security');
?>
</label></th>
<td>
<?php
$form->add_select('frontend', $frontend_modes);
?>
<br />
<label for="itsec-ssl-frontend"><?php
_e('Front End SSL Mode', 'better-wp-security');
?>
</label>
<p class="description"><?php
_e('Enables secure SSL connection for the front-end (public parts of your site). Turning this off will disable front-end SSL control, turning this on "Per Content" will place a checkbox on the edit page for all posts and pages (near the publish settings) allowing you to turn on SSL for selected pages or posts. Selecting "Whole Site" will force the whole site to use SSL.', 'better-wp-security');
?>
</p>
</td>
</tr>
<tr>
<th scope="row"><label for="itsec-ssl-admin"><?php
_e('SSL for Dashboard', 'better-wp-security');
?>
</label></th>
<td>
<?php
$form->add_checkbox('admin');
?>
<label for="itsec-ssl-admin"><?php
_e('Force SSL for Dashboard', 'better-wp-security');
?>
</label>
<p class="description"><?php
_e('Forces all dashboard access to be served only over an SSL connection.', 'better-wp-security');
?>
</p>
</td>
</tr>
</table>
<?php
}