Sub Menu
Links Menu
Online Users

In total there are 547 users online :: 2 registered, 0 hidden and 545 guests

Most users ever online was 1091 on Wed Aug 16, 2023 5:27 pm

Registered users: Google [Bot], Majestic-12 [Bot] based on users active over the past 60 minutes

Flash Chat

Support for IntegraMOD 140

Moderator: Integra Moderator

PostAuthor: Dr. Bantham » Sun Jun 04, 2006 6:03 am

"cleo";p="8395" wrote:on, if you to to .../chat/index.php and am signed into my forum i cannot auto login where indicated and can auto login where indicated
I would not call this an auto login, since you are entering your username and password. The auto login would transfer this information instantly for users logged in. No worries - I was just confused a bit.
now when i login, there is not A beside my name, and i cannot log into the chat admin, but when my other admin logins, there is an A beside her name, and she can get into the chat admin.
Do you have full admin capabilities on the site, or are you only a Junior Admin or Moderator? Neither of the latter would give you access to FlashChat Admin.
Last edited by Dr. Bantham on Wed Dec 31, 1969 4:00 pm, edited 1 time in total.
User avatar
Dr. Bantham
Integra Member
Integra Member
 
Posts: 152
Likes: 0 post
Liked in: 0 post
Joined: Sat Apr 08, 2006 5:25 pm
Cash on hand: 0.00

PostAuthor: ayasha » Sun Jun 04, 2006 6:35 am

ok, when i go to .../chat/index.php, my name and pw are automatically there, i did not enter them, that is why i say it is an autologin. that and the fact that if i am not signed into the forum, neither of those buttons will log me in without me entering my information on a second login that pops up.

if i could get the link on my forum to pop up the smaller popup chat room, i would prefer that.

on the admin capablilities, i am the founder, so yes i have full admin capabilities.
Last edited by ayasha on Wed Dec 31, 1969 4:00 pm, edited 1 time in total.
No one can make you feel inferior without your consent.
~Eleanor Roosevelt

ayasha
Sr Integra Member
Sr Integra Member
 
Posts: 634
Likes: 0 post
Liked in: 0 post
Joined: Tue Mar 28, 2006 5:10 pm
Cash on hand: 0.00

Re: Flash Chat

PostAuthor: Skywalker » Tue Jun 06, 2006 1:47 am

i have created my own integration based on the posted one:

my changes are: both admin and mods are moderator on chat
moderater level in chat no longer based on user_rank but based on user_level (how it should be)

option to pull user_passwords out of the mysql DB
OPEN chat/inc/config.php
FIND
Code: Select all
        //your CMS system  

Code: Select all
 REPLACE NEXT LINE with]

CREATE: integramodCMS.php
ADD
[code]  <php>constArr = array(                       'users'       =>'phpbb_users',                       'login'       =>'username',                       'id'          =>'user_id',                       'password'    =>'user_password',                       'roles'       =>'user_id',                       //'encode_type' =>'md5', use this for passwords filled in by users                       //'encode_type' =>'', use this for passwords pulled out of the DB                       'encode_type' =>'',                       'spy_fld'     =>'user_id',                       'spy_value'   =>'100',                       'profile_path'=>'../profile.php',                       'profile_arg' =>'?mode=viewprofile&u={$user_id}',                       'moderator_fld'=>'user_level',                       'moderator_value'=>'2',                       'admin_fld'=>'user_level',                       'admin_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' ]} 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['moderator_fld']] == $this->constArr['moderator_value']) ? ROLE_MODERATOR : ($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['admin_fld']] == $this->constArr['admin_value']) ? ROLE_ADMIN : ($users[$this->constArr['moderator_fld']] == $this->constArr['moderator_value']) ? ROLE_MODERATOR : ($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['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'] = '';     }?>  [/code]


for those who want to make a auto login page

OPEN includes/page_header.php

FIND:
[code]  //// Generate logged in/logged out status//  [/code]

BEFORE ADD]  //insert variable USERNAME into smarty engine$template->assign_vars(array('USERNAME' => $userdata['username'],'PASSWORD' => $userdata['user_password'],'ID' => $userdata['user_id']));  


IN WICH TEMPLATE YOU WANT TO CREATE LOGIN ADD:
Code: Select all
 <a><img></a>  Or a tekst link can also be created just use "chat/flashchat.php?username={USERNAME}&password={PASSWORD}" as url  


iff you gonna pull the data out off the db make sure to make following edit in interamodCMS.php]                         //'encode_type' =>'md5', use this for passwords filled in by users                       //'encode_type' =>'', use this for passwords pulled out of the DB                       'encode_type' =>'',[/code]
Last edited by Skywalker on Tue Jun 06, 2006 2:30 am, edited 1 time in total.

Skywalker
Sr Integra Member
Sr Integra Member
 
Posts: 236
Likes: 0 post
Liked in: 0 post
Joined: Fri Apr 14, 2006 4:25 pm
Cash on hand: 0.00

PostAuthor: Skywalker » Tue Jun 06, 2006 1:50 am

"cleo";p="8357" wrote:thanks, got it to working, and the auto login does not work for me either. but if you go to chat/index.php and click on the auto login from there, it works.

and i cannot log in as admin, when i go to FlashChat Admin Panel i get

Could not grant admin role for this login and password.

any ideas how i can get in there and set up the chat rooms etc?

i found this

http://www.tufat.com/docs/flashchat/admin.html

but i don't see where it tells you what file to edit, or where exactly to put the edit. sorry i am no good at this guys <img>


the original integration is based on user ranks therefor you don't have admin permissions in the chat

i have created my own integration based on the original posted ere above.
use this integration and you and your mods have the same rights in the chat as on the forum
Last edited by Skywalker on Wed Dec 31, 1969 4:00 pm, edited 1 time in total.

Skywalker
Sr Integra Member
Sr Integra Member
 
Posts: 236
Likes: 0 post
Liked in: 0 post
Joined: Fri Apr 14, 2006 4:25 pm
Cash on hand: 0.00

Re: Flash Chat

PostAuthor: ayasha » Tue Jun 06, 2006 2:08 am

skywalker, what file do you do this edit in?

option to pull user_passwords out of the mysql DB
FIND


//your CMS system


REPLACE next line with:

'CMSsystem' => 'defaultUsrExtCMS',// defaultCMS - default CMS, blank - stateless CMS
Last edited by ayasha on Wed Dec 31, 1969 4:00 pm, edited 1 time in total.
No one can make you feel inferior without your consent.
~Eleanor Roosevelt

ayasha
Sr Integra Member
Sr Integra Member
 
Posts: 634
Likes: 0 post
Liked in: 0 post
Joined: Tue Mar 28, 2006 5:10 pm
Cash on hand: 0.00

Re: Flash Chat

PostAuthor: Skywalker » Tue Jun 06, 2006 2:14 am

i've updated the instruction i was forgotten to rename the CMS file and write the file path

its a clear instruction now
Last edited by Skywalker on Wed Dec 31, 1969 4:00 pm, edited 1 time in total.

Skywalker
Sr Integra Member
Sr Integra Member
 
Posts: 236
Likes: 0 post
Liked in: 0 post
Joined: Fri Apr 14, 2006 4:25 pm
Cash on hand: 0.00

Re: Flash Chat

PostAuthor: Skywalker » Tue Jun 06, 2006 2:22 am

i have noticed when you use the function to pull data out of the db you can't login to the chat admin pannel with a plain password i'll see wat i can create to let the admin login pull the username/password out of the db also
Last edited by Skywalker on Wed Dec 31, 1969 4:00 pm, edited 1 time in total.

Skywalker
Sr Integra Member
Sr Integra Member
 
Posts: 236
Likes: 0 post
Liked in: 0 post
Joined: Fri Apr 14, 2006 4:25 pm
Cash on hand: 0.00

Re: Flash Chat

PostAuthor: Skywalker » Tue Jun 06, 2006 2:32 am

updated integramodCMS.php
make sure you use your prefix in the userstable:
Code: Select all
                        'users'       =>'phpbb_users',  
Last edited by Skywalker on Wed Dec 31, 1969 4:00 pm, edited 1 time in total.

Skywalker
Sr Integra Member
Sr Integra Member
 
Posts: 236
Likes: 0 post
Liked in: 0 post
Joined: Fri Apr 14, 2006 4:25 pm
Cash on hand: 0.00

Re: Flash Chat

PostAuthor: Skywalker » Tue Jun 06, 2006 3:33 am

also make sure that the autologin link is always between user logged in tags...

i've been searching for a auto login fo admin but failed to create so now i've created another common.php,config.php,smartyinit.phpand another CMS file for the admin section.
so users can auto login and admins can just enter there plain password.

with the autologin instruction enabled admins should enter there md5 encrypted password to be able to login in the admin pannel.

the extra files is a rough way around that but it works
Last edited by Skywalker on Wed Dec 31, 1969 4:00 pm, edited 1 time in total.

Skywalker
Sr Integra Member
Sr Integra Member
 
Posts: 236
Likes: 0 post
Liked in: 0 post
Joined: Fri Apr 14, 2006 4:25 pm
Cash on hand: 0.00

Re: Flash Chat

PostAuthor: Dr. Bantham » Tue Jun 06, 2006 3:50 pm

Skywalker, I am trying to utilize pulling the database username and password for autologin and I can not get it to work. I have made all of the edits, and the resultant URL does relay my username and what appears to be an encoded password. However, the page becomes white with no activity whatsoever. Any clues and to what the problem might be?

I am using the upgraded 2.0.20 version of phpBB within IntegraMOD and phpBB Security 1.0.3.
Last edited by Dr. Bantham on Wed Dec 31, 1969 4:00 pm, edited 1 time in total.
User avatar
Dr. Bantham
Integra Member
Integra Member
 
Posts: 152
Likes: 0 post
Liked in: 0 post
Joined: Sat Apr 08, 2006 5:25 pm
Cash on hand: 0.00

Re: Flash Chat

PostAuthor: Skywalker » Tue Jun 06, 2006 3:59 pm

"Dr. Bantham";p="8730" wrote:Skywalker, I am trying to utilize pulling the database username and password for autologin and I can not get it to work. I have made all of the edits, and the resultant URL does relay my username and what appears to be an encoded password. However, the page becomes white with no activity whatsoever. Any clues and to what the problem might be?

I am using the upgraded 2.0.20 version of phpBB within IntegraMOD and phpBB Security 1.0.3.


the install instruction worked for me so it should work on yours also.
a white page is always an error

can you wait one day? i have edited the original file of flash chat phpBB2CMS.php and this is working for me now i will look if it is still working tomorow because the first time i used that CMS it was also only working for one day if it then still is working i will post the edited original file and then al the functions are working how they should be autologin normal login admin pannel login and so on

just give me 24 hours to check
Last edited by Skywalker on Wed Dec 31, 1969 4:00 pm, edited 1 time in total.

Skywalker
Sr Integra Member
Sr Integra Member
 
Posts: 236
Likes: 0 post
Liked in: 0 post
Joined: Fri Apr 14, 2006 4:25 pm
Cash on hand: 0.00

Re: Flash Chat

PostAuthor: Dr. Bantham » Tue Jun 06, 2006 4:22 pm

"Skywalker";p="8731" wrote:can you wait one day? i have edited the original file of flash chat phpBB2CMS.php and this is working for me now i will look if it is still working tomorow because the first time i used that CMS it was also only working for one day if it then still is working i will post the edited original file and then al the functions are working how they should be autologin normal login admin pannel login and so on

just give me 24 hours to check
Certainly - and thanks for posting an update.
Last edited by Dr. Bantham on Wed Dec 31, 1969 4:00 pm, edited 1 time in total.
User avatar
Dr. Bantham
Integra Member
Integra Member
 
Posts: 152
Likes: 0 post
Liked in: 0 post
Joined: Sat Apr 08, 2006 5:25 pm
Cash on hand: 0.00

Re: Flash Chat

PostAuthor: Skywalker » Wed Jun 07, 2006 3:01 pm

my chat is still running so this schould fix it.
i will post the phpBB2CMS.php you should use tomorow i'm gonna get some sleep first
Last edited by Skywalker on Wed Dec 31, 1969 4:00 pm, edited 1 time in total.

Skywalker
Sr Integra Member
Sr Integra Member
 
Posts: 236
Likes: 0 post
Liked in: 0 post
Joined: Fri Apr 14, 2006 4:25 pm
Cash on hand: 0.00

Re: Flash Chat

PostAuthor: Skywalker » Wed Jun 07, 2006 11:35 pm

ok
i'm back again lets post the fix:
OPEN chat/inc/cmses/phpBB2CMS.php

REPLACE WHOLE FILE WITH:

Code: Select all
 <php>loginStmt = new Statement("SELECT user_id FROM {$GLOBALS['table_prefix']}users WHERE username=? AND user_password=md5(?) AND user_active<>0 LIMIT 1");         $this->loggedinStmt = new Statement("SELECT session_user_id as id FROM {$GLOBALS['table_prefix']}sessions WHERE session_id=?");         $this->configStmt = new Statement("SELECT config_value FROM {$GLOBALS['table_prefix']}config WHERE config_name='cookie_name'");         $this->getUserStmt = new Statement("SELECT user_id as id, username as login, user_level FROM {$GLOBALS['table_prefix']}users WHERE user_id=? AND user_active<>0 LIMIT 1");         $this->getUsersStmt = new Statement("SELECT user_id as id, username as login FROM {$GLOBALS['table_prefix']}users ORDER BY login");         $this->getPhotoStmt = new Statement("SELECT user_avatar FROM {$GLOBALS['table_prefix']}users WHERE user_id=? AND user_active<>0 LIMIT 1");     }       function isLoggedIn() {         $userdata = session_pagestart($GLOBALS['user_ip'], PAGE_FAQ);         init_userprefs($userdata);         return ($userdata['user_id'] > 0) ? $userdata['user_id'] ], $GLOBALS['user_ip'], PAGE_INDEX, FALSE, FALSE);             return $rec['user_id'];         }           return null;     }       function logout()     {         /*             $userdata = session_pagestart($GLOBALS['user_ip'], PAGE_FAQ);             session_end($userdata['session_id'], $userdata['user_id']);         */     }       function getUser($userid)     {         if($userid == SPY_USERID) return null;           //fwrite($GLOBALS['fp'], "llada a getuser:".print_r($userid, true)."n");           if($userid && ($rs = $this->getUserStmt->process($userid)) && ($rec = $rs->next())) {             if ($rec['user_level'] >= 1) {                              if ($rec['user_level'] == 1) {                             $rec['roles'] = ROLE_ADMIN;                 $rec['user_level'] = ROLE_ADMIN;                            }else{                             $rec['roles'] = ROLE_MODERATOR;                 $rec['user_level'] = ROLE_MODERATOR;                           }                          }               elseif ($GLOBALS['fc_config']['liveSupportMode']) {                 $rec['roles'] = ROLE_CUSTOMER;                 $rec['user_level'] = ROLE_CUSTOMER;             }             else {                 $rec['roles'] = ROLE_USER;                 $rec['user_level'] = ROLE_USER;             }             //fwrite($GLOBALS['fp'], "rec:".print_r($rec, true)."n");             //$rec['login'] = utf8_encode( $rec['login'] );//umlavta characters fix             return $rec;         } else {             return null;         }     }       function getUsers() {         return  $this->getUsersStmt->process();     }       function getUserProfile($userid) {         if($user = $this->getUser($userid)) {             return (($id = $this->isLoggedIn()) && ($id == $userid))?"../profile.php?mode=editprofile":"../profile.php?mode=viewprofile&u=$userid";         } else {             return null;         }     }         function getPhoto($userid)     {         $rs = $this->getPhotoStmt->process($userid);         if(($rec = $rs->next()) == null) return '';           $fileExt = explode(',', $GLOBALS['fc_config']['photoloading']['allowFileExt']);           $oldFile = './nick_image/' . $userid . '.';         $fs = reset($fileExt);           while($fs) {             if(file_exists($oldFile . $fs)) return $oldFile . $fs;             $fs = next($fileExt);         }           return '../images/avatars/'.$rec['user_avatar'];     }       function userInRole($userid, $role) {         if($user = $this->getUser($userid)) {             return ($user['roles'] == $role);         }         return false;     }       function getGender($userid) {         // 'M' for Male, 'F' for Female, NULL for undefined         return NULL;     }}  $GLOBALS['fc_config']['db'] = array(     'host' => $dbhost,     'user' => (isset($dbuser) ? $dbuser : $dbuname),     'pass' => $dbpasswd,     'base' => $dbname,     'pref' => $table_prefix . "fc_",     );  $GLOBALS['fc_config']['cms'] = new PhpBB2CMS();  //fwrite($GLOBALS['fp'], print_r($GLOBALS['fc_config'], true));  //clear 'if moderator' messageforeach($GLOBALS['fc_config']['languages'] as $k => $v) {         $GLOBALS['fc_config']['languages'][$k]['dialog']['login']['moderator'] = '';     }?>


OPEN chat/inc/config.php

FIND:
Code: Select all
          //your CMS system  


REPLACE NEXT LINE with]         'CMSsystem' => 'phpBB2CMS',// defaultCMS - default CMS, blank - stateless CMS  [/code]

and reupload all files.
your flash chat should be working how it should be
auto logins are working and so on
Last edited by Skywalker on Wed Dec 31, 1969 4:00 pm, edited 1 time in total.

Skywalker
Sr Integra Member
Sr Integra Member
 
Posts: 236
Likes: 0 post
Liked in: 0 post
Joined: Fri Apr 14, 2006 4:25 pm
Cash on hand: 0.00

Re: Flash Chat

PostAuthor: Dr. Bantham » Thu Jun 08, 2006 1:39 am

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]
Last edited by Dr. Bantham on Wed Dec 31, 1969 4:00 pm, edited 1 time in total.
User avatar
Dr. Bantham
Integra Member
Integra Member
 
Posts: 152
Likes: 0 post
Liked in: 0 post
Joined: Sat Apr 08, 2006 5:25 pm
Cash on hand: 0.00

PreviousNext

Return to IntegraMOD 140

Who is online

Registered users: Google [Bot], Majestic-12 [Bot]