You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* _gigya_error_log function has been removed.
* New GigyaLogger class added.
* There is no 'error_log' used except while checking the new gigya_log.txt file.
* Drop list of log level added in global settings with dynamic description.
if ( $_POST['gigya_global_settings']['auth_mode'] === 'user_rsa' ) {
@@ -215,10 +219,18 @@ public static function onSave() {
215
219
}
216
220
} else {
217
221
add_settings_error( 'gigya_global_settings', 'api_validate', __( 'Error sending request to SAP CDC' ), 'error' );
222
+
return;
218
223
}
219
224
} else {
220
225
add_settings_error( 'gigya_global_settings', 'api_validate', __( 'Error retrieving existing secret key or private key from the database. This is normal if you have a multisite setup. Please re-enter the key.' ), 'error' );
226
+
return;
221
227
}
228
+
if ( ! $is_gigya_log_fie_valid ) {
229
+
add_settings_error( 'gigya_global_settings', 'gigya_validate', __( 'Settings saved.' ) . '<p>' . __( 'Warning: Can\'t reach SAP CDC "gigya_log" file, please make sure the file exists at the path' . GIGYA__LOG_FILE . '.' ) . '</p>', 'warning' );
230
+
} else {
231
+
232
+
$logger->info( '"Global Settings" page was saved successfully.' );
@@ -607,4 +621,20 @@ public static function _getSiteOptions( $option = GIGYA__SETTINGS_GLOBAL ) {
607
621
return$options;
608
622
}
609
623
624
+
privatestaticfunctiondoesGigyaErrorLogValid() {
625
+
if ( ! is_dir( GIGYA__LOG_FILE ) ) {
626
+
$error_message = "Could not open the SAP CDC log file at: " . GIGYA__LOG_FILE . " The parent directory of the file does not exist, or the file is not writable.";
$global_log_level_messag = '<br>' . __( 'for more information click ' ) . '<a href="">here</a>' . '.';
166
+
if ( $form['logLevel']['value'] == 'error' ) {
167
+
$form['logLevel']['markup'] = __( 'This level is for general site errors only.' ) . '<br>' . __( 'It will include any error shown to the administrator by the SAP CDC plugin in the admin control panel. ' );
$form['logLevel']['markup'] = __( 'Logs all actions done by the administrator in the SAP CDC plugin, including all the errors log that logs in the "Error Only" option. ' );
$form['logLevel']['markup'] = __( 'Logs all interactions with SAP CDC, i.e. every call made to SAP CDC is logged.' ) . '<br>' . __( ' Also including the "Debug" and "Error Only" levels.' );
'desc' => __( 'Log all SAP Customer Data Cloud\'s requests and responses. You can then find the log' ) . ' <a href="javascript:void(0)" class="gigya-debug-log">' . __( 'here' ) . '</a>'
175
+
$form['google_analytics'] = array(
176
+
'type' => 'checkbox',
177
+
'label' => __( "Enable Google Social Analytics" ),
if ( ! empty( get_option( GIGYA__SETTINGS_GLOBAL )['debug'] ) ) {
240
-
if ( $screenset_list !== false ) {
241
-
error_log( 'The current site has no screen sets defined. Either the screen-sets are at the parent site level, or they have not been initialized. Check Screen-Set settings in the SAP CDC console.' );
$logger->error( 'The current site has no screen sets defined. Either the screen-sets are at the parent site level, or they have not been initialized. Check Screen-Set settings in the SAP CDC console.' );
varendDisc='<br>for more information click <a href="">here</a> ';
465
+
vardescription='';
466
+
467
+
$('#gigya_logLevel').on('change',function(){
468
+
console.log(this.value);
469
+
if(this.value==='error'){
470
+
description='This level is for general site errors only.<br>It will include any error shown to the administrator by the SAP CDC plugin in the admin control panel.';
471
+
472
+
}elseif(this.value==='info'){
473
+
description='Logs all actions done by the administrator in the SAP CDC plugin, including all the errors log that logs in the "Error Only" option.';
474
+
}elseif(this.value==='debug'){
475
+
description='Logs all interactions with SAP CDC, i.e. every call made to SAP CDC is logged.<br>Also including the "Debug" and "Error Only" levels.';
0 commit comments