$user->name = $name_new; // OK - nick changed
/* se nome gia' in uso, segnala cosa potrebbe capitare */
if (($user->flags & USER_FLAG_AUTH) == 0) {
- $userdb = new LoginDB();
+ $bdb = new BriskDB();
+ $bdb->users_load();
/* MLANG: "Il nickname <b>\'%s\'</b> è già registrato, <b>se il suo proprietario si autentificherà verrai rinominato d\'ufficio come ghost<i>N</i>.</b>" */
- if ($userdb->login_exists($name_new)) {
+ if ($bdb->login_exists($name_new)) {
$prestr = sprintf($mlang_brisk['nickjust'][$G_lang], xcape($name_new));
$to_user .= sprintf('chatt_sub("%s", [2, "%s"],"%s");', $dt, NICKSERV, $prestr);
}
/* if pass != FALSE verify the login with pass */
log_auth("XXX", "auth1");
- $userdb = new LoginDB();
+ $bdb = new BriskDB();
+ $bdb->users_load();
if ($pass != FALSE) {
log_auth("XXX", "auth2");
- $authenticate = $userdb->login_verify($name_new, $pass);
+ $authenticate = $bdb->login_verify($name_new, $pass, $code);
log_auth("XXX", "authenticate: ".($authenticate != FALSE ? "TRUE" : "FALSE"));
if ($authenticate != FALSE) {
}
}
else {
- $login_exists = $userdb->login_exists($name_new);
+ $login_exists = $bdb->login_exists($name_new);
}
for ($i = 0 ; $i < MAX_PLAYERS ; $i++) {
/* free user ? */
define(BRISK_AUTH_CONF, "brisk_auth.conf.pho");
-class LoginDB {
+class BriskDB {
var $item;
var $item_n;
- function LoginDB()
+ function BriskDB()
+ {
+ log_main("BriskDB create:start");
+
+ log_main("BriskDB create:end");
+ }
+
+ function users_load()
{
GLOBAL $DOCUMENT_ROOT;
- log_main("LoginDB create:start");
if (file_exists("$DOCUMENT_ROOT/Etc/".BRISK_AUTH_CONF)) {
require("$DOCUMENT_ROOT/Etc/".BRISK_AUTH_CONF);
new LoginDBItem(4, "tre", md5("three"), "pippo@pluto.com", USER_FLAG_TY_NORM) );
}
$this->item_n = count($this->item);
- log_main("LoginDB create:end");
}
function count()
{
log_main("login_exists: ".$login);
- /* check the existence of the nick in the LoginDB */
+ /* check the existence of the nick in the BriskDB */
for ($i = 0 ; $i < $this->item_n ; $i++) {
if (strcasecmp($this->item[$i]->login, $login) == 0) {
log_main("login[".$i."]: ".$this->item[$i]->login);
log_main("login_exists: ".$login);
- /* check the existence of the nick in the LoginDB */
+ /* check the existence of the nick in the BriskDB */
for ($i = 0 ; $i < $this->item_n ; $i++) {
if (strcasecmp($this->item[$i]->login, $login) == 0) {
log_main("login[".$i."]: ".$this->item[$i]->login);
{
log_main("getmail");
- /* check the existence of the nick in the LoginDB */
+ /* check the existence of the nick in the BriskDB */
for ($i = 0 ; $i < $this->item_n ; $i++) {
if (strcasecmp($this->item[$i]->login, $login) == 0) {
log_main("login[".$i."]: ".$this->item[$i]->login);
{
log_main("getmail");
- /* check the existence of the nick in the LoginDB */
+ /* check the existence of the nick in the BriskDB */
for ($i = 0 ; $i < $this->item_n ; $i++) {
if (strcasecmp($this->item[$i]->login, $login) == 0) {
log_main("login[".$i."]: ".$this->item[$i]->login);
log_main("login_verify: ".$login);
- /* check the existence of the nick in the LoginDB */
+ /* check the existence of the nick in the BriskDB */
for ($i = 0 ; $i < $this->item_n ; $i++) {
log_main("login_verify: LOOP");
if (strcasecmp($this->item[$i]->login, $login) == 0) {
}
}
-class LoginDB
+class BriskDB
{
var $dbconn;
var $item;
var $item_n;
- function LoginDB()
+ function BriskDB()
{
GLOBAL $DOCUMENT_ROOT, $G_dbpfx, $G_false;
- log_main("LoginDB create:start");
+ log_main("BriskDB create:start");
$this->dbconn = new DBConn();
- log_main("LoginDB create:end");
+ log_main("BriskDB create:end");
+ }
+
+ function users_load()
+ {
}
function login_exists($login)
{
GLOBAL $G_dbpfx;
- /* check the existence of the nick in the LoginDB */
+ /* check the existence of the nick in the BriskDB */
log_main("login_exists: ".$login);
$user_sql = sprintf("SELECT * FROM %susers WHERE login = lower('%s');", $G_dbpfx, escsql($login));
log_main("login_verify: ".$login);
- //O /* check the existence of the nick in the LoginDB */
+ //O /* check the existence of the nick in the BriskDB */
//O for ($i = 0 ; $i < $this->item_n ; $i++) {
//O log_main("login_verify: BEGIN");
fclose($fp_start);
}
- $userdb = new LoginDB();
+ $bdb = new BriskDB();
+ $bdb->users_load();
- for ($i = 0 ; $i < $userdb->count() ; $i++) {
- $login = $userdb->getlogin_byidx($i);
+ for ($i = 0 ; $i < $bdb->count() ; $i++) {
+ $login = $bdb->getlogin_byidx($i);
$tri[$i] = new Ptsgam($login);
$mon[$i] = new Ptsgam($login);
$wee[$i] = new Ptsgam($login);
for ($i = 0 ; $i < BRISKIN5_PLAYERS_N ; $i++) {
// echo $p." i) ".$i."<br>";
$username = $ar[9+($i*2)];
- if (($item = $userdb->getitem_bylogin($username, &$id)) == FALSE) {
+ if (($item = $bdb->getitem_bylogin($username, &$id)) == FALSE) {
echo "WARNING: the user [".$username."] NOT EXISTS!<br>";
continue;
}
log_wr("INFO:SKIP:argz == mesgtoadm name: [".$cli_name."] AUTH: ".($user->flags & USER_FLAG_AUTH));
if ($user->flags & USER_FLAG_AUTH) {
if (($wa_lock = Warrant::lock_data()) != FALSE) {
- $userdb = new LoginDB();
-
- if (($ema = $userdb->getmail($user->name)) != FALSE) {
+ $bdb = new BriskDB();
+ $bdb->users_load();
+
+ if (($ema = $bdb->getmail($user->name)) != FALSE) {
// mail("nastasi",
mail("brisk@alternativeoutput.it", urldecode($cli_subj), urldecode($cli_mesg), sprintf("From: %s <%s>", $user->name, $ema));
}