From: martin Date: Wed, 5 Jun 2002 05:37:55 +0000 (+0000) Subject: Changes to user settings, now it matches the stored data better X-Git-Url: http://git.mjollnir.org/gw?a=commitdiff_plain;h=bda8d43a78a53956e11f0fc7c8243eba9413c104;p=moodle.git Changes to user settings, now it matches the stored data better --- diff --git a/lib/db/mysql.sql b/lib/db/mysql.sql index b9e023138a..195d9fbc9b 100644 --- a/lib/db/mysql.sql +++ b/lib/db/mysql.sql @@ -153,6 +153,7 @@ CREATE TABLE user ( picture tinyint(1) default NULL, url varchar(255) default NULL, description text, + mailformat tinyint(1) unsigned NOT NULL default '1', timemodified int(10) unsigned NOT NULL default '0', PRIMARY KEY (id), UNIQUE KEY username (username), diff --git a/lib/weblib.php b/lib/weblib.php index b21dc31e66..0a695c8652 100644 --- a/lib/weblib.php +++ b/lib/weblib.php @@ -170,11 +170,13 @@ function choose_from_menu ($options, $name, $selected="", $nothing="Choose...", $javascript = "onChange=\"$script\""; } echo " - ( .jpg or .png ) + ( .jpg or .png ) -

Email: - +

Description: + + + + + +

Email address: + -

ICQ Number: +

Email format: + mailformat, "") ?> + + + +

Web address (URL): + + + + + +

ICQ number: -

Phone Number 1: - (private) +

ID Number: + (for the only) + + + + +

Phone number 1: + (for the only) -

Phone Number 2: - (private) +

Phone number 2: + (for the only) -

Address: - (private) +

Street Address: + (for the only) -

Web Address: - - +

City/town: + + -

Description: - +

Country: + country, "Select a country...", "", "") ?> + diff --git a/user/edit.php b/user/edit.php index fc48b756a7..f35f68948b 100644 --- a/user/edit.php +++ b/user/edit.php @@ -1,6 +1,7 @@ Edit profile", ""); } + $teacher = strtolower($course->teacher); + print_simple_box_start("center", "", "$THEME->cellheading"); echo "

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

"; include("edit.html"); @@ -147,6 +150,12 @@ function find_form_errors(&$user, &$usernew, &$err) { if (empty($usernew->email)) $err["email"] = "Missing email address"; + if (empty($usernew->city)) + $err["city"] = "Missing city or town"; + + if (empty($usernew->country)) + $err["country"] = "Missing country"; + else if (! validate_email($usernew->email)) $err["email"] = "Invalid email address, check carefully"; diff --git a/user/index.php b/user/index.php index b9636f2ae3..26df7feb13 100644 --- a/user/index.php +++ b/user/index.php @@ -3,6 +3,7 @@ // Lists all the users within a given course require("../config.php"); + require("../lib/countries.php"); require("lib.php"); require_variable($id); //course @@ -54,6 +55,8 @@ /// FUNCTIONS ////////////////// function print_user($user, $course, $teacherlinks) { + + global $COUNTRIES; echo "
"; echo ""; @@ -69,7 +72,7 @@ function print_user($user, $course, $teacherlinks) { echo ""; echo "$user->firstname $user->lastname"; echo "

Email: email\">$user->email
"; - echo "Location: $user->city, $user->country
"; + echo "Location: $user->city, ".$COUNTRIES["$user->country"]."
"; echo "Last access: ".userdate($user->lastaccess); echo "  (".format_time(time() - $user->lastaccess).")"; echo "

"; diff --git a/user/view.php b/user/view.php index 63903d2eda..3735a39c1c 100644 --- a/user/view.php +++ b/user/view.php @@ -3,6 +3,7 @@ // Display profile for a particular user require("../config.php"); + require("../lib/countries.php"); require("lib.php"); require_variable($id); @@ -78,7 +79,7 @@ echo "city, $user->country"); + print_row("Location:", "$user->city, ".$COUNTRIES["$user->country"]); if (isteacher($course->id)) { if ($user->address) {