From 8553b7005a546eb325ddb89eabcff69ada4aba68 Mon Sep 17 00:00:00 2001 From: martin Date: Thu, 11 Jul 2002 05:30:57 +0000 Subject: [PATCH] Changes related to internationalision strings and printing them --- index.php | 2 +- lang/en/strings.php | 83 +++++++++++++++++++++++++++++-- lib/weblib.php | 34 +++---------- login/change_password.php | 21 ++++---- login/change_password_form.html | 20 ++++---- login/confirm.php | 21 ++++---- login/forgot_password.php | 52 ++++++++----------- login/forgot_password_change.html | 15 ------ login/forgot_password_form.html | 17 ++----- login/index.php | 3 +- login/index_confirm.html | 3 -- login/index_form.html | 4 -- login/signup.php | 60 ++++++++++------------ login/signup_confirm.html | 19 ------- login/signup_form.php | 42 +++++++--------- user/edit.html | 50 +++++++++---------- user/edit.php | 26 +++++----- 17 files changed, 233 insertions(+), 239 deletions(-) delete mode 100644 login/forgot_password_change.html delete mode 100644 login/signup_confirm.html diff --git a/index.php b/index.php index aa6ba51e66..c455013755 100644 --- a/index.php +++ b/index.php @@ -6,7 +6,7 @@ include("mod/reading/lib.php"); include("mod/forum/lib.php"); - if (! $site = get_record("course", "category", 0)) { + if (! $site = get_site()) { redirect("$CFG->wwwroot/admin/"); } diff --git a/lang/en/strings.php b/lang/en/strings.php index edf662201b..768efbcc4d 100644 --- a/lang/en/strings.php +++ b/lang/en/strings.php @@ -4,24 +4,54 @@ $string[address] = "Address"; $string[admin] = "Admin"; $string[adminpage] = "Admin page"; +$string[again] = "again"; $string[alllogs] = "All logs"; +$string[allfieldsrequired] = "All fields are required"; +$string[alphanumerical] = "Can only contain alphabetical letters or numbers"; +$string[alreadyconfirmed] = "Registration has already been confirmed"; $string[availablecourses] = "Available Courses"; +$string[changepassword] = "Change password"; +$string[changedpassword] = "Changed password"; $string[city] = "City/town"; +$string[confirmed] = "Your registration has been confirmed"; $string[contributions] = "Contributions"; $string[country] = "Country"; $string[course] = "Course"; $string[courses] = "Courses"; +$string[createaccount] = "Create my new account"; $string[currentlocaltime] = "your current local time"; $string[delete] = "Delete"; $string[editmyprofile] = "Edit my profile"; -$string[email] = "Email"; +$string[email] = "Email address"; $string[emailformat] = "Email format"; +$string[emailconfirm] = "Confirm your account"; $string[emailconfirmsent] = "

An email should have been sent to your address at \$a

It contains easy instructions to complete your registration.

If you continue to have difficulty, contact the site administrator."; +$string[emailconfirmation] = "Hi \$a->firstname, +A new account has been requested at '\$a->sitename' +using your email address. + +To confirm your new account, please go to the +following web address: + + \$a->link + +In most mail programs, this should appear as a blue link +which you can just click on. If that doesn't work, +then cut and paste the address into the address +line at the top of your web browser window. + +Cheers from the '\$a->sitename' administrator, +\$a->admin"; + +$string[emailexists] = "This email address is already registered."; $string[entercourse] = "Click to enter this course"; +$string[enteremailaddress] = "Enter in your email address to reset your + password and have the new password sent to you via email."; +$string[firstname] = "First name"; $string[firsttime] = "Is this your first time here?"; $string[forgotten] = "Forgotten your username or password?"; $string[fullprofile] = "Full profile"; @@ -30,7 +60,9 @@ $string[htmlformat] = "Pretty HTML format"; $string[icqnumber] = "ICQ number"; $string[idnumber] = "ID number"; $string[invalidlogin] = "Invalid login, please try again"; +$string[invalidemail] = "Invalid email address"; $string[lastaccess] = "Last access"; +$string[lastname] = "Last name"; $string[location] = "Location"; $string[loggedinas] = "You are logged in as \$a."; $string[loggedinnot] = "You are not logged in."; @@ -39,9 +71,8 @@ $string[loginas] = "Login as"; $string[loginguest] = "Login as a guest"; $string[loginsite] = "Login to the site"; $string[loginusing] = "Login using your username and password"; -$string[loginsteps] = " - Hi! For full access to courses you'll need to take a minute to create - a new account for yourself on this web site. +$string[loginsteps] = "Hi! For full access to courses you'll need to take + a minute to create a new account for yourself on this web site. Each of the individual courses may also have a one-time "enrolment key", which you won't need until later. Here are the steps: @@ -60,13 +91,53 @@ $string[loginsteps] = " "; $string[logout] = "Logout"; $string[mainmenu] = "Main menu"; +$string[missingcity] = "Missing city/town"; +$string[missingcountry] = "Missing country"; +$string[missingemail] = "Missing email address"; +$string[missingfirstname] = "Missing first name"; +$string[missinglastname] = "Missing last name"; +$string[missingnewpassword] = "Missing new password"; +$string[missingpassword] = "Missing password"; +$string[missingusername] = "Missing username"; $string[movedown] = "Move down"; $string[moveup] = "Move up"; $string[mustconfirm] = "You need to confirm your login"; +$string[newaccount] = "New account"; +$string[newpassword] = "New password"; +$string[newpasswordtext] = "Hi \$a->firstname, + +Your account password at '\$a->sitename' has been reset +and you have been issued with a new temporary password. + +Your current login information is now: + username: \$a->username + password: \$a->newpassword + +Please go to this page to change your password: + \$a->link + +In most mail programs, this should appear as a blue link +which you can just click on. If that doesn't work, +then cut and paste the address into the address +line at the top of your web browser window. + +Cheers from the '\$a->sitename' administrator, +\$a->signoff\n"; + $string[newpicture] = "New picture"; +$string[nosuchemail] = "No such email address"; $string[notenrolled] = "\$a is not enrolled in this course."; +$string[ok] = "OK"; $string[participants] = "Participants"; $string[password] = "Password"; +$string[passwordchanged] = "Password has been changed"; +$string[passwordsdiffer] = "These passwords do not match"; +$string[passwordsent] = "Password has been sent"; +$string[passwordsenttext] = " +

An email has been sent to your address at \$a->email. +

Please check your email for your new password +

The new password was automatically generated, so you might like to + link>change it to something easier to remember."; $string[personalprofile] = "Personal profile"; $string[phone] = "Phone"; $string[returningtosite] = "Returning to this web site?"; @@ -81,6 +152,7 @@ $string[startsignup] = "Start now by creating a new account!"; $string[teacheronly] = "for the \$a only"; $string[textformat] = "Plain text format"; $string[timezone] = "Timezone"; +$string[thanks] = "Thanks"; $string[todaylogs] = "Today's logs"; $string[unenrol] = "Unenrol"; $string[unenrolme] = "Unenrol me from \$a"; @@ -88,6 +160,9 @@ $string[update] = "Update"; $string[updatemyprofile] = "Update my profile"; $string[userdescription] = "Description"; $string[username] = "Username"; +$string[usernameexists] = "This username already exists, choose another"; +$string[userprofilefor] = "User profile for \$a"; $string[webpage] = "Web page"; +$string[wrongpassword] = "Incorrect password for this username"; ?> diff --git a/lib/weblib.php b/lib/weblib.php index 2efda8dd98..376a821f27 100644 --- a/lib/weblib.php +++ b/lib/weblib.php @@ -6,29 +6,7 @@ // // -function nvl(&$var, $default="") { -// if $var is undefined, return $default, otherwise return $var - - return isset($var) ? $var : $default; -} - -function ov(&$var) { -// returns $var with the HTML characters (like "<", ">", etc.) properly quoted, -// or if $var is undefined, will return an empty string. note this function -// must be called with a variable, for normal strings or functions use o() - - return isset($var) ? htmlSpecialChars(stripslashes($var)) : ""; -} - -function pv(&$var) { -// prints $var with the HTML characters (like "<", ">", etc.) properly quoted, -// or if $var is undefined, will print an empty string. note this function -// must be called with a variable, for normal strings or functions use p() - - echo isset($var) ? htmlSpecialChars(stripslashes($var)) : ""; -} - -function o($var) { +function s($var) { // returns $var with HTML characters (like "<", ">", etc.) properly quoted, // or if $var is empty, will return an empty string. @@ -42,6 +20,11 @@ function p($var) { echo empty($var) ? "" : htmlSpecialChars(stripslashes($var)); } +function nvl(&$var, $default="") { +// if $var is undefined, return $default, otherwise return $var + + return isset($var) ? $var : $default; +} function strip_querystring($url) { // takes a URL and returns it without the querystring portion @@ -56,11 +39,10 @@ function strip_querystring($url) { function get_referer() { // returns the URL of the HTTP_REFERER, less the querystring portion - $HTTP_REFERER = getenv("HTTP_REFERER"); - return strip_querystring(nvl($HTTP_REFERER)); + $HTTP_REFERER = getenv("HTTP_REFERER"); + return strip_querystring(nvl($HTTP_REFERER)); } - function me() { // returns the name of the current script, WITH the querystring portion. // this function is necessary because PHP_SELF and REQUEST_URI and PATH_INFO diff --git a/login/change_password.php b/login/change_password.php index c3d601ae99..8181b73c20 100644 --- a/login/change_password.php +++ b/login/change_password.php @@ -28,8 +28,9 @@ reset_login_count(); - print_header("Changed password", "Password changed successfully", "Changed Password", ""); - notice("Password changed successfully", "$CFG->wwwroot/course/"); + $passwordchanged = get_string("passwordchanged"); + print_header($passwordchanged, $passwordchanged, $passwordchanged, ""); + notice($passwordchanged, "$CFG->wwwroot/course/"); print_footer(); exit; } @@ -46,8 +47,8 @@ $focus = "form.username"; } - - print_header("Change password", "Change Password", "Change Password", "$focus"); + $changepassword = get_string("changepassword"); + print_header($changepassword, $changepassword, $changepassword, $focus); print_simple_box_start("center", "", $THEME->cellheading); include("change_password_form.html"); print_simple_box_end(); @@ -62,22 +63,22 @@ function validate_form($frm, &$err) { if (empty($frm->username)) - $err->username = "Missing username"; + $err->username = get_string("missingusername"); else if (empty($frm->password)) - $err->password = "Missing password"; + $err->password = get_string("missingpassword"); else if (!verify_login($frm->username, $frm->password)) - $err->password = "Incorrect password for this username"; + $err->password = get_string("wrongpassword"); if (empty($frm->newpassword1)) - $err->newpassword1 = "Missing new password"; + $err->newpassword1 = get_string("missingnewpassword"); if (empty($frm->newpassword2)) - $err->newpassword2 = "Missing new password"; + $err->newpassword2 = get_string("missingnewpassword"); else if ($frm->newpassword1 <> $frm->newpassword2) - $err->newpassword2 = "Passwords not the same"; + $err->newpassword2 = get_string("passwordsdiffer"); return; } diff --git a/login/change_password_form.html b/login/change_password_form.html index e66953c403..cf52bd918f 100644 --- a/login/change_password_form.html +++ b/login/change_password_form.html @@ -1,33 +1,33 @@ -

All fields are required

+

- - + - - + - - + - - + - +

Username:

+

:

username) ?>

Password:

+

:

password) ?>

New Password:

+

:

newpassword1) ?>

New Password (again):

+

():

newpassword2) ?>
">
diff --git a/login/confirm.php b/login/confirm.php index 27a9ca490f..869f2bea82 100644 --- a/login/confirm.php +++ b/login/confirm.php @@ -10,10 +10,10 @@ if ($user->username == $s) { if ($user->confirmed) { - print_header("Registration already confirmed", "Already confirmed", "Confirmed", ""); - echo "

Thanks, ". $USER->firstname ." ". $USER->lastname . "

\n"; - echo "

Your registration has already been confirmed.

\n"; - echo "

wwwroot/course/\">Proceed to the courses

\n"; + print_header(get_string("alreadyconfirmed"), get_string("alreadyconfirmed"), "", ""); + echo "

".get_string("thanks").", ". $USER->firstname ." ". $USER->lastname . "

\n"; + echo "

".get_string("alreadyconfirmed")."

\n"; + echo "

wwwroot/course/\">".get_string("courses")."

\n"; print_footer(); exit; } @@ -25,7 +25,9 @@ $rs = $db->Execute("UPDATE user SET confirmed=1, lastIP='$REMOTE_ADDR', firstaccess='$timenow', lastaccess='$timenow' WHERE id = '$USER->id' "); - if (!$rs) error("Could not update this user while confirming"); + if (!$rs) { + error("Could not update this user while confirming"); + } set_moodle_cookie($USER->username); @@ -37,11 +39,12 @@ redirect("$goto"); } - print_header("Registration confirmed", "Confirmed", "Confirmed", ""); - echo "

Thanks, ". $USER->firstname ." ". $USER->lastname . "

\n"; - echo "

Your registration is now confirmed.

\n"; - echo "

wwwroot/course/\">Show me the courses

\n"; + print_header(get_string("confirmed"), get_string("confirmed"), "", ""); + echo "

".get_string("thanks").", ". $USER->firstname ." ". $USER->lastname . "

\n"; + echo "

".get_string("confirmed")."

\n"; + echo "

wwwroot/course/\">".get_string("courses")."

\n"; print_footer(); + } else { error("Invalid confirmation data"); } diff --git a/login/forgot_password.php b/login/forgot_password.php index bcf0c0a91d..3a10783bab 100644 --- a/login/forgot_password.php +++ b/login/forgot_password.php @@ -21,8 +21,13 @@ } reset_login_count(); - print_header("Password has been sent", "Password has been sent", "Password Sent", ""); - include("forgot_password_change.html"); + print_header(get_string("passwordsent"), get_string("passwordsent"), get_string("passwordsent")); + echo "
"; + $a->email = $frm->email; + $a->link = "$CFG->wwwroot/login/change_password.php"; + print_string("passwordsenttext", "", $a); + echo "
"; + print_footer(); exit; } } @@ -33,9 +38,11 @@ } } - print_header("Email your login details", "Email your login details", "wwwroot/login\">Login -> Email username and password", "form.email"); - + print_header(get_string("senddetails"), get_string("senddetails"), + "wwwroot/login\">".get_string("login")." -> ".get_string("senddetails"), + "form.email"); include("forgot_password_form.html"); + print_footer(); /****************************************************************************** @@ -45,13 +52,13 @@ function validate_form($frm, &$err) { if (empty($frm->email)) - $err->email = "Missing email address"; + $err->email = get_string("missingemail"); else if (! validate_email($frm->email)) - $err->email = "Invalid email address"; + $err->email = get_string("invalidemail"); else if (! record_exists("user", "email", $frm->email)) - $err->email = "No such email address on file"; + $err->email = get_string("nosuchemail"); } @@ -69,34 +76,19 @@ function reset_password_and_mail($user) { error("Could not set user password!"); } - $message = "Hi $user->firstname,\n\n"; - - $message .= "Your account password at '$site->fullname' has been reset\n"; - $message .= "and you have been issued with a new temporary password.\n\n"; - - $message .= "Your current login information is now:\n\n"; - - $message .= " username: $user->username\n"; - $message .= " password: $newpassword\n\n"; - - $message .= "Please go to this page to change your password:\n\n"; + $a->firstname = $user->firstname; + $a->sitename = $site->fullname; + $a->username = $user->username; + $a->newpassword = $newpassword; + $a->link = "$CFG->wwwroot/login/change_password.php"; + $a->signoff = "$from->firstname $from->lastname ($from->email)"; - $message .= "$CFG->wwwroot/login/change_password.php\n\n"; + $message = get_string("newpasswordtext", "", $a); - $message .= "In most mail programs, this should appear as a blue link\n"; - $message .= "which you can just click on. If that doesn't work, \n"; - $message .= "then cut and paste the address into the address\n"; - $message .= "line at the top of your web browser window.\n\n"; - - $message .= "Cheers from the '$site->fullname' administrator,\n"; - $message .= "$from->firstname $from->lastname ($from->email)\n"; - - $subject = "$site->fullname: Changed password"; + $subject = "$site->fullname: ".get_string("changedpassword"); return email_to_user($user, $from, $subject, $message); } - - ?> diff --git a/login/forgot_password_change.html b/login/forgot_password_change.html deleted file mode 100644 index bff2199e6b..0000000000 --- a/login/forgot_password_change.html +++ /dev/null @@ -1,15 +0,0 @@ -
- -

An email has been sent to your address at email) ?>

- -

Please check your email for your new password - -

The new password was automatically generated, so you might like to - change it to something easier to remember. -

- -
-
-

Home

- - diff --git a/login/forgot_password_form.html b/login/forgot_password_form.html index 93bacaae6a..8a1b2d2ae2 100644 --- a/login/forgot_password_form.html +++ b/login/forgot_password_form.html @@ -1,25 +1,20 @@
-

Enter in your email address to reset your password, and - have the new password sent to you via email. - -

Otherwise, you can return to the - login screen or the - home page now. +

- - + -
Email: + : email); ?>
+ ">
@@ -28,7 +23,3 @@
-
-
-

Home

- diff --git a/login/index.php b/login/index.php index ab73b0b7a2..0319c998e1 100644 --- a/login/index.php +++ b/login/index.php @@ -30,6 +30,7 @@ if (! $user->confirmed ) { // they never confirmed via email print_header(get_string("mustconfirm"), get_string("mustconfirm") ); include("index_confirm.html"); + print_footer(); die; } @@ -79,8 +80,8 @@ $loginsite = get_string("loginsite"); print_header($loginsite, $loginsite, get_string("login"), $focus); - include("index_form.html"); + print_footer(); exit; diff --git a/login/index_confirm.html b/login/index_confirm.html index e3327aaf04..e7700b6760 100644 --- a/login/index_confirm.html +++ b/login/index_confirm.html @@ -1,7 +1,4 @@

email) ?> -
-

-
diff --git a/login/index_form.html b/login/index_form.html index 89ad7e5cd2..18a61b2c9c 100644 --- a/login/index_form.html +++ b/login/index_form.html @@ -69,7 +69,3 @@ - -
-
-

diff --git a/login/signup.php b/login/signup.php index ada95adcc1..5e381dbc54 100644 --- a/login/signup.php +++ b/login/signup.php @@ -22,8 +22,10 @@ error("Tried to send you an email but failed!"); } - print_header("Check your email", "Check your email", "Confirm", ""); - include("signup_confirm.html"); + $emailconfirm = get_string("emailconfirm"); + print_header($emailconfirm, $emailconfirm, $emailconfirm); + print_string("emailconfirmsent", "", $user->email); + print_footer(); exit; } } @@ -34,10 +36,12 @@ } } - print_header("New account", "New account", - "Login -> New Account", $focus); + $newaccount = get_string("newaccount"); + $login = get_string("login"); + print_header($newaccount, $newaccount, "$login -> $newaccount", $focus); include("signup_form.php"); + print_footer(); @@ -48,43 +52,43 @@ function validate_form($user, &$err) { if (empty($user->username)) - $err->username = "Missing username"; + $err->username = get_string("missingusername"); else if (record_exists("user", "username", $user->username)) - $err->username = "This username already exists, choose another"; + $err->username = get_string("usernameexists"); else { $string = eregi_replace("[^([:alnum:])]", "", $user->username); if (strcmp($user->username, $string)) - $err->username = "Must only contain alphabetical characters"; + $err->username = get_string("alphanumerical"); } if (empty($user->password)) - $err->password = "Missing password"; + $err->password = get_string("missingpassword"); if (empty($user->firstname)) - $err->firstname = "Missing first name"; + $err->firstname = get_string("missingfirstname"); if (empty($user->lastname)) - $err->lastname = "Missing last name"; + $err->lastname = get_string("missinglastname"); if (empty($user->email)) - $err->email = "Missing email address"; + $err->email = get_string("missingemail"); else if (! validate_email($user->email)) - $err->email = "Invalid email address, check carefully"; + $err->email = get_string("invalidemail"); else if (record_exists("user", "email", $user->email)) - $err->email = "Email address already registered. New password?"; + $err->email = get_string("emailexists")."".get_string("newpassword").""; if (empty($user->city)) - $err->city = "Missing city"; + $err->city = get_string("missingcity"); if (empty($user->country)) - $err->country = "Missing country"; + $err->country = get_string("missingcountry"); return; } @@ -94,28 +98,16 @@ function send_confirmation_email($user) { global $CFG; - $site = get_site(); + $site = get_site(); $from = get_admin(); - $message = "Hi $user->firstname,\n\n"; + $data->firstname = $user->firstname; + $data->sitename = $site->fullname; + $data->link = "$CFG->wwwroot/login/confirm.php?x=$user->id&s=$user->username"; + $data->admin = "$from->firstname $from->lastname ($from->email)"; - $message .= "A new account has been requested at '$site->fullname'\n"; - $message .= "using your email address.\n\n"; - - $message .= "To confirm your new account, please go to the \n"; - $message .= "following web address:\n\n"; - - $message .= "$CFG->wwwroot/login/confirm.php?x=$user->id&s=$user->username\n\n"; - - $message .= "In most mail programs, this should appear as a blue link\n"; - $message .= "which you can just click on. If that doesn't work, \n"; - $message .= "then cut and paste the address into the address\n"; - $message .= "line at the top of your web browser window.\n\n"; - - $message .= "Cheers from the '$site->fullname' administrator,\n"; - $message .= "$from->firstname $from->lastname ($from->email)\n"; - - $subject = "$site->fullname account confirmation"; + $message = get_string("emailconfirmation", "", $data); + $subject = "$site->fullname account confirmation"; return email_to_user($user, $from, $subject, $message); diff --git a/login/signup_confirm.html b/login/signup_confirm.html deleted file mode 100644 index a4a8203c29..0000000000 --- a/login/signup_confirm.html +++ /dev/null @@ -1,19 +0,0 @@ -
- -

Thanks, firstname) ?>

-

Your new account is almost finished

- -

Please check your email!

- -

-An email has been sent to your address at email) ?> - -

-

-It contains easy instructions to confirm your new account. -

- -
-
-

Home

- diff --git a/login/signup_form.php b/login/signup_form.php index 1acfe5d87a..b3f933786e 100644 --- a/login/signup_form.php +++ b/login/signup_form.php @@ -7,14 +7,14 @@

Create a new username and password to log in with: -

New username: - +

: + username) ?> -

New password: - +

: + password) ?> @@ -22,56 +22,52 @@

Please supply some information about yourself:
(Note: your email address must be a real one)

-

Email address: - +

: + email) ?> -

First name: - +

: + firstname) ?> -

Last name: - +

: + lastname) ?> -

ID Number: - (optional) +

: + (optional) idnumber) ?> -

Phone number: - (optional) +

: + (optional) phone) ?> -

City or town: - +

: + city) ?> -

Country: - country, "Select a country...", "", "") ?> +

: + country, get_string("selectacountry"), "", "") ?> country) ?> - + "> -


-
-

Home

- diff --git a/user/edit.html b/user/edit.html index 5718a6cedc..f2e2b74f4d 100644 --- a/user/edit.html +++ b/user/edit.html @@ -1,7 +1,7 @@
- + - - + - - + - + - - + - - + - - + - - + - - + - - + - - + - + - + - +

:

:

( .jpg / .png ) @@ -9,19 +9,19 @@

:

+

:

:

+

:

:

:

:

+

:

:

+

:

:

+

:

1:

+

1:

2:

+

2:

:

+

:

:

+

:

:

:

country, get_string("selectacountry")."...", "", "") ?>

:

:

timezone) > 12) { $user->timezone = 99; @@ -104,8 +104,8 @@
">">
- - + +
diff --git a/user/edit.php b/user/edit.php index 343899b273..0d36c886b7 100644 --- a/user/edit.php +++ b/user/edit.php @@ -123,26 +123,28 @@ /// Otherwise fill and print the form. + $editmyprofile = get_string("editmyprofile"); + $participants = get_string("participants"); + if ($course->category) { - print_header("Edit user profile", "Edit user profile", + print_header($editmyprofile, $editmyprofile, "wwwroot/course/view.php?id=$course->id\">$course->shortname - -> id\">Participants + -> id\">$participants -> id&course=$course->id\">$USER->firstname $USER->lastname - -> Edit profile", ""); + -> $editmyprofile", ""); } else { - print_header("Edit user profile", "Edit user profile", + print_header($editmyprofile, $editmyprofile, "id&course=$course->id\">$USER->firstname $USER->lastname - -> Edit profile", ""); + -> $editmyprofile", ""); } $teacher = strtolower($course->teacher); $teacheronly = "(".get_string("teacheronly", "", $teacher).")"; print_simple_box_start("center", "", "$THEME->cellheading"); - echo "

User profile for $user->firstname $user->lastname

"; + print_heading( get_string("userprofilefor", "", "$user->firstname $user->lastname") ); include("edit.html"); print_simple_box_end(); - print_footer($course); @@ -153,20 +155,20 @@ function find_form_errors(&$user, &$usernew, &$err) { if (empty($usernew->email)) - $err["email"] = "Missing email address"; + $err["email"] = get_string("missingemail"); if (empty($usernew->city)) - $err["city"] = "Missing city or town"; + $err["city"] = get_string("missingcity"); if (empty($usernew->country)) - $err["country"] = "Missing country"; + $err["country"] = get_string("missingcountry"); else if (! validate_email($usernew->email)) - $err["email"] = "Invalid email address, check carefully"; + $err["email"] = get_string("invalidemail"); else if ($otheruser = get_record("user", "email", $usernew->email)) { if ($otheruser->id <> $user->id) { - $err["email"] = "Email address already in use by someone else."; + $err["email"] = get_string("emailexists"); } } -- 2.39.5