It appears you have not yet registered with our community. To register please click here...

vbulletin-skins-forum
| Discussions: 2,479 | Messages: 7,246 | Members: 6,413 | Online: 42 | Newest : johnisak (Welcome!)
Logo
All times are GMT -5. The time now is 06:52 AM.

Go Back   Forums Help - vBulletin, IPB, phpBB, SMF skins and community > Forum Areas > vBulletin Area > VB Mods & Plug-ins

VB Mods & Plug-ins All subjects related to vBulletin Mods, Plug-ins & Hacks goes here

Tags: ,

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old 11-23-2007, 04:47 AM   #1 (permalink)
User Profile
caedas
Junior Member
 

Join Date: Nov 2007
Age: 25
Posts: 1
Total Points: 186
Donate
My Photos: (0)
Plugin help - missing fields

A friend of ours made this program...and we have been trying to get it adjusted to work. So far, no luck...but we are close.

I pasted the code/table info below. I am getting the error: Error: User is a controlled non-entity. Cannot login.

It also points to the line: mysql_free_result($result);

In the vB table, some of the fields aren't created. It was written for v3.6.8, and we are using 3.6.1.

Any help is very much appreciated!

PHP Code:
<?php



$relative_root 
"";



$is_login_page true;



require(
$relative_root "util/wrapper.php");



global 
$_POST;



$char_name $_POST["txt_char_name"];

$password  $_POST["txt_password"];



if (
strlen($char_name) == || !isAlpha($char_name))

{

    
httpRedirect("login.php?error=" urlencode("Username must be only characters"));

}



if (
strlen($password) == || !isAlphaNumeric($password))

{

    
httpRedirect("login.php?error=" urlencode("Invalid password"));

}



$encodedPassword md5(strtolower($password));





$authQuery "SELECT username, password, salt FROM vb_user WHERE LOWER(username)='" strtolower($char_name) . "'";

$connect mysql_connect("server_hidden""login_hidden""pass_hidden") or die("Cannot connect.");

mysql_select_db("dbname_hidden") or die("Cannot access DB.");

$sth mysql_query($authQuery$connect) or die("Error in query, unable to retrieve password.");

mysql_close($connect);


if (
mysql_num_rows($sth) == 0httpRedirect("login.php?error=" urlencode("Invalid username or password"));



$row mysql_fetch_assoc($sth);

if (
md5(md5($password). $row["salt"]) != $row["password"]) httpRedirect("login.php?error=" urlencode("Invalid username or password"));

//$result = dbQuery("SELECT * FROM user WHERE LOWER(char_name)='" . strtolower($char_name) . "' AND password='" . $encodedPassword . "'");

$result dbQuery("SELECT * FROM vb_user WHERE LOWER(char_name)='" strtolower($char_name) . "'");



$row mysql_fetch_assoc($result);

if (
$row["is_active"] == "0"httpRedirect("login.php?error=" urlencode("User is inactive. Contact an administrator."));

if (
$row["parent_user_id"] != "0"httpRedirect("login.php?error=" urlencode("User is a controlled non-entity. Cannot login."));



$uid $row["user_id"];



session_start();

session_regenerate_id();



$_SESSION["var"] = $row["test"];



mysql_free_result($result);



dbQuery("UPDATE vb_user SET session_id='" session_id() . "' WHERE user_id=" $uid);



httpRedirect("index.php");



?>

Quote:
Originally Posted by SQL information
-- Table "vb_user" DDL

CREATE TABLE `vb_user` (
`userid` int(10) unsigned NOT NULL auto_increment,
`usergroupid` smallint(5) unsigned NOT NULL default '0',
`membergroupids` varchar(250) NOT NULL default '',
`displaygroupid` smallint(5) unsigned NOT NULL default '0',
`username` varchar(100) NOT NULL default '',
`password` varchar(32) NOT NULL default '',
`passworddate` date NOT NULL default '0000-00-00',
`email` varchar(100) NOT NULL default '',
`styleid` smallint(5) unsigned NOT NULL default '0',
`parentemail` varchar(50) NOT NULL default '',
`homepage` varchar(100) NOT NULL default '',
`icq` varchar(20) NOT NULL default '',
`aim` varchar(20) NOT NULL default '',
`yahoo` varchar(32) NOT NULL default '',
`showvbcode` smallint(5) unsigned NOT NULL default '0',
`showbirthday` smallint(5) unsigned NOT NULL default '2',
`usertitle` varchar(250) NOT NULL default '',
`customtitle` smallint(6) NOT NULL default '0',
`joindate` int(10) unsigned NOT NULL default '0',
`daysprune` smallint(6) NOT NULL default '0',
`lastvisit` int(10) unsigned NOT NULL default '0',
`lastactivity` int(10) unsigned NOT NULL default '0',
`lastpost` int(10) unsigned NOT NULL default '0',
`posts` int(10) unsigned NOT NULL default '0',
`reputation` int(11) NOT NULL default '10',
`reputationlevelid` int(10) unsigned NOT NULL default '1',
`timezoneoffset` varchar(4) NOT NULL default '',
`pmpopup` smallint(6) NOT NULL default '0',
`avatarid` smallint(6) NOT NULL default '0',
`avatarrevision` int(10) unsigned NOT NULL default '0',
`profilepicrevision` int(10) unsigned NOT NULL default '0',
`options` int(10) unsigned NOT NULL default '15',
`birthday` varchar(10) NOT NULL default '',
`birthday_search` date NOT NULL default '0000-00-00',
`maxposts` smallint(6) NOT NULL default '-1',
`startofweek` smallint(6) NOT NULL default '1',
`ipaddress` varchar(15) NOT NULL default '',
`referrerid` int(10) unsigned NOT NULL default '0',
`languageid` smallint(5) unsigned NOT NULL default '0',
`msn` varchar(100) NOT NULL default '',
`emailstamp` int(10) unsigned NOT NULL default '0',
`threadedmode` smallint(5) unsigned NOT NULL default '0',
`autosubscribe` smallint(6) NOT NULL default '-1',
`pmtotal` smallint(5) unsigned NOT NULL default '0',
`pmunread` smallint(5) unsigned NOT NULL default '0',
`salt` char(3) NOT NULL default '',
`skype` varchar(32) NOT NULL default '',
`adminoptions` int(10) unsigned NOT NULL default '0',
`lastpostid` int(10) unsigned NOT NULL default '0',
`sigpicrevision` int(10) unsigned NOT NULL default '0',
`ipoints` int(10) unsigned NOT NULL default '0',
`infractions` int(10) unsigned NOT NULL default '0',
`warnings` int(10) unsigned NOT NULL default '0',
`infractiongroupids` varchar(255) NOT NULL default '',
`infractiongroupid` smallint(5) unsigned NOT NULL default '0',
PRIMARY KEY (`userid`),
KEY `usergroupid` (`usergroupid`),
KEY `username` (`username`),
KEY `birthday` (`birthday`,`showbirthday`),
KEY `birthday_search` (`birthday_search`),
KEY `posts` (`posts`)
) ENGINE=MyISAM AUTO_INCREMENT=349 DEFAULT CHARSET=latin1;
caedas is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply



Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Points Per Thread View: 1
Points Per Thread: 15
Points Per Reply: 5


Similar Threads
Thread Thread Starter Forum Replies Last Post
[3.6.1] Clickable User Fields -=Sniper=- Add-ons 3 05-11-2008 08:37 PM
Radio/Input fields done the hard way? BotMan vBulletin News Feeds 0 07-18-2007 08:39 PM
Input/Radio fields inserted the hard way? BotMan vBulletin News Feeds 0 07-18-2007 07:12 PM
How to add a user profile field when installing a plugin BotMan vBulletin News Feeds 0 02-08-2007 02:41 PM
plugin location help BotMan vBulletin News Feeds 0 12-17-2006 09:33 AM


Links: Babyforum.com | Deejayforum.com | Hometalkcafe.com | Equineboard.com | Evboard.com


Forums Help: Forum Skin Design and Professional Services RSS Feeds



Powered by vBulletin® Version 3.6.7
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.0.0
Forums Help - All Rights Reserved