Suspending a User with a Shop - FIXED IN V3.3

Post Reply
Site Admin
Posts: 750
Joined: Fri Jan 08, 2010 2:23 am
Location: Stoke-on-Trent

Suspending a User with a Shop - FIXED IN V3.3

Post by RWAP » Tue May 28, 2013 3:54 pm

If a user has a shop and is suspended through the admin backend, their shop will still appear in the list of shops (although there will be no items listed).

To overcome this, in class\User.php


Code: Select all

    public function suspend(MyPDO $DB)
        $return = true;
        $bids = Bid::getListFromDB($DB, " where and bids.userId='".$this->id."'");
            foreach($bids as $bid){
                $offer = Offer::getInstanceFromDB($DB, $bid['offerId']);
                $return&= $offer->removeUserBids($DB,$this);
        $offers = Offer::getFastListFromDB($DB, " where and items.userId='".$this->id."'");
            foreach($offers as $v){
Add below this:

Code: Select all

		// Disable any store by setting status to inactive
		$store = Store::getUserStore($DB,$this);
		if ($store){
			$store->active = 0;

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest