vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 Programming Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=15)
-   -   Hack not working in internal forums? (https://vborg.vbsupport.ru/showthread.php?t=169056)

Sven 01-29-2008 12:08 PM

Hack not working in internal forums?
 
1 Attachment(s)
We have created a nice function that parses information of a gamereplay that is attached to a posting. Works nice but there's a problem:
In all forums that are 'internal' the tool won't work.

This is the code used:
showthread.php (3.6.4), lines 939 to 942, of course the file that contains the stremreplay function is included at the top of showthread.php (line 99: require_once("twrr.php"); )
Code:

            if (stristr($attachment['filename'], ".CNC3Replay"))
            {
                    $attachment['replay'] = streamReplay("http://www.cncforen.de/attachment.php?attachmentid=$attachment[attachmentid]", $attachment['filename']);
}

postbit_attachment template:
Code:

<tr>
        <td valign='top'><img class="inlineimg" src="$stylevar[imgdir_attach]/$attachment[attachmentextension].gif" alt="<phrase 1="$attachment[attachmentextension]">$vbphrase[file_type_x]</phrase>" width="16" height="16" border="0" style="vertical-align:baseline" /></td>
        <td><a href="attachment.php?$session[sessionurl]attachmentid=$attachment[attachmentid]&amp;d=$attachment[dateline]"<if condition="$show['newwindow']"> target="_blank"</if>>$attachment[filename]</a> ($attachment[filesize]<if condition="$show['views']">, <phrase 1="$attachment[counter]">$vbphrase[x_views]</phrase></if>)


<if condition="$attachment['replay']">
<div style='border:1px double medium; height: 300px; margin:3px; padding:3px;'>
<div class='thead'>Replayinfos: (<small>Beta-Status)</small></div>
<div class='alt1'>
        <span>Replay-Version: {$attachment[replay][version]} | </span>
        <span>Game-Name: {$attachment[replay][name]} | </span>
        <span>Voip: {$attachment[replay][ini][voip]} | </span>
        <span>Battlecast: {$attachment[replay][ini][bc]}</span>
</div>
<div class='alt2' style='border-top:1px solid; border-bottom:1px solid;'>
        <span>Kisten: {$attachment[replay][ini][crates]} | </span>
        <span>Startcredits: {$attachment[replay][ini][startcash]} | </span>
        <span>Gamespeed: {$attachment[replay][ini][gamespeed]} | </span>
        <span>Sonst: {$attachment[replay][ini][gametype]}, {$attachment[replay][ini][matchtype]}</span>
</div>
<div style='float:left;'>
<div style='text-align:center; padding:3px;'><strong>Map: {$attachment[replay][mapname]}</strong></div>
<if condition="$attachment['replay']['official']">
<img src='images/mappics/{$attachment[replay][mapname]}.png' style='width:200px; height:200px; margin:3px;' alt='{$attachment[replay][mapname]}' />
<else />
<img src='images/mappics/unofficial.jpg' style='width:200px; height:200px; margin:3px;' alt='{$attachment[replay][mapname]}' />
</if></div>
<div style='margin:3px; text-align:center;'>
        <table border='1' cellpadding='0' cellspacing='0'>
                <tr>
                        <td style='font-weight:bold;'>#</td>
                        <td style='font-weight:bold;'>&nbsp;Fraktion&nbsp;</td>
                        <td style='font-weight:bold;'>&nbspSpieler-Typ&nbsp;</td>
                        <td style='font-weight:bold;'>&nbsp;Name&nbsp;</td>
                        <td style='font-weight:bold;'>&nbsp;Team&nbsp;</td>
                        <td style='font-weight:bold;'>&nbsp;Farbe&nbsp;</td>
                        <td style='font-weight:bold;'>&nbsp;Position&nbsp;</td>
                        <td style='font-weight:bold;'>&nbsp;Clan&nbsp;</td>
                </tr>
<if condition="$attachment[replay][ini][players][1]">
                <tr style='height:25px;'>
                        <td>1</td>
                        <td>&nbsp;<img src='images/mappics/{$attachment[replay][ini][players][1][faction]}.png' alt='{$attachment[replay][ini][players][1][faction]}' />&nbsp;</td>
                        <td>&nbsp;{$attachment[replay][ini][players][1][playertype]}&nbsp;</td>
                        <td>&nbsp;{$attachment[replay][ini][players][1][playername]}</a>&nbsp;</td>
                        <td>&nbsp;{$attachment[replay][ini][players][1][team]}&nbsp;</td>
                        <td>&nbsp;{$attachment[replay][ini][players][1][color]}&nbsp;</td>
                        <td>&nbsp;{$attachment[replay][ini][players][1][mappos]}&nbsp;</td>
                        <td>&nbsp;{$attachment[replay][ini][players][1][clan]}&nbsp;</td>
                </tr>
</if>
<if condition="$attachment[replay][ini][players][2]">
                <tr style='height:25px;'>
                        <td>2</td>
                        <td>&nbsp;<img src='images/mappics/{$attachment[replay][ini][players][2][faction]}.png' alt='{$attachment[replay][ini][players][2][faction]}' />&nbsp;</td>
                        <td>&nbsp;{$attachment[replay][ini][players][2][playertype]}&nbsp;</td>
                        <td>&nbsp;{$attachment[replay][ini][players][2][playername]}&nbsp;</td>
                        <td>&nbsp;{$attachment[replay][ini][players][2][team]}&nbsp;</td>
                        <td>&nbsp;{$attachment[replay][ini][players][2][color]}&nbsp;</td>
                        <td>&nbsp;{$attachment[replay][ini][players][2][mappos]}&nbsp;</td>
                        <td>&nbsp;{$attachment[replay][ini][players][2][clan]}&nbsp;</td>
                </tr>
</if>
<if condition="$attachment[replay][ini][players][3]">
                <tr style='height:25px;'>
                        <td>3</td>
                        <td>&nbsp;<img src='images/mappics/{$attachment[replay][ini][players][3][faction]}.png' alt='{$attachment[replay][ini][players][3][faction]}' />&nbsp;</td>
                        <td>&nbsp;{$attachment[replay][ini][players][3][playertype]}&nbsp;</td>
                        <td>&nbsp;{$attachment[replay][ini][players][3][playername]}&nbsp;</td>
                        <td>&nbsp;{$attachment[replay][ini][players][3][team]}&nbsp;</td>
                        <td>&nbsp;{$attachment[replay][ini][players][3][color]}&nbsp;</td>
                        <td>&nbsp;{$attachment[replay][ini][players][3][mappos]}&nbsp;</td>
                        <td>&nbsp;{$attachment[replay][ini][players][3][clan]}&nbsp;</td>
                </tr>
</if>
<if condition="$attachment[replay][ini][players][4]">
                <tr style='height:25px;'>
                        <td>4</td>
                        <td>&nbsp;<img src='images/mappics/{$attachment[replay][ini][players][4][faction]}.png' alt='{$attachment[replay][ini][players][4][faction]}' />&nbsp;</td>
                        <td>&nbsp;{$attachment[replay][ini][players][4][playertype]}&nbsp;</td>
                        <td>&nbsp;{$attachment[replay][ini][players][4][playername]}&nbsp;</td>
                        <td>&nbsp;{$attachment[replay][ini][players][4][team]}&nbsp;</td>
                        <td>&nbsp;{$attachment[replay][ini][players][4][color]}&nbsp;</td>
                        <td>&nbsp;{$attachment[replay][ini][players][4][mappos]}&nbsp;</td>
                        <td>&nbsp;{$attachment[replay][ini][players][4][clan]}&nbsp;</td>
                </tr>
</if>
<if condition="$attachment[replay][ini][players][5]">
                <tr style='height:25px;'>
                        <td>5</td>
                        <td>&nbsp;<img src='images/mappics/{$attachment[replay][ini][players][5][faction]}.png' alt='{$attachment[replay][ini][players][5][faction]}' />&nbsp;</td>
                        <td>&nbsp;{$attachment[replay][ini][players][5][playertype]}&nbsp;</td>
                        <td>&nbsp;{$attachment[replay][ini][players][5][playername]}&nbsp;</td>
                        <td>&nbsp;{$attachment[replay][ini][players][5][team]}&nbsp;</td>
                        <td>&nbsp;{$attachment[replay][ini][players][5][color]}&nbsp;</td>
                        <td>&nbsp;{$attachment[replay][ini][players][5][mappos]}&nbsp;</td>
                        <td>&nbsp;{$attachment[replay][ini][players][5][clan]}&nbsp;</td>
                </tr>
</if>
<if condition="$attachment[replay][ini][players][6]">
                <tr style='height:25px;'>
                        <td>6</td>
                        <td>&nbsp;<img src='images/mappics/{$attachment[replay][ini][players][6][faction]}.png' alt='{$attachment[replay][ini][players][6][faction]}' />&nbsp;</td>
                        <td>&nbsp;{$attachment[replay][ini][players][6][playertype]}&nbsp;</td>
                        <td>&nbsp;{$attachment[replay][ini][players][6][playername]}&nbsp;</td>
                        <td>&nbsp;{$attachment[replay][ini][players][6][team]}&nbsp;</td>
                        <td>&nbsp;{$attachment[replay][ini][players][6][color]}&nbsp;</td>
                        <td>&nbsp;{$attachment[replay][ini][players][6][mappos]}&nbsp;</td>
                        <td>&nbsp;{$attachment[replay][ini][players][6][clan]}&nbsp;</td>
                </tr>
</if>
<if condition="$attachment[replay][ini][players][7]">
                <tr style='height:25px;'>
                        <td>7</td>
                        <td>&nbsp;<img src='images/mappics/{$attachment[replay][ini][players][7][faction]}.png' alt='{$attachment[replay][ini][players][7][faction]}' />&nbsp;</td>
                        <td>&nbsp;{$attachment[replay][ini][players][7][playertype]}&nbsp;</td>
                        <td>&nbsp;{$attachment[replay][ini][players][7][playername]}&nbsp;</td>
                        <td>&nbsp;{$attachment[replay][ini][players][7][team]}&nbsp;</td>
                        <td>&nbsp;{$attachment[replay][ini][players][7][color]}&nbsp;</td>
                        <td>&nbsp;{$attachment[replay][ini][players][7][mappos]}&nbsp;</td>
                        <td>&nbsp;{$attachment[replay][ini][players][7][clan]}&nbsp;</td>
                </tr>
</if>
<if condition="$attachment[replay][ini][players][8]">
                <tr style='height:25px;'>
                        <td>8</td>
                        <td>&nbsp;<img src='images/mappics/{$attachment[replay][ini][players][8][faction]}.png' alt='{$attachment[replay][ini][players][8][faction]}' />&nbsp;</td>
                        <td>&nbsp;{$attachment[replay][ini][players][8][playertype]}&nbsp;</td>
                        <td>&nbsp;{$attachment[replay][ini][players][8][playername]}&nbsp;</td>
                        <td>&nbsp;{$attachment[replay][ini][players][8][team]}&nbsp;</td>
                        <td>&nbsp;{$attachment[replay][ini][players][8][color]}&nbsp;</td>
                        <td>&nbsp;{$attachment[replay][ini][players][8][mappos]}&nbsp;</td>
                        <td>&nbsp;{$attachment[replay][ini][players][8][clan]}&nbsp;</td>
                </tr>
</if>
</table>
</div>
<div style='clear:left;'></div>               
<div class='thead' style='padding:3px; margin:3px;'>&copy; Chrissyx &amp; cncforen.de</div>
</div>
</if>

</td>
</tr>

Attached please find the twrr.php

I don't have a clue why it is working in forums that are public and not in forums that have limited access by usergroup or individually.
Please help...

Sven 01-29-2008 06:03 PM

We got a little further and found out that it seems like the twrr.php behaves as if it would be a user without proper permissions.

How can we achieve that it is recognized as having permission?


All times are GMT. The time now is 03:54 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.01452 seconds
  • Memory Usage 1,765KB
  • 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
  • (2)bbcode_code_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (2)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
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete