Esempio n. 1
0
	function addAddress($email){
		$this->id = intval($this->id);
		if($this->id <= 0){
			$this->error = "Notification::addAddress(): Invalid notification id!";
			return FALSE;
		}

		$na = new NotificationAddress();
		$na->notification_id = $this->id;
		$na->address = $email;
		$result = $na->add();
		if($result === FALSE){
			$this->error = "Notification::addAddress(): Error adding address: ".$na->getLastError();
			return FALSE;
		}

		return TRUE;
	}
Esempio n. 2
0
				$error_msg .= "Error deleting Notification!\n";
			}
		}else{
			goBack();
		}
	}
}else if($_REQUEST['mode'] == 'delete_address'){
	$title = "Delete Email Address";

	$na = new NotificationAddress();
	if($na->delete($_REQUEST['address_id'])){
		header("Location: ".getCurrentURL(null, false)."?mode=edit&id=".$_REQUEST['id']."\r\n");
		exit();
	}else{
		$error_msg .= "Error deleting email address!\n";
		debug_message($na->getLastError());
	}
}else if($_REQUEST['mode'] == 'delete_macro'){
	$title = "Delete Notification Macro";

	$nm = new NotificationMacro();
	if($nm->delete($_REQUEST['macro_id'])){
		header("Location: ".getCurrentURL(null, false)."?mode=edit&id=".$_REQUEST['id']."\r\n");
		exit();
	}else{
		$error_msg .= "Error deleting macro!\n";
		debug_message($nm->getLastError());
	}
}else{
	$title = "Invalid Mode";
	$error_msg .= "Error: Invalid mode!\n";