Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
D
drupal
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Custom Issue Tracker
Custom Issue Tracker
Labels
Merge Requests
292
Merge Requests
292
Requirements
Requirements
List
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Analytics
Analytics
Code Review
Insights
Issue
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
project
drupal
Commits
ddb31aaf
Commit
ddb31aaf
authored
Aug 07, 2004
by
Steven Wittens
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
-
#3606
: Missing translations for user.module watchdog
parent
bdbc34c9
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
20 additions
and
30 deletions
+20
-30
modules/user.module
modules/user.module
+10
-15
modules/user/user.module
modules/user/user.module
+10
-15
No files found.
modules/user.module
View file @
ddb31aaf
...
...
@@ -767,7 +767,7 @@ function user_login($edit = array(), $msg = '') {
if
(
!
$user
->
uid
&&
$server
&&
$result
=
user_get_authmaps
(
"
$name
@
$server
"
))
{
if
(
module_invoke
(
key
(
$result
),
'auth'
,
$name
,
$pass
,
$server
))
{
$user
=
user_external_load
(
"
$name
@
$server
"
);
watchdog
(
'user'
,
"external load:
$name
@
$server
, module: "
.
key
(
$result
));
watchdog
(
'user'
,
t
(
'external load by %user using module "%module".'
,
array
(
'%user'
=>
$name
.
'@'
.
$server
,
'%module'
=>
key
(
$result
))
));
}
else
{
$error
=
t
(
'Invalid password for %s.'
,
array
(
'%s'
=>
"<i>
$name
@
$server
</i>"
));
...
...
@@ -784,7 +784,7 @@ function user_login($edit = array(), $msg = '') {
$account
=
user_load
(
array
(
'name'
=>
"
$name
@
$server
"
));
if
(
!
$account
->
uid
)
{
// Register this new user.
$user
=
user_save
(
''
,
array
(
'name'
=>
"
$name
@
$server
"
,
'pass'
=>
user_password
(),
'init'
=>
"
$name
@
$server
"
,
'status'
=>
1
,
"authname_
$module
"
=>
"
$name
@
$server
"
,
'roles'
=>
array
(
_user_authenticated_id
())));
watchdog
(
'user'
,
"new user:
$name
@
$server
(
$module
ID)"
,
l
(
t
(
'edit'
),
"user/
$user->uid
/edit"
));
watchdog
(
'user'
,
t
(
'new external user: %user using module "%module".'
,
array
(
'%user'
=>
$name
.
'@'
.
$server
,
'%module'
=>
$module
)),
l
(
t
(
'edit'
),
'user/'
.
$user
->
uid
.
'/edit'
));
break
;
}
}
...
...
@@ -794,7 +794,7 @@ function user_login($edit = array(), $msg = '') {
}
if
(
$user
->
uid
)
{
watchdog
(
'user'
,
'session opened for "'
.
$user
->
name
.
'"'
);
watchdog
(
'user'
,
t
(
'session opened for "%user".'
,
array
(
'%user'
=>
$user
->
name
))
);
// Update the user table timestamp noting user has logged in.
db_query
(
"UPDATE
{
users
}
SET changed = '%d' WHERE uid = '%s'"
,
time
(),
$user
->
uid
);
...
...
@@ -813,12 +813,7 @@ function user_login($edit = array(), $msg = '') {
if
(
!
$error
)
{
$error
=
t
(
'Sorry. Unrecognized username or password.'
)
.
' '
.
l
(
t
(
'Have you forgotten your password?'
),
'user/password'
);
}
if
(
$server
)
{
watchdog
(
'user'
,
"failed login for '
$name
@
$server
':
$error
"
);
}
else
{
watchdog
(
'user'
,
"failed login for '
$name
':
$error
"
);
}
watchdog
(
'user'
,
t
(
'login attempt failed for %user: "%error"'
,
array
(
'%user'
=>
$server
?
(
$name
.
'@'
.
$server
)
:
$name
,
'%error'
=>
$error
)));
}
}
...
...
@@ -868,7 +863,7 @@ function user_logout() {
global
$user
;
if
(
$user
->
uid
)
{
watchdog
(
'user'
,
'session closed for "'
.
$user
->
name
.
'"'
);
watchdog
(
'user'
,
t
(
'session closed for %user.'
,
array
(
'%user'
=>
$user
->
name
))
);
// Destroy the current session:
session_destroy
();
...
...
@@ -906,11 +901,11 @@ function user_pass($edit = array()) {
$mail_success
=
user_mail
(
$account
->
mail
,
$subject
,
$body
,
$headers
);
if
(
$mail_success
)
{
watchdog
(
'user'
,
'mail password: "'
.
$account
->
name
.
'" <'
.
$account
->
mail
.
'>'
);
watchdog
(
'user'
,
t
(
'password mailed to %user at %address.'
,
array
(
'%user'
=>
$account
->
name
,
'%address'
=>
$account
->
mail
))
);
return
t
(
'Your password and further instructions have been sent to your e-mail address.'
);
}
else
{
watchdog
(
'error'
,
'error mailing new password: "'
.
$account
->
name
.
'" <'
.
$account
->
mail
.
'>'
);
watchdog
(
'error'
,
t
(
'error mailing password to %user at %address.'
,
array
(
'%user'
=>
$account
->
name
,
'%address'
=>
$account
->
mail
))
);
return
t
(
'Unable to send mail. Please contact the site admin.'
);
}
}
...
...
@@ -949,7 +944,7 @@ function user_register($edit = array()) {
// TODO: Is this necessary? Won't session_write() replicate this?
unset
(
$edit
[
'session'
]);
$account
=
user_save
(
''
,
array
(
'name'
=>
$edit
[
'name'
],
'pass'
=>
$pass
,
'init'
=>
$edit
[
'mail'
],
'mail'
=>
$edit
[
'mail'
],
'roles'
=>
array
(
_user_authenticated_id
()),
'status'
=>
(
variable_get
(
'user_register'
,
1
)
==
1
?
1
:
0
)));
watchdog
(
'user'
,
'new user: "'
.
$edit
[
'name'
]
.
'" <'
.
$edit
[
'mail'
]
.
'>'
,
l
(
t
(
'edit'
),
"user/
$account->uid
/edit"
));
watchdog
(
'user'
,
t
(
'new user: "%user" <%address>.'
,
array
(
'%user'
=>
$edit
[
'name'
],
'%address'
=>
$edit
[
'mail'
])),
l
(
t
(
'edit'
),
'user/'
.
$account
->
uid
.
'/edit'
));
$variables
=
array
(
'%username'
=>
$edit
[
'name'
],
'%site'
=>
variable_get
(
'site_name'
,
'drupal'
),
'%password'
=>
$pass
,
'%uri'
=>
$base_url
,
'%uri_brief'
=>
substr
(
$base_url
,
strlen
(
'http://'
)),
'%mailto'
=>
$edit
[
'mail'
],
'%date'
=>
format_date
(
time
()),
'%login_uri'
=>
url
(
'user/login'
,
NULL
,
NULL
,
TRUE
),
'%edit_uri'
=>
url
(
'user/edit'
,
NULL
,
NULL
,
TRUE
));
...
...
@@ -1084,7 +1079,7 @@ function user_edit($category = 'account') {
if
(
!
form_get_errors
())
{
// Validate input to ensure that non-privileged users can't alter protected data.
if
(
!
user_access
(
'administer users'
)
&&
array_intersect
(
array_keys
(
$edit
),
array
(
'uid'
,
'roles'
,
'init'
,
'session'
)))
{
watchdog
(
'warning'
,
'detected malicious attempt to alter a protected database field'
);
watchdog
(
'warning'
,
t
(
'detected malicious attempt to alter a protected database field.'
)
);
}
else
{
user_save
(
$account
,
$edit
,
$category
);
...
...
@@ -1272,7 +1267,7 @@ function user_admin_create($edit = array()) {
user_module_invoke
(
'validate'
,
$edit
,
$edit
,
'account'
);
if
(
!
form_get_errors
())
{
watchdog
(
'user'
,
'new user: "'
.
$edit
[
'name'
]
.
'" <'
.
$edit
[
'mail'
]
.
'>'
);
watchdog
(
'user'
,
t
(
'new user: "%user" <%address>.'
,
array
(
'%user'
=>
$edit
[
'name'
],
'%address'
=>
$edit
[
'mail'
]))
);
user_save
(
''
,
array
(
'name'
=>
$edit
[
'name'
],
'pass'
=>
$edit
[
'pass'
],
'init'
=>
$edit
[
'mail'
],
'mail'
=>
$edit
[
'mail'
],
'roles'
=>
array
(
_user_authenticated_id
()),
'status'
=>
1
));
...
...
modules/user/user.module
View file @
ddb31aaf
...
...
@@ -767,7 +767,7 @@ function user_login($edit = array(), $msg = '') {
if
(
!
$user
->
uid
&&
$server
&&
$result
=
user_get_authmaps
(
"
$name
@
$server
"
))
{
if
(
module_invoke
(
key
(
$result
),
'auth'
,
$name
,
$pass
,
$server
))
{
$user
=
user_external_load
(
"
$name
@
$server
"
);
watchdog
(
'user'
,
"external load:
$name
@
$server
, module: "
.
key
(
$result
));
watchdog
(
'user'
,
t
(
'external load by %user using module "%module".'
,
array
(
'%user'
=>
$name
.
'@'
.
$server
,
'%module'
=>
key
(
$result
))
));
}
else
{
$error
=
t
(
'Invalid password for %s.'
,
array
(
'%s'
=>
"<i>
$name
@
$server
</i>"
));
...
...
@@ -784,7 +784,7 @@ function user_login($edit = array(), $msg = '') {
$account
=
user_load
(
array
(
'name'
=>
"
$name
@
$server
"
));
if
(
!
$account
->
uid
)
{
// Register this new user.
$user
=
user_save
(
''
,
array
(
'name'
=>
"
$name
@
$server
"
,
'pass'
=>
user_password
(),
'init'
=>
"
$name
@
$server
"
,
'status'
=>
1
,
"authname_
$module
"
=>
"
$name
@
$server
"
,
'roles'
=>
array
(
_user_authenticated_id
())));
watchdog
(
'user'
,
"new user:
$name
@
$server
(
$module
ID)"
,
l
(
t
(
'edit'
),
"user/
$user->uid
/edit"
));
watchdog
(
'user'
,
t
(
'new external user: %user using module "%module".'
,
array
(
'%user'
=>
$name
.
'@'
.
$server
,
'%module'
=>
$module
)),
l
(
t
(
'edit'
),
'user/'
.
$user
->
uid
.
'/edit'
));
break
;
}
}
...
...
@@ -794,7 +794,7 @@ function user_login($edit = array(), $msg = '') {
}
if
(
$user
->
uid
)
{
watchdog
(
'user'
,
'session opened for "'
.
$user
->
name
.
'"'
);
watchdog
(
'user'
,
t
(
'session opened for "%user".'
,
array
(
'%user'
=>
$user
->
name
))
);
// Update the user table timestamp noting user has logged in.
db_query
(
"UPDATE
{
users
}
SET changed = '%d' WHERE uid = '%s'"
,
time
(),
$user
->
uid
);
...
...
@@ -813,12 +813,7 @@ function user_login($edit = array(), $msg = '') {
if
(
!
$error
)
{
$error
=
t
(
'Sorry. Unrecognized username or password.'
)
.
' '
.
l
(
t
(
'Have you forgotten your password?'
),
'user/password'
);
}
if
(
$server
)
{
watchdog
(
'user'
,
"failed login for '
$name
@
$server
':
$error
"
);
}
else
{
watchdog
(
'user'
,
"failed login for '
$name
':
$error
"
);
}
watchdog
(
'user'
,
t
(
'login attempt failed for %user: "%error"'
,
array
(
'%user'
=>
$server
?
(
$name
.
'@'
.
$server
)
:
$name
,
'%error'
=>
$error
)));
}
}
...
...
@@ -868,7 +863,7 @@ function user_logout() {
global
$user
;
if
(
$user
->
uid
)
{
watchdog
(
'user'
,
'session closed for "'
.
$user
->
name
.
'"'
);
watchdog
(
'user'
,
t
(
'session closed for %user.'
,
array
(
'%user'
=>
$user
->
name
))
);
// Destroy the current session:
session_destroy
();
...
...
@@ -906,11 +901,11 @@ function user_pass($edit = array()) {
$mail_success
=
user_mail
(
$account
->
mail
,
$subject
,
$body
,
$headers
);
if
(
$mail_success
)
{
watchdog
(
'user'
,
'mail password: "'
.
$account
->
name
.
'" <'
.
$account
->
mail
.
'>'
);
watchdog
(
'user'
,
t
(
'password mailed to %user at %address.'
,
array
(
'%user'
=>
$account
->
name
,
'%address'
=>
$account
->
mail
))
);
return
t
(
'Your password and further instructions have been sent to your e-mail address.'
);
}
else
{
watchdog
(
'error'
,
'error mailing new password: "'
.
$account
->
name
.
'" <'
.
$account
->
mail
.
'>'
);
watchdog
(
'error'
,
t
(
'error mailing password to %user at %address.'
,
array
(
'%user'
=>
$account
->
name
,
'%address'
=>
$account
->
mail
))
);
return
t
(
'Unable to send mail. Please contact the site admin.'
);
}
}
...
...
@@ -949,7 +944,7 @@ function user_register($edit = array()) {
// TODO: Is this necessary? Won't session_write() replicate this?
unset
(
$edit
[
'session'
]);
$account
=
user_save
(
''
,
array
(
'name'
=>
$edit
[
'name'
],
'pass'
=>
$pass
,
'init'
=>
$edit
[
'mail'
],
'mail'
=>
$edit
[
'mail'
],
'roles'
=>
array
(
_user_authenticated_id
()),
'status'
=>
(
variable_get
(
'user_register'
,
1
)
==
1
?
1
:
0
)));
watchdog
(
'user'
,
'new user: "'
.
$edit
[
'name'
]
.
'" <'
.
$edit
[
'mail'
]
.
'>'
,
l
(
t
(
'edit'
),
"user/
$account->uid
/edit"
));
watchdog
(
'user'
,
t
(
'new user: "%user" <%address>.'
,
array
(
'%user'
=>
$edit
[
'name'
],
'%address'
=>
$edit
[
'mail'
])),
l
(
t
(
'edit'
),
'user/'
.
$account
->
uid
.
'/edit'
));
$variables
=
array
(
'%username'
=>
$edit
[
'name'
],
'%site'
=>
variable_get
(
'site_name'
,
'drupal'
),
'%password'
=>
$pass
,
'%uri'
=>
$base_url
,
'%uri_brief'
=>
substr
(
$base_url
,
strlen
(
'http://'
)),
'%mailto'
=>
$edit
[
'mail'
],
'%date'
=>
format_date
(
time
()),
'%login_uri'
=>
url
(
'user/login'
,
NULL
,
NULL
,
TRUE
),
'%edit_uri'
=>
url
(
'user/edit'
,
NULL
,
NULL
,
TRUE
));
...
...
@@ -1084,7 +1079,7 @@ function user_edit($category = 'account') {
if
(
!
form_get_errors
())
{
// Validate input to ensure that non-privileged users can't alter protected data.
if
(
!
user_access
(
'administer users'
)
&&
array_intersect
(
array_keys
(
$edit
),
array
(
'uid'
,
'roles'
,
'init'
,
'session'
)))
{
watchdog
(
'warning'
,
'detected malicious attempt to alter a protected database field'
);
watchdog
(
'warning'
,
t
(
'detected malicious attempt to alter a protected database field.'
)
);
}
else
{
user_save
(
$account
,
$edit
,
$category
);
...
...
@@ -1272,7 +1267,7 @@ function user_admin_create($edit = array()) {
user_module_invoke
(
'validate'
,
$edit
,
$edit
,
'account'
);
if
(
!
form_get_errors
())
{
watchdog
(
'user'
,
'new user: "'
.
$edit
[
'name'
]
.
'" <'
.
$edit
[
'mail'
]
.
'>'
);
watchdog
(
'user'
,
t
(
'new user: "%user" <%address>.'
,
array
(
'%user'
=>
$edit
[
'name'
],
'%address'
=>
$edit
[
'mail'
]))
);
user_save
(
''
,
array
(
'name'
=>
$edit
[
'name'
],
'pass'
=>
$edit
[
'pass'
],
'init'
=>
$edit
[
'mail'
],
'mail'
=>
$edit
[
'mail'
],
'roles'
=>
array
(
_user_authenticated_id
()),
'status'
=>
1
));
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment