Ravens PHP Scripts: Forums
 

 

View next topic
View previous topic
Post new topic   Reply to topic    Ravens PHP Scripts And Web Hosting Forum Index -> Security - PHP Nuke
Author Message
scriptleek
Hangin' Around



Joined: Oct 19, 2005
Posts: 40

PostPosted: Tue Oct 25, 2005 5:34 am Reply with quote

Hi, Suddenly another weird error occurred.
When my users want to register they get the message ..error! username already taken.. Whatever username they choose they get this message.

phpnuke 7.8 patched 3.1

can anyone help me out here?

Thnx.
Regards;
Scriptleek.
 
View user's profile Send private message
CurtisH
Life Cycles Becoming CPU Cycles



Joined: Mar 15, 2004
Posts: 638
Location: West Branch, MI

PostPosted: Tue Oct 25, 2005 6:21 am Reply with quote

Check your nuke_users table and make sure that you have an entry for anonymous with the user_id of "1"

Without that entry you can get the error you are reporting.

_________________
Those who dream by day are cognizant of many things which escape those who dream only by night. ~Poe 
View user's profile Send private message Visit poster's website Yahoo Messenger
scriptleek







PostPosted: Tue Oct 25, 2005 6:37 am Reply with quote

Hello CurtisH, thnx for the info i restored my db and all works now but i was curious what caused it..now i know.. the weird thing is ..it works..ok..but..now i checked my db and in the nuke_users table there are all users but no anonymous Shocked and when i try to add anonymous to the database i get the error..#1136 - Column count doesn't match value count at row 1 ..using the original 7.8 table string:

INSERT INTO nuke_users VALUES (1, '', 'Anonymous', '', '', '', 'blank.gif', 'Nov 10, 2000', '', '', '', '', '', 0, 0, '', '', '', '', 10, '', 0, 0, 0, '', 0, '', '', 4096, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 10, NULL, 'english', 'D M d, Y g:i a', 0, 0, 0, NULL, 1, 1, 1, 1, 1, 1, 1, 1, 0, 3, NULL, NULL, NULL, 0, '0', 0);

Am i overlooking things?
Thnx & regards;
Scriptleek.
 
CurtisH







PostPosted: Tue Oct 25, 2005 6:54 am Reply with quote

Compare your INSERT statement with the existing table to ensure that you have the same number of values as there are columns. If they do not match you will get that error.
 
scriptleek







PostPosted: Tue Oct 25, 2005 6:57 am Reply with quote

Ah.. i c ..hm..ok many thnx CurtisH.

Greetz;
Scriptleek.
 
scriptleek







PostPosted: Tue Oct 25, 2005 2:23 pm Reply with quote

Good evening,

Well after the above post i tried and i tried but i gave up on how to add the anonymous user to the database..i ran out of options.. so i don't know how to do this.

Can anybody explain how to add the anonymous user to my database please because now i constantly get the ..username already taken.. error at registration.

Thnx.
Regards;
Scriptleek.
 
CurtisH







PostPosted: Tue Oct 25, 2005 2:32 pm Reply with quote

Please provide the sql for the nuke_users table. Export the table (not data too, just the table) to an sql file and post it (using the code tags please) in a reply so I can see the structure of your nuke_users table.

It should look something like this:

Code:


CREATE TABLE nuke_users (
  user_id int(11) NOT NULL auto_increment,
  name varchar(60) NOT NULL default '',
  username varchar(25) NOT NULL default '',
  user_email varchar(255) NOT NULL default '',
  femail varchar(255) NOT NULL default '',
  user_website varchar(255) NOT NULL default '',
  user_avatar varchar(255) NOT NULL default '',
  user_regdate varchar(20) NOT NULL default '',
  user_icq varchar(15) default NULL,
  user_occ varchar(100) default NULL,
  user_from varchar(100) default NULL,
  user_interests varchar(150) NOT NULL default '',
  user_sig varchar(255) default NULL,
  user_viewemail tinyint(2) default NULL,
  user_theme int(3) default NULL,
  user_aim varchar(18) default NULL,
  user_yim varchar(25) default NULL,
  user_msnm varchar(25) default NULL,
  user_password varchar(40) NOT NULL default '',
  storynum tinyint(4) NOT NULL default '10',
  umode varchar(10) NOT NULL default '',
  uorder tinyint(1) NOT NULL default '0',
  thold tinyint(1) NOT NULL default '0',
  noscore tinyint(1) NOT NULL default '0',
  bio tinytext NOT NULL,
  ublockon tinyint(1) NOT NULL default '0',
  ublock tinytext NOT NULL,
  theme varchar(255) NOT NULL default '',
  commentmax int(11) NOT NULL default '4096',
  counter int(11) NOT NULL default '0',
  newsletter int(1) NOT NULL default '0',
  user_posts int(10) NOT NULL default '0',
  user_attachsig int(2) NOT NULL default '0',
  user_rank int(10) NOT NULL default '0',
  user_level int(10) NOT NULL default '1',
  broadcast tinyint(1) NOT NULL default '1',
  popmeson tinyint(1) NOT NULL default '0',
  user_active tinyint(1) default '1',
  user_session_time int(11) NOT NULL default '0',
  user_session_page smallint(5) NOT NULL default '0',
  user_lastvisit int(11) NOT NULL default '0',
  user_timezone tinyint(4) NOT NULL default '10',
  user_style tinyint(4) default NULL,
  user_lang varchar(255) NOT NULL default 'english',
  user_dateformat varchar(14) NOT NULL default 'D M d, Y g:i a',
  user_new_privmsg smallint(5) unsigned NOT NULL default '0',
  user_unread_privmsg smallint(5) unsigned NOT NULL default '0',
  user_last_privmsg int(11) NOT NULL default '0',
  user_emailtime int(11) default NULL,
  user_allowhtml tinyint(1) default '1',
  user_allowbbcode tinyint(1) default '1',
  user_allowsmile tinyint(1) default '1',
  user_allowavatar tinyint(1) NOT NULL default '1',
  user_allow_pm tinyint(1) NOT NULL default '1',
  user_allow_viewonline tinyint(1) NOT NULL default '1',
  user_notify tinyint(1) NOT NULL default '0',
  user_notify_pm tinyint(1) NOT NULL default '0',
  user_popup_pm tinyint(1) NOT NULL default '0',
  user_avatar_type tinyint(4) NOT NULL default '3',
  user_sig_bbcode_uid varchar(10) default NULL,
  user_actkey varchar(32) default NULL,
  user_newpasswd varchar(32) default NULL,
  points int(10) default '0',
  last_ip varchar(15) NOT NULL default '0',
  PRIMARY KEY  (user_id),
  KEY uid (user_id),
  KEY uname (username),
  KEY user_session_time (user_session_time)
) TYPE=MyISAM;
 
Raven
Site Admin/Owner



Joined: Aug 27, 2002
Posts: 17088

PostPosted: Tue Oct 25, 2005 2:33 pm Reply with quote

INSERT INTO nuke_users VALUES (NULL, '', 'Anonymous', '', '', '', 'blank.gif', 'Nov 10, 2000', '', '', '', '', '', 0, 0, '', '', '', '', 10, '', 0, 0, 0, '', 0, '', '', 4096, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 10, NULL, 'english', 'D M d, Y g:i a', 0, 0, 0, NULL, 1, 1, 1, 1, 1, 1, 1, 1, 0, 3, NULL, NULL, NULL, 0, '0', 0);

That will get it added but the system assumes that Anonymous is user_id 1. What I would do is this. Use phpMyAdmin and assign whatever user has user_id 1 a new number. Just make it the very next number in sequence. Then, modify Anonymous to be uder_id 1.
 
View user's profile Send private message
scriptleek







PostPosted: Tue Oct 25, 2005 2:52 pm Reply with quote

Hi Raven, i tried your INSERT but didn't work then i get a sql error about column 1 thingy...so below the nuke_users table of my phpnuke v7.8 patched 3.1.

#
# Table structure for table 'nuke_users'
#

DROP TABLE IF EXISTS `nuke_users`;
CREATE TABLE `nuke_users` (
`user_id` int(11) NOT NULL auto_increment,
`name` varchar(60) NOT NULL default '',
`username` varchar(25) NOT NULL default '',
`user_email` varchar(255) NOT NULL default '',
`femail` varchar(255) NOT NULL default '',
`user_website` varchar(255) NOT NULL default '',
`user_avatar` varchar(255) NOT NULL default '',
`user_regdate` varchar(20) NOT NULL default '',
`user_icq` varchar(15) default NULL,
`user_occ` varchar(100) default NULL,
`user_from` varchar(100) default NULL,
`user_interests` varchar(150) NOT NULL default '',
`user_sig` varchar(255) default NULL,
`user_viewemail` tinyint(2) default NULL,
`user_theme` int(3) default NULL,
`user_aim` varchar(1Cool default NULL,
`user_yim` varchar(25) default NULL,
`user_msnm` varchar(25) default NULL,
`user_password` varchar(40) NOT NULL default '',
`storynum` tinyint(4) NOT NULL default '10',
`umode` varchar(10) NOT NULL default '',
`uorder` tinyint(1) NOT NULL default '0',
`thold` tinyint(1) NOT NULL default '0',
`noscore` tinyint(1) NOT NULL default '0',
`bio` tinytext NOT NULL,
`ublockon` tinyint(1) NOT NULL default '0',
`ublock` tinytext NOT NULL,
`theme` varchar(255) NOT NULL default '',
`commentmax` int(11) NOT NULL default '4096',
`counter` int(11) NOT NULL default '0',
`newsletter` int(1) NOT NULL default '0',
`user_posts` int(10) NOT NULL default '0',
`user_attachsig` int(2) NOT NULL default '0',
`user_rank` int(10) NOT NULL default '0',
`user_level` int(10) NOT NULL default '1',
`broadcast` tinyint(1) NOT NULL default '1',
`popmeson` tinyint(1) NOT NULL default '0',
`user_active` tinyint(1) default '1',
`user_session_time` int(11) NOT NULL default '0',
`user_session_page` smallint(5) NOT NULL default '0',
`user_lastvisit` int(11) NOT NULL default '0',
`user_timezone` tinyint(4) NOT NULL default '10',
`user_style` tinyint(4) default NULL,
`user_lang` varchar(255) NOT NULL default 'english',
`user_dateformat` varchar(14) NOT NULL default 'D M d, Y g:i a',
`user_new_privmsg` smallint(5) unsigned NOT NULL default '0',
`user_unread_privmsg` smallint(5) unsigned NOT NULL default '0',
`user_last_privmsg` int(11) NOT NULL default '0',
`user_emailtime` int(11) default NULL,
`user_allowhtml` tinyint(1) default '1',
`user_allowbbcode` tinyint(1) default '1',
`user_allowsmile` tinyint(1) default '1',
`user_allowavatar` tinyint(1) NOT NULL default '1',
`user_allow_pm` tinyint(1) NOT NULL default '1',
`user_allow_viewonline` tinyint(1) NOT NULL default '1',
`user_notify` tinyint(1) NOT NULL default '0',
`user_notify_pm` tinyint(1) NOT NULL default '0',
`user_popup_pm` tinyint(1) NOT NULL default '0',
`user_avatar_type` tinyint(4) NOT NULL default '3',
`user_sig_bbcode_uid` varchar(10) default NULL,
`user_actkey` varchar(32) default NULL,
`user_newpasswd` varchar(32) default NULL,
`points` int(10) default '0',
`last_ip` varchar(15) NOT NULL default '0',
`karma` tinyint(1) default '0',
`user_allow_arcadepm` tinyint(4) NOT NULL default '1',
`user_group_cp` int(11) NOT NULL default '2',
`user_group_list_cp` varchar(100) NOT NULL default '2',
`user_active_cp` enum('YES','NO') NOT NULL default 'YES',
`user_ip` varchar(15) NOT NULL default '',
`user_lastlogin` varchar(12) NOT NULL default '',
`user_hits` varchar(11) NOT NULL default '0',
`user_lastlogindate` varchar(12) NOT NULL default '',
`user_lastlogintime` time NOT NULL default '00:00:00',
`user_flag` char(1) NOT NULL default '0',
`user_flagdate` varchar(12) NOT NULL default '',
`user_status` char(1) NOT NULL default '0',
`custom1` varchar(255) default NULL,
`custom2` varchar(255) default NULL,
`custom3` varchar(255) default NULL,
`custom4` varchar(255) default NULL,
`custom5` varchar(255) default NULL,
`custom6` varchar(255) default NULL,
`custom7` varchar(255) default NULL,
`custom8` varchar(255) default NULL,
`custom9` varchar(255) default NULL,
`custom10` varchar(255) default NULL,
`custom11` varchar(255) default NULL,
`custom12` varchar(255) default NULL,
`custom13` varchar(255) default NULL,
`custom14` varchar(255) default NULL,
`custom15` varchar(255) default NULL,
`custom16` varchar(255) default NULL,
`custom17` varchar(255) default NULL,
`custom18` varchar(255) default NULL,
`custom19` varchar(255) default NULL,
`custom20` varchar(255) default NULL,
`custom21` varchar(255) default NULL,
`custom22` varchar(255) default NULL,
`custom23` varchar(255) default NULL,
`custom24` varchar(255) default NULL,
`user_show_custom1` tinyint(2) NOT NULL default '1',
`user_show_custom2` tinyint(2) NOT NULL default '1',
`user_show_custom3` tinyint(2) NOT NULL default '1',
`user_show_custom4` tinyint(2) NOT NULL default '1',
`user_show_custom5` tinyint(2) NOT NULL default '1',
`user_show_custom6` tinyint(2) NOT NULL default '1',
`user_show_custom7` tinyint(2) NOT NULL default '1',
`user_show_custom8` tinyint(2) NOT NULL default '1',
`user_show_custom9` tinyint(2) NOT NULL default '1',
`user_show_custom10` tinyint(2) NOT NULL default '1',
`user_show_custom11` tinyint(2) NOT NULL default '1',
`user_show_custom12` tinyint(2) NOT NULL default '1',
`user_show_custom13` tinyint(2) NOT NULL default '1',
`user_show_custom14` tinyint(2) NOT NULL default '1',
`user_show_custom15` tinyint(2) NOT NULL default '1',
`user_show_custom16` tinyint(2) NOT NULL default '1',
`user_show_custom17` tinyint(2) NOT NULL default '1',
`user_show_custom18` tinyint(2) NOT NULL default '1',
`user_show_custom19` tinyint(2) NOT NULL default '1',
`user_show_custom20` tinyint(2) NOT NULL default '1',
`user_show_custom21` tinyint(2) NOT NULL default '1',
`user_show_custom22` tinyint(2) NOT NULL default '1',
`user_show_custom23` tinyint(2) NOT NULL default '1',
`user_show_custom24` tinyint(2) NOT NULL default '1',
PRIMARY KEY (`user_id`),
KEY `uid` (`user_id`),
KEY `uname` (`username`),
KEY `user_session_time` (`user_session_time`),
KEY `karma` (`karma`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
#
# Dumping data for table 'nuke_users'
#

Thnx;
Scriptleek.
 
Raven







PostPosted: Tue Oct 25, 2005 3:01 pm Reply with quote

Laughing - That's because you now have a VERY modified users table! Compare your schema with the one that came with your version. The solution I gave you will work but it was based on the [mis]assumption that the query you posted was what your system was actually using. Now, probably you will need to export any record that you have, clone it, modify the clone user_id and username and reinsert it.
 
scriptleek







PostPosted: Tue Oct 25, 2005 3:11 pm Reply with quote

Hello Raven, thnx for your time..

If i understood well i delete this nuke_users table and reinstall the original nuke7.8 one..or am i saying stupid things now..? Sad
I was planning to do this earlier but first i seeked some advice.. and ofcourse to learn from it.
I wondered, if this can be done i can enter the information of the existing users in the fresh and empty users add from the Admincontrolpanel..isn't it?
Let me know ok.. my site is pretty young of existance so i only have 17 users till now so can be done Smile

Thnx;
Scriptleek.
 
scriptleek







PostPosted: Tue Oct 25, 2005 4:43 pm Reply with quote

Ok i deleted the nuke_users in the database and i installed the original nuke_users tabel, that came with phpnuke 7.8, to the database. I register the user that i want to add.. also to see if everything works.. and when i click the activationlink in the email i get the following error on my webpage:

ERROR
Unknown column 'custom1' in 'field list'

and when i check the database nothing is added..lol..now i only have the anonymous user but no new users heheh.

Am i overlooking something here..concerning the error?

Laterzz..
Scriptleek.
 
Raven







PostPosted: Tue Oct 25, 2005 7:16 pm Reply with quote

That would indicate that your Your_Account module is no longer in sync with your database. You need to restore your original Your_Account module now that you have restored the original table.
 
Display posts from previous:       
Post new topic   Reply to topic    Ravens PHP Scripts And Web Hosting Forum Index -> Security - PHP Nuke

View next topic
View previous topic
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You can attach files in this forum
You can download files in this forum


Powered by phpBB © 2001-2007 phpBB Group
All times are GMT - 6 Hours
 
Forums ©