same nested test removed
[brisk.git] / web / Obj / user.phh
index 5ef9d9c..b3cbf51 100644 (file)
@@ -562,9 +562,17 @@ class User {
       // 4 -> is certified
       // 2 -> is authorized
       // 1 -> is myself
-      $class_id = (($this->flags & USER_FLAG_TY_CERT) >> 16) | ($this->flags & USER_FLAG_AUTH) | 1;
-      
-      return (sprintf('$("myname").innerHTML = "<span class=\"au%d\">%s</span>";', $class_id, 
+      $class_ids = (($this->flags & USER_FLAG_TY_CERT) >> 16) | ($this->flags & USER_FLAG_AUTH) | 1;
+      $sp = "";
+      $cl = "";
+
+      for ($i = 0 ; $i < 3 ; $i++) {
+          if ($class_ids & (1 << $i)) {
+              $cl .= sprintf("%sau%d", $sp, $i);
+              $sp = " ";
+          }
+      }
+      return (sprintf('$("myname").innerHTML = "<span class=\"%s\">%s</span>";', $cl,
                       xcape($this->name,ENT_COMPAT,"UTF-8")));
   }
 
@@ -741,19 +749,16 @@ class User {
                   log_rd2("LOGOUT BYE BYE!!");
                   log_auth($this->sess, "Explicit logout.");
                   
-                  if ($this->the_end == TRUE) {
-                      $this->reset();
-                      
-                      if ($this->subst == 'sitdown') {
-                          log_load("ROOM WAKEUP");
-                          $this->room->room_wakeup($this);
-                      }
-                      else if ($this->subst == 'standup')
-                          $this->room->room_outstandup($this);
-                      else
-                          log_rd2("LOGOUT FROM WHAT ???");
-                      
-                  } /* if ($this->the_end == TRUE) { ... */
+                  $this->reset();
+
+                  if ($this->subst == 'sitdown') {
+                      log_load("ROOM WAKEUP");
+                      $this->room->room_wakeup($this);
+                  }
+                  else if ($this->subst == 'standup')
+                      $this->room->room_outstandup($this);
+                  else
+                      log_rd2("LOGOUT FROM WHAT ???");
               } /* if ($this->the_end == TRUE) { ... */
           } /* if ($this->rd_step < $this->step) { */
       }  /* else of if ($this->rd_step == -1) { */