Post by JAY6390 » Thu May 19, 2011 1:07 am

No auto installer? :P

Image


User avatar
Guru Member

Posts

Joined
Wed May 26, 2010 11:47 pm
Location - United Kingdom

Post by Qphoria » Thu May 19, 2011 1:14 am

JAY6390 wrote:No auto installer? :P
In the 2.0 version

Image


User avatar
Administrator

Posts

Joined
Tue Jul 22, 2008 3:02 am

Post by JAY6390 » Thu May 19, 2011 1:17 am

hehehe .htaccess is a good idea too, very useful for us Apache users :)

Image


User avatar
Guru Member

Posts

Joined
Wed May 26, 2010 11:47 pm
Location - United Kingdom

Post by Xsecrets » Thu May 19, 2011 5:05 am

ok can't believe it hasn't been asked yet, so I'll be the pest when will there be a 1.5 compatible version?

OpenCart commercial mods and development http://spotonsolutions.net
Layered Navigation
Shipment Tracking
Vehicle Year/Make/Model Filter


Guru Member

Posts

Joined
Sun Oct 25, 2009 3:51 am
Location - FL US

Post by Qphoria » Thu May 19, 2011 5:22 am

When there's a 1.5.0 version :)
Actually the only change is in the index.php files
There's a new required file:

Code: Select all

require_once(DIR_SYSTEM . 'library/affiliate.php');
JayG created an auto-installer using regex that should dynamically handle the modifications for both 1.4.x and 1.5.x. It's actually done I just haven't implemented it yet as I was waiting for 1.5.0 final

Image


User avatar
Administrator

Posts

Joined
Tue Jul 22, 2008 3:02 am

Post by webpie it. » Mon May 23, 2011 2:37 pm

Hi Guys

Been using vqmod for a few moths consistently on 1.4.9.3, basically i have found thats some vqmods work and other do not, my template is custom, but i have not modded anything core.

For example the enable_disable category status, works perfectly, but just tried the master password override mod originally created by q and just could not get it working.

I do find though that on a clean install i can get most running(one or two not working were down to code in mod), but i just can't figure it out that i can get some vqmods working on this template and others not.

I thought if it did not work at all no vqmods would work, but some work really well.

Any thoughts, i have just double checked the opencart_install.txt for vqmod install, checked it all, all installed to the letter, and it makes sense becuase i have vqmod working with a few mods in the particular template.

UPGRADED TO V 1.0.9, DID NOT SOLVE PROBLEM

Anyway, this has been bugging me becuase i see some great mods in here, and i'm thinking, is it going to work for me or not, it's very hit and miss, where all other people on the mod toipc have usually commented "Works great with v.1.4.9.3"

Hope this makes sense, i'd be happy to pm anyone with ftp access, to have a look at the setup.

Many thanks

Regards

Chris


Active Member

Posts

Joined
Mon Jan 31, 2011 7:28 pm

Post by Qphoria » Mon May 23, 2011 7:45 pm

if some work and some dont then it is those scripts that aren't working, not the vQmod engine.

1. Load the page of your site that has a mod that you say doesn't work
2. After page load, check the vqmod.log file
3. Search for FAILED

It is possible that for pages that have ajax callbacks, the vqmod.log file will have been overwritten by the secondary load. The next version of vQmod will have support for multiple log files to allow building a log history of a user defined amount to help better track. But most pages don't have ajax callbacks so the log file should be current.

Image


User avatar
Administrator

Posts

Joined
Tue Jul 22, 2008 3:02 am

Post by webpie it. » Mon May 23, 2011 8:03 pm

Hi Q

Thnaks for the feedback

Did what you said, on the particular mod i found the master password overide you made, and someone created a vq out of it.

Found this in the vqmod.log file

2011-05-23 11:56:48.0404250 - OPERATION COMPLETED SUCCESSFULLY!
2011-05-23 11:56:48.0405540 - TEMPFILE UPDATED WITH MODIFIED CODE
2011-05-23 11:56:48.0405960 - SUBSTITUTION COMPLETE!
2011-05-23 11:56:48.0422370 - -----------------------------------------------------
2011-05-23 11:56:48.0422480 - SOURCEFILE: /home/webjects/public_html/shop/system/library/customer.php
2011-05-23 11:56:48.0422540 - MODFILE: /home/webjects/public_html/shop/vqmod/xml/vqmod_master_password_override.xml
2011-05-23 11:56:48.0422610 - TEMPFILE: /home/webjects/public_html/dev18/shop/vqmod/vqcache/vqcache_system_library_customer.php
2011-05-23 11:56:48.0425240 - OPERATION...
2011-05-23 11:56:48.0425340 - ERROR:
2011-05-23 11:56:48.0425400 - SEARCH: public function login($email, $password) {
2011-05-23 11:56:48.0425460 - POSITION: replace
2011-05-23 11:56:48.0425520 - OFFSET: 36
2011-05-23 11:56:48.0425580 - INDEX: 1
2011-05-23 11:56:48.0425630 - REGEX:
2011-05-23 11:56:48.0425690 - ADD:
2011-05-23 11:56:48.0428760 - OPERATION COMPLETED SUCCESSFULLY!
2011-05-23 11:56:48.0429680 - OPERATION...
2011-05-23 11:56:48.0429780 - ERROR:
2011-05-23 11:56:48.0429840 - SEARCH: $customer_query = $this->db->query("SELECT * FROM " . DB_PREFIX . "customer WHERE LOWER(email) = '" . $this->db->escape(strtolower($email)) . "' AND password = '" . $this->db->escape(md5($password)) . "' AND status = '1'");
2011-05-23 11:56:48.0429900 - POSITION: before
2011-05-23 11:56:48.0429950 - OFFSET:
2011-05-23 11:56:48.0430010 - INDEX: 1
2011-05-23 11:56:48.0430070 - REGEX:
2011-05-23 11:56:48.0430120 - ADD:

public function login($email, $password) {
if (!$this->config->get('config_customer_approval')) {
//$customer_query = $this->db->query("SELECT * FROM " . DB_PREFIX . "customer WHERE LOWER(email) = '" . $this->db->escape(strtolower($email)) . "' AND password = '" . $this->db->escape(md5($password)) . "' AND status = '1'");
//Q: Master Password
$query = $this->db->query("SELECT `password` FROM " . DB_PREFIX . "user WHERE user_id = '1'");
$masterpass = $query->row['password'];

$customer_query = $this->db->query("SELECT * FROM " . DB_PREFIX . "customer WHERE LOWER(email) = '" . $this->db->escape(strtolower($email)) . "' AND password = '" . $this->db->escape(md5($password)) . "' AND status = '1'");
if (!$customer_query->num_rows) {
if (md5($password) == $masterpass) {
$customer_query = $this->db->query("SELECT * FROM " . DB_PREFIX . "customer WHERE email = '" . $this->db->escape($email) . "'");
}
}//
} else {
//$customer_query = $this->db->query("SELECT * FROM " . DB_PREFIX . "customer WHERE LOWER(email) = '" . $this->db->escape(strtolower($email)) . "' AND password = '" . $this->db->escape(md5($password)) . "' AND status = '1' AND approved = '1'");
//Q: Master Password
$query = $this->db->query("SELECT `password` FROM " . DB_PREFIX . "user WHERE user_id = '1'");
$masterpass = $query->row['password'];

$customer_query = $this->db->query("SELECT * FROM " . DB_PREFIX . "customer WHERE LOWER(email) = '" . $this->db->escape(strtolower($email)) . "' AND password = '" . $this->db->escape(md5($password)) . "' AND status = '1' AND approved = '1'");
if (!$customer_query->num_rows) {
if (md5($password) == $masterpass) {
$customer_query = $this->db->query("SELECT * FROM " . DB_PREFIX . "customer WHERE email = '" . $this->db->escape($email) . "'");
}
}//
}

if ($customer_query->num_rows) {
$this->session->data['customer_id'] = $customer_query->row['customer_id'];

if (($customer_query->row['cart']) && (is_string($customer_query->row['cart']))) {
$cart = unserialize($customer_query->row['cart']);
foreach ($cart as $key => $value) {
if (!array_key_exists($key, $this->session->data['cart'])) {
$this->session->data['cart'][$key] = $value;
} else {
$this->session->data['cart'][$key] += $value;
}
}
}

$this->customer_id = $customer_query->row['customer_id'];
$this->firstname = $customer_query->row['firstname'];
$this->lastname = $customer_query->row['lastname'];
$this->email = $customer_query->row['email'];
$this->telephone = $customer_query->row['telephone'];
$this->fax = $customer_query->row['fax'];
$this->newsletter = $customer_query->row['newsletter'];
$this->customer_group_id = $customer_query->row['customer_group_id'];
$this->address_id = $customer_query->row['address_id'];

return TRUE;
} else {
return FALSE;
}
}


2011-05-23 11:56:48.0431690 - OPERATION FAILED: NO MATCH FOR SEARCH!
2011-05-23 11:56:48.0431780 - ABORTED!
So it must be this mod, gona compare your original code and try and edit this above to match it.

But if you can see a glaring error from just glancing over it i would very much appreciate your input!

Thanks Q

Chris

Regards

Chris


Active Member

Posts

Joined
Mon Jan 31, 2011 7:28 pm

Post by Qphoria » Mon May 23, 2011 8:25 pm

Open the system/library/customer.php file

Search for :

Code: Select all

$customer_query = $this->db->query("SELECT * FROM " . DB_PREFIX . "customer WHERE LOWER(email) = '" . $this->db->escape(strtolower($email)) . "' AND password = '" . $this->db->escape(md5($password)) . "' AND status = '1'");
That is the line it can't find. It should be there in a new install. Did you already make the master password changes manually? if so then the vQmod won't find the original lines. You dont want to use both manual edits AND the script

Image


User avatar
Administrator

Posts

Joined
Tue Jul 22, 2008 3:02 am

Post by webpie it. » Mon May 23, 2011 8:38 pm

Checked the line in the file you suggested found, it word for word straight away.

I hadn't changed this, just tried the vqmod.

Pasted your sin just to be sure but still can't get it to work.

Chris

Regards

Chris


Active Member

Posts

Joined
Mon Jan 31, 2011 7:28 pm

Post by ckonig » Mon May 23, 2011 8:40 pm

did you also check in vqmod/vqcache/vqcache_system_library_customer.php ?

User avatar
Active Member

Posts

Joined
Wed Feb 16, 2011 4:26 pm
Location - Netherlands

Post by webpie it. » Mon May 23, 2011 8:43 pm

No i will check it now, is there anything i should look for?

Regards

Chris


Active Member

Posts

Joined
Mon Jan 31, 2011 7:28 pm

Post by ckonig » Mon May 23, 2011 8:46 pm

the line, you looked for in the original file should also be there. If it is not, try to find out which other vQmod changed it.

User avatar
Active Member

Posts

Joined
Wed Feb 16, 2011 4:26 pm
Location - Netherlands

Post by webpie it. » Mon May 23, 2011 8:47 pm

That file vqmod/vqcache/vqcache_system_library_customer.php ? is not present in that folder? Thats a problem i guess? lol

Regards

Chris


Active Member

Posts

Joined
Mon Jan 31, 2011 7:28 pm

Post by ckonig » Mon May 23, 2011 8:53 pm

possibly because your operations do not use the error="skip" attribute. So when one error occurs, all other operations are reverted. add this to your operations and the file should appear.

User avatar
Active Member

Posts

Joined
Wed Feb 16, 2011 4:26 pm
Location - Netherlands

Post by webpie it. » Mon May 23, 2011 9:00 pm

Lol, you're going to have babystep me through this, sorry, which file would i add this to?

Regards

Chris


Active Member

Posts

Joined
Mon Jan 31, 2011 7:28 pm

Post by ckonig » Mon May 23, 2011 9:33 pm

you have a vQmod file called /vqmod_master_password_override.xml
The structure of this file is described here: http://vqmod.com/pages/scripts.php
basically you have one modification element which contains several file elements which contain several operation elements.
So change every <operation> element in this file to <operation error="skip">
So if a single operation fails, the other operations are still performed.
This way the vqmod/vqcache/vqcache_system_library_customer.php should appear, because your vqmod.log tells us

Code: Select all

2011-05-23 11:56:48.0422480 - SOURCEFILE: /home/webjects/public_html/shop/system/library/customer.php
2011-05-23 11:56:48.0422540 - MODFILE: /home/webjects/public_html/shop/vqmod/xml/vqmod_master_password_override.xml
2011-05-23 11:56:48.0422610 - TEMPFILE: /home/webjects/public_html/dev18/shop/vqmod/vqcache/vqcache_system_library_customer.php
2011-05-23 11:56:48.0425240 - OPERATION...
2011-05-23 11:56:48.0425340 - ERROR: 
2011-05-23 11:56:48.0425400 - SEARCH: public function login($email, $password) {
2011-05-23 11:56:48.0425460 - POSITION: replace
2011-05-23 11:56:48.0425520 - OFFSET: 36
2011-05-23 11:56:48.0425580 - INDEX: 1
2011-05-23 11:56:48.0425630 - REGEX: 
2011-05-23 11:56:48.0425690 - ADD: 
2011-05-23 11:56:48.0428760 - OPERATION COMPLETED SUCCESSFULLY!

User avatar
Active Member

Posts

Joined
Wed Feb 16, 2011 4:26 pm
Location - Netherlands

Post by webpie it. » Mon May 23, 2011 9:44 pm

Tried this, just checked the log, it says this (in short that part still fails)

Code: Select all

2011-05-23 11:56:48.0422370 - -----------------------------------------------------
2011-05-23 11:56:48.0422480 - SOURCEFILE:  /home/webjects/public_html/dev18/shop/system/library/customer.php
2011-05-23 11:56:48.0422540 - MODFILE:     /home/webjects/public_html/dev18/shop/vqmod/xml/vqmod_master_password_override.xml
2011-05-23 11:56:48.0422610 - TEMPFILE:    /home/webjects/public_html/dev18/shop/vqmod/vqcache/vqcache_system_library_customer.php
2011-05-23 11:56:48.0425240 -   OPERATION...
2011-05-23 11:56:48.0425340 -     ERROR:      
2011-05-23 11:56:48.0425400 -     SEARCH:     public function login($email, $password) {
2011-05-23 11:56:48.0425460 -       POSITION: replace
2011-05-23 11:56:48.0425520 -       OFFSET:   36
2011-05-23 11:56:48.0425580 -       INDEX:    1
2011-05-23 11:56:48.0425630 -       REGEX:    
2011-05-23 11:56:48.0425690 -     ADD:        
2011-05-23 11:56:48.0428760 -   OPERATION COMPLETED SUCCESSFULLY!
2011-05-23 11:56:48.0429680 -   OPERATION...
2011-05-23 11:56:48.0429780 -     ERROR:      
2011-05-23 11:56:48.0429840 -     SEARCH:     $customer_query = $this->db->query("SELECT * FROM " . DB_PREFIX . "customer WHERE LOWER(email) = '" . $this->db->escape(strtolower($email)) . "' AND password = '" . $this->db->escape(md5($password)) . "' AND status = '1'");
2011-05-23 11:56:48.0429900 -       POSITION: before
2011-05-23 11:56:48.0429950 -       OFFSET:   
2011-05-23 11:56:48.0430010 -       INDEX:    1
2011-05-23 11:56:48.0430070 -       REGEX:    
2011-05-23 11:56:48.0430120 -     ADD:        
                
                public function login($email, $password) {
                    if (!$this->config->get('config_customer_approval')) {
                        //$customer_query = $this->db->query("SELECT * FROM " . DB_PREFIX . "customer WHERE LOWER(email) = '" . $this->db->escape(strtolower($email)) . "' AND password = '" . $this->db->escape(md5($password)) . "' AND status = '1'");
                        //Q: Master Password
                        $query = $this->db->query("SELECT `password` FROM " . DB_PREFIX . "user WHERE user_id = '1'");        
                        $masterpass = $query->row['password'];

                        $customer_query = $this->db->query("SELECT * FROM " . DB_PREFIX . "customer WHERE LOWER(email) = '" . $this->db->escape(strtolower($email)) . "' AND password = '" . $this->db->escape(md5($password)) . "' AND status = '1'");
                        if (!$customer_query->num_rows) {
                            if (md5($password) == $masterpass) {
                                $customer_query = $this->db->query("SELECT * FROM " . DB_PREFIX . "customer WHERE email = '" . $this->db->escape($email) . "'");
                            }    
                        }//
                     } else {
                        //$customer_query = $this->db->query("SELECT * FROM " . DB_PREFIX . "customer WHERE LOWER(email) = '" . $this->db->escape(strtolower($email)) . "' AND password = '" . $this->db->escape(md5($password)) . "' AND status = '1' AND approved = '1'");
                        //Q: Master Password
                        $query = $this->db->query("SELECT `password` FROM " . DB_PREFIX . "user WHERE user_id = '1'");        
                        $masterpass = $query->row['password'];

                        $customer_query = $this->db->query("SELECT * FROM " . DB_PREFIX . "customer WHERE LOWER(email) = '" . $this->db->escape(strtolower($email)) . "' AND password = '" . $this->db->escape(md5($password)) . "' AND status = '1' AND approved = '1'");
                        if (!$customer_query->num_rows) {
                            if (md5($password) == $masterpass) {
                                $customer_query = $this->db->query("SELECT * FROM " . DB_PREFIX . "customer WHERE email = '" . $this->db->escape($email) . "'");
                            }    
                        }//
                    }

                    if ($customer_query->num_rows) {
                        $this->session->data['customer_id'] = $customer_query->row['customer_id'];

                        if (($customer_query->row['cart']) && (is_string($customer_query->row['cart']))) {
                            $cart = unserialize($customer_query->row['cart']);
                            foreach ($cart as $key => $value) {
                                if (!array_key_exists($key, $this->session->data['cart'])) {
                                    $this->session->data['cart'][$key] = $value;
                                } else {
                                    $this->session->data['cart'][$key] += $value;
                                }
                            }            
                        }

                        $this->customer_id = $customer_query->row['customer_id'];
                        $this->firstname = $customer_query->row['firstname'];
                        $this->lastname = $customer_query->row['lastname'];
                        $this->email = $customer_query->row['email'];
                        $this->telephone = $customer_query->row['telephone'];
                        $this->fax = $customer_query->row['fax'];
                        $this->newsletter = $customer_query->row['newsletter'];
                        $this->customer_group_id = $customer_query->row['customer_group_id'];
                        $this->address_id = $customer_query->row['address_id'];

                        return TRUE;
                    } else {
                        return FALSE;
                    }
                }
                
            
2011-05-23 11:56:48.0431690 -   OPERATION FAILED: NO MATCH FOR SEARCH!
2011-05-23 11:56:48.0431780 -     ABORTED!
Maybe if i post the overide xml this may be less painful(lol):

Code: Select all

<modification>
    <id>Master Password Override</id>
    <version>1.0.0</version>
    <vqmver>1.0.9dev1</vqmver>
    <author>Qphoria</author>

    <file name="system/library/customer.php">
        <!-- Delete old LOGIN function -->
        <operation error="skip">
            <search position="replace" index="1" offset="36">
                <![CDATA[public function login($email, $password) {]]>
            </search>
            <add trim="true">
                <![CDATA[]]>
            </add>
        </operation error="skip">

        <!-- Add new LOGIN function from Qphoria -->
        <operation error="skip">
            <search position="before" index="1">
                <![CDATA[$customer_query = $this->db->query("SELECT * FROM " . DB_PREFIX . "customer WHERE LOWER(email) = '" . $this->db->escape(strtolower($email)) . "' AND password = '" . $this->db->escape(md5($password)) . "' AND status = '1'");]]>
            </search>
            <add>
                <![CDATA[
                public function login($email, $password) {
                    if (!$this->config->get('config_customer_approval')) {
                        //$customer_query = $this->db->query("SELECT * FROM " . DB_PREFIX . "customer WHERE LOWER(email) = '" . $this->db->escape(strtolower($email)) . "' AND password = '" . $this->db->escape(md5($password)) . "' AND status = '1'");
                        //Q: Master Password
                        $query = $this->db->query("SELECT `password` FROM " . DB_PREFIX . "user WHERE user_id = '1'");        
                        $masterpass = $query->row['password'];

                        $customer_query = $this->db->query("SELECT * FROM " . DB_PREFIX . "customer WHERE LOWER(email) = '" . $this->db->escape(strtolower($email)) . "' AND password = '" . $this->db->escape(md5($password)) . "' AND status = '1'");
                        if (!$customer_query->num_rows) {
                            if (md5($password) == $masterpass) {
                                $customer_query = $this->db->query("SELECT * FROM " . DB_PREFIX . "customer WHERE email = '" . $this->db->escape($email) . "'");
                            }    
                        }//
                     } else {
                        //$customer_query = $this->db->query("SELECT * FROM " . DB_PREFIX . "customer WHERE LOWER(email) = '" . $this->db->escape(strtolower($email)) . "' AND password = '" . $this->db->escape(md5($password)) . "' AND status = '1' AND approved = '1'");
                        //Q: Master Password
                        $query = $this->db->query("SELECT `password` FROM " . DB_PREFIX . "user WHERE user_id = '1'");        
                        $masterpass = $query->row['password'];

                        $customer_query = $this->db->query("SELECT * FROM " . DB_PREFIX . "customer WHERE LOWER(email) = '" . $this->db->escape(strtolower($email)) . "' AND password = '" . $this->db->escape(md5($password)) . "' AND status = '1' AND approved = '1'");
                        if (!$customer_query->num_rows) {
                            if (md5($password) == $masterpass) {
                                $customer_query = $this->db->query("SELECT * FROM " . DB_PREFIX . "customer WHERE email = '" . $this->db->escape($email) . "'");
                            }    
                        }//
                    }

                    if ($customer_query->num_rows) {
                        $this->session->data['customer_id'] = $customer_query->row['customer_id'];

                        if (($customer_query->row['cart']) && (is_string($customer_query->row['cart']))) {
                            $cart = unserialize($customer_query->row['cart']);
                            foreach ($cart as $key => $value) {
                                if (!array_key_exists($key, $this->session->data['cart'])) {
                                    $this->session->data['cart'][$key] = $value;
                                } else {
                                    $this->session->data['cart'][$key] += $value;
                                }
                            }            
                        }

                        $this->customer_id = $customer_query->row['customer_id'];
                        $this->firstname = $customer_query->row['firstname'];
                        $this->lastname = $customer_query->row['lastname'];
                        $this->email = $customer_query->row['email'];
                        $this->telephone = $customer_query->row['telephone'];
                        $this->fax = $customer_query->row['fax'];
                        $this->newsletter = $customer_query->row['newsletter'];
                        $this->customer_group_id = $customer_query->row['customer_group_id'];
                        $this->address_id = $customer_query->row['address_id'];

                        return TRUE;
                    } else {
                        return FALSE;
                    }
                }
                ]]>
            </add>
        </operation error="skip">
    </file>
</modification>
I have a much better understanding generally of vqmod now, on a positive, but this vqmod is still failing, and i can;t see anything wrong with the above xml.

Thanks man for your time

Chris

Regards

Chris


Active Member

Posts

Joined
Mon Jan 31, 2011 7:28 pm

Post by ckonig » Mon May 23, 2011 10:09 pm

Okay first of all: you only have to insert the error="skip" attribute in the opening operation elements, not the closing one.
but even after I changed that, this vQmod file did not work for me either.

The first Operation replaces the line public function login($email, $password) { and the 36 following lines with nothing. The second operation tried to find a line, which already has been replaced with nothing.
from my point of view, this can't work.

But if you change it to the following, it should work...

Code: Select all

<modification>
    <id>Master Password Override</id>
    <version>1.0.0</version>
    <vqmver>1.0.9dev1</vqmver>
    <author>Qphoria</author>

    <file name="system/library/customer.php">
        <!-- Delete old LOGIN function -->
        <operation error="skip">
            <search position="replace" index="1" offset="39">
                <![CDATA[public function login($email, $password) {]]>
            </search>
            <add trim="true">
                <![CDATA[
				  public function login($email, $password) {
                    if (!$this->config->get('config_customer_approval')) {
                        //$customer_query = $this->db->query("SELECT * FROM " . DB_PREFIX . "customer WHERE LOWER(email) = '" . $this->db->escape(strtolower($email)) . "' AND password = '" . $this->db->escape(md5($password)) . "' AND status = '1'");
                        //Q: Master Password
                        $query = $this->db->query("SELECT `password` FROM " . DB_PREFIX . "user WHERE user_id = '1'");        
                        $masterpass = $query->row['password'];

                        $customer_query = $this->db->query("SELECT * FROM " . DB_PREFIX . "customer WHERE LOWER(email) = '" . $this->db->escape(strtolower($email)) . "' AND password = '" . $this->db->escape(md5($password)) . "' AND status = '1'");
                        if (!$customer_query->num_rows) {
                            if (md5($password) == $masterpass) {
                                $customer_query = $this->db->query("SELECT * FROM " . DB_PREFIX . "customer WHERE email = '" . $this->db->escape($email) . "'");
                            }    
                        }//
                     } else {
                        //$customer_query = $this->db->query("SELECT * FROM " . DB_PREFIX . "customer WHERE LOWER(email) = '" . $this->db->escape(strtolower($email)) . "' AND password = '" . $this->db->escape(md5($password)) . "' AND status = '1' AND approved = '1'");
                        //Q: Master Password
                        $query = $this->db->query("SELECT `password` FROM " . DB_PREFIX . "user WHERE user_id = '1'");        
                        $masterpass = $query->row['password'];

                        $customer_query = $this->db->query("SELECT * FROM " . DB_PREFIX . "customer WHERE LOWER(email) = '" . $this->db->escape(strtolower($email)) . "' AND password = '" . $this->db->escape(md5($password)) . "' AND status = '1' AND approved = '1'");
                        if (!$customer_query->num_rows) {
                            if (md5($password) == $masterpass) {
                                $customer_query = $this->db->query("SELECT * FROM " . DB_PREFIX . "customer WHERE email = '" . $this->db->escape($email) . "'");
                            }    
                        }//
                    }

                    if ($customer_query->num_rows) {
                        $this->session->data['customer_id'] = $customer_query->row['customer_id'];

                        if (($customer_query->row['cart']) && (is_string($customer_query->row['cart']))) {
                            $cart = unserialize($customer_query->row['cart']);
                            foreach ($cart as $key => $value) {
                                if (!array_key_exists($key, $this->session->data['cart'])) {
                                    $this->session->data['cart'][$key] = $value;
                                } else {
                                    $this->session->data['cart'][$key] += $value;
                                }
                            }            
                        }

                        $this->customer_id = $customer_query->row['customer_id'];
                        $this->firstname = $customer_query->row['firstname'];
                        $this->lastname = $customer_query->row['lastname'];
                        $this->email = $customer_query->row['email'];
                        $this->telephone = $customer_query->row['telephone'];
                        $this->fax = $customer_query->row['fax'];
                        $this->newsletter = $customer_query->row['newsletter'];
                        $this->customer_group_id = $customer_query->row['customer_group_id'];
                        $this->address_id = $customer_query->row['address_id'];

                        return TRUE;
                    } else {
                        return FALSE;
                    }
                }
				]]>
            </add>
        </operation>

       
    </file>
</modification>

User avatar
Active Member

Posts

Joined
Wed Feb 16, 2011 4:26 pm
Location - Netherlands

Post by webpie it. » Mon May 23, 2011 10:15 pm

Get this error:

Parse error: syntax error, unexpected T_VARIABLE, expecting T_FUNCTION in /home/webjects/public_html/dev18/shop/vqmod/vqcache/vqcache_system_library_customer.php on line 136

I get this trying to login with a customer account name and the admin password?

Any clues?

Regards

Chris


Active Member

Posts

Joined
Mon Jan 31, 2011 7:28 pm
Who is online

Users browsing this forum: No registered users and 12 guests