From 2cfe4378c2ec14861236c1642b9dfaaea0c0e590 Mon Sep 17 00:00:00 2001 From: fbsanchez Date: Wed, 22 May 2019 18:50:51 +0200 Subject: [PATCH] license forms sync MC-N --- pandora_console/godmode/setup/license.php | 104 ++++++++++++++++------ 1 file changed, 75 insertions(+), 29 deletions(-) diff --git a/pandora_console/godmode/setup/license.php b/pandora_console/godmode/setup/license.php index 3f559be660..f03d32ef0a 100644 --- a/pandora_console/godmode/setup/license.php +++ b/pandora_console/godmode/setup/license.php @@ -1,15 +1,32 @@ $value) { - db_process_sql_update( - 'tupdate_settings', - [db_escape_key_identifier('value') => $value], - [db_escape_key_identifier('key') => $key] - ); - } - - ui_print_success_message(__('License updated')); + ui_require_javascript_file_enterprise('load_enterprise'); + enterprise_include_once('include/functions_license.php'); +} + +if ($update_settings) { + if (!is_metaconsole()) { + // Node. + foreach ($_POST['keys'] as $key => $value) { + db_process_sql_update( + 'tupdate_settings', + [db_escape_key_identifier('value') => $value], + [db_escape_key_identifier('key') => $key] + ); + } + + ui_print_success_message(__('License updated')); + } } -ui_require_javascript_file_enterprise('load_enterprise'); -enterprise_include_once('include/functions_license.php'); $license = enterprise_hook('license_get_info'); $rows = db_get_all_rows_in_table('tupdate_settings'); @@ -55,11 +88,20 @@ if (enterprise_installed()) { echo ''; echo '
'; +// Retrieve UM url configured (or default). +$url = get_um_url(); $table = new stdClass(); $table->width = '100%'; $table->class = 'databox filters'; +if (is_metaconsole()) { + $table->head[0] = __('Licence'); + $table->head_colspan[0] = 3; + $table->headstyle[0] = 'text-align: center'; + $table->style[0] = 'font-weight: bold;'; +} + $table->data = []; $table->data[0][0] = ''.__('Customer key').''; @@ -98,13 +140,17 @@ if (enterprise_installed()) { html_print_input_hidden('update_settings', 1); html_print_submit_button(__('Validate'), 'update_button', false, 'class="sub upd"'); echo '  '; - html_print_button(__('Request new license'), '', false, 'generate_request_code()', 'class="ui-button-dialog ui-widget ui-state-default ui-corner-all ui-button-text-only sub next"'); + html_print_button(__('Request new license'), '', false, 'generate_request_code()', 'class="sub next"'); echo ''; } -if (enterprise_installed()) { - echo ''; - echo ''; +if (is_metaconsole()) { + ui_require_css_file('pandora_enterprise', '../../'.ENTERPRISE_DIR.'/include/styles/'); + ui_require_css_file('register', '../../include/styles/'); +} else { + ui_require_css_file('pandora'); + ui_require_css_file('pandora_enterprise', ENTERPRISE_DIR.'/include/styles/'); + ui_require_css_file('register'); } if (enterprise_hook('print_activate_licence_dialog') == ENTERPRISE_NOT_HOOK) { @@ -116,7 +162,7 @@ if (enterprise_hook('print_activate_licence_dialog') == ENTERPRISE_NOT_HOOK) { echo ''.__('To get your %s Enterprise License:', get_product_name()).'
'; echo '