inc/record.inc.php
changeset 57 acc4da012674
parent 56 6db9adfa86ac
child 60 6ffacb626294
equal deleted inserted replaced
56:6db9adfa86ac 57:acc4da012674
   151 function add_record_owner($zoneid,$userid,$recordid)
   151 function add_record_owner($zoneid,$userid,$recordid)
   152 {
   152 {
   153 	global $db;
   153 	global $db;
   154 	if (!xs($zoneid))
   154 	if (!xs($zoneid))
   155 	{
   155 	{
   156 		echo "debug: $zoneid";
       
   157 		error(ERR_RECORD_ACCESS_DENIED);
   156 		error(ERR_RECORD_ACCESS_DENIED);
   158 	}
   157 	}
   159 	if (is_numeric($zoneid) || is_numeric($userid) || is_numeric($recordid))
   158 	if (is_numeric($zoneid) || is_numeric($userid) || is_numeric($recordid))
   160 	{
   159 	{
   161 		$db->query("INSERT INTO record_owners (user_id, record_id) VALUES ('".$userid."','".$recordid."')");
   160 		$db->query("INSERT INTO record_owners (user_id, record_id) VALUES ('".$userid."','".$recordid."')");
   162 		return true;
   161 		return true;
   163 	}
   162 	}
   164 	else
   163 	else
   165 	{
   164 	{
   166 		error(sprintf(ERR_INV_ARGC, "add_record_owner", "at least one of the arguments is not numeric"));
   165 		error(sprintf(ERR_INV_ARGC, "add_record_owner", "at least one of the arguments is not numeric"));
       
   166 	}
       
   167 }
       
   168 
       
   169 function delete_record_owner($zoneid,$rowid,$recordid)
       
   170 {
       
   171 	global $db;
       
   172 	if (!xs($zoneid))
       
   173 	{
       
   174 		error(ERR_RECORD_ACCESS_DENIED);
       
   175 	}
       
   176 	if (is_numeric($zoneid) || is_numeric($rowid) || is_numeric($recordid))
       
   177 	{
       
   178 		$db->query("DELETE FROM record_owners WHERE id='".$rowid."' AND record_id='".$recordid."'");
       
   179 		return true;
       
   180 	}
       
   181 	else
       
   182 	{
       
   183 		error(sprintf(ERR_INV_ARGC, "delete_record_owner", "at least one of the arguments is not numeric"));
   167 	}
   184 	}
   168 }
   185 }
   169 
   186 
   170 /*
   187 /*
   171  * Adds a record.
   188  * Adds a record.