Beispiel #1
0
/**
 * free for user /**
  * @author Deian
  *
  * free for user type
  */

//die(print_r($my,true));
//die("{$my->usertype} | " . $dm->cfg['free_for_usertypes']);
//if (array_key_exists(,explode(",",$dm->cfg['free_for_usertypes']))) {


if (is_array($my->groups)) {
	foreach ($my->groups as $group => $group_id) {
		$group = $dm->groupName($group_id);
		if (in_array($group, explode(",",$dm->cfg['free_for_usertypes']))) {
			$price = 0;
		}
	}
}

/**
 * Free X seconds after registration
 */
/*if (time() - strtotime($my->registerDate) <= $dm->cfg['free_download_after_seconds'] && $price > 0) {
	$price = 0;
}*/

/**
 * The user is back from PayPal and has the order key, or it's the delivery email, can he download? Did he hit the download limit?