--- login/signup_form.php.orig0	2007-05-14 06:39:21.000000000 +0900
+++ login/signup_form.php	2007-05-14 06:45:49.000000000 +0900
@@ -29,11 +29,19 @@
         $mform->setType('email2', PARAM_NOTAGS);
         $mform->addRule('email2', get_string('missingemail'), 'required', null, 'client');
 
-        $mform->addElement('text', 'firstname', get_string('firstname'), 'size="25"');
+	$nameordercheck->firstname = "a";
+	$nameordercheck->lastname  = "b";
+	if ( fullname($nameordercheck) == "b a" ){
+	  $mform->addElement('text', 'lastname', get_string('lastname'), 'size="25"');
+          $mform->addElement('text', 'firstname', get_string('firstname'), 'size="25"');
+        }else{
+          $mform->addElement('text', 'firstname', get_string('firstname'), 'size="25"');
+          $mform->addElement('text', 'lastname', get_string('lastname'), 'size="25"');
+        }
+
         $mform->setType('firstname', PARAM_TEXT);
         $mform->addRule('firstname', get_string('missingfirstname'), 'required', null, 'client');
 
-        $mform->addElement('text', 'lastname', get_string('lastname'), 'size="25"');
         $mform->setType('lastname', PARAM_TEXT);
         $mform->addRule('lastname', get_string('missinglastname'), 'required', null, 'client');
 
--- user/editlib.php.orig0	2007-05-14 06:57:33.000000000 +0900
+++ user/editlib.php	2007-05-14 07:08:53.000000000 +0900
@@ -59,11 +59,19 @@
 
     $strrequired = get_string('required');
 
-    $mform->addElement('text', 'firstname', get_string('firstname'), 'maxlength="100" size="30"');
+    $nameordercheck->firstname = "a";
+    $nameordercheck->lastname  = "b";
+    if ( fullname($nameordercheck) == "b a" ){
+        $mform->addElement('text', 'lastname',  get_string('lastname'),  'maxlength="100" size="30"');
+	$mform->addElement('text', 'firstname', get_string('firstname'), 'maxlength="100" size="30"');
+    }else{
+	$mform->addElement('text', 'firstname', get_string('firstname'), 'maxlength="100" size="30"');
+	$mform->addElement('text', 'lastname',  get_string('lastname'),  'maxlength="100" size="30"');
+    }
+
     $mform->addRule('firstname', $strrequired, 'required', null, 'client');
     $mform->setType('firstname', PARAM_NOTAGS);
 
-    $mform->addElement('text', 'lastname', get_string('lastname'), 'maxlength="100" size="30"');
     $mform->addRule('lastname', $strrequired, 'required', null, 'client');
     $mform->setType('lastname', PARAM_NOTAGS);
 
