Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
integration
prechecker
Commits
da622b49
Commit
da622b49
authored
Feb 15, 2011
by
Eloy Lafuente
Browse files
Merge branch 'w07_MDL-25778_20_defaultcity' of
git://github.com/skodak/moodle
parents
9aaa767c
9449d0c5
Changes
4
Hide whitespace changes
Inline
Side-by-side
admin/uploaduser.php
View file @
da622b49
...
...
@@ -572,10 +572,6 @@ if ($formdata = $mform->is_cancelled()) {
$user
->
timemodified
=
time
();
$user
->
timecreated
=
time
();
if
(
!
empty
(
$CFG
->
defaultcity
)
and
!
property_exists
(
$user
,
'city'
))
{
$user
->
city
=
$CFG
->
defaultcity
;
}
if
(
isset
(
$user
->
auth
)
&&
empty
(
$user
->
auth
))
{
$user
->
auth
=
'manual'
;
}
...
...
admin/uploaduser_form.php
View file @
da622b49
...
...
@@ -206,10 +206,18 @@ class admin_uploaduser_form2 extends moodleform {
$mform
->
addElement
(
'text'
,
'city'
,
get_string
(
'city'
),
'maxlength="100" size="25"'
);
$mform
->
setType
(
'city'
,
PARAM_MULTILANG
);
$mform
->
setDefault
(
'city'
,
$templateuser
->
city
);
if
(
empty
(
$CFG
->
defaultcity
))
{
$mform
->
setDefault
(
'city'
,
$templateuser
->
city
);
}
else
{
$mform
->
setDefault
(
'city'
,
$CFG
->
defaultcity
);
}
$mform
->
addElement
(
'select'
,
'country'
,
get_string
(
'selectacountry'
),
get_string_manager
()
->
get_list_of_countries
());
$mform
->
setDefault
(
'country'
,
$templateuser
->
country
);
if
(
empty
(
$CFG
->
country
))
{
$mform
->
setDefault
(
'country'
,
$templateuser
->
country
);
}
else
{
$mform
->
setDefault
(
'country'
,
$CFG
->
country
);
}
$mform
->
setAdvanced
(
'country'
);
$choices
=
get_list_of_timezones
();
...
...
auth/db/auth.php
View file @
da622b49
...
...
@@ -358,10 +358,6 @@ class auth_plugin_db extends auth_plugin_base {
echo
"
\t
"
;
print_string
(
'auth_dbreviveduser'
,
'auth_db'
,
array
(
'name'
=>
$user
->
username
,
'id'
=>
$user
->
id
));
echo
"
\n
"
;
}
else
{
if
(
!
empty
(
$CFG
->
defaultcity
)
and
!
property_exists
(
$user
,
'city'
))
{
$user
->
city
=
$CFG
->
defaultcity
;
}
$id
=
$DB
->
insert_record
(
'user'
,
$user
);
// it is truly a new user
echo
"
\t
"
;
print_string
(
'auth_dbinsertuser'
,
'auth_db'
,
array
(
'name'
=>
$user
->
username
,
'id'
=>
$id
));
echo
"
\n
"
;
// if relevant, tag for password generation
...
...
auth/ldap/auth.php
View file @
da622b49
...
...
@@ -490,10 +490,6 @@ class auth_plugin_ldap extends auth_plugin_base {
print_error
(
'auth_ldap_create_error'
,
'auth_ldap'
);
}
if
(
!
empty
(
$CFG
->
defaultcity
)
and
!
property_exists
(
$user
,
'city'
))
{
$user
->
city
=
$CFG
->
defaultcity
;
}
$user
->
id
=
$DB
->
insert_record
(
'user'
,
$user
);
// Save any custom profile field information
...
...
@@ -853,10 +849,6 @@ class auth_plugin_ldap extends auth_plugin_base {
$user
->
lang
=
$CFG
->
lang
;
}
if
(
!
empty
(
$CFG
->
defaultcity
)
and
!
property_exists
(
$user
,
'city'
))
{
$user
->
city
=
$CFG
->
defaultcity
;
}
$id
=
$DB
->
insert_record
(
'user'
,
$user
);
echo
"
\t
"
;
print_string
(
'auth_dbinsertuser'
,
'auth_db'
,
array
(
'name'
=>
$user
->
username
,
'id'
=>
$id
));
echo
"
\n
"
;
if
(
!
empty
(
$this
->
config
->
forcechangepassword
))
{
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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