summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDries Buytaert <dries@buytaert.net>2001-09-18 18:39:15 +0000
committerDries Buytaert <dries@buytaert.net>2001-09-18 18:39:15 +0000
commitca85a56f1b4db802a72b4def5b20ba9dafb5e0e2 (patch)
treecf3231d532cd1ceeb6dfb259c52ee152fc66fd7b
parentc5a349ca5140dec738903afe7f6e0deda604d013 (diff)
downloadbrdo-ca85a56f1b4db802a72b4def5b20ba9dafb5e0e2.tar.gz
brdo-ca85a56f1b4db802a72b4def5b20ba9dafb5e0e2.tar.bz2
- Fixed 2 typos in the user module. Thanks Axel and Remco.
- Applied (modified versions of) Alexander's patches on the development branch.
-rw-r--r--index.php2
-rw-r--r--modules/cloud.module4
-rw-r--r--modules/search.module4
-rw-r--r--modules/search/search.module4
-rw-r--r--modules/user.module15
-rw-r--r--modules/user/user.module15
-rw-r--r--submit.php2
7 files changed, 28 insertions, 18 deletions
diff --git a/index.php b/index.php
index 63538dec7..46f9b3663 100644
--- a/index.php
+++ b/index.php
@@ -14,7 +14,7 @@ if (user_access("access content")) {
}
}
else {
- $theme->box("Access denied", message_access());
+ $theme->box(t("Access denied"), message_access());
}
$theme->footer();
diff --git a/modules/cloud.module b/modules/cloud.module
index 75e9fb63e..381319e1a 100644
--- a/modules/cloud.module
+++ b/modules/cloud.module
@@ -122,10 +122,10 @@ function cloud_list($limit = 10) {
if ($hour != floor((time() - $site->timestamp) / 3600)) {
$hour = floor((time() - $site->timestamp) / 3600);
if ($hour < 12) {
- $output .= "<p />Updated ". format_plural($hour, "hour", "hours") ." ago:";
+ $output .= "<p />". strtr(t("Updated %a ago:"), array("%a" => format_plural($hour, "hour", "hours")));
}
else if ($list) {
- $output .= "<p />Updated ". format_plural($hour, "+ hour", "+ hours") ." ago:";
+ $output .= "<p />". strtr(t("Updated more than %a ago:"), array("%a" => format_plural($hour, "hour", "hours")));
$list = 0;
}
}
diff --git a/modules/search.module b/modules/search.module
index 7beb1e74c..bb74db3c2 100644
--- a/modules/search.module
+++ b/modules/search.module
@@ -6,7 +6,7 @@ function search_perm() {
function search_link($type) {
if ($type == "page" && user_access("search content")) {
- $links[] = "<a href=\"module.php?mod=search\">search</a>";
+ $links[] = "<a href=\"module.php?mod=search\">". t("search") ."</a>";
}
return $links ? $links : array();
@@ -49,7 +49,7 @@ function search_page() {
}
else {
$theme->header();
- $theme->box("Access denied", message_access());
+ $theme->box(t("Access denied"), message_access());
$theme->footer();
}
}
diff --git a/modules/search/search.module b/modules/search/search.module
index 7beb1e74c..bb74db3c2 100644
--- a/modules/search/search.module
+++ b/modules/search/search.module
@@ -6,7 +6,7 @@ function search_perm() {
function search_link($type) {
if ($type == "page" && user_access("search content")) {
- $links[] = "<a href=\"module.php?mod=search\">search</a>";
+ $links[] = "<a href=\"module.php?mod=search\">". t("search") ."</a>";
}
return $links ? $links : array();
@@ -49,7 +49,7 @@ function search_page() {
}
else {
$theme->header();
- $theme->box("Access denied", message_access());
+ $theme->box(t("Access denied"), message_access());
$theme->footer();
}
}
diff --git a/modules/user.module b/modules/user.module
index c63d0a370..00efa07ae 100644
--- a/modules/user.module
+++ b/modules/user.module
@@ -143,7 +143,7 @@ function user_access($perm) {
}
}
-function user_mail($subject, $message, $header) {
+function user_mail($mail, $subject, $message, $header) {
// print "<pre>subject: $subject<hr />header: $header<hr />$message</pre>";
mail($mail, $subject, $message, $header);
}
@@ -403,7 +403,7 @@ function drupal_auth($username, $password, $server) {
/*** User features *********************************************************/
function user_login($edit = array()) {
- global $user, $REQUEST_URI;
+ global $user, $REQUEST_URI, $HTTP_REFERER;
if (user_deny("user", $edit["name"])) {
$error = sprintf(t("The name '%s' has been denied access."), $edit["name"]);
@@ -468,10 +468,14 @@ function user_login($edit = array()) {
user_save($user, array("session" => session_id()));
/*
- ** Redirect the user to his personal information page:
+ ** Redirect the user to the page he logged on from or to his personal
+ ** information page if we can detect the referer page:
*/
- header("Location: module.php?mod=user");
+ $url = $HTTP_REFERER ? $HTTP_REFERER : "module.php?mod=user&op=view";
+
+ header("Location: $url");
+
}
else {
watchdog("user", "failed to login for '". $name ."': invalid password");
@@ -517,7 +521,7 @@ function user_logout() {
** Redirect the user to his personal information page:
*/
- header("Location: module.php?mod=user");
+ header("Location: index.php");
}
}
@@ -608,6 +612,7 @@ function user_register($edit = array()) {
** Create new user account, no administrator approval required:
*/
+ user_save("", array("name" => $edit["name"], "pass" => $pass, "init" => $edit["mail"], "mail" => $edit["mail"], "role" => "authenticated user", "status" => 1));
user_mail($edit["mail"], t("user account details"), sprintf(t("%s,\n\nsomoneone signed up for a user account on %s and supplied this e-mail address as their contact. If it wasn't you, just ignore this mail but if it was you, you can now login using the following username and password:\n\n username: %s\n password: %s\n\n\n-- %s team"), $edit["name"], variable_get("site_name", "drupal"), $edit["name"], $pass, variable_get("site_name", "drupal")), "From: $from\nReply-to: $from\nX-Mailer: Drupal\nReturn-path: $from\nErrors-to: $from");
}
diff --git a/modules/user/user.module b/modules/user/user.module
index c63d0a370..00efa07ae 100644
--- a/modules/user/user.module
+++ b/modules/user/user.module
@@ -143,7 +143,7 @@ function user_access($perm) {
}
}
-function user_mail($subject, $message, $header) {
+function user_mail($mail, $subject, $message, $header) {
// print "<pre>subject: $subject<hr />header: $header<hr />$message</pre>";
mail($mail, $subject, $message, $header);
}
@@ -403,7 +403,7 @@ function drupal_auth($username, $password, $server) {
/*** User features *********************************************************/
function user_login($edit = array()) {
- global $user, $REQUEST_URI;
+ global $user, $REQUEST_URI, $HTTP_REFERER;
if (user_deny("user", $edit["name"])) {
$error = sprintf(t("The name '%s' has been denied access."), $edit["name"]);
@@ -468,10 +468,14 @@ function user_login($edit = array()) {
user_save($user, array("session" => session_id()));
/*
- ** Redirect the user to his personal information page:
+ ** Redirect the user to the page he logged on from or to his personal
+ ** information page if we can detect the referer page:
*/
- header("Location: module.php?mod=user");
+ $url = $HTTP_REFERER ? $HTTP_REFERER : "module.php?mod=user&op=view";
+
+ header("Location: $url");
+
}
else {
watchdog("user", "failed to login for '". $name ."': invalid password");
@@ -517,7 +521,7 @@ function user_logout() {
** Redirect the user to his personal information page:
*/
- header("Location: module.php?mod=user");
+ header("Location: index.php");
}
}
@@ -608,6 +612,7 @@ function user_register($edit = array()) {
** Create new user account, no administrator approval required:
*/
+ user_save("", array("name" => $edit["name"], "pass" => $pass, "init" => $edit["mail"], "mail" => $edit["mail"], "role" => "authenticated user", "status" => 1));
user_mail($edit["mail"], t("user account details"), sprintf(t("%s,\n\nsomoneone signed up for a user account on %s and supplied this e-mail address as their contact. If it wasn't you, just ignore this mail but if it was you, you can now login using the following username and password:\n\n username: %s\n password: %s\n\n\n-- %s team"), $edit["name"], variable_get("site_name", "drupal"), $edit["name"], $pass, variable_get("site_name", "drupal")), "From: $from\nReply-to: $from\nX-Mailer: Drupal\nReturn-path: $from\nErrors-to: $from");
}
diff --git a/submit.php b/submit.php
index 8181a0cfe..8741c0b32 100644
--- a/submit.php
+++ b/submit.php
@@ -24,7 +24,7 @@ if (user_access("post content")) {
}
}
else {
- $theme->box("Submit", message_access());
+ $theme->box(t("Submit"), message_access());
}
$theme->footer();