• Welcome to KonaKart Community Forum. Please login or sign up.
 

User (admin@konakart) has been blocked??????

Started by jbarb, March 29, 2009, 11:10:59 pm

Previous topic - Next topic

ming

You've really got yourself in a mess haven't you :-(

You could always reinstall the database and start again.

If that's not a good option for you, why don't you log in to the Admin App as order@konakart.com and create a new admin user.   Make sure you create the new user as an admin user.

This is a good start but you're not out of the woods after doing that because your new user will not have any privileges to allow him to do anything in the Admin App.

So..  since you have deleted your one and only authorised user (admin@konakart.com in your case) (which is a very bad thing to do), you will have to turn to SQL to allocate some privileges rather than simply using the Admin App for this task.

Run this SQL statement using your newly-created user's email address (instead of "admin@konakart.com"):

INSERT INTO kk_customers_to_role (role_id, customers_id, date_added) SELECT 1, customers_id, now() FROM customers WHERE customers_email_address = 'admin@konakart.com'

(You're allocating role 1 to the new user which should give him the super user privileges...   naturally this assumes you haven't changed the roles in your system)


jbarb

Thanks Ming,

I am really in a mess but I am determined to learn from my mistakes.

I do not believe I have altered the roles but I can't be sure of anything at this stage.

I'm using a MYSQL Query Browser to access the database. I noticed in the "Customers Table" attribute Customers_Passwords, that even though the user "order@konakart.com" and "cat@konakart.com" user IDs are there the "admin@konakart.com" user is missing (this is what I must have deleted).
Also a sequential number (WHICH I assume belongs to the "admin user") is also missing at the start of the row.

If "admin@konakart.com" is in fact missing (because I deleted it from the admin application) from that table attribute, Customers_Passwords, can I just add it to the table attribute or must I use the "order@ konakart.com" user to log on to the admin utility and make up the new admin user there?

If so, (use the query browser to edit "Customers"   can I use the same basic syntax (as order and cat) i.e. make up a user name and an email address?

I realize I will still also have to follow your other instructions regarding the customers ID role change.

Again, I really appreciate your help with this problem. I am certainly going to be more cautious when altering (deleting) other parts of the admin utility.




Thanks,

jbarb
Jim




ming

I would just follow my previous instructions if I were you.

jbarb

Quote from: ming on July 10, 2010, 11:41:59 am


Run this SQL statement using your newly-created user's email address (instead of "admin@konakart.com"):

INSERT INTO kk_customers_to_role (role_id, customers_id, date_added) SELECT 1, customers_id, now() FROM customers WHERE customers_email_address = 'admin@konakart.com'



Ming,

I ran the SQL statement as you instructed: "INSERT INTO kk_customers_to_role (role_id, customers_id, date_added) SELECT 1, customers_id, now(14) FROM customers WHERE customers_email_address = 'admin@konakart.com'" However it did not solve the problem of not being able to log on to the admin utility, (username or password does not match).

The only thing I added to the SQL statement was the new cust ID # 14. Was there more that I should have added to the SQL statement i.e the actual new role ID, customer ID and date added in the parenthesis and the new email address before " = 'admin@konakart'?


Thanks,
jbarb

ming

You didn't do what I said at all.  Follow the instructions more carefully if you want the SQL to work.

jbarb

Ming,

I have tried every which way the MYSQL manual says to arrange the syntax for the insert, select query but nothing seems to work.

My new admin users role ID is "6", email is; productsales@envirosales.com, date added etc.
Where do I insert this into the query? I get conflicting syntax instructions from the MYSQL site's manual. I either get an error or referral to the manual. MYSQL version is 5.0.51a.  Please Help! I'm almost there as I am learning.

Thanks.

James

INSERT INTO kk_customers_to_role (role_id, customers_id, date_added) SELECT 1, customers_id, now() FROM customers WHERE customers_email_address = 'admin@konakart.com'

ming

did you try:

INSERT INTO kk_customers_to_role (role_id, customers_id, date_added) SELECT 6, customers_id, now() FROM customers WHERE customers_email_address = 'productsales@envirosales.com'


note 1:  I have used 6 as the roleId   (because that's what you said, but I think you may have that wrong)
note 2:  I have used your admin user's email address


BUT..   a new admin user has nothing to do with roleIds so I think you may still be confused?  Users are users and have a customers_id,  roles are roles and have a role_id.   They are different things.   

jbarb

Thanks Ming,

Like you wrote to me, "just follow my instructions," so I did and it worked.

I must have been looking for a more complicated solution and overlooked the obvious.
Thanks or all your help. I believe I leaned some valuable lessons, not to mention learning more on how to work with MYSQL.

Thanks

Jim.