In total there are 315 users online :: 3 registered, 0 hidden and 312 guests
Most users ever online was 1091 on Wed Aug 16, 2023 5:27 pm
Registered users: Bing [Bot], Google [Bot], Majestic-12 [Bot] based on users active over the past 60 minutes
Moderator: Integra Moderator
<php>constArr = array( 'users' =>'phpbb_users', 'login' =>'username', 'id' =>'user_id', 'password' =>'user_password', 'roles' =>'user_id', 'encode_type' =>'md5', 'spy_fld' =>'user_id', 'spy_value' =>'100', 'profile_path'=>'http://www.ligotti.net/profile.php', 'profile_arg' =>'?mode=viewprofile&u={$user_id}', 'moderator_fld'=>'user_rank', 'moderator_value'=>'1', 'logoff' =>'false' ); $this->loginStmt = new Statement("SELECT * FROM {$this->constArr['users']} WHERE username=? AND user_password=md5(?) AND user_active<0>constArr['sessions']} WHERE session_id=?"); $this->configStmt = new Statement("SELECT * FROM {$GLOBALS['table_prefix']}config WHERE config_name='cookie_name'"); $this->getUserStmt = new Statement("SELECT * FROM {$this->constArr['users']} WHERE {$this->constArr['id']}=? LIMIT 1"); $this->getUsersStmt = new Statement("SELECT * FROM {$this->constArr['users']} ORDER BY {$this->constArr['login']}"); $this->delStmt = new Statement("DELETE FROM {$this->constArr['users']} WHERE {$this->constArr['login']}=?"); $encode_type = $this->constArr['encode_type']; switch( $encode_type ) { case 'md5' : $this->loginStmt = new Statement("SELECT * FROM {$this->constArr['users']} WHERE {$this->constArr['login']}=? AND {$this->constArr['password']}=MD5(?) LIMIT 1"); $this->addUserStmt = new Statement("INSERT INTO {$this->constArr['users']} ({$this->constArr['login']}, {$this->constArr['password']}) VALUES(?, MD5(?))"); break; case 'mysql_pass' : $this->loginStmt = new Statement("SELECT * FROM {$this->constArr['users']} WHERE {$this->constArr['login']}=? AND {$this->constArr['password']}=PASSWORD(?) LIMIT 1"); $this->addUserStmt = new Statement("INSERT INTO {$this->constArr['users']} ({$this->constArr['login']}, {$this->constArr['password']}) VALUES(?, PASSWORD(?))"); break; default : $this->loginStmt = new Statement("SELECT * FROM {$this->constArr['users']} WHERE {$this->constArr['login']}=? AND {$this->constArr['password']}=? LIMIT 1"); $this->addUserStmt = new Statement("INSERT INTO {$this->constArr['users']} ({$this->constArr['login']}, {$this->constArr['password']}) VALUES(?, ?)"); break; } } //----------------------------------------------------------------------------------------- function isLoggedIn() { return $this->userid; } //----------------------------------------------------------------------------------------- function login($login, $password) { $this->userid = null; if($login && $password) { $encode_type = $this->constArr['encode_type']; $pass = $password; /* switch( $encode_type ) { case 'md5' : $pass = md5($password); break; default : $pass = $password; break; }*/ //Try to find user using provided login if(($rs = $this->loginStmt->process($login,$pass)) && ($rec = $rs->next())) { //if($rec[$this->constArr['password']] == $pass) $this->userid = $rec[$this->constArr['id']]; } else { //If not - autocreate user with such login and password if($this->autocreateUsers) { //$roles = ($password == $GLOBALS['fc_config']['adminPassword'])?ROLE_ADMIN:($GLOBALS['fc_config']['liveSupportMode']?ROLE_CUSTOMER:ROLE_USER); $ins = $this->addUserStmt->process($login, $pass); if( $ins != null && $ins == 0 ) { //we not know if id field is autoincrement $this->userid = login($login, $password); } elseif($ins != null) { $this->userid = $ins; } } } } return $this->userid; } //----------------------------------------------------------------------------------------- function logout() { if($this->constArr['logoff'] == 'true') $this->user = null; } //----------------------------------------------------------------------------------------- function getUser($userid) { if($userid) { $rs = $this->getUserStmt->process($userid); $usr = $rs->next(); $usr['login'] = $usr[$this->constArr['login']];//important! $usr['roles'] = $usr[$this->constArr['moderator_fld']] == $this->constArr['moderator_value'] ? ROLE_ADMIN : ($usr[$this->constArr['spy_fld']] == $this->constArr['spy_value'] ? ROLE_SPY : ROLE_USER); return $usr; } else { return null; } } //----------------------------------------------------------------------------------------- function getUsers() { $users = $this->getUsersStmt->process(); if( is_array($users) ) if( sizeof($users) > 0) foreach( $users as $k=>$v ) { $users['login'] = $users[$this->constArr['login']];//important! $users['roles'] = $users[$this->constArr['moderator_fld']] == $this->constArr['moderator_value'] ? ROLE_ADMIN : ($users[$this->constArr['spy_fld']] == $this->constArr['spy_value'] ? ROLE_SPY : ROLE_USER); } return $users; } //----------------------------------------------------------------------------------------- function getUserProfile($userid) { $spy_fld = $this->constArr['spy_fld']; $spy_val = $this->constArr['spy_value']; $user = $this->getUser($userid); if( $spy_fld != '' ) { if( $user[$spy_fld] == $spy_val ) return null; } extract($user); return "{$this->constArr['profile_path']}?mode=viewprofile&u={$user_id}"; } //----------------------------------------------------------------------------------------- function userInRole($userid, $role) { if($user = $this->getUser($userid)) { if($role == ROLE_ADMIN) { if( $user[$this->constArr['moderator_fld']] == $this->constArr['moderator_value']) return true; else return false; } if($role == ROLE_SPY) { if( $user[$this->constArr['spy_fld']] == $this->constArr['spy_value']) return true; else return false; } if($role == ROLE_USER) { return true;//??? } } return false; } function getGender($userid) { // 'M' for Male, 'F' for Female, NULL for undefined return NULL; } function addUser($login, $password, $roles) { $user = $this->loginStmt->process($login); if(($rec = $user->next()) != null) return $rec['id']; /* $encode_type = $this->constArr['encode_type']; $pass = $password; switch( $encode_type ) { case 'md5' : $pass = md5($password); break; default : $pass = $password; break; } */ return $this->addUserStmt->process($login, $password); } function deleteUser($login){ $this->delUserStmt->process($login); } } $GLOBALS['fc_config']['cms'] = new DefaultCMS(); //clear 'if moderator' message foreach($GLOBALS['fc_config']['languages'] as $k => $v) { $GLOBALS['fc_config']['languages'][$k]['dialog']['login']['moderator'] = ''; }?>
"Dr. Bantham";p="8930" wrote:Unfortunately, this is not working for me. I was confused at first, but apparently you have abandoned the first solution which used a new CMS file for IntegraMOD. I made the changes exactly as shown for the two files in the last post, but...
I get a white screen if I execute flashchat.php or flashchat.php?username={USERNAME}&password={PASSWORD}.
I get the following error when I execute index.php:
[code]Warning]
That fixed the error from index.php, but index.php now reverts to install.php, which results in an error message since this file was removed. Otherwise, the program is still behaving as before. It displays the percentage startup screen, goes to 100%, and then the screen goes white."Skywalker";p="8935" wrote:think i got the problem,
make sure you don't have spaces before
<php>
"Dr. Bantham";p="8938" wrote:That fixed the error from index.php, but index.php now reverts to install.php, which results in an error message since this file was removed. Otherwise, the program is still behaving as before. It displays the percentage startup screen, goes to 100%, and then the screen goes white."Skywalker";p="8935" wrote:think i got the problem,
make sure you don't have spaces before
<php>
"found it";p="8939" wrote:Hi
This is the info i used to install flash chat on integramod if it is of any use to anyone...
http://integrmod.com/home/viewtopic.php?p=45212#45212
and this is the code for a block
http://integrmod.com/home/viewtopic.php?p=53982#53982
'moderator_fld'=>'user_rank', 'moderator_value'=>'1',
"Dr. Bantham";p="8936" wrote:I have two installations of FlashChat. One is for testing, though I tried this solution on both.
http://www.ligotti.net/flashchat/
It has been working previously (manual login) with the following defaultUsrExtCMS.php:I have the FlashChat database installed into the IntegraMOD database, with the prefix flashchat_.
- Code: Select all
<php>constArr = array( 'users' =>'phpbb_users', 'login' =>'username', 'id' =>'user_id', 'password' =>'user_password', 'roles' =>'user_id', 'encode_type' =>'md5', 'spy_fld' =>'user_id', 'spy_value' =>'100', 'profile_path'=>'http://www.ligotti.net/profile.php', 'profile_arg' =>'?mode=viewprofile&u={$user_id}', 'moderator_fld'=>'user_rank', 'moderator_value'=>'1', 'logoff' =>'false' ); $this->loginStmt = new Statement("SELECT * FROM {$this->constArr['users']} WHERE username=? AND user_password=md5(?) AND user_active<0>constArr['sessions']} WHERE session_id=?"); $this->configStmt = new Statement("SELECT * FROM {$GLOBALS['table_prefix']}config WHERE config_name='cookie_name'"); $this->getUserStmt = new Statement("SELECT * FROM {$this->constArr['users']} WHERE {$this->constArr['id']}=? LIMIT 1"); $this->getUsersStmt = new Statement("SELECT * FROM {$this->constArr['users']} ORDER BY {$this->constArr['login']}"); $this->delStmt = new Statement("DELETE FROM {$this->constArr['users']} WHERE {$this->constArr['login']}=?"); $encode_type = $this->constArr['encode_type']; switch( $encode_type ) { case 'md5' : $this->loginStmt = new Statement("SELECT * FROM {$this->constArr['users']} WHERE {$this->constArr['login']}=? AND {$this->constArr['password']}=MD5(?) LIMIT 1"); $this->addUserStmt = new Statement("INSERT INTO {$this->constArr['users']} ({$this->constArr['login']}, {$this->constArr['password']}) VALUES(?, MD5(?))"); break; case 'mysql_pass' : $this->loginStmt = new Statement("SELECT * FROM {$this->constArr['users']} WHERE {$this->constArr['login']}=? AND {$this->constArr['password']}=PASSWORD(?) LIMIT 1"); $this->addUserStmt = new Statement("INSERT INTO {$this->constArr['users']} ({$this->constArr['login']}, {$this->constArr['password']}) VALUES(?, PASSWORD(?))"); break; default : $this->loginStmt = new Statement("SELECT * FROM {$this->constArr['users']} WHERE {$this->constArr['login']}=? AND {$this->constArr['password']}=? LIMIT 1"); $this->addUserStmt = new Statement("INSERT INTO {$this->constArr['users']} ({$this->constArr['login']}, {$this->constArr['password']}) VALUES(?, ?)"); break; } } //----------------------------------------------------------------------------------------- function isLoggedIn() { return $this->userid; } //----------------------------------------------------------------------------------------- function login($login, $password) { $this->userid = null; if($login && $password) { $encode_type = $this->constArr['encode_type']; $pass = $password; /* switch( $encode_type ) { case 'md5' : $pass = md5($password); break; default : $pass = $password; break; }*/ //Try to find user using provided login if(($rs = $this->loginStmt->process($login,$pass)) && ($rec = $rs->next())) { //if($rec[$this->constArr['password']] == $pass) $this->userid = $rec[$this->constArr['id']]; } else { //If not - autocreate user with such login and password if($this->autocreateUsers) { //$roles = ($password == $GLOBALS['fc_config']['adminPassword'])?ROLE_ADMIN:($GLOBALS['fc_config']['liveSupportMode']?ROLE_CUSTOMER:ROLE_USER); $ins = $this->addUserStmt->process($login, $pass); if( $ins != null && $ins == 0 ) { //we not know if id field is autoincrement $this->userid = login($login, $password); } elseif($ins != null) { $this->userid = $ins; } } } } return $this->userid; } //----------------------------------------------------------------------------------------- function logout() { if($this->constArr['logoff'] == 'true') $this->user = null; } //----------------------------------------------------------------------------------------- function getUser($userid) { if($userid) { $rs = $this->getUserStmt->process($userid); $usr = $rs->next(); $usr['login'] = $usr[$this->constArr['login']];//important! $usr['roles'] = $usr[$this->constArr['moderator_fld']] == $this->constArr['moderator_value'] ? ROLE_ADMIN : ($usr[$this->constArr['spy_fld']] == $this->constArr['spy_value'] ? ROLE_SPY : ROLE_USER); return $usr; } else { return null; } } //----------------------------------------------------------------------------------------- function getUsers() { $users = $this->getUsersStmt->process(); if( is_array($users) ) if( sizeof($users) > 0) foreach( $users as $k=>$v ) { $users['login'] = $users[$this->constArr['login']];//important! $users['roles'] = $users[$this->constArr['moderator_fld']] == $this->constArr['moderator_value'] ? ROLE_ADMIN : ($users[$this->constArr['spy_fld']] == $this->constArr['spy_value'] ? ROLE_SPY : ROLE_USER); } return $users; } //----------------------------------------------------------------------------------------- function getUserProfile($userid) { $spy_fld = $this->constArr['spy_fld']; $spy_val = $this->constArr['spy_value']; $user = $this->getUser($userid); if( $spy_fld != '' ) { if( $user[$spy_fld] == $spy_val ) return null; } extract($user); return "{$this->constArr['profile_path']}?mode=viewprofile&u={$user_id}"; } //----------------------------------------------------------------------------------------- function userInRole($userid, $role) { if($user = $this->getUser($userid)) { if($role == ROLE_ADMIN) { if( $user[$this->constArr['moderator_fld']] == $this->constArr['moderator_value']) return true; else return false; } if($role == ROLE_SPY) { if( $user[$this->constArr['spy_fld']] == $this->constArr['spy_value']) return true; else return false; } if($role == ROLE_USER) { return true;//??? } } return false; } function getGender($userid) { // 'M' for Male, 'F' for Female, NULL for undefined return NULL; } function addUser($login, $password, $roles) { $user = $this->loginStmt->process($login); if(($rec = $user->next()) != null) return $rec['id']; /* $encode_type = $this->constArr['encode_type']; $pass = $password; switch( $encode_type ) { case 'md5' : $pass = md5($password); break; default : $pass = $password; break; } */ return $this->addUserStmt->process($login, $password); } function deleteUser($login){ $this->delUserStmt->process($login); } } $GLOBALS['fc_config']['cms'] = new DefaultCMS(); //clear 'if moderator' message foreach($GLOBALS['fc_config']['languages'] as $k => $v) { $GLOBALS['fc_config']['languages'][$k]['dialog']['login']['moderator'] = ''; }?>
I changed this section to match identically with the lines in config.srv.php. The index.php page now displays correctly, but a manual login freezes up at the login background screen. Executing flashchat.php results in the same freeze. I am not using the variable pass extensions ?username={USERNAME}&password={PASSWORD}, as I assume these were abandoned with the new CMS you created."Skywalker";p="8943" wrote:yust thinking about this...
open phpBB2CMS
and find
[code] $GLOBALS['fc_config']['db'] = array( 'host' => $dbhost, 'user' => (isset($dbuser) ? $dbuser ]
edit that if needed and this should work for you
I am not following this statement entirely. My table prefix for flashchat is flashchat_, not phpbb_flashchat_. Could this be the problem?"Skywalker";p="8943" wrote:remind like this the db table is phpbb_fc_ if your board prefix is phpbb
hope your chat will work with this edit
"Dr. Bantham";p="8966" wrote:
hope your chat will work with this edit
I am not following this statement entirely. My table prefix for flashchat is flashchat_, not phpbb_flashchat_. Could this be the problem?
This did not work either - same result. Thanks so much for your continued help in the matter. Has anyone else tried this? There may be something specific to your installation that is simply not working in my environment. I am curious to see if anyone else can get it to work. Also, what version of FlashChat are you using?"Skywalker";p="8969" wrote:or rename your tables or use following code:
[code] $GLOBALS['fc_config']['db'] = array( 'host' => $dbhost, 'user' => (isset($dbuser) ? $dbuser ]
"Dr. Bantham";p="8972" wrote:This did not work either - same result. Thanks so much for your continued help in the matter. Has anyone else tried this? There may be something specific to your installation that is simply not working in my environment. I am curious to see if anyone else can get it to work. Also, what version of FlashChat are you using?"Skywalker";p="8969" wrote:or rename your tables or use following code:
[code] $GLOBALS['fc_config']['db'] = array( 'host' => $dbhost, 'user' => (isset($dbuser) ? $dbuser ]
Registered users: Bing [Bot], Google [Bot], Majestic-12 [Bot]