| ||||||||||
Shopping cart software Solutions for online shops and malls | ||||||||||
|
X-Cart Home | FAQ | Forum rules | Calendar | User manuals | Login |
Temporary Solution: Importing Customer Password from outside | |||
|
|
Thread Tools | Search this Thread |
#1
|
|||||||||
|
|||||||||
Temporary Solution: Importing Customer Password from outside
I was writing this "little" post to try to obtain help to solve this problem that I was having on importing passwords from plain to encrypted with xcart text_crypt function.
After 2 days working on this (and at same time doing lot of other stuffs) I finally got to a kinda obvious solution... If at least I had someone who could understand what I were doing and would point me "why don't you just do [this]" it would have been done at least 24hours ago. "[this]" means "moving the same function I were using to encrypt with text_crypt function from my PHP personalized script to admin/user_modify.php". That solved all my problems on this importing. The script is included in the "little" post above. I hope this solution can get head aches out of a lot of people out there. In fact, it just needed to go into a better place than in this topic that I'm just creating to share it. This is my first return to this community. I couldn't get much help out of it yet, but I'll keep on trying. :P Remember, while the code included in here will work alone, you should remove the function and add it to admin/user_modify.php to actually get the text_crypt working properly All you have to do is having a pre-prepared table with username and passwords, or just modify the code that's not that complicated. I didn't get to any other better solution and I don't have the time to keep trying and get to know how the text_crypt works in reality. Also I saw that some warning came up when I did it, but as I already spended way too much time in this, I didn't even read them. This is just temporary anyway. --------------------------------- References: http://forum.x-cart.com/viewtopic.php?t=10740 -nice 27stars script http://forum.x-cart.com/viewtopic.php?p=95925 -guy with same problem Those are kinda old and inactive references. I'm pretty sure I got something wrong on using the text_crypt function, I can't tell what. Also I don't know if there's anything else that could be wrong. So basically, I'm asking for a script, just like 27stars one, but one that works. :P Now, here was my problem... Read it if you are curious or maybe it can help who is ceptic about me to get to know me a little better. I'm just telling that because I have the feeling like I never have got a good straight answer, neither from psoft support, neither in this forum. I believe it's because I'm giving wrong information out, or missing something. I must be doing something wrong. [don't need to read] --------------------------------- I got a list of customers with plain text user and password, among other information. This other table, of course, don't have all the same information, so some customization needed to be done to import the data. Of course this potentially could have bring problems. I still don't know what field is needed and what relation might be missing with another table. But I did added a customer, it looks to me that the only table that register.php works with is the xcart_customers, and then I checked the fields on how they are arranged before trying to bring the "outsider table" information into xcart. I have made similar rows on xcart_costumers, but the login still doesn't work. I'm using the text_crypt function just like on 27stars's script. I even used the text_decrypt function to show (to myself) that the password is actually being properly encrpyted. There is no secret on the script, but if you need to see it, I'll copy it in here: P.S. I like to make it as a function so it is easier to "comment out". Code:
Once the data is in xcart_customers, I can see all information (except the password, of course) in the administration panel, searching for each user. I know that this wouldn't work without the usertype, as it shows on 27stars's script. Also, if I look at the source in there, the password is written in it (which shouldn't be done that way) and it is wrongly decrypted. Also, looking into the xcart database, the imported rows and the rows made by xcart itself contain way too diferent pattern passwords. While Xcart's customer's password looks like "Shjadjhklajrlke" (this is random input) the imported customer's password look like this: "S????e6637?? a ma J??bWц╗?7u " I mean, one has only letters, the other one has any kind of ASCII code. And at last I tried to just copy a password from a row from XCart to imported row and the login works. --------------------------------- [/don't need to read]
__________________
-- 2005-10 (signature needing update) X-Cart Gold 4.0.13 [win] -- developing purpose (migrating to [rhel3 as] some day) |
|||||||||
#2
|
|||||||
|
|||||||
THANK YOU!
I used this to successfully import 675 customers from an old Interchange customer database. You saved me many, MANY hours of trying to figure this out. THANKS!
__________________
Andy Melichar, Tech Director - REBEL INTERACTIVE - andy@rebel-interactive.com - X-Cart version 4.1.3 |
|||||||
#3
|
|||||||||
|
|||||||||
Thanks for your feedback!
I'm glad to know at least one person could benefit from it.
__________________
-- 2005-10 (signature needing update) X-Cart Gold 4.0.13 [win] -- developing purpose (migrating to [rhel3 as] some day) |
|||||||||
#4
|
|||||||
|
|||||||
I hope you see this.
I'm new to PHP programming and was wondering where to put this in the user_modify.php. Also you mean just the 2 functions correct? Thanks
__________________
xCart Version 4.0.17 Richard S Albrecht |
|||||||
#5
|
|||||||||
|
|||||||||
sorry I can't help any further right now
That's a very good question, it's something I should have mentioned.
I don't remember where I've put it, but I do remember the results came in the top. I probably put it as first things right after any INCLUDE or REQUIRE, where I'd naturally think it's the first proper place to add the line. But, right now, out of any further testing / retrying, I'd say you can put in the first line of user_modify.php At same time, I'm not sure if one can use this little work-around without knowing some scripting... But if that's all you need to know, there you go. Now, the following is a little bit irrelevant. But since you said you're new to PHP: In fact, the functions itself could be anywhere in any file within the chain of inclusion, but better keep it simple and put them together with the one line that starts the functions, and that's the one line you should care about where to put in: execute();
__________________
-- 2005-10 (signature needing update) X-Cart Gold 4.0.13 [win] -- developing purpose (migrating to [rhel3 as] some day) |
|||||||||
#6
|
|||||||
|
|||||||
Thanks for the reply. I am a programmer and have written a PHP script to take a CSV and import to a MySQL database on our web sever.
I am basically a Delphi, VB .Net programmer so I'm not totaly new. I will probally start working on this next week. Is it OK if I run into a problem to post some questions here? Thanks
__________________
xCart Version 4.0.17 Richard S Albrecht |
|||||||
#7
|
|||||||||
|
|||||||||
anytime
Sure, that's what the forums are meant for, I suppose.
People helping people. I just miss a forum more "wikable"... |
|||||||||
#8
|
|||||||
|
|||||||
Alright I need help.
Firest Here is my import script: Code:
I inserted this in user_modify.php right after the Code:
I uploaded my csv to same admin directory then created a file to call the execute called RunImport.php Code:
Now when I load RunImport.php I get this error from xcart: Warning: Smarty error: unable to read resource: "partner/main/register.tpl" in /var/www/aspe.org/htdocs/xcart/Smarty-2.6.9/Smarty.class.php on line 1088 This is displayed on the Admin screen. I did put it all in 1 file and it ran fine, however it didn't put the correct password in, same problem you originally had. Any help would be appreciated. TIA[/code]
__________________
xCart Version 4.0.17 Richard S Albrecht |
|||||||
#9
|
|||||||||
|
|||||||||
Nice to see someones scripted an import customers script.
What I mainly do when importing a clients customer base over from an pre-existing 3rd party cart is get all the information into excel to fine tune and extract only the necessary needed data. If the passwords are plain text I use this simple tool I wrote awhile back: http://www.cart-lab.com/lab/salt.php And copy all the needed passwords in order into the text area, and convert the plain text passwords into a format I can copy/paste into my excel document and create a new CSV file which I then upload into the xcart_customers table via phpMyAdmin. Kudos however on the code Caue, defiantly makes this whole process easier.
__________________
Cart-Lab - 100+ Social Bookmarks for X-Cart. |
|||||||||
#10
|
|||||||||
|
|||||||||
oh, sorry I couldn't answer before. I've had many things happening, and I had to quit my job where I used to handle x-cart. even my e-mail was configured within the company, otherwise I'd have answered you before HawkCode. next month I might get back some working on it, and that's why I came to check new stuff.
anyway, what's "Kudos", Boomer? It sounds like a name of something to me, but wikipedia says it's a regular word (that I've never heard of). o_O heh, that's one reason why I mostly hate uppercases... back to the subject, Hawk, I'm sorry I can't read your whole script and try to understand it right now, but I just noticed you're running 4.0.17 and I were running 4.0.13 i know for a fact that the problem i was having was a version issue, so it might have changed on your version and it would need some adaptation. now, i reall don't recall out of my head what you could do, but as soon as i get started with x-cart again i'll take a look into that. although i hope you have everything solved by now, hopefuly not manualy. :P -- caue.cm.rego@gmail.com |
|||||||||
|
|||
X-Cart forums © 2001-2020
|