2011-07-28 Sergio Martin <sergio.martin@artica.es>

* include/functions_networkmap.php: Added new mode to 
	get networkmap function to allow get the map of another user



git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@4643 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
This commit is contained in:
zarzuelo 2011-07-28 16:26:26 +00:00
parent 8e2edc65e2
commit 814c0fe8d3
2 changed files with 11 additions and 2 deletions

View File

@ -1,3 +1,8 @@
2011-07-28 Sergio Martin <sergio.martin@artica.es>
* include/functions_networkmap.php: Added new mode to
get networkmap function to allow get the map of another user
2011-07-28 Ramon Novoa <rnovoa@artica.es>
* operation/events/events_list.php: Changed the event pagination query

View File

@ -618,10 +618,11 @@ function networkmap_create_networkmap ($name, $type = 'topology', $layout = 'rad
* @param int Networkmap id to get.
* @param array Extra filter.
* @param array Fields to get.
* @param bool Get only the map if is of the user ($config['id_user'])
*
* @return Networkmap with the given id. False if not available or readable.
*/
function networkmap_get_networkmap ($id_networkmap, $filter = false, $fields = false) {
function networkmap_get_networkmap ($id_networkmap, $filter = false, $fields = false, $check_user = true) {
global $config;
$id_networkmap = safe_int ($id_networkmap);
@ -631,7 +632,10 @@ function networkmap_get_networkmap ($id_networkmap, $filter = false, $fields = f
$filter = array ();
$filter['id_networkmap'] = $id_networkmap;
$filter['id_user'] = $config['id_user'];
if($check_user) {
$filter['id_user'] = $config['id_user'];
}
$networkmap = db_get_row_filter ('tnetwork_map', $filter, $fields);