summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDries Buytaert <dries@buytaert.net>2005-08-22 20:39:43 +0000
committerDries Buytaert <dries@buytaert.net>2005-08-22 20:39:43 +0000
commit6a4e6df36fe43b45c78a160fdf58df8d78ae5f02 (patch)
treebc214693b7f2b0d75feb593766b5d3b825ef3cc7
parent22a98528b741042a06d1227182bd4162cc2e8c45 (diff)
downloadbrdo-6a4e6df36fe43b45c78a160fdf58df8d78ae5f02.tar.gz
brdo-6a4e6df36fe43b45c78a160fdf58df8d78ae5f02.tar.bz2
- Patch #17592 by killes: improved access denied messages.
-rw-r--r--includes/common.inc12
-rw-r--r--modules/blogapi.module8
-rw-r--r--modules/blogapi/blogapi.module8
-rw-r--r--modules/node.module2
-rw-r--r--modules/node/node.module2
5 files changed, 11 insertions, 21 deletions
diff --git a/includes/common.inc b/includes/common.inc
index 33519b450..e5e6d0190 100644
--- a/includes/common.inc
+++ b/includes/common.inc
@@ -301,7 +301,7 @@ function drupal_access_denied() {
if (empty($return)) {
drupal_set_title(t('Access denied'));
- $return = message_access();
+ $return = t('You are not authorized to access this page.');
}
print theme('page', $return);
}
@@ -570,16 +570,6 @@ function object2array($object) {
*/
/**
- * Return a string with an "access denied" message.
- *
- * Always consider whether to use drupal_access_denied() instead to return a
- * proper (and customizable) 403 error.
- */
-function message_access() {
- return t('You are not authorized to access this page.');
-}
-
-/**
* Return a string with a "not applicable" message.
*/
function message_na() {
diff --git a/modules/blogapi.module b/modules/blogapi.module
index 6b35a68ef..9dd9d511b 100644
--- a/modules/blogapi.module
+++ b/modules/blogapi.module
@@ -215,7 +215,7 @@ function blogapi_blogger_new_post($appkey, $blogid, $username, $password, $conte
}
if (!node_access('create', $node)) {
- return blogapi_error(message_access());
+ return blogapi_error(t('You do not have permission to create the type of post you wanted to create.'));
}
$nid = node_save($node);
@@ -246,7 +246,7 @@ function blogapi_blogger_edit_post($appkey, $postid, $username, $password, $cont
unset($node->teaser);
if (!node_access('update', $node)) {
- return blogapi_error(message_access());
+ return blogapi_error(t('You do not have permission to update this post.'));
}
$node->status = $publish;
@@ -485,7 +485,7 @@ function blogap_mti_publish_post($postid, $username, $password) {
$node->status = 1;
if (!node_access('update', $node)) {
- return blogapi_error(message_access());
+ return blogapi_error(t('You do not have permission to update this post.'));
}
node_save($node);
@@ -520,7 +520,7 @@ function blogapi_validate_user($username, $password) {
return $user;
}
else {
- return message_access();
+ return t("You either tried to edit somebody else's blog or you don't have permission to edit your own blog.");
}
}
else {
diff --git a/modules/blogapi/blogapi.module b/modules/blogapi/blogapi.module
index 6b35a68ef..9dd9d511b 100644
--- a/modules/blogapi/blogapi.module
+++ b/modules/blogapi/blogapi.module
@@ -215,7 +215,7 @@ function blogapi_blogger_new_post($appkey, $blogid, $username, $password, $conte
}
if (!node_access('create', $node)) {
- return blogapi_error(message_access());
+ return blogapi_error(t('You do not have permission to create the type of post you wanted to create.'));
}
$nid = node_save($node);
@@ -246,7 +246,7 @@ function blogapi_blogger_edit_post($appkey, $postid, $username, $password, $cont
unset($node->teaser);
if (!node_access('update', $node)) {
- return blogapi_error(message_access());
+ return blogapi_error(t('You do not have permission to update this post.'));
}
$node->status = $publish;
@@ -485,7 +485,7 @@ function blogap_mti_publish_post($postid, $username, $password) {
$node->status = 1;
if (!node_access('update', $node)) {
- return blogapi_error(message_access());
+ return blogapi_error(t('You do not have permission to update this post.'));
}
node_save($node);
@@ -520,7 +520,7 @@ function blogapi_validate_user($username, $password) {
return $user;
}
else {
- return message_access();
+ return t("You either tried to edit somebody else's blog or you don't have permission to edit your own blog.");
}
}
else {
diff --git a/modules/node.module b/modules/node.module
index ddb76a8ce..296664b41 100644
--- a/modules/node.module
+++ b/modules/node.module
@@ -1420,7 +1420,7 @@ function node_add($type) {
$output = t('Choose the appropriate item from the list:') .'<dl>'. implode('', $item) .'</dl>';
}
else {
- $output = message_access();
+ $output = t('You are not allowed to create content.');
}
}
diff --git a/modules/node/node.module b/modules/node/node.module
index ddb76a8ce..296664b41 100644
--- a/modules/node/node.module
+++ b/modules/node/node.module
@@ -1420,7 +1420,7 @@ function node_add($type) {
$output = t('Choose the appropriate item from the list:') .'<dl>'. implode('', $item) .'</dl>';
}
else {
- $output = message_access();
+ $output = t('You are not allowed to create content.');
}
}