In total there are 642 users online :: 3 registered, 0 hidden and 639 guests
Most users ever online was 1091 on Wed Aug 16, 2023 5:27 pm
Registered users: Bing [Bot], Helter, Majestic-12 [Bot] based on users active over the past 60 minutes
Moderator: Integra Moderator
<php>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['admin_fld']] == $this->constArr['admin_value'] ? ROLE_ADMIN : ($usr[$this->constArr['spy_fld']] == $this->constArr['spy_value'] ? ROLE_SPY : ($usr[$this->constArr['moderator_fld']] == $this->constArr['moderator_value'] ? ROLE_MODERATOR : 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['admin_fld']] == $this->constArr['admin_value'] ? ROLE_ADMIN : ($users[$this->constArr['spy_fld']] == $this->constArr['spy_value'] ? ROLE_SPY : ($usr[$this->constArr['moderator_fld']] == $this->constArr['moderator_value'] ? ROLE_MODERATOR : 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']}?user={$user_id}"; } //----------------------------------------------------------------------------------------- function userInRole($userid, $role) { if($user = $this->getUser($userid)) { if($role == ROLE_ADMIN) { if( $user[$this->constArr['admin_fld']] == $this->constArr['admin_value']) return true; else return false; } if($role == ROLE_MODERATOR) { 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'] = ''; }?>
"found it";p="9335" wrote:hi
this is my defaultUsrExtCMS.php file which will run on an integramod forum but you will have to log in...it also excepts moderators and admin but you will have to change the profile path as it is set up on my local machine...
Obviously you do not need to use this if you do not want to but this does work....
- Code: Select all
<php>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['admin_fld']] == $this->constArr['admin_value'] ? ROLE_ADMIN : ($usr[$this->constArr['spy_fld']] == $this->constArr['spy_value'] ? ROLE_SPY : ($usr[$this->constArr['moderator_fld']] == $this->constArr['moderator_value'] ? ROLE_MODERATOR : 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['admin_fld']] == $this->constArr['admin_value'] ? ROLE_ADMIN : ($users[$this->constArr['spy_fld']] == $this->constArr['spy_value'] ? ROLE_SPY : ($usr[$this->constArr['moderator_fld']] == $this->constArr['moderator_value'] ? ROLE_MODERATOR : 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']}?user={$user_id}"; } //----------------------------------------------------------------------------------------- function userInRole($userid, $role) { if($user = $this->getUser($userid)) { if($role == ROLE_ADMIN) { if( $user[$this->constArr['admin_fld']] == $this->constArr['admin_value']) return true; else return false; } if($role == ROLE_MODERATOR) { 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'] = ''; }?>
My board is IntegraMOD 1.4.0 with upgrades installed through phpBB 2.0.20 and phpBB Security 1.0.3, if this should help."Skywalker";p="9328" wrote:i don't know of upgrades to phpbb2.0.20 made it work or any of my other mods.
"Dr. Bantham";p="9340" wrote:My board is IntegraMOD 1.4.0 with upgrades installed through phpBB 2.0.20 and phpBB Security 1.0.3, if this should help."Skywalker";p="9328" wrote:i don't know of upgrades to phpbb2.0.20 made it work or any of my other mods.
I'm definitely interested. I have been running the same CMS as found it and it works great - with the exception of the autologin. If you would manage to get that working I would be a happy camper indeed. <img>"Skywalker";p="9346" wrote:
iff someone is interested in this and want to use this function just let me know and i'm on it
think i can heave it ready already today
please note that the autologin is created for flashchat 4.5.7
"Dr. Bantham";p="9388" wrote:I'm definitely interested. I have been running the same CMS as found it and it works great - with the exception of the autologin. If you would manage to get that working I would be a happy camper indeed. <img>"Skywalker";p="9346" wrote:
iff someone is interested in this and want to use this function just let me know and i'm on it
think i can heave it ready already today
please note that the autologin is created for flashchat 4.5.7
"Dr. Bantham";p="9697" wrote:I tried the new FlashChat IM integration with password transfer, and I must have something off. It seems to be connecting to the database, as the link generated lists my unsername correctly, but the login box states "incorrect username or password". The URL generated has a long series of scrambled letters and numbers for the password element. If I manually type my password within the URL in place of the scrambled password, it logs in correctly. Therefore, I assume I have a setting incorrect which is not allowing for the translation of the encrypted password. This is a new installation of FlashChat which is installed within the IntegraMOD database with the phpbb_fc prefix. Any ideas? Thanks again for hanging in there with us!
"Dr. Bantham";p="9722" wrote:It works! I am ever grateful!
Though this next question does not fall into a standard integration, perhaps you can help with little effort. I am using a javascript menu system which is called from overallheader.tpl and it seems that the login variables are not transferred when I call the link from this javascript. Again, it works like a charm when linking through conventional means. Do you have an idea of how I can transfer the variables to a javascript routine?
Again, many thanks for the patience and effort of following through!
Registered users: Bing [Bot], Helter, Majestic-12 [Bot]