Commit 7997ebb9 authored by Dries's avatar Dries
Browse files

- Bugfix: added more permissions checks.  Patches #60-62 by Al.  Should fix
  bug #2163 and #2164.
parent dc15ba06
......@@ -161,7 +161,7 @@ function archive_block($op = "list", $delta = 0) {
$blocks[0]["info"] = t("Calendar to browse archives");
return $blocks;
}
else {
else if (user_access("access content")) {
switch ($delta) {
case 0:
$block["subject"] = t("Browse archives");
......
......@@ -161,7 +161,7 @@ function archive_block($op = "list", $delta = 0) {
$blocks[0]["info"] = t("Calendar to browse archives");
return $blocks;
}
else {
else if (user_access("access content")) {
switch ($delta) {
case 0:
$block["subject"] = t("Browse archives");
......
......@@ -65,8 +65,10 @@ function blog_user($type, &$edit, &$user) {
switch ($type) {
case "view_public":
case "view_private":
if (user_access("maintain personal blog", $user)) {
return form_item(t("Blog"), l(t("view recent blog entries"), "blog/$user->uid", array("title" => t("Read %username's latest blog entries.", array("%username" => $user->name)))));
}
}
}
function blog_help() {
......
......@@ -65,8 +65,10 @@ function blog_user($type, &$edit, &$user) {
switch ($type) {
case "view_public":
case "view_private":
if (user_access("maintain personal blog", $user)) {
return form_item(t("Blog"), l(t("view recent blog entries"), "blog/$user->uid", array("title" => t("Read %username's latest blog entries.", array("%username" => $user->name)))));
}
}
}
function blog_help() {
......
......@@ -710,7 +710,7 @@ function statistics_block($op = "list", $delta = 0) {
}
return $blocks;
}
else {
else if (user_access("access content")) {
switch($delta) {
case 0:
$block["subject"] = variable_get("statistics_block_top_title", t("Popular content"));
......
......@@ -710,7 +710,7 @@ function statistics_block($op = "list", $delta = 0) {
}
return $blocks;
}
else {
else if (user_access("access content")) {
switch($delta) {
case 0:
$block["subject"] = variable_get("statistics_block_top_title", t("Popular content"));
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment