summaryrefslogtreecommitdiff
path: root/modules/user/user.module
diff options
context:
space:
mode:
authorDries Buytaert <dries@buytaert.net>2009-10-10 19:54:15 +0000
committerDries Buytaert <dries@buytaert.net>2009-10-10 19:54:15 +0000
commite419a37e843f703d71a320a3e165e42a9e6a127f (patch)
tree5d9535799cb1321ad64193079862399eeaaec9b8 /modules/user/user.module
parentbcd2a1a44fa0b074c792610ccb867af2f0ead5aa (diff)
downloadbrdo-e419a37e843f703d71a320a3e165e42a9e6a127f.tar.gz
brdo-e419a37e843f703d71a320a3e165e42a9e6a127f.tar.bz2
- Patch #525504 by Dave Reid, gpk: anonymous user should not have contact form.
Diffstat (limited to 'modules/user/user.module')
-rw-r--r--modules/user/user.module22
1 files changed, 20 insertions, 2 deletions
diff --git a/modules/user/user.module b/modules/user/user.module
index 1e0afc923..26064f886 100644
--- a/modules/user/user.module
+++ b/modules/user/user.module
@@ -1557,12 +1557,30 @@ function user_menu() {
return $items;
}
+/**
+ * Implement hook_init().
+ */
function user_init() {
drupal_add_css(drupal_get_path('module', 'user') . '/user.css');
}
-function user_uid_optional_load($arg) {
- return user_load(isset($arg) ? $arg : $GLOBALS['user']->uid);
+/**
+ * Load a either a specified or the current user account.
+ *
+ * @param $uid
+ * An optional user ID of the user to load. If not provided, the current
+ * user's ID will be used.
+ * @return
+ * A fully-loaded $user object upon successful user load, FALSE if user
+ * cannot be loaded.
+ *
+ * @see user_load()
+ */
+function user_uid_optional_load($uid = NULL) {
+ if (!isset($uid)) {
+ $uid = $GLOBALS['user']->uid;
+ }
+ return user_load($uid);
}
/**