vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   Member Archives (https://vborg.vbsupport.ru/forumdisplay.php?f=202)
-   -   Can anyone help me? (https://vborg.vbsupport.ru/showthread.php?t=35006)

ace 02-12-2002 08:17 AM

Ok, I'm on a mission to expand my knowledge of PHP and MySQL. So as a project, i decided to try and integrate vB (Yes I am Licensed! Check my records :D) with a news script written by a friend of mine. now this is my problem(s).

My friend's News script uses sessions (vB uses Sessions for admin and cookies for users) and only supports one news poster (the admin).

So I was thinking that if i could modify this enough, i could get it to work with vB. What I'm planning to do is use the usergroupid variable from vB and create a newsposter's group and then multiple people would be able to post news and not just the admin.

The problem i ran into was that when i tried to login, it would not accept my password. I think this has something to do with the MD5 encryption that vB uses on their passwords. How would I be able to do this?


adminlogin.php
PHP Code:

<?php
include("../config.php");
include(
"../global.php");
session_start();
if(!isset(
$uid)) {
?>
<html><head>
<title>X-Gate admin</title></head>
<body leftmargin="10" topmargin="10" marginwidth="10" marginheight="10">
<br><br><br>
<table cellpadding="1" cellspacing="0" border="0" align="center" width="450" bgcolor="<?=$menucolor1?>">
<tr><td><table cellpadding="4" cellspacing="0" border="0" width="100%">
<tr><td><font size='2'><b><font size="3" face="Arial" color="#000000">Please Log in:</font></b></font></td>
</tr><tr>
<td align="center" nowrap bgcolor="<?=$leftcontentmenu?>"> 
<p><font face="Arial" size="2" color="#000000">You are either not a valid administrator or have not logged in.<br>
</font>
<form method="post" action="<?=$PHP_SELF?>">
<table cellpadding="0" cellspacing="1" border="0">
<tr><td><input type="text" name="uid"></td>
<td><input type="password" name="pwd"></td>
<td><input type="submit" value="Log in"></td>
</tr><tr><td><font size="1" face="Verdana, Arial, Helvetica, sans-serif" color="#000000">Username</font></td>
<td colspan="2"><font size="1" face="Verdana, Arial, Helvetica, sans-serif" color="#000000">Password</font></td>
</tr></table>
</form>
</td></tr></table>
</td></tr></table>
<p align="center"><font size="1" face="Verdana"><b>X-Gate v1.3 Administrator Control Panel</b></font></p>
</body></html>

<?php
exit;
}
session_register("uid");
session_register("pwd");

mysql_select_db("auspc_net");

$sql "SELECT * FROM user WHERE username = '$uid' AND password = '$pwd'";
$result mysql_query($sql);

if (
$number mysql_num_rows($result) == 0) {
session_unregister("uid");
session_unregister("pwd");
?>

<br>
<meta http-equiv ="Refresh" content = "0 ; URL=<?=$HTTP_REFERER?>">
<?php
exit;
}
$adminname mysql_result($result,0,"userid");
$adminemail mysql_result($result,0,"email");
$password mysql_result($result,0,"password");
?>


global.php
PHP Code:

<?php

mysql_connect
($DBhost,$DBuser,$DBpass) or die("Unable to connect to database");
mysql_select_db ($DBname);
    
    
$result mysql_db_query($DBname"SELECT * FROM newsoptions");
    
$row mysql_fetch_array($result);

    
$adminname $row["adminname"];
    
$adminemail $row["adminemail"];
    
$welcome_msg $row["welcomemsg"];
    
$boxxnet_site $row["xgate"];
    
$sitename5 $row["sitename"];
    
$backgroundcolor $row["color1"];
    
$menucolor1 $row["color2"];
    
$textcolor $row["textcolor"];
    
$leftcontentmenu $row["color3"];
    
$footer $row["footer"];
    
$logoimage $row["logoimage"];
    
$siteurl $row["siteurl"];
    
$titlecolor $row["titlecolor"];
    
$titlebgcolor $row["titlebgcolor"];
    
$version $row["version"];
    
$leftmwidth $row["leftmwidth"];
?>

Any help GREATLY appreciated.

Cheers

ace 02-13-2002 06:39 AM

anyone? :(

Dark_Wizard 02-13-2002 09:45 PM

Why not just use vb's session/permissions instead of using the ones in this script? Just look at the other files in vb to get an idea of what you need to do. You would also want to use vb's global.php and merge the data in the news scripts global php into the adminlogin.php. You could also go further and use vb's sql functions as well....just my 2 cents...


All times are GMT. The time now is 08:31 AM.

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.01159 seconds
  • Memory Usage 1,739KB
  • 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_php_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (3)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