minor logger and settings page documentation improvements

isekai
Jonathan Daggerhart 8 years ago
parent 6e9790c221
commit aafb5f7a2c

@ -60,7 +60,7 @@ class OpenID_Connect_Generic_Settings_Page {
'scope' => array(
'title' => __( 'OpenID Scope' ),
'description' => __( 'Space separated list of scopes this client should access.' ),
'example' => 'email profile openid',
'example' => 'email profile openid offline_access',
'type' => 'text',
'section' => 'client_settings',
),
@ -101,14 +101,14 @@ class OpenID_Connect_Generic_Settings_Page {
),
'no_sslverify' => array(
'title' => __( 'Disable SSL Verify' ),
'description' => __( 'Do not require SSL verification during authorization. The OAuth extension uses curl to make the request. By default CURL will generally verify the SSL certificate to see if its valid an issued by an accepted CA. This setting disabled that verification.' ),
'description' => __( 'Do not require SSL verification during authorization. The OAuth extension uses curl to make the request. By default CURL will generally verify the SSL certificate to see if its valid an issued by an accepted CA. This setting disabled that verification.<br><strong>Not recommended for production sites.</strong>' ),
'type' => 'checkbox',
'section' => 'client_settings',
),
'http_request_timeout' => array(
'title' => __( 'HTTP Request Timeout' ),
'description' => __( 'Set the timeout for requests made to the IDP. Default value is 5.' ),
'example' => 5,
'example' => 30,
'type' => 'text',
'section' => 'client_settings',
),
@ -303,10 +303,17 @@ class OpenID_Connect_Generic_Settings_Page {
<strong><?php _e( 'Redirect URI' ); ?></strong>
<code><?php print admin_url( 'admin-ajax.php?action=openid-connect-authorize' ); ?></code>
</p>
<p class="description">
<strong><?php _e( 'Login Button Shortcode' ); ?></strong>
<code>[openid_connect_generic_login_button]</code>
</p>
<?php if ( $this->settings->enable_logging ) { ?>
<h2><?php _e( 'Logs' ); ?> </h2>
<div><?php print $this->logger->get_logs_table(); ?></div>
<h2><?php _e( 'Logs' ); ?></h2>
<div id="logger-table-wrapper">
<?php print $this->logger->get_logs_table(); ?>
</div>
<?php } ?>
</div>
<?php
@ -394,4 +401,3 @@ class OpenID_Connect_Generic_Settings_Page {
_e( 'Log information about login attempts through OpenID Connect Generic' );
}
}

@ -108,6 +108,15 @@ class WP_Option_Logger {
return $this->logs;
}
/**
* Get the name of the option where this log is stored
*
* @return string
*/
public function get_option_name(){
return $this->option_name;
}
/**
* Create a message array containing the data and other information
@ -169,6 +178,13 @@ class WP_Option_Logger {
return update_option( $this->option_name, $logs, FALSE );
}
/**
* Clear all log messages
*/
public function clear_logs(){
$this->save_logs( array() );
}
/**
* Get a simple html table of all the logs
*
@ -179,6 +195,7 @@ class WP_Option_Logger {
if ( empty( $logs ) ) {
$logs = $this->get_logs();
}
$logs = array_reverse( $logs );
ini_set( 'xdebug.var_display_max_depth', -1 );
@ -216,7 +233,7 @@ class WP_Option_Logger {
</div>
</td>
<td class="col-data"><?php var_dump( $log['data'] ); ?></td>
<td class="col-data"><pre><?php var_dump( $log['data'] ); ?></pre></td>
</tr>
<?php } ?>
</tbody>
@ -228,4 +245,4 @@ class WP_Option_Logger {
}
}
endif;
endif;

Loading…
Cancel
Save