From 168c093445961ffcd9ce3848b5bf43d16d4db513 Mon Sep 17 00:00:00 2001 From: Julio Montoya Date: Thu, 4 Mar 2010 10:27:52 -0500 Subject: [PATCH] Cleaning code + adding intval value --- main/inc/lib/group_portal_manager.lib.php | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/main/inc/lib/group_portal_manager.lib.php b/main/inc/lib/group_portal_manager.lib.php index e030fc3923..62af166783 100755 --- a/main/inc/lib/group_portal_manager.lib.php +++ b/main/inc/lib/group_portal_manager.lib.php @@ -1,11 +1,11 @@ -* @package dokeos.library +* @package chamilo.library ============================================================================== */ // Group permissions @@ -163,7 +163,7 @@ class GroupPortalManager $tags = array(); if (Database::num_rows($res)>0) { while ($row = Database::fetch_array($res,'ASSOC')) { - $tags[] = $row; + $tags[] = $row; } } @@ -247,12 +247,12 @@ class GroupPortalManager $result=Database::query($sql); $array = array(); while ($row = Database::fetch_array($result, 'ASSOC')) { - if ($with_image == true) { - $picture = self::get_picture_group($row['id'], $row['picture_uri'],80); - $img = ''; - $row['picture_uri'] = $img; - } - $array[$row['id']] = $row; + if ($with_image == true) { + $picture = self::get_picture_group($row['id'], $row['picture_uri'],80); + $img = ''; + $row['picture_uri'] = $img; + } + $array[$row['id']] = $row; } return $array; } @@ -434,8 +434,7 @@ class GroupPortalManager $role = self::get_user_group_role($user_id,$group_id); if ($role == 0) { $sql = "INSERT INTO $table_url_rel_group - SET user_id = ".intval($user_id).", group_id = ".intval($group_id).", relation_type = ".intval($relation_type).""; - + SET user_id = ".intval($user_id).", group_id = ".intval($group_id).", relation_type = ".intval($relation_type); $result = Database::query($sql); if ($result) @@ -461,6 +460,7 @@ class GroupPortalManager $table_ = Database :: get_main_table(TABLE_MAIN_USER_REL_GROUP); $condition_relation = ""; if (!empty($relation_type)) { + $relation_type = intval($relation_type); $condition_relation = " AND relation_type = '$relation_type'"; } $sql = "DELETE FROM $table_ WHERE group_id = ".intval($group_id).$condition_relation;