]> git.mjollnir.org Git - moodle.git/commitdiff
More little fixups for robustness
authormoodler <moodler>
Mon, 30 Dec 2002 05:13:43 +0000 (05:13 +0000)
committermoodler <moodler>
Mon, 30 Dec 2002 05:13:43 +0000 (05:13 +0000)
admin/config.html
admin/site.html
admin/site.php
course/lib.php
lang/en/moodle.php
lib/graphlib.php
lib/weblib.php
mod/forum/lib.php
mod/survey/graph.php
mod/survey/report.php
user/edit.html

index 6403cbba018be32e790ef86df59a31353b2fe2ce..8d7a4b5026eeea44444e4c920c8c0d89bc665351 100644 (file)
@@ -4,9 +4,7 @@
 <TR VALIGN=TOP>
        <TD ALIGN=RIGHT><P>lang:</TD>
        <TD>
-    <? choose_from_menu (get_list_of_languages(), "lang", $config->lang, "", "", "");
-       formerr($err["lang"]);
-    ?>
+    <? choose_from_menu (get_list_of_languages(), "lang", $config->lang, "", "", ""); ?>
     </TD>
     <TD>
     <? print_string("configlang") ?>
@@ -30,7 +28,6 @@
        <TD ALIGN=RIGHT><P>locale:</TD>
        <TD>
     <INPUT NAME=locale TYPE=text SIZE=10 VALUE="<?=$config->locale?>">
-    <? formerr($err["locale"]); ?>
     </TD>
     <TD>
     <? print_string("configlocale") ?>
@@ -48,7 +45,6 @@
        <TD ALIGN=RIGHT><P>smtphosts:</TD>
        <TD>
     <INPUT NAME=smtphosts TYPE=text SIZE=30 VALUE="<?=$config->smtphosts?>">
-    <? formerr($err["smtphosts"]); ?>
     </TD>
     <TD>
     <? print_string("configsmtphosts") ?>
@@ -58,7 +54,6 @@
        <TD ALIGN=RIGHT><P>smtpuser:</TD>
        <TD>
     <INPUT NAME=smtpuser TYPE=text SIZE=10 VALUE="<?=$config->smtpuser?>">
-    <? formerr($err["smtpuser"]); ?>
     </TD>
     <TD ROWSPAN=2>
     <? print_string("configsmtpuser") ?>
@@ -68,7 +63,6 @@
        <TD ALIGN=RIGHT><P>smtppass:</TD>
        <TD>
     <INPUT NAME=smtppass TYPE=text SIZE=10 VALUE="<?=$config->smtppass?>">
-    <? formerr($err["smtppass"]); ?>
     </TD>
 </TR>
 <TR VALIGN=TOP>
@@ -95,7 +89,6 @@
        $options[0] = get_string("allownot");
        $options[1] = get_string("allow");
        choose_from_menu ($options, "htmleditor", $config->htmleditor, "", "", "");
-       formerr($err["htmleditor"]);
     ?>
     </TD>
     <TD>
        <TD ALIGN=RIGHT><P>zip:</TD>
        <TD>
     <INPUT name=zip TYPE=text SIZE=30 VALUE="<?=$config->zip?>">
-    <? formerr($err["zip"]); ?>
     </TD>
     <TD>
     <? print_string("configzip") ?>
        <TD ALIGN=RIGHT><P>unzip:</TD>
        <TD>
     <INPUT name=unzip TYPE=text SIZE=30 VALUE="<?=$config->unzip?>">
-    <? formerr($err["unzip"]); ?>
     </TD>
     <TD>
     <? print_string("configunzip") ?>
        <TD ALIGN=RIGHT><P>proxyhost:</TD>
        <TD>
     <INPUT name=proxyhost TYPE=text SIZE=30 VALUE="<?=$config->proxyhost?>">
-    <? formerr($err["proxyhost"]); ?>
     </TD>
     <TD ROWSPAN=2>
     <? print_string("configproxyhost") ?>
        <TD ALIGN=RIGHT><P>proxyport:</TD>
        <TD>
     <INPUT name=proxyport TYPE=text SIZE=5 VALUE="<?=$config->proxyport?>">
-    <? formerr($err["proxyport"]); ?>
+    </TD>
+</TR>
+<TR VALIGN=TOP>
+       <TD ALIGN=RIGHT><P>debug:</TD>
+       <TD>
+    <? $options[7]  = get_string("no");
+       $options[15] = get_string("yes");
+
+       choose_from_menu ($options, "debug", $config->debug, "", "", "");
+       unset($options);
+    ?>
+    </TD>
+    <TD>
+    <? print_string("configdebug") ?>
     </TD>
 </TR>
 
index ed94e5db5f3548bf0d13f4b5cd2e9675eb072d49..ee691c113fea0d65964033a55de69505104f6261 100644 (file)
@@ -1,16 +1,16 @@
 <FORM METHOD="post" action="site.php" NAME="form">
 <TABLE cellpadding=9 cellspacing=0 >
 <tr valign=top>
-       <td align=right><P><? print_string("fullsitename") ?>:</td>
-       <td><input type="text" name="fullname" size=50 value="<? p($form->fullname) ?>">
-       <? formerr($err["fullname"]) ?>
-       </td>
+    <td align=right><P><? print_string("fullsitename") ?>:</td>
+    <td><input type="text" name="fullname" size=50 value="<? p($form->fullname) ?>">
+    <? if (isset($err["fullname"])) formerr($err["fullname"]); ?>
+    </td>
 </tr>
 <tr valign=top>
-       <td align=right><P><? print_string("shortsitename") ?>:</td>
-       <td><input type="text" name="shortname" size=50 value="<? p($form->shortname) ?>">
-       <? formerr($err["shortname"]) ?>
-       </td>
+    <td align=right><P><? print_string("shortsitename") ?>:</td>
+    <td><input type="text" name="shortname" size=50 value="<? p($form->shortname) ?>">
+    <? if (isset($err["shortname"])) formerr($err["shortname"]); ?>
+    </td>
 </tr>
 <tr valign=top>
     <td align=right><P><? print_string("frontpagedescription") ?>:</P><BR>
@@ -18,7 +18,7 @@
      <? helpbutton("text", get_string("helptext"), "moodle", true, true) ?><br \>
     </td>
     <td><TEXTAREA NAME=summary COLS=50 ROWS=10 WRAP=virtual><? p($form->summary) ?></TEXTAREA>
-    <? formerr($err["summary"]) ?>
+    <? if (isset($err["summary"])) formerr($err["summary"]); ?>
     </td>
 </tr>
 <tr valign=top>
                             "9"  =>  "9 $newsitems",
                             "10" => "10 $newsitems");
            choose_from_menu ($options, "newsitems", "$form->newsitems", "");
-           formerr($err["newsitems"]);
         ?>
         </td>
 </tr>
 <tr>
     <td></td>
-       <td><input type="submit" value="<? print_string("savechanges") ?>"></td>
+    <td><input type="submit" value="<? print_string("savechanges") ?>"></td>
 </tr>
 </TABLE>
 <INPUT type="hidden" name="id" value="<?=$form->id ?>">
index 799471cb9b8dbfbf4b1f207bef867b62b7cf2a9f..201f8f53075151d70e4b33c1073c1d44e8a2bd35 100644 (file)
@@ -1,6 +1,6 @@
 <?PHP // $Id$
 
-       require("../config.php");
+    require("../config.php");
 
     if ($site = get_site()) {
         if (!isadmin()) {
@@ -11,7 +11,7 @@
 
 /// If data submitted, then process and store.
 
-       if (match_referer() && isset($HTTP_POST_VARS)) {
+    if (match_referer() && isset($HTTP_POST_VARS)) {
 
         $form = (object)$HTTP_POST_VARS;
 
@@ -23,7 +23,7 @@
 
             if ($form->id) {
                 if (update_record("course", $form)) {
-                           redirect("index.php", get_string("changessaved"));
+                    redirect("index.php", get_string("changessaved"));
                 } else {
                     error("Serious Error! Could not update the site record! (id = $form->id)");
                 }
@@ -31,7 +31,7 @@
                 if ($newid = insert_record("course", $form)) {
                     $cat->name = get_string("miscellaneous");
                     if (insert_record("course_categories", $cat)) {
-                               redirect("index.php", get_string("changessaved"), "1");
+                        redirect("index.php", get_string("changessaved"), "1");
                     } else {
                         error("Serious Error! Could not set up a default course category!");
                     }
                     error("Serious Error! Could not set up the site!");
                 }
             }
-                   die;
+            die;
 
         } else {
             foreach ($err as $key => $value) {
                 $focus = "form.$key";
             }
         }
-       }
+    }
 
 /// Otherwise fill and print the form.
 
-    if ($site && !$form) {
+    if ($site and empty($form)) {
         $form = $site;
     } else {
         $form->category = 0;
         $form->newsitems = 0;
     }
 
+    if (empty($focus)) {
+        $focus = "form.fullname";
+    }
+
     $stradmin = get_string("administration");
     $strsitesettings = get_string("sitesettings");
 
@@ -66,7 +70,7 @@
 
     print_heading($strsitesettings);
     print_simple_box_start("center", "", "$THEME->cellheading");
-       include("site.html");
+    include("site.html");
     print_simple_box_end();
     print_footer();
 
index d0defb5b7568e7426c2ac50a4c9efd0b46db5760..9eff089bbc77b5cfaa8683a2a5a1d3db63d63891 100644 (file)
@@ -105,6 +105,8 @@ function print_log($course, $user=0, $date=0, $order="ORDER BY l.time ASC") {
 // It is assumed that $date is the GMT time of midnight for that day, 
 // and so the next 86400 seconds worth of logs are printed.
 
+    global $CFG;
+
     if ($course->category) {
         $selector = "WHERE l.course='$course->id' AND l.userid = u.id";
 
@@ -152,7 +154,7 @@ function print_log($course, $user=0, $date=0, $order="ORDER BY l.time ASC") {
         echo "<TD NOWRAP ALIGN=right><FONT SIZE=2>".userdate($log->time, "%A")."</TD>";
         echo "<TD NOWRAP><FONT SIZE=2>".userdate($log->time, "%d %B %Y, %I:%M %p")."</TD>";
         echo "<TD NOWRAP><FONT SIZE=2>";
-        link_to_popup_window("$CFG->wwwroot/lib/ipatlas/plot.php?address=$log->ip&user=$log->userid", "ipatlas","$log->ip", 400, 700);
+        link_to_popup_window("/lib/ipatlas/plot.php?address=$log->ip&user=$log->userid", "ipatlas","$log->ip", 400, 700);
         echo "</TD>";
         echo "<TD NOWRAP><FONT SIZE=2><A HREF=\"../user/view.php?id=$log->userid&course=$log->course\"><B>$log->firstname $log->lastname</B></TD>";
         echo "<TD NOWRAP><FONT SIZE=2>";
@@ -325,7 +327,7 @@ function print_recent_activity($course) {
                     break;
                     case "update mod":
                        $strupdated = get_string("updated", "moodle", get_string("modulename", $info[0]));
-                       if (! $changelist["$log->info"]) {
+                       if (empty($changelist["$log->info"])) {
                            $changelist["$log->info"] = array ("operation" => "update", "text" => "$strupdated:<BR><A HREF=\"$CFG->wwwroot/course/$log->url\">$modname</A>");
                        }
                     break;
@@ -477,6 +479,8 @@ function print_section_block($heading, $course, $section, $mods, $modnames, $mod
         $editmenu = popup_form("$CFG->wwwroot/course/mod.php?id=$course->id&section=0&add=", 
                    $modnames, "section0", "", get_string("add")."...", "mods", get_string("activities"), true);
         $editmenu = "<DIV ALIGN=right>$editmenu</DIV>";
+    } else {
+        $editmenu = "";
     }
 
     print_side_block($heading, "", $moddata, $modicon, $editmenu, $width);
index 8d9c3aa2d5f5d22179c37148fd4d15c778582a04..17d3422359bb9ddc1cdfa39e4826eb919af673e4 100644 (file)
@@ -54,6 +54,7 @@ $string['city'] = "City/town";
 $string['closewindow'] = "Close this window";
 $string['comparelanguage'] = "Compare and edit current language";
 $string['configcountry'] = "If you set a country here, then this country will be selected by default on new user accounts.  To force users to choose a country, just leave this unset.";
+$string['configdebug'] = "If you turn this on, then PHP's error_reporting will be increased so that more warnings are printed.  This is only useful for developers.";
 $string['configgdversion'] = "Indicate the version of GD that is installed.  The version shown by default is the one that has been auto-detected.  Don't change this unless you really know what you're doing.";
 $string['configerrorlevel'] = "Choose the amount of PHP warnings that you want to be displayed.  Normal is usually the best choice.";
 $string['confightmleditor'] = "Choose whether or not to allow use of the embedded HTML text editor. Even if you choose allow, this editor will only appear when the user is using a compatible browser (IE 5.5 or later).  Users can also choose not to use it.";
index 43bcfab6640b579b76ec5e42963400b7ad966a6a..ba75e4d0cff09176d71354d8abad2e6d0feda4cb 100644 (file)
@@ -762,6 +762,12 @@ function init_x_ticks() {
   //print "xStep: $xStep <BR>";\r
   // if numeric x axis then calculate x coords for each data point. this is seperate from x ticks.\r
   $gridX = $gridLeft;\r
+  if (empty($this->calculated['x_axis']['factor'])) {\r
+      $this->calculated['x_axis']['factor'] = 0;\r
+  }\r
+  if (empty($this->calculated['x_axis']['min'])) {\r
+      $this->calculated['x_axis']['min'] = 0;\r
+  }\r
   $factor = $this->calculated['x_axis']['factor'];\r
   $min = $this->calculated['x_axis']['min'];\r
 \r
index ba0e871d388b0870a4ec442aa9071930ea4a2ac5..dfe6b14b243ab6971b37acc19ae78cce5fce1d00 100644 (file)
@@ -981,9 +981,9 @@ function print_date_selector($day, $month, $year, $currenttime=0) {
     for ($i=2000; $i<=2010; $i++) {
         $years[$i] = $i;
     }
-    choose_from_menu($days,   $day,   $currentdate[mday], "");
-    choose_from_menu($months, $month, $currentdate[mon],  "");
-    choose_from_menu($years,  $year,  $currentdate[year], "");
+    choose_from_menu($days,   $day,   $currentdate['mday'], "");
+    choose_from_menu($months, $month, $currentdate['mon'],  "");
+    choose_from_menu($years,  $year,  $currentdate['year'], "");
 }
 
 function print_time_selector($hour, $minute, $currenttime=0) {
@@ -1000,8 +1000,8 @@ function print_time_selector($hour, $minute, $currenttime=0) {
     for ($i=0; $i<=59; $i++) {
         $minutes[$i] = sprintf("%02d",$i);
     }
-    choose_from_menu($hours,   $hour,   $currentdate[hours],   "");
-    choose_from_menu($minutes, $minute, $currentdate[minutes], "");
+    choose_from_menu($hours,   $hour,   $currentdate['hours'],   "");
+    choose_from_menu($minutes, $minute, $currentdate['minutes'], "");
 }
 
 function error ($message, $link="") {
index 690c5ff27d2966c50b0a684b69322e7da9bb0f18..b760e84dbeabcc18dabb987b489a913acd9ece87 100644 (file)
@@ -1326,7 +1326,7 @@ function forum_print_user_discussions($courseid, $userid) {
             if (($discussion->forumtype == "teacher") and !isteacher($courseid)) {
                 continue;
             }
-            if ($replies[$discussion->discussion]) {
+            if (!empty($replies[$discussion->discussion])) {
                 $discussion->replies = $replies[$discussion->discussion]->replies;
             } else {
                 $discussion->replies = 0;
index dabc0874bc98d138e7b2d05908cfadfe4c156149..fb9b70a470d9516294bd6690630540400547ad08 100644 (file)
            $count1[$i] = 0;
            $count2[$i] = 0;
            $indexof[$val] = $i;
+           $stdev1[$i] = 0;
+           $stdev2[$i] = 0;
        }
 
        $aaa = get_records_select("survey_answers", "((survey = $cm->instance) AND (question in ($question->multi)))");
            $studbuckets2[$i] = 0.0;
            $studcount1[$i] = 0;
            $studcount2[$i] = 0;
+           $stdev1[$i] = 0.0;
+           $stdev2[$i] = 0.0;
 
            $subquestions = $question[$i]->multi;   // otherwise next line doesn't work
            $aaa = get_records_select("survey_answers","((survey = $cm->instance) AND (question in ($subquestions)))");
            $studbuckets2[$i] = 0.0;
            $studcount1[$i] = 0;
            $studcount2[$i] = 0;
+           $stdev1[$i] = 0.0;
+           $stdev2[$i] = 0.0;
        }
 
        $aaa = get_records_select("survey_answers", "((survey = $cm->instance) AND (question in ($question->multi)))");
        $graph->y_tick_labels = $options;
 
        if (($maxbuckets1 > 0.0) && ($maxbuckets2 > 0.0)) {
-              $graph->y_order = array('stdev1', 'stdev2', 'answers1', 'answers2', 'studanswers1', 'studanswers2');
+           $graph->y_order = array('stdev1', 'stdev2', 'answers1', 'answers2', 'studanswers1', 'studanswers2');
        } else if ($maxbuckets1 > 0.0) {
            $graph->y_order = array('stdev1', 'answers1', 'studanswers1');
        } else {
index 38cbb42707b8e8f5b665bf17bd6434082d90baae..0a8c6b4d96b324e4db6dec60d77b0d811b9cb62f 100644 (file)
     $strseemoredetail = get_string("seemoredetail", "survey");
     $strnotes = get_string("notes", "survey");
 
-    if (!$action) {
+    if (empty($action)) {
         $display = "summary";
     }
 
-    if ($display)  { // Display the frame containing something.
+    if (!empty($display))  { // Display the frame containing something.
         add_to_log($course->id, "survey", "view report", "report.php?id=$cm->id", "$survey->id");
         echo "<HEAD><TITLE>$course->shortname: $strreport: $survey->name</TITLE>\n";
         echo "<FRAMESET ROWS=70,* BORDER=1> ";
index 8054b3c560dc3c285904638f0b03fbf56e0c59a3..34fc4ec8cab68c337586e598eeee3b18fa951956 100644 (file)
 <?
 if (isadmin()) {
     echo "<tr valign=top>";
-       echo "<td><P>".get_string("username").":</td>";
-       echo "<td><input type=text name=username size=20 value=\"";
+    echo "<td><P>".get_string("username").":</td>";
+    echo "<td><input type=text name=username size=20 value=\"";
     p($user->username);
     echo "\">";
-       if (isset($err["username"])) formerr($err["username"]);
-       echo "</td>";
+    if (isset($err["username"])) formerr($err["username"]);
+    echo "</td>";
     echo "</tr>";
 
     echo "<tr valign=top>";
-       echo "<td><P>".get_string("newpassword").":</td>";
-       echo "<td><input type=text name=newpassword size=20 value=\"";
+    echo "<td><P>".get_string("newpassword").":</td>";
+    echo "<td><input type=text name=newpassword size=20 value=\"";
     if (isset($user->newpassword)) p($user->newpassword);
     echo "\">";
-       if (isset($err["newpassword"])) {
+    if (isset($err["newpassword"])) {
         formerr($err["newpassword"]);
     } else if (empty($user->newpassword)) {
-           echo " (".get_string("leavetokeep").")";
+        echo " (".get_string("leavetokeep").")";
     }
-       echo "</td>";
+    echo "</td>";
     echo "</tr>";
     echo "<tr><td colspan=2><HR></td></tr>";
 }
 ?>
 <tr valign=top>
-       <td><P><? print_string("firstname") ?>:</td>
-       <td><input type="text" name="firstname" size=30 value="<? p($user->firstname) ?>">
-       <? if (isset($err["firstname"])) formerr($err["firstname"]); ?>
-       </td>
+    <td><P><? print_string("firstname") ?>:</td>
+    <td><input type="text" name="firstname" size=30 value="<? p($user->firstname) ?>">
+    <? if (isset($err["firstname"])) formerr($err["firstname"]); ?>
+    </td>
 </tr>
 <tr valign=top>
-       <td><P><? print_string("lastname") ?>:</td>
-       <td><input type="text" name="lastname" size=30 value="<? p($user->lastname) ?>">
-       <? if (isset($err["lastname"])) formerr($err["lastname"]); ?>
-       </td>
+    <td><P><? print_string("lastname") ?>:</td>
+    <td><input type="text" name="lastname" size=30 value="<? p($user->lastname) ?>">
+    <? if (isset($err["lastname"])) formerr($err["lastname"]); ?>
+    </td>
 </tr>
 <tr valign=top>
-       <td><P><? print_string("email") ?>:</td>
-       <td><input type="text" name="email" size=30 value="<? p($user->email) ?>">
-       <? if (isset($err["email"])) formerr($err["email"]); ?>
-       </td>
+    <td><P><? print_string("email") ?>:</td>
+    <td><input type="text" name="email" size=30 value="<? p($user->email) ?>">
+    <? if (isset($err["email"])) formerr($err["email"]); ?>
+    </td>
 </tr>
 <tr valign=top>
-       <td><P><? print_string("emaildisplay") ?>:</td>
-       <td><? 
+    <td><P><? print_string("emaildisplay") ?>:</td>
+    <td><? 
     $choices["0"] = get_string("emaildisplayno");
     $choices["1"] = get_string("emaildisplayyes");
     $choices["2"] = get_string("emaildisplaycourse");
     choose_from_menu ($choices, "maildisplay", $user->maildisplay, "") ?>
-       </td>
+    </td>
 </tr>
 <tr valign=top>
-       <td><P><? print_string("emailformat") ?>:</td>
-       <td><? 
+    <td><P><? print_string("emailformat") ?>:</td>
+    <td><? 
     unset($choices);
     $choices["0"] = get_string("textformat");
     $choices["1"] = get_string("htmlformat");
     choose_from_menu ($choices, "mailformat", $user->mailformat, "") ?>
-       </td>
+    </td>
 </tr>
 <? if ($CFG->htmleditor) { ?>
 <tr valign=top>
-       <td><P><? print_string("textediting") ?>:</td>
-       <td><? 
+    <td><P><? print_string("textediting") ?>:</td>
+    <td><? 
     unset($choices);
     $choices["0"] = get_string("texteditor");
     $choices["1"] = get_string("htmleditor");
     choose_from_menu ($choices, "htmleditor", $user->htmleditor, "") ?>
-       </td>
+    </td>
 </tr>
 <? } ?>
 <tr valign=top>
-       <td><P><? print_string("city") ?>:</td>
-       <td><input type="text" name="city" size=25 value="<? p($user->city) ?>">
-       <? if (isset($err["city"])) formerr($err["city"]); ?>
-       </td>
+    <td><P><? print_string("city") ?>:</td>
+    <td><input type="text" name="city" size=25 value="<? p($user->city) ?>">
+    <? if (isset($err["city"])) formerr($err["city"]); ?>
+    </td>
 </tr>
 <tr valign=top>
-       <td><P><? print_string("country") ?>:</td>
-       <td><? 
+    <td><P><? print_string("country") ?>:</td>
+    <td><? 
 
     if (!$user->country and $CFG->country) {
         $user->country = $CFG->country;
     }
     
     choose_from_menu ($COUNTRIES, "country", $user->country, get_string("selectacountry")."...", "", "") ?>
-       <? if (isset($err["country"])) formerr($err["country"]); ?>
-       </td>
+    <? if (isset($err["country"])) formerr($err["country"]); ?>
+    </td>
 </tr>
 <tr valign=top>
-       <td><P><? print_string("preferredlanguage") ?>:</td>
-       <td><? if ($languages = get_list_of_languages()) {
+    <td><P><? print_string("preferredlanguage") ?>:</td>
+    <td><? if ($languages = get_list_of_languages()) {
                if (!$user->lang) {
                    $user->lang = $CFG->lang;
                }
                choose_from_menu ($languages, "lang", $user->lang, "", "", "");
            }
-              if (isset($err["lang"])) formerr($err["lang"]);
+           if (isset($err["lang"])) formerr($err["lang"]);
         ?>
-       </td>
+    </td>
 </tr>
 <tr valign=top>
-       <td><P><? print_string("timezone") ?>:</td>
-       <td><?
+    <td><P><? print_string("timezone") ?>:</td>
+    <td><?
        if (abs($user->timezone) > 13) {
            $user->timezone = 99;
        }
@@ -126,72 +126,72 @@ if (isadmin()) {
        choose_from_menu ($timezones, "timezone", $user->timezone, get_string("serverlocaltime"), "", "99");
 
        echo "(".get_string("currentlocaltime").")";
-       ?>
+    ?>
     </td>
 </tr>
 <tr valign=top>
-       <td><P><? print_string("userdescription") ?>:</td>
-       <td><? if (isset($err["description"])) {
+    <td><P><? print_string("userdescription") ?>:</td>
+    <td><? if (isset($err["description"])) {
                formerr($err["description"]);
                echo "<BR>";
            } ?>
     <TEXTAREA NAME=description COLS=50 ROWS=10 WRAP=virtual><? p($user->description) ?></TEXTAREA> 
     <? helpbutton("text", get_string("helptext")) ?>
-       </td>
+    </td>
 </tr>
 <tr>
     <td colspan=2><BR><B><? print_string("followingoptional") ?>:</B></td>
 </tr>
 <tr valign=top>
-       <td><P><? print_string("newpicture") ?>:</td>
-       <td>
+    <td><P><? print_string("newpicture") ?>:</td>
+    <td>
     <INPUT type="hidden" name="MAX_FILE_SIZE" value="<? echo get_max_upload_file_size() ?>">
     <input type="file" name="imagefile" size=40>
     <? helpbutton("picture", get_string("helppicture"));
        print_string("maxsize", "", display_size(get_max_upload_file_size())); 
-          if (isset($err["imagefile"])) formerr($err["imagefile"]);
+       if (isset($err["imagefile"])) formerr($err["imagefile"]);
     ?>
-       </td>
+    </td>
 </tr>
 <tr valign=top>
-       <td><P><? print_string("webpage") ?>:</td>
-       <td><input type="text" name="url" size=50 value="<? p($user->url) ?>">
-       <? if (isset($err["url"])) formerr($err["url"]); ?>
-       </td>
+    <td><P><? print_string("webpage") ?>:</td>
+    <td><input type="text" name="url" size=50 value="<? p($user->url) ?>">
+    <? if (isset($err["url"])) formerr($err["url"]); ?>
+    </td>
 </tr>
 <tr valign=top>
-       <td><P><? print_string("icqnumber") ?>:</td>
-       <td><input type="text" name="icq" size=25 value="<? p($user->icq) ?>">
-       <? if (isset($err["icq"])) formerr($err["icq"]); ?>
-       </td>
+    <td><P><? print_string("icqnumber") ?>:</td>
+    <td><input type="text" name="icq" size=25 value="<? p($user->icq) ?>">
+    <? if (isset($err["icq"])) formerr($err["icq"]); ?>
+    </td>
 </tr>
 <tr valign=top>
-       <td><P><? print_string("idnumber") ?>:</td>
-       <td><input type="text" name="idnumber" size=25 value="<? p($user->idnumber) ?>"> <? p($teacheronly) ?>
-       <? if (isset($err["idnumber"])) formerr($err["idnumber"]); ?>
-       </td>
+    <td><P><? print_string("idnumber") ?>:</td>
+    <td><input type="text" name="idnumber" size=25 value="<? p($user->idnumber) ?>"> <? p($teacheronly) ?>
+    <? if (isset($err["idnumber"])) formerr($err["idnumber"]); ?>
+    </td>
 </tr>
 <tr valign=top>
-       <td><P><? print_string("phone") ?> 1:</td>
-       <td><input type="text" name="phone1" size=25 value="<? p($user->phone1) ?>"> <? p($teacheronly) ?>
-       <? if (isset($err["phone1"])) formerr($err["phone1"]); ?>
-       </td>
+    <td><P><? print_string("phone") ?> 1:</td>
+    <td><input type="text" name="phone1" size=25 value="<? p($user->phone1) ?>"> <? p($teacheronly) ?>
+    <? if (isset($err["phone1"])) formerr($err["phone1"]); ?>
+    </td>
 </tr>
 <tr valign=top>
-       <td><P><? print_string("phone") ?> 2:</td>
-       <td><input type="text" name="phone2" size=25 value="<? p($user->phone2) ?>"> <? p($teacheronly) ?>
-       <? if (isset($err["phone2"])) formerr($err["phone2"]); ?>
-       </td>
+    <td><P><? print_string("phone") ?> 2:</td>
+    <td><input type="text" name="phone2" size=25 value="<? p($user->phone2) ?>"> <? p($teacheronly) ?>
+    <? if (isset($err["phone2"])) formerr($err["phone2"]); ?>
+    </td>
 </tr>
 <tr valign=top>
-       <td><P><? print_string("address") ?>:</td>
-       <td><input type="text" name="address" size=25 value="<? p($user->address) ?>"> <? p($teacheronly) ?>
-       <? if (isset($err["address"])) formerr($err["address"]); ?>
-       </td>
+    <td><P><? print_string("address") ?>:</td>
+    <td><input type="text" name="address" size=25 value="<? p($user->address) ?>"> <? p($teacheronly) ?>
+    <? if (isset($err["address"])) formerr($err["address"]); ?>
+    </td>
 </tr>
 <tr>
-       <td></td>
-       <td align=right><input type="submit" value="<? print_string("updatemyprofile") ?>"></td>
+    <td></td>
+    <td align=right><input type="submit" value="<? print_string("updatemyprofile") ?>"></td>
 </TABLE>
 <INPUT type="hidden" name="course" value="<? p($course->id) ?>">
 <INPUT type="hidden" name="id" value="<? p($user->id) ?>">