Commits

p2501  committed 3a116e2

Error acccesing blogs with user not logued

  • Participants
  • Parent commits 15e977b

Comments (0)

Files changed (2)

File elgg/engine/lib/entities.php

 		$return = true;
 	} else {
 		$container = get_entity($container_guid);
-
 		if ($container && $user) {
+			
 			// If the user can edit the container, they can also write to it
 			$return = $container->canEdit($user->getGUID());
 

File elgg/mod/blog/start.php

 						add_submenu_item(elgg_echo('blog:everyone'),$CONFIG->wwwroot."pg/blog/all/");
 					}
 					
-					if (can_write_to_container(0, page_owner()) && isloggedin())
-						add_submenu_item(elgg_echo('blog:addpost'),$CONFIG->wwwroot."pg/blog/new/{$page_owner->username}/");
+					if(isloggedin()){	
+						if (can_write_to_container(0, page_owner()))
+							error_log("lo pinta");
+							add_submenu_item(elgg_echo('blog:addpost'),$CONFIG->wwwroot."pg/blog/new/{$page_owner->username}/");
+					}
 						
 					if (!defined('everyoneblog') && page_owner()) {