function get($id = NULL){
		global $PHPNOTIFY_DB;

		if(!isset($id)){
			$id = $this->id;
		}

		if(!isset($id)){
			$this->error = "NotificationAddress::get() : NotificationAddress id not set\n";
			return FALSE;
		}

		$NotificationAddress = NotificationAddress::retrieveSet("WHERE id = $id", TRUE);
		if($NotificationAddress === FALSE){
			return FALSE;
		}

		if(isset($NotificationAddress[0])){
			$this->_populateData($NotificationAddress[0]);
			$this->stripSlashes();
		}else{
			$this->error = "NotificationAddress::get() : No data retrieved from query\n";
			return FALSE;
		}
		return TRUE;
	}
Esempio n. 2
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. 3
0
	if($_POST['confirm']){
		if($_POST['confirm'] == "Yes"){
			if($notification->delete($_REQUEST['id'])){
				goBack();
			}else{
				$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{