$relatedshares=explode(",",getvalescaped("sharerelatedresources",""));
			}
		// Create new collection
		$allow_changes=(getval("allow_changes","")!=""?1:0);
		$sharedcollection=create_collection($userref,i18n_get_translated($resource["field".$view_title_field]) . " Share " . nicedate(date("Y-m-d H:i:s")),$allow_changes);
		
		add_resource_to_collection($ref,$sharedcollection);
		if($sharing_related)
			{
			foreach($relatedshares as $relatedshare)
				{
				add_resource_to_collection($relatedshare,$sharedcollection);
				}			
			}
			
		$errors=email_collection($sharedcollection,i18n_get_collection_name($sharedcollection),$userfullname,$users,$message,false,$access,$expires,$user_email,$from_name,$cc,false,"","",$list_recipients,$add_internal_access);
		// Hide from drop down by default
		show_hide_collection($sharedcollection, false, $userref);
		
		if ($errors=="")
			{
			// Log this	
			// fix for bomb on multiple collections, daily stat object ref must be a single number.
			$crefs=explode(",",$ref);
			foreach ($crefs as $cref){		
				daily_stat("E-mailed collection",$cref);
			}
			if (!hook("replacecollectionemailredirect")){
				redirect($baseurl_short."pages/done.php?text=collection_email");
				}
			}
Example #2
0
		create_previews($r,false,$file['extension']); 
		echo "Creating Previews... \r\n";
	}
		 
	if (!$build_collection && $checkmail_confirm){
		email_resource($r,$subject,$applicationname,$fromusername,$lang['yourresourcehasbeenuploaded'],0,$expires="",$fromaddress,$applicationname);
		echo "Email Confirmation sent. \r\n";
	}

	if ($checkmail_purge){$delete=true;}
	$files[$n]['ref']=$r;
	$refs[]=$r;
}

if ($build_collection && $checkmail_confirm){
	email_collection($collection,$subject,$email_from,$fromaddress,$lang['yourresourceshavebeenuploaded'],false,0,$expires="",$fromaddress,$applicationname);
	echo "Email Confirmation sent. \r\n";
}

if ($delete && $checkmail_purge) {
	if (strlen(strstr($checkmail_imap_server,"imap.gmail.com"))>0){
		imap_mail_move($imap,$current_message,'[Gmail]/Trash');
	}
	else {
		// for non-gmail
		imap_delete($imap,$current_message);
	}
	echo "Deleting Email... \r\n";
}

Example #3
0
if (getval("save","")!="")
	{
	# Email / share collection
	# Build a new list and insert
	$users=getvalescaped("users","");
	$message=getvalescaped("message","");
	$access=getvalescaped("access",-1);
	$expires=getvalescaped("expires","");	
	$feedback=getvalescaped("request_feedback","");	if ($feedback=="") {$feedback=false;} else {$feedback=true;}
	
	$use_user_email=getvalescaped("use_user_email",false);
	if ($use_user_email){$user_email=$useremail;} else {$user_email="";} // if use_user_email, set reply-to address
	if (!$use_user_email){$from_name=$applicationname;} else {$from_name=$userfullname;} // make sure from_name matches email
	
	if (getval("ccme",false)){ $cc=$useremail;} else {$cc="";}
	$errors=email_collection($ref,i18n_get_collection_name($collection),$userfullname,$users,$message,$feedback,$access,$expires,$user_email,$from_name,$cc,$themeshare,$themename,$linksuffix);

	if ($errors=="")
		{
		# Log this	
		// fix for bomb on multiple collections, daily stat object ref must be a single number.
		$crefs=explode(",",$ref);
		foreach ($crefs as $cref){		
			daily_stat("E-mailed collection",$cref);
		}
		if (!hook("replacecollectionemailredirect")){
			redirect($baseurl_short."pages/done.php?text=collection_email");
			}
		}
	}
    } else {
        $user_email = "";
    }
    // if use_user_email, set reply-to address
    if (!$use_user_email) {
        $from_name = $applicationname;
    } else {
        $from_name = $userfullname;
    }
    // make sure from_name matches email
    if (getval("ccme", false)) {
        $cc = $useremail;
    } else {
        $cc = "";
    }
    $errors = email_collection($ref, i18n_get_collection_name($collection), $userfullname, $users, $message, $feedback, $access, $expires, $user_email, $from_name, $cc, $themeshare, $themename, $linksuffix, $list_recipients, $add_internal_access, $group);
    if ($errors == "") {
        # Log this
        // fix for bomb on multiple collections, daily stat object ref must be a single number.
        $crefs = explode(",", $ref);
        foreach ($crefs as $cref) {
            daily_stat("E-mailed collection", $cref);
        }
        if (!hook("replacecollectionemailredirect")) {
            redirect($baseurl_short . "pages/done.php?text=collection_email");
        }
    }
}
if ($collection_dropdown_user_access_mode) {
    $users = get_users();
}
    } else {
        $user_email = "";
    }
    // if use_user_email, set reply-to address
    if (!$use_user_email) {
        $from_name = $applicationname;
    } else {
        $from_name = $userfullname;
    }
    // make sure from_name matches email
    if (getval("ccme", false)) {
        $cc = $useremail;
    } else {
        $cc = "";
    }
    $errors = email_collection($ref, i18n_get_translated($collection["name"]), $userfullname, $users, $message, $feedback, $access, $expires, $user_email, $from_name, $cc);
    if ($errors == "") {
        # Log this
        // fix for bomb on multiple collections, daily stat object ref must be a single number.
        $crefs = explode(",", $ref);
        foreach ($crefs as $cref) {
            daily_stat("E-mailed collection", $cref);
        }
        if (!hook("replacecollectionemailredirect")) {
            redirect("pages/done.php?text=collection_email");
        }
    }
}
# Get min access to this collection
$minaccess = collection_min_access($ref);
if ($minaccess >= 1 && !$restricted_share) {