--- og_user_roles.module.orig 2009-07-23 10:04:35.000000000 +0200 +++ og_user_roles.module 2009-07-23 10:12:21.000000000 +0200 @@ -2173,7 +2173,7 @@ function og_user_roles_all_roles($user) $ref = $_SERVER['HTTP_REFERER']; $ref_url = parse_url($ref); $ref_path = $ref_url['path']; - $ref_query = $ref_url['query']; + $ref_query = isset($ref_url['query']) ? $ref_url['query'] : ''; $ref_arg = explode('/', $ref_path); // @@ -2186,7 +2186,7 @@ function og_user_roles_all_roles($user) // require_once("modules/og/og.module"); $group_node = og_get_group_context(); - $gid02 = $group_node->nid; + $gid02 = isset($group_node->nid) ? $group_node->nid : NULL; $gid = $gid02; if ($gid02 === NULL) { $gid = 0; @@ -3422,7 +3422,7 @@ function og_user_roles_form_alter(&$form // the user has the 'auto assign group roles' permission, and we allow group admins // to set default group roles, then print the 'basicgrouprole' form on the // group edit form. - if (arg(0) == 'node' && ($_SESSION['og_last'] == arg(1)) && arg(2) == 'edit' && user_access('auto assign group roles') && variable_get('og_user_roles_assign_basicgrouprole_gid', 0) == 1) { + if (arg(0) == 'node' && (isset($_SESSION['og_last']) && $_SESSION['og_last'] == arg(1)) && arg(2) == 'edit' && user_access('auto assign group roles') && variable_get('og_user_roles_assign_basicgrouprole_gid', 0) == 1) { $gid = arg(1); // First, we need to get a list of all og-enabled node types @@ -3465,7 +3465,7 @@ function og_user_roles_form_alter(&$form } // If this is a group node edit (use og_last to determine if this is a group node) - if (arg(0) == 'node' && ($_SESSION['og_last'] == arg(1)) && arg(2) == 'edit' ) { + if (arg(0) == 'node' && (isset($_SESSION['og_last']) && $_SESSION['og_last'] == arg(1)) && arg(2) == 'edit' ) { $gid = arg(1); // First, we need to get a list of all og-enabled node types @@ -3710,7 +3710,7 @@ function og_user_roles_determine_context global $custom_theme; $group_node = NULL; // a node object containing the 'active' group for this request - $type = $_GET['type']; + $type = isset($_GET['type']) ? $_GET['type'] : NULL; if (arg(0) == 'og' && is_numeric(arg(2))) { $group_node = og_set_theme(arg(2)); @@ -3765,7 +3765,7 @@ function og_user_roles_determine_context */ function og_user_roles_link_alter(&$links, $node) { $node = og_get_group_context(); - if ($node->nid) { + if (isset($node->nid) && $node->nid) { $gid = $node->nid; foreach ($links as $type => $link) { if ($type == 'book_add_child') $links['book_add_child']['query'] .= '&gids[]='.$gid; @@ -3855,7 +3855,7 @@ function og_user_roles_block($op = 'list } break; } - return $block; + return isset($block) ? $block : NULL; } } @@ -4217,4 +4217,4 @@ function og_user_roles_list_users_sql($m return "SELECT u.uid, u.name, u.mail, u.picture, ou.* FROM {og_uid} ou INNER JOIN {users} u ON ou.uid = u.uid WHERE ou.nid = %d AND u.status > 0 AND ou.is_active >= $min_is_active AND ou.is_admin >= $min_is_admin ORDER BY $orderby"; } -?> \ No newline at end of file +?>