2011-02-14 Juan Manuel Ramon <juanmanuel.ramon@artica.es>
* include/functions_config.php: Loads relative_path variable in user session. * include/functions_db.php: Added include call to functions_extensions.php. * godmode/groups/configure_group.php godmode/groups/group_list.php: Added functionality to assign a skin to a group. * godmode/menu.php: Added an entry to skins submenu. * godmode/users/configure_user.php: Added functionality to assign a skin to a user. git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@3823 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
This commit is contained in:
parent
a0da53df2c
commit
ba00d69e54
|
@ -1,3 +1,16 @@
|
||||||
|
2011-02-14 Juan Manuel Ramon <juanmanuel.ramon@artica.es>
|
||||||
|
|
||||||
|
* include/functions_config.php: Loads relative_path variable in user
|
||||||
|
session.
|
||||||
|
* include/functions_db.php: Added include call to
|
||||||
|
functions_extensions.php.
|
||||||
|
* godmode/groups/configure_group.php
|
||||||
|
godmode/groups/group_list.php: Added functionality to assign a skin to
|
||||||
|
a group.
|
||||||
|
* godmode/menu.php: Added an entry to skins submenu.
|
||||||
|
* godmode/users/configure_user.php: Added functionality to assign a skin to
|
||||||
|
a user.
|
||||||
|
|
||||||
2011-02-09 Miguel de Dios <miguel.dedios@artica.es>
|
2011-02-09 Miguel de Dios <miguel.dedios@artica.es>
|
||||||
|
|
||||||
* pandoradb.data.postgreSQL.sql: added the first version of data of Pandora
|
* pandoradb.data.postgreSQL.sql: added the first version of data of Pandora
|
||||||
|
|
|
@ -31,6 +31,7 @@ $id_parent = 0;
|
||||||
$alerts_disabled = 0;
|
$alerts_disabled = 0;
|
||||||
$custom_id = "";
|
$custom_id = "";
|
||||||
$propagate = 0;
|
$propagate = 0;
|
||||||
|
$skin = 0;
|
||||||
|
|
||||||
$create_group = (bool) get_parameter ('create_group');
|
$create_group = (bool) get_parameter ('create_group');
|
||||||
$id_group = (int) get_parameter ('id_group');
|
$id_group = (int) get_parameter ('id_group');
|
||||||
|
@ -44,6 +45,7 @@ if ($id_group) {
|
||||||
$id_parent = $group["parent"];
|
$id_parent = $group["parent"];
|
||||||
$custom_id = $group["custom_id"];
|
$custom_id = $group["custom_id"];
|
||||||
$propagate = $group["propagate"];
|
$propagate = $group["propagate"];
|
||||||
|
$skin = $group["id_skin"];
|
||||||
} else {
|
} else {
|
||||||
echo "<h3 class='error'>".__('There was a problem loading group')."</h3>";
|
echo "<h3 class='error'>".__('There was a problem loading group')."</h3>";
|
||||||
echo "</table>";
|
echo "</table>";
|
||||||
|
@ -98,6 +100,12 @@ $table->data[4][1] = print_checkbox('propagate', 1, $propagate, true);
|
||||||
$table->data[5][0] = __('Custom ID');
|
$table->data[5][0] = __('Custom ID');
|
||||||
$table->data[5][1] = print_input_text ('custom_id', $custom_id, '', 16, 255, true);
|
$table->data[5][1] = print_input_text ('custom_id', $custom_id, '', 16, 255, true);
|
||||||
|
|
||||||
|
$isFunctionSkins = enterprise_include_once ('include/functions_skins.php');
|
||||||
|
if ($isFunctionSkins !== ENTERPRISE_NOT_HOOK) {
|
||||||
|
$table->data[6][0] = __('Skin');
|
||||||
|
$table->data[6][1] = print_select_skins($config["id_user"], 'skin', $skin, '', __('None'), 0, true);
|
||||||
|
}
|
||||||
|
|
||||||
echo '<form name="grupo" method="post" action="index.php?sec=gagente&sec2=godmode/groups/group_list">';
|
echo '<form name="grupo" method="post" action="index.php?sec=gagente&sec2=godmode/groups/group_list">';
|
||||||
print_table ($table);
|
print_table ($table);
|
||||||
echo '<div class="action-buttons" style="width: '.$table->width.'">';
|
echo '<div class="action-buttons" style="width: '.$table->width.'">';
|
||||||
|
|
|
@ -92,12 +92,13 @@ if ($create_group) {
|
||||||
$id_parent = (int) get_parameter ('id_parent');
|
$id_parent = (int) get_parameter ('id_parent');
|
||||||
$alerts_disabled = (bool) get_parameter ('alerts_disabled');
|
$alerts_disabled = (bool) get_parameter ('alerts_disabled');
|
||||||
$custom_id = (string) get_parameter ('custom_id');
|
$custom_id = (string) get_parameter ('custom_id');
|
||||||
|
$skin = (string) get_parameter ('skin');
|
||||||
|
|
||||||
/*Check if name field is empty*/
|
/*Check if name field is empty*/
|
||||||
if ($name != "") {
|
if ($name != "") {
|
||||||
$sql = sprintf ('INSERT INTO tgrupo (nombre, icon, parent, disabled, custom_id)
|
$sql = sprintf ('INSERT INTO tgrupo (nombre, icon, parent, disabled, custom_id, id_skin)
|
||||||
VALUES ("%s", "%s", %d, %d, "%s")',
|
VALUES ("%s", "%s", %d, %d, "%s", %d)',
|
||||||
$name, substr ($icon, 0, -4), $id_parent, $alerts_disabled, $custom_id);
|
$name, substr ($icon, 0, -4), $id_parent, $alerts_disabled, $custom_id, $skin);
|
||||||
$result = mysql_query ($sql);
|
$result = mysql_query ($sql);
|
||||||
} else {
|
} else {
|
||||||
$result = false;
|
$result = false;
|
||||||
|
@ -118,13 +119,14 @@ if ($update_group) {
|
||||||
$alerts_enabled = (bool) get_parameter ('alerts_enabled');
|
$alerts_enabled = (bool) get_parameter ('alerts_enabled');
|
||||||
$custom_id = (string) get_parameter ('custom_id');
|
$custom_id = (string) get_parameter ('custom_id');
|
||||||
$propagate = (bool) get_parameter('propagate');
|
$propagate = (bool) get_parameter('propagate');
|
||||||
|
$skin = (string) get_parameter ('skin');
|
||||||
|
|
||||||
/*Check if name field is empty*/
|
/*Check if name field is empty*/
|
||||||
if( $name != "") {
|
if( $name != "") {
|
||||||
$sql = sprintf ('UPDATE tgrupo SET nombre = "%s",
|
$sql = sprintf ('UPDATE tgrupo SET nombre = "%s",
|
||||||
icon = "%s", disabled = %d, parent = %d, custom_id = "%s", propagate = %d
|
icon = "%s", disabled = %d, parent = %d, custom_id = "%s", propagate = %d, id_skin = %d
|
||||||
WHERE id_grupo = %d',
|
WHERE id_grupo = %d',
|
||||||
$name, substr ($icon, 0, -4), !$alerts_enabled, $id_parent, $custom_id, $propagate, $id_group);
|
$name, substr ($icon, 0, -4), !$alerts_enabled, $id_parent, $custom_id, $propagate, $skin, $id_group);
|
||||||
$result = process_sql ($sql);
|
$result = process_sql ($sql);
|
||||||
} else {
|
} else {
|
||||||
$result = false;
|
$result = false;
|
||||||
|
|
|
@ -204,6 +204,7 @@ if (give_acl ($config['id_user'], 0, "PM")) {
|
||||||
$sub["godmode/setup/os"]["text"] = __('Edit OS');
|
$sub["godmode/setup/os"]["text"] = __('Edit OS');
|
||||||
enterprise_hook ('historydb_submenu');
|
enterprise_hook ('historydb_submenu');
|
||||||
enterprise_hook ('enterprise_acl_submenu');
|
enterprise_hook ('enterprise_acl_submenu');
|
||||||
|
enterprise_hook ('skins_submenu');
|
||||||
|
|
||||||
$sub["extras/pandora_diag"]["text"] = __('Diagnostic info');
|
$sub["extras/pandora_diag"]["text"] = __('Diagnostic info');
|
||||||
$menu["gsetup"]["sub"] = $sub;
|
$menu["gsetup"]["sub"] = $sub;
|
||||||
|
|
|
@ -62,6 +62,7 @@ if ($new_user && $config['admin_can_add_user']) {
|
||||||
$user_info['comments'] = '';
|
$user_info['comments'] = '';
|
||||||
$user_info['is_admin'] = 0;
|
$user_info['is_admin'] = 0;
|
||||||
$user_info['language'] = $config["language"];
|
$user_info['language'] = $config["language"];
|
||||||
|
$user_info['id_skin'] = '';
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($create_user) {
|
if ($create_user) {
|
||||||
|
@ -82,6 +83,7 @@ if ($create_user) {
|
||||||
$values['comments'] = (string) get_parameter ('comments');
|
$values['comments'] = (string) get_parameter ('comments');
|
||||||
$values['is_admin'] = get_parameter ('is_admin', 0);
|
$values['is_admin'] = get_parameter ('is_admin', 0);
|
||||||
$values['language'] = get_parameter ('language', $config["language"]);
|
$values['language'] = get_parameter ('language', $config["language"]);
|
||||||
|
$values['id_skin'] = get_parameter ('skin', 0);
|
||||||
|
|
||||||
if ($id == '') {
|
if ($id == '') {
|
||||||
print_error_message (__('User ID cannot be empty'));
|
print_error_message (__('User ID cannot be empty'));
|
||||||
|
@ -109,7 +111,7 @@ if ($create_user) {
|
||||||
' Lastname: ' . $values['lastname'] . ' Email: ' . $values['email'] .
|
' Lastname: ' . $values['lastname'] . ' Email: ' . $values['email'] .
|
||||||
' Phone: ' . $values['phone'] . ' Comments: ' . $values['comments'] .
|
' Phone: ' . $values['phone'] . ' Comments: ' . $values['comments'] .
|
||||||
' Is_admin: ' . $values['is_admin'] .
|
' Is_admin: ' . $values['is_admin'] .
|
||||||
' Laguage: ' . $values['language'];
|
' Language: ' . $values['language'] . ' Skin: ' . $values['id_skin'];
|
||||||
|
|
||||||
$result = create_user ($id, $password_new, $values);
|
$result = create_user ($id, $password_new, $values);
|
||||||
|
|
||||||
|
@ -145,6 +147,7 @@ if ($update_user) {
|
||||||
$values['comments'] = (string) get_parameter ('comments');
|
$values['comments'] = (string) get_parameter ('comments');
|
||||||
$values['is_admin'] = get_parameter ('is_admin', 0 );
|
$values['is_admin'] = get_parameter ('is_admin', 0 );
|
||||||
$values['language'] = (string) get_parameter ('language', $config["language"]);
|
$values['language'] = (string) get_parameter ('language', $config["language"]);
|
||||||
|
$values['id_skin'] = get_parameter ('skin', 0);
|
||||||
|
|
||||||
$res1 = update_user ($id, $values);
|
$res1 = update_user ($id, $values);
|
||||||
|
|
||||||
|
@ -167,7 +170,7 @@ if ($update_user) {
|
||||||
' Lastname: ' . $values['lastname'] . ' Email: ' . $values['email'] .
|
' Lastname: ' . $values['lastname'] . ' Email: ' . $values['email'] .
|
||||||
' Phone: ' . $values['phone'] . ' Comments: ' . $values['comments'] .
|
' Phone: ' . $values['phone'] . ' Comments: ' . $values['comments'] .
|
||||||
' Is_admin: ' . $values['is_admin'] .
|
' Is_admin: ' . $values['is_admin'] .
|
||||||
' Laguage: ' . $values['language'];
|
' Language: ' . $values['language'] . ' Skin: ' . $values['id_skin'];
|
||||||
|
|
||||||
pandora_audit("User management", "Updated user ".safe_input($id),
|
pandora_audit("User management", "Updated user ".safe_input($id),
|
||||||
false, false, $info);
|
false, false, $info);
|
||||||
|
@ -279,6 +282,25 @@ $table->data[9][0] = __('Comments');
|
||||||
$table->data[9][1] = print_textarea ("comments", 2, 65, $user_info['comments'],
|
$table->data[9][1] = print_textarea ("comments", 2, 65, $user_info['comments'],
|
||||||
($view_mode ? 'readonly="readonly"' : ''), true);
|
($view_mode ? 'readonly="readonly"' : ''), true);
|
||||||
|
|
||||||
|
// If we want to create a new user, skins displayed are the skins of the creator's group. If we want to update, skins displayed are the skins of the modified user.
|
||||||
|
if ($new_user){
|
||||||
|
$usr_groups = (get_user_groups($config['id_user']));
|
||||||
|
$id_usr = $config['id_user'];
|
||||||
|
}else{
|
||||||
|
$usr_groups = (get_user_groups($id));
|
||||||
|
$id_usr = $id;
|
||||||
|
}
|
||||||
|
|
||||||
|
// 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);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
echo '<form method="post">';
|
echo '<form method="post">';
|
||||||
|
|
||||||
print_table ($table);
|
print_table ($table);
|
||||||
|
|
|
@ -240,6 +240,10 @@ function update_config () {
|
||||||
else {
|
else {
|
||||||
update_config_value ('can_block_policies', get_parameter('can_block_policies', $config['can_block_policies']));
|
update_config_value ('can_block_policies', get_parameter('can_block_policies', $config['can_block_policies']));
|
||||||
}
|
}
|
||||||
|
$enterprise = enterprise_include_once ('include/functions_skins.php');
|
||||||
|
if ($enterprise !== ENTERPRISE_NOT_HOOK) {
|
||||||
|
$config['relative_path'] = get_parameter('relative_path', $config['relative_path']);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -387,7 +391,6 @@ function process_config () {
|
||||||
unset($config[$keyConfig]);
|
unset($config[$keyConfig]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// This is not set here. The first time, when no
|
// This is not set here. The first time, when no
|
||||||
// setup is done, update_manager extension manage it
|
// setup is done, update_manager extension manage it
|
||||||
// the first time make a conenction and disable itself
|
// the first time make a conenction and disable itself
|
||||||
|
@ -590,6 +593,17 @@ function process_config () {
|
||||||
update_config_value ( 'can_block_policies', 0);
|
update_config_value ( 'can_block_policies', 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!isset ($config['relative_path']) && (isset ($_POST['nick']) || isset ($config['id_user']))) {
|
||||||
|
|
||||||
|
$isFunctionSkins = enterprise_include_once ('include/functions_skins.php');
|
||||||
|
if ($isFunctionSkins !== ENTERPRISE_NOT_HOOK) {
|
||||||
|
if(isset($config['id_user']))
|
||||||
|
$relative_path = enterprise_hook('set_image_skin_path',array($config['id_user']));
|
||||||
|
else
|
||||||
|
$relative_path = enterprise_hook('set_image_skin_path',array($_POST['nick']));
|
||||||
|
$config['relative_path'] = $relative_path;
|
||||||
|
}
|
||||||
|
}
|
||||||
/* Finally, check if any value was overwritten in a form */
|
/* Finally, check if any value was overwritten in a form */
|
||||||
update_config ();
|
update_config ();
|
||||||
}
|
}
|
||||||
|
|
|
@ -19,6 +19,8 @@
|
||||||
* @subpackage DataBase
|
* @subpackage DataBase
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
include_once("include/functions_extensions.php");
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* When you delete (with the function "process_sql_delete" or other) any row in
|
* When you delete (with the function "process_sql_delete" or other) any row in
|
||||||
* any table, some times the cache save the data just deleted, because you
|
* any table, some times the cache save the data just deleted, because you
|
||||||
|
|
Loading…
Reference in New Issue