vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 2.x Full Releases (https://vborg.vbsupport.ru/forumdisplay.php?f=4)
-   -   A phpMyChat integration Hack (https://vborg.vbsupport.ru/showthread.php?t=21329)

Stasik 06-25-2001 10:00 PM

Hi.... it is my first hack - phpProbe ;)
here is it... it was tested under vbb2x RC2 and phpMyChat 0.14.4

News:
Updated on 19.07.01
- FAQ has been add

Updated on 18.07.01
The hack is compatible with version 0.14.5 of phpMyChat
- there is some javaScript code there, so the hack will not work with browsers without JS support (phpMyChat will not work with these browsers too ;) )
- the Exit link in chat works ok now

Hack:
Step 1:
open /lib/index.lib.php3 in yours phpMyChat Derictory
find:
PHP Code:

// Fix some security holes 

replace it with
PHP Code:

//a VBB integration hack by Stasik (stasik@t-online.de)
//v0.1
//(C)2001

$exiturl "http://www.blabla.com"// the url the user will be redirected exiting the chat

if($Ver == ""){print "
<HTML>
<SCRIPT TYPE=\"text/javascript\" LANGUAGE=\"javascript\">
    <!--
    var NS4 = (document.layers) ? 1 : 0;
    var IE4 = ((document.all) && (parseInt(navigator.appVersion)>=4)) ? 1 : 0;
    var ver4 = (NS4 || IE4) ? \"H\" : \"L\";
function defineVerField()
    {
        if (document.images && ver4 == 'L')
            document.forms['Params'].elements['Ver'].value = 'M';    // js1.1 enabled browser
        else document.forms['Params'].elements['Ver'].value = ver4;
    }
 -->
</SCRIPT>
<FORM ACTION=\"index.php3\" METHOD=\"POST\" AUTOCOMPLETE=\"OFF\" NAME=\"Params\">
<INPUT TYPE=\"hidden\" NAME=\"Ver\" VALUE=\"L\">
</FORM>
<SCRIPT TYPE=\"text/javascript\" LANGUAGE=\"javascript\">
defineVerField();
document.forms.Params.submit();
</SCRIPT>
</HTML>
"
; exit;}

chdir("/path/to/board/");
require(
"./global.php");
chdir("/path/to/chat/");

if (
$bbuserid == 0

print 
"no"//Message if the user has no cookie
exit; 
}
else
{
if (
$bbusername == "" || (isset($bbusername))==0

$getusername=$DB_site->query_first("SELECT username FROM user WHERE userid=$bbuserid"); 
$username=$getusername[username]; 
$bbusername $username
}
else 

$username $bbusername
} }

$U $username;

$pat "[[:space:]]"
$repl ""
$U ereg_replace($pat,$repl,$U); 
$pat ','
$U ereg_replace($pat,$repl,$U); 
stripslashes($U); 

$N 20
$D 10
$Form_Send 1

//Replace admin with your administration nick
if($U != "Admin")
{
$PASSWORD="1";
}

// Fix some security holes 

Step 2:
open /lib/index.lib.php3 in yours phpMyChat Derictory
find:
PHP Code:

$DbLink->query("INSERT INTO ".C_MSG_TBL." VALUES ($EN, '$E', 'SYS exit', '', ".time().", '', 'sprintf(L_EXIT_ROM, \"".special_char($U,$Latin1)."\")')");
        }
    } 

replace it with:
PHP Code:

$DbLink->query("INSERT INTO ".C_MSG_TBL." VALUES ($EN, '$E', 'SYS exit', '', ".time().", '', 'sprintf(L_EXIT_ROM, \"".special_char($U,$Latin1)."\")')");
        }
    }
if(
$exit == "1"){header ("Location: $exiturl"); exit;} 

Step 3:
open /exit.php3 in yours phpMyChat Derictory
find:

PHP Code:

<A HREF="<?php echo("$From?Ver=$Ver&L=$L&U=".urlencode(stripslashes($U))."&E=".urlencode(stripslashes($R))."&EN=$T"); ?>" TARGET="_parent"><?php echo(L_EXIT); ?></A>

replace it with:
PHP Code:

<A HREF="<?php echo("$From?exit=1&Ver=$Ver&L=$L&U=".urlencode(stripslashes($U))."&E=".urlencode(stripslashes($R))."&EN=$T"); ?>" TARGET="_parent"><?php echo(L_EXIT); ?></A>

ENJOY

FAQ:
Q: I`m getting "no" every time.
A: You need to upgrade a cookie option in your VB control panel. Write under: Options->Change Options->[HTTP Headers and output]->Cookie Domain your domainname ONLY (blabla.com).

Q: I`m getting "you need to register" error.
A: Enable chat using for not registered users in your phpMyChat config (/config/config.lib.php3).

Q: I`m getting "wrong password" error.
A: Make shure you have deleted all user accounts in your chat and have only administrative one. If you are logging is as administrator note that you have to enter your password EVERY time you are logging in.

Questions or Bug reports?
Post it here I`ll answer ASAP.

Dakota 06-26-2001 07:10 PM

Is there a demo of it? I would like to see it in action before installing it.

Stasik 06-27-2001 07:47 AM

there was a local demo of it, i`m searching a demo forum... IT WORKS REALLY :)

polizist 07-12-2001 09:08 AM

Your hack works fine for me, but i have a quastion:

Ho are users able to open a private room? They are not listed in the phpmychat user database i guess, so they can "only" chat, right?

Is there a chance to use the vbulletin database for all other actions (like open a private room)?

Best wishes, polizist

MarkB 07-12-2001 09:56 AM

Is phpMyChat hard on a server? I'm running on a virtual account, and would love to have this hack, but I'd like to know whether the chat script would have my host howling for my blood (or shutting down my account;)) first :)

polizist 07-12-2001 10:03 AM

well, we have it on our own server with a gig of memory. just try what happens ;)

rmusic 07-12-2001 12:00 PM

is there a php4 version of phpmychat because i cant use php3 on my site :(

Stasik 07-12-2001 02:12 PM

I think there is no php4 version

Stasik 07-12-2001 02:14 PM

Quote:

Originally posted by polizist
Your hack works fine for me, but i have a quastion:

Ho are users able to open a private room? They are not listed in the phpmychat user database i guess, so they can "only" chat, right?

Is there a chance to use the vbulletin database for all other actions (like open a private room)?

Best wishes, polizist

Hi....

this things with other actions are not so easy to do...... i know theoretically how to do it, but i have no time and lust to do it :(

bye...

P.S. Nickname "Polizist" ist geil :)

snyx 07-12-2001 11:56 PM

I installed this hack, but it dont work? It just keeps saying "invalid password" no matter who trys?

Stasik 07-13-2001 12:59 PM

Hi

you have to allow the chat-use to unregistered useres (using setup.php3 or manually in config file)

--OR/AND--

you have to delete all users from chat and leave only Admin-nick

bye

webhost 07-15-2001 02:51 AM

Will it work with version 2.0.1 and phpmychat version 14.2 if so where do I place it because fix security holes is not found in version 14.2

Thanks

Stasik 07-15-2001 04:25 PM

hi

try to enter this text BEFORE
"require("./${ChatPath}config/config.lib.php3");"

if not then

try to upgrade your chat or post index.lib.php3 here

BYE

webhost 07-15-2001 04:53 PM

I am waiting to upgrade my chat until 15.0 comes up.

Here is the url http://chat.realwebhost.net

Here is the link to my forums http://forums.realwebhost.net

I have attached the zip file. I did try to place code where you stated and I tried this for the paths
board path I tried http://forums.realwebhost.net and also tried http://www.realwebhost.net/forums I think it should be the first one because that is how I get to my forums.

Niether worked gave a error saying bad path.

Then I tried chat path the same way switching the word forums with chat and I got the samew errors.
I have attached the file

Joey

Stasik 07-15-2001 05:06 PM

enter a hack code before:

"require("./${ChatPath}config/config.lib.php3");"

for the both path i will need a tree of your server.

webhost 07-15-2001 05:17 PM

this is the error I get with the attached file. I have attached the file to this thread with the script change in it
Warning: ChDir: No such file or directory (errno 2) in /home/realweb/public_html/chat/chat/lib/index.lib.php3 on line 60

Warning: ChDir: No such file or directory (errno 2) in /home/realweb/public_html/chat/chat/lib/index.lib.php3 on line 62
no

When I ftp in I have files and directories including public)html underneath this I have the forums directory which has forums/gobal.php and also the chat directory which is chat/chat/lib/index.lib.php

Stasik 07-15-2001 06:01 PM

your both path are not ok

try smth like this

fist
/home/realweb/public_html/forums/

second
/home/realweb/public_html/chat/chat/

webhost 07-15-2001 06:02 PM

Here is the script I put in and below that is the error I get.

chdir("public_html/forums");
require("http://www.realwebhost.net/forums/global.php");
chdir("./${ChatPath}");

Warning: ChDir: No such file or directory (errno 2) in /home/realweb/public_html/chat/chat/lib/index.lib.php3 on line 60
no

webhost 07-15-2001 06:07 PM

OK HERE is the script change you recommended and below that is the error I get

chdir("/home/realweb/public_html/forums/ ");
require("/global.php");
chdir("/home/realweb/public_html/chat/chat/");

==========================================

Warning: ChDir: No such file or directory (errno 2) in /home/realweb/public_html/chat/chat/lib/index.lib.php3 on line 60

Fatal error: Failed opening required '/global.php' (include_path='') in /home/realweb/public_html/chat/chat/lib/index.lib.php3 on line 61

Stasik 07-15-2001 06:07 PM

NOOOOOOO

here are the parts... i think they are ok

look and replace

//a VBB integration hack by Stasik - source parts were taken from other authors ;)
chdir("/home/realweb/public_html/forums/");
require("./global.php");
chdir("/home/realweb/public_html/chat/chat/");

Stasik 07-15-2001 06:08 PM

ok... write me a FULL PATH to your forum

webhost 07-15-2001 06:12 PM

I put this in

chdir("/home/realweb/public_html/forums/");
require("./global.php");
chdir("/home/realwhttp://www.vbulletin.com/forum/newreply.php?action=newreply&threadid=21329eb/public_html/chat/chat/");

Now go here and see what we get
http://chat.realwebhost.net

Stasik 07-15-2001 06:18 PM

u has a small tipp mistake there

but as i have seen in link it works... replace "no" wiht page that means "chat is only for forum registered members... please login yourself or register" or so that ;)

webhost 07-15-2001 06:25 PM

this is what I put in go to link and see result

print "/index.php3"; //Message if the user has no cookie
exit;

Stasik 07-15-2001 06:28 PM

you should write
require("./index.php3");


BUT IT WOULD NOT WORK!

you can foget the standart login page with this hack... :(

users without forum-accout can not use it :(

webhost 07-15-2001 06:30 PM

ok I changed go to link and see result

webhost 07-15-2001 06:38 PM

here is line 9 and 10 of my global.php file

// get rid of slashes in get / post / cookie data
function stripslashesarray (&$arr) {

Stasik 07-15-2001 06:38 PM

ups ;)

i dont know php very good.. delete the line ;)

replace "no" with HTML code

webhost 07-15-2001 07:05 PM

we tired I think the way you put require ./index.php3 in is correct problem somewhere else. I f you have it working could you direct to the url where I could see it in action?

Stasik 07-15-2001 07:16 PM

i`ll show you original php-code

~~
if ($bbuserid == 0)
{
print "<html>
Please register you or login you by our forum.
</html>
";
exit;
}
else
{
if ($bbusername == "" || (isset($bbusername))==0)
~~

somthing like this

Stasik 07-15-2001 07:29 PM

it had workt I had seen it.... it worked when there was "no"

polizist 07-17-2001 12:06 PM

Quote:

Originally posted by webhost
we tired I think the way you put require ./index.php3 in is correct problem somewhere else. I f you have it working could you direct to the url where I could see it in action?
http://www.windelwinni.de/docs/forum/index.php

Click on a forum and read the red marked announcement. Into the annoucement click on "hier aufrufen" and enter the chat (or not, if you?re not registered)

but it?s german ;)

webhost 07-17-2001 12:50 PM

Thanks
It was a struggle, no good at German but I did manage to register on your board and go to the chat room. What version of vb and phpmycaht ar you using. Can you help me get mind working. I am using vb 2.0.1 and phpmychat version 14.2

Joey

Great looking board which I could understand the German though.

polizist 07-17-2001 01:09 PM

Well, i should be able to help you. What?s your problem?

We are using 2.0.0 with phpMyChat *14..5

What is the exact problem? Maybe you can post a link to your forum or chat and i?ll see what i can do. But i`m very busy, so please bepatience ;)

polizist

webhost 07-17-2001 01:34 PM

forum is here http://forums.realwebhost.net
chat is here http://chat.realwebhost.net

I have a chat button on the top of the opening page in my forum

Thanks you can read the previous posts and see what peoblems we were having.

Stasik 07-17-2001 04:54 PM

Hey webhost, it has worked by you, when there was written "no".

webhost 07-17-2001 04:57 PM

I never got it working.

Stasik 07-17-2001 05:01 PM

ok... lets start it new

edit ur /usr/lib/index.lib.php3
plaste bbefore "require("./${ChatPath}config/config.lib.php3");"

//a VBB integration hack by Stasik - source parts were taken from other authors ;)
chdir("/home/realweb/public_html/forums/");
require("./global.php");
chdir("/home/realweb/public_html/chat/chat/");

if ($bbuserid == 0)
{
print "no"; //Message if the user has no cookie
exit;
}
else
{
if ($bbusername == "" || (isset($bbusername))==0)
{
$getusername=$DB_site->query_first("SELECT username FROM user WHERE userid=$bbuserid");
$username=$getusername[username];
$bbusername = $username;
}
else
{
$username = $bbusername;
} }

$U = $username;

$pat = "[[:space:]]";
$repl = "";
$U = ereg_replace($pat,$repl,$U);
$pat = ',';
$U = ereg_replace($pat,$repl,$U);
stripslashes($U);

$N = 20;
$D = 10;
$Form_Send = 1;

//Replace admin with your administration nick
if($U != "Admin")
{
$PASSWORD="1";
}


If you had a login problems (bad password), I have forgotten to say, that you have to DELETE all exisind accounts and leave only admin-account

webhost 07-17-2001 09:20 PM

Sorry for the delay, got busy. Do you mean delete all users in my chat and just leave admin?

Joey

Stasik 07-17-2001 09:45 PM

yes, I mean it

P.S. The name must not be "Admin", but if you want it - you can do it ;)


All times are GMT. The time now is 09:48 PM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01533 seconds
  • Memory Usage 1,855KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (6)bbcode_php_printable
  • (2)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (2)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (40)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete