diff --git a/pandora_console/ChangeLog b/pandora_console/ChangeLog index 16fb73791e..f536f71726 100644 --- a/pandora_console/ChangeLog +++ b/pandora_console/ChangeLog @@ -1,3 +1,14 @@ +2011-04-20 Miguel de Dios + + * pandoradb_data.sql, pandoradb.data.postgreSQL.sql, + pandoradb.data.oracle.sql: added the default value for flash_chart for + admin user. The value is "use the global conf". + + * include/db/mysql.php: cleaned source code style. + + * godmode/users/configure_user.php: fixed when update or create the user + in Pandora Console without Enterprise version installed. + 2011-04-23 Junichi Satoh * include/help/ja/help_alert_macros.php: Added the new _policy_ alert diff --git a/pandora_console/godmode/users/configure_user.php b/pandora_console/godmode/users/configure_user.php index f2e8f59d11..a059c895b6 100644 --- a/pandora_console/godmode/users/configure_user.php +++ b/pandora_console/godmode/users/configure_user.php @@ -22,6 +22,8 @@ include_once($config['homedir'] . "/include/functions_profile.php"); include_once($config['homedir'] . '/include/functions_users.php'); include_once ($config['homedir'] . '/include/functions_groups.php'); +$isFunctionSkins = enterprise_include_once ('include/functions_skins.php'); + // This defines the working user. Beware with this, old code get confusses // and operates with current logged user (dangerous). @@ -66,7 +68,9 @@ if ($new_user && $config['admin_can_add_user']) { $user_info['comments'] = ''; $user_info['is_admin'] = 0; $user_info['language'] = $config["language"]; - $user_info['id_skin'] = ''; + if ($isFunctionSkins !== ENTERPRISE_NOT_HOOK) { + $user_info['id_skin'] = ''; + } //This attributes are inherited from global configuration $user_info['block_size'] = $config["block_size"]; $user_info['flash_chart'] = $config["flash_charts"]; @@ -90,7 +94,9 @@ if ($create_user) { $values['comments'] = (string) get_parameter ('comments'); $values['is_admin'] = get_parameter ('is_admin', 0); $values['language'] = get_parameter ('language', $config["language"]); - $values['id_skin'] = get_parameter ('skin', 0); + if ($isFunctionSkins !== ENTERPRISE_NOT_HOOK) { + $values['id_skin'] = get_parameter ('skin', 0); + } $values['block_size'] = get_parameter ('block_size', $config["block_size"]); $values['flash_chart'] = get_parameter ('flash_charts', $config["flash_charts"]); @@ -120,9 +126,13 @@ if ($create_user) { ' Lastname: ' . $values['lastname'] . ' Email: ' . $values['email'] . ' Phone: ' . $values['phone'] . ' Comments: ' . $values['comments'] . ' Is_admin: ' . $values['is_admin'] . - ' Language: ' . $values['language'] . ' Skin: ' . $values['id_skin'] . + ' Language: ' . $values['language'] . ' Block size: ' . $values['block_size'] . ' Flash Chats: ' . $values['flash_chart']; + if ($isFunctionSkins !== ENTERPRISE_NOT_HOOK) { + $info .= ' Skin: ' . $values['id_skin']; + } + $result = create_user($id, $password_new, $values); db_pandora_audit("User management", @@ -157,7 +167,9 @@ if ($update_user) { $values['comments'] = (string) get_parameter ('comments'); $values['is_admin'] = get_parameter ('is_admin', 0 ); $values['language'] = (string) get_parameter ('language', $config["language"]); - $values['id_skin'] = get_parameter ('skin', 0); + if ($isFunctionSkins !== ENTERPRISE_NOT_HOOK) { + $values['id_skin'] = get_parameter ('skin', 0); + } $values['block_size'] = get_parameter ('block_size', $config["block_size"]); $values['flash_chart'] = get_parameter ('flash_charts', $config["flash_charts"]); @@ -182,9 +194,13 @@ if ($update_user) { ' Lastname: ' . $values['lastname'] . ' Email: ' . $values['email'] . ' Phone: ' . $values['phone'] . ' Comments: ' . $values['comments'] . ' Is_admin: ' . $values['is_admin'] . - ' Language: ' . $values['language'] . ' Skin: ' . $values['id_skin'] . + ' Language: ' . $values['language'] . ' Block size: ' . $values['block_size'] . ' Flash Chats: ' . $values['flash_chart']; + if ($isFunctionSkins !== ENTERPRISE_NOT_HOOK) { + $info .= ' Skin: ' . $values['id_skin']; + } + db_pandora_audit("User management", "Updated user ".safe_input($id), false, false, $info); @@ -305,8 +321,6 @@ if ($new_user){ // User only can change skins if has more than one group if (count($usr_groups) > 1){ - - $isFunctionSkins = enterprise_include_once ('include/functions_skins.php'); if ($isFunctionSkins !== ENTERPRISE_NOT_HOOK) { $table->data[10][0] = __('Skin'); $table->data[10][1] = print_select_skins($id_usr,'skin', $user_info['id_skin'], '', __('None'), 0, true); @@ -314,7 +328,7 @@ if (count($usr_groups) > 1){ } $table->data[11][0] = __('Flash charts'); -$values = array(-1 => 'Default',1 => 'Yes',0 => 'No'); +$values = array(-1 => __('Use global conf'), 1 => __('Yes'), 0 => __('No')); $table->data[11][1] = print_select($values, 'flash_charts', $user_info["flash_chart"], '', '', -1, true, false, false); $table->data[12][0] = __('Block size for pagination'); $table->data[12][1] = print_input_text ('block_size', $user_info["block_size"], '', 5, 5, true); diff --git a/pandora_console/include/db/mysql.php b/pandora_console/include/db/mysql.php index f5fc3a6edb..5b67d014bd 100644 --- a/pandora_console/include/db/mysql.php +++ b/pandora_console/include/db/mysql.php @@ -844,7 +844,7 @@ function mysql_db_process_sql_update($table, $values, $where = false, $where_joi $query .= db_format_array_where_clause_sql ($where, $where_join, ' WHERE '); } } - + return db_process_sql ($query); } diff --git a/pandora_console/pandoradb.data.oracle.sql b/pandora_console/pandoradb.data.oracle.sql index 881032d3fa..bc04c29568 100644 --- a/pandora_console/pandoradb.data.oracle.sql +++ b/pandora_console/pandoradb.data.oracle.sql @@ -268,8 +268,8 @@ END;; -- BEGIN LOCK TABLE tusuario IN EXCLUSIVE MODE; -INSERT INTO tusuario (id_user, fullname, firstname, lastname, middlename, password, comments, last_connect, registered, email, phone, is_admin) VALUES -('admin', 'Pandora', 'Pandora', 'Admin', ' ', '1da7ee7d45b96d0e1f45ee4ee23da560', 'Admin Pandora', 1232642121, 0, 'admin@example.com', '555-555-5555', 1); +INSERT INTO tusuario (id_user, fullname, firstname, lastname, middlename, password, comments, last_connect, registered, email, phone, is_admin, flash_chart) VALUES +('admin', 'Pandora', 'Pandora', 'Admin', ' ', '1da7ee7d45b96d0e1f45ee4ee23da560', 'Admin Pandora', 1232642121, 0, 'admin@example.com', '555-555-5555', 1, -1); COMMIT; END;; diff --git a/pandora_console/pandoradb.data.postgreSQL.sql b/pandora_console/pandoradb.data.postgreSQL.sql index 1913a2dd8b..364c7ed2a5 100644 --- a/pandora_console/pandoradb.data.postgreSQL.sql +++ b/pandora_console/pandoradb.data.postgreSQL.sql @@ -246,8 +246,8 @@ SELECT setval('ttipo_modulo_id_tipo_seq', (SELECT (SELECT MAX(id_tipo) FROM ttip -- -- Dumping data for table "tusuario" -- -INSERT INTO "tusuario" ("id_user", "fullname", "firstname", "lastname", "middlename", "password", "comments", "last_connect", "registered", "email", "phone", "is_admin") VALUES -('admin', 'Pandora', 'Pandora', 'Admin', '', '1da7ee7d45b96d0e1f45ee4ee23da560', 'Admin Pandora', 1232642121, 0, 'admin@example.com', '555-555-5555', 1); +INSERT INTO "tusuario" ("id_user", "fullname", "firstname", "lastname", "middlename", "password", "comments", "last_connect", "registered", "email", "phone", "is_admin", "flash_chart") VALUES +('admin', 'Pandora', 'Pandora', 'Admin', '', '1da7ee7d45b96d0e1f45ee4ee23da560', 'Admin Pandora', 1232642121, 0, 'admin@example.com', '555-555-5555', 1, -1); -- -- Dumping data for table "tusuario_perfil" diff --git a/pandora_console/pandoradb_data.sql b/pandora_console/pandoradb_data.sql index d85c2df545..489a746450 100644 --- a/pandora_console/pandoradb_data.sql +++ b/pandora_console/pandoradb_data.sql @@ -249,8 +249,8 @@ INSERT INTO `ttipo_modulo` VALUES -- -- Dumping data for table `tusuario` -- -INSERT INTO `tusuario` (`id_user`, `fullname`, `firstname`, `lastname`, `middlename`, `password`, `comments`, `last_connect`, `registered`, `email`, `phone`, `is_admin`) VALUES -('admin', 'Pandora', 'Pandora', 'Admin', '', '1da7ee7d45b96d0e1f45ee4ee23da560', 'Admin Pandora', 1232642121, 0, 'admin@example.com', '555-555-5555', 1); +INSERT INTO `tusuario` (`id_user`, `fullname`, `firstname`, `lastname`, `middlename`, `password`, `comments`, `last_connect`, `registered`, `email`, `phone`, `is_admin`, `flash_chart`) VALUES +('admin', 'Pandora', 'Pandora', 'Admin', '', '1da7ee7d45b96d0e1f45ee4ee23da560', 'Admin Pandora', 1232642121, 0, 'admin@example.com', '555-555-5555', 1, -1); -- -- Dumping data for table `tusuario_perfil`