function TableColumn($name, $title, $attrs = "", $fname = null) { $this->name = $name; $this->title = $title; $allowed_attrs = array('align', 'width', 'icon', 'link', 'sort', 'append', 'type', 'embedlink', 'flag', 'skill_change', 'heatmap'); parse_str($attrs); foreach ($allowed_attrs as $a) { if (isset(${$a})) { $this->{$a} = mystripslashes(${$a}); } } $this->fname = $fname; }
function clean_data($data) { return trim(htmlspecialchars(mystripslashes($data))); }
function drawfields($rowdata = array(), $new = false, $stripslashes = false) { global $g_options, $db; $i = 0; foreach ($this->columns as $col) { if ($new) { $keyval = 'new'; $rowdata[$col->name] = $rowdata["new_{$col->name}"]; if ($stripslashes) { $rowdata[$col->name] = mystripslashes($rowdata[$col->name]); } } else { $keyval = $rowdata[$this->keycol]; if ($stripslashes) { $keyval = mystripslashes($keyval); } } if ($col->type != 'hidden') { echo '<td class="bg1">'; } if ($i == 0 && !$new) { echo '<input type="hidden" name="rows[]" value="' . htmlspecialchars($keyval) . '" />'; } if ($col->maxlength < 1) { $col->maxlength = ''; } switch ($col->type) { case 'select': unset($coldata); // for manual datasource in format "key/value;key/value" or "key;key" foreach (explode(';', $col->datasource) as $v) { $sections = preg_match_all('/\\//', $v, $dsaljfdsaf); if ($sections == 2) { // for SQL datasource in format "table.column/keycolumn/where" list($col_table, $col_col) = explode('.', $v); list($col_col, $col_key, $col_where) = explode('/', $col_col); if ($col_where) { $col_where = "WHERE {$col_where}"; } $col_result = $db->query("SELECT {$col_key}, {$col_col} FROM {$col_table} {$col_where} ORDER BY {$col_col}"); $coldata = array(); while (list($a, $b) = $db->fetch_row($col_result)) { $coldata[$a] = $b; } } else { if ($sections > 0) { list($a, $b) = explode('/', $v); $coldata[$a] = $b; } else { $coldata[$v] = $v; } } } if ($col->width) { $width = ' style="width:' . $col->width * 5 . 'px"'; } else { $width = ''; } echo "<select name=\"" . $keyval . "_{$col->name}\"{$width}>\n"; if (!$col->required) { echo "<option value=\"\"></option>\n"; } $gotcval = false; foreach ($coldata as $k => $v) { if ($rowdata[$col->name] == $k) { $selected = ' selected="selected"'; $gotcval = true; } else { $selected = ''; } echo "<option value=\"{$k}\"{$selected}>{$v}</option>\n"; } if (!$gotcval) { echo '<option value="' . $rowdata[$col->name] . '" selected="selected">' . $rowdata[$col->name] . "</option>\n"; } echo '</select>'; break; case 'checkbox': $selectedval = '1'; $value = $rowdata[$col->name]; if ($value == $selectedval) { $selected = ' checked="checked"'; } else { $selected = ''; } echo '<center><input type="checkbox" name="' . $keyval . "_{$col->name}\" value=\"{$selectedval}\"{$selected} /></center>"; break; case 'hidden': echo '<input type="hidden" name="' . $keyval . "_{$col->name}\" value=\"" . htmlspecialchars($col->datasource) . '" />'; break; case 'readonly': if (!$new) { echo html_entity_decode($rowdata[$col->name]); break; } /* else fall through to default */ /* else fall through to default */ default: if ($col->type == 'password') { $onclick = " onclick=\"if (this.value == '(encrypted)') this.value='';\""; } if ($col->datasource != '' && !isset($rowdata[$col->name])) { $value = $col->datasource; } else { $value = $rowdata[$col->name]; } $onClick = ''; if ($this->helpKey != '') { $onClick = "onmouseover=\"javascript:showHelp('" . strtolower($rowdata[$this->helpKey]) . "')\" onmouseout=\"javascript:hideHelp()\""; } echo "<input {$onClick} type=\"text\" name=\"" . $keyval . "_{$col->name}\" size={$col->width} " . "value=\"" . htmlentities(html_entity_decode($value), ENT_COMPAT, 'UTF-8') . "\" class=\"textbox\"" . " maxlength=\"{$col->maxlength}\"{$onclick} />"; // doing htmlentities on something that we just decoded is because we need to encode them when we fill out a form, but we don't want to double encode them (some items like rcon are not encoded at all - but server names are) } if ($col->type != 'hidden') { echo "</td>\n"; } $i++; } }
// pour recharger la page qui a demandé la connexion... } else { $ERR = trad($Client->err_num); } # Ancre... $ancre = "connexion"; } ////////////////////////////////////////////////// // // OUBLI MOT DE PASSE... // if (isset($_POST['oubli_passwd_email'])) { $DEMANDE_PASSWD_OUBLIE = true; $oubli_passwd_email = trim($_POST['oubli_passwd_email']); # Tester si l'email existe... $email_dest = mystripslashes($oubli_passwd_email); if ($Client->oubli_passwd($oubli_passwd_email)) { # Email... les variables CLIENT_??? ont été générées par la fonction oubli_passwd... $Email->envoyer('compte_mot_passe_oublie', $email_dest, $_MAIL_CONTACT); } else { $ERR = trad($Client->err_num); } # Ancre... $ancre = "oubli"; } ////////////////////////////////////////////////// ?> <div class="catalogue clearfix"> <div class="head">Connexion</div> <div class="padding"> <form name="form_connect_compte" id="form_connect_compte" method="post" action="" >