var $rd_scristp; // current script step (for each session)
var $rd_kalive; // if no message are sent after RD_KEEPALIVE_TOUT secs we send a keepalive from server
var $rd_cache; // place where store failed fwrite data
+ var $rd_toflush; // bool to inform about unfflushed socket
var $rd_zls; // zlibstream object handle if compressed stream, else FALSE
var $rd_transp; // class that define stream encapsulation type (iframe, xhr, ...)
var $rd_is_chunked; // is the transport chunked or not ?
$thiz->rd_scristp = -1;
$thiz->rd_kalive = -1;
$thiz->rd_cache = "";
+ $thiz->td_toflush = FALSE;
$thiz->rd_zls = FALSE;
$thiz->rd_transp = NULL;
$thiz->rd_is_chunked = FALSE;
return ($thiz);
}
+ function is_auth()
+ {
+ return ($this->flags & USER_FLAG_AUTH);
+ }
+
+ function is_cert()
+ {
+ return (($this->flags & USER_FLAG_AUTH) && ($this->flags & USER_FLAG_TY_CERT));
+ }
+
function flags_set($flags, $mask)
{
$flags_old = $this->flags & (~$mask);
function myname_innerHTML()
{
- $class_id = ($this->flags & USER_FLAG_AUTH) + 1;
-
- return (sprintf('$("myname").innerHTML = "<span class=\"au%d\">%s</span>";', $class_id,
+ // 4 -> is certified
+ // 2 -> is authorized
+ // 1 -> is myself
+ $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")));
}
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) { */