Commit bb2930cb authored by Florian Schaal's avatar Florian Schaal

update ipv4-mapping

parent 349272c2
......@@ -28,8 +28,8 @@ NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
$form["title"] = "IP Addresse mapping";
$form["description"] = "";
$form["title"] = "IPv4 Addresse mapping";
$form["description"] = "Form to map IPv4-addresses for Web-Server";
$form["name"] = "server_ip_map";
$form["action"] = "server_ip_map_edit.php";
$form["db_table"] = "server_ip_map";
......
......@@ -6,6 +6,7 @@ $wb["active_txt"] = 'Active';
$wb["ip_error_wrong"] = 'The Destination IP address is invalid';
$wb["destination_ip_empty"] = 'The Destination IP is empty.';
$wb["source_ip_empty"] = 'The Source IP is empty.';
$wb["server_empty_error"] = 'The Server is empty.';
$wb["duplicate_mapping_error"] = "Mapping already exists.";
$wb["duplicate_mapping_error"] = "Source IP can not be an IP of the Rewrite-Server";
$wb["ip_mapping_error"] = "Source IP can not be an IP of the Rewrite-Server";
?>
......@@ -6,6 +6,7 @@ $wb["active_txt"] = 'Active';
$wb["ip_error_wrong"] = 'The Destination IP address is invalid';
$wb["destination_ip_empty"] = 'The Destination IP is empty.';
$wb["source_ip_empty"] = 'The Source IP is empty.';
$wb["server_empty_error"] = 'The Server is empty.';
$wb["duplicate_mapping_error"] = "Mapping already exists.";
$wb["duplicate_mapping_error"] = "Source IP can not be an IP of the Rewrite-Server";
$wb["ip_mapping_error"] = "Source IP can not be an IP of the Rewrite-Server";
?>
......@@ -6,6 +6,7 @@ $wb["active_txt"] = 'Active';
$wb["ip_error_wrong"] = 'The Destination IP address is invalid';
$wb["destination_ip_empty"] = 'The Destination IP is empty.';
$wb["source_ip_empty"] = 'The Source IP is empty.';
$wb["server_empty_error"] = 'The Server is empty.';
$wb["duplicate_mapping_error"] = "Mapping already exists.";
$wb["duplicate_mapping_error"] = "Source IP can not be an IP of the Rewrite-Server";
$wb["ip_mapping_error"] = "Source IP can not be an IP of the Rewrite-Server";
?>
......@@ -6,6 +6,7 @@ $wb["active_txt"] = 'Active';
$wb["ip_error_wrong"] = 'The Destination IP address is invalid';
$wb["destination_ip_empty"] = 'The Destination IP is empty.';
$wb["source_ip_empty"] = 'The Source IP is empty.';
$wb["server_empty_error"] = 'The Server is empty.';
$wb["duplicate_mapping_error"] = "Mapping already exists.";
$wb["duplicate_mapping_error"] = "Source IP can not be an IP of the Rewrite-Server";
$wb["ip_mapping_error"] = "Source IP can not be an IP of the Rewrite-Server";
?>
......@@ -6,6 +6,7 @@ $wb["active_txt"] = 'Aktiv';
$wb["ip_error_wrong"] = 'Die neue IP ist ungueltig';
$wb["destination_ip_empty"] = 'Die neue IP ist leer.';
$wb["source_ip_empty"] = 'Die eigentliche IP ist leer.';
$wb["server_empty_error"] = 'Der Server ist leer.';
$wb["duplicate_mapping_error"] = "Mapping existiert bereits.";
$wb["duplicate_mapping_error"] = "Die eigentliche IP darf keine IP des Rewrite-Servers sein.";
$wb["ip_mapping_error"] = "Die eigentliche IP darf keine IP des Rewrite-Servers sein.";
?>
......@@ -6,6 +6,7 @@ $wb["active_txt"] = 'Active';
$wb["ip_error_wrong"] = 'The Destination IP address is invalid';
$wb["destination_ip_empty"] = 'The Destination IP is empty.';
$wb["source_ip_empty"] = 'The Source IP is empty.';
$wb["server_empty_error"] = 'The Server is empty.';
$wb["duplicate_mapping_error"] = "Mapping already exists.";
$wb["duplicate_mapping_error"] = "Source IP can not be an IP of the Rewrite-Server";
$wb["ip_mapping_error"] = "Source IP can not be an IP of the Rewrite-Server";
?>
......@@ -6,6 +6,7 @@ $wb["active_txt"] = 'Active';
$wb["ip_error_wrong"] = 'The Destination IP address is invalid';
$wb["destination_ip_empty"] = 'The Destination IP is empty.';
$wb["source_ip_empty"] = 'The Source IP is empty.';
$wb["server_empty_error"] = 'The Server is empty.';
$wb["duplicate_mapping_error"] = "Mapping already exists.";
$wb["duplicate_mapping_error"] = "Source IP can not be an IP of the Rewrite-Server";
$wb["ip_mapping_error"] = "Source IP can not be an IP of the Rewrite-Server";
?>
......@@ -6,6 +6,7 @@ $wb["active_txt"] = 'Active';
$wb["ip_error_wrong"] = 'The Destination IP address is invalid';
$wb["destination_ip_empty"] = 'The Destination IP is empty.';
$wb["source_ip_empty"] = 'The Source IP is empty.';
$wb["server_empty_error"] = 'The Server is empty.';
$wb["duplicate_mapping_error"] = "Mapping already exists.";
$wb["duplicate_mapping_error"] = "Source IP can not be an IP of the Rewrite-Server";
$wb["ip_mapping_error"] = "Source IP can not be an IP of the Rewrite-Server";
?>
......@@ -6,6 +6,7 @@ $wb["active_txt"] = 'Active';
$wb["ip_error_wrong"] = 'The Destination IP address is invalid';
$wb["destination_ip_empty"] = 'The Destination IP is empty.';
$wb["source_ip_empty"] = 'The Source IP is empty.';
$wb["server_empty_error"] = 'The Server is empty.';
$wb["duplicate_mapping_error"] = "Mapping already exists.";
$wb["duplicate_mapping_error"] = "Source IP can not be an IP of the Rewrite-Server";
$wb["ip_mapping_error"] = "Source IP can not be an IP of the Rewrite-Server";
?>
......@@ -6,6 +6,7 @@ $wb["active_txt"] = 'Active';
$wb["ip_error_wrong"] = 'The Destination IP address is invalid';
$wb["destination_ip_empty"] = 'The Destination IP is empty.';
$wb["source_ip_empty"] = 'The Source IP is empty.';
$wb["server_empty_error"] = 'The Server is empty.';
$wb["duplicate_mapping_error"] = "Mapping already exists.";
$wb["duplicate_mapping_error"] = "Source IP can not be an IP of the Rewrite-Server";
$wb["ip_mapping_error"] = "Source IP can not be an IP of the Rewrite-Server";
?>
......@@ -6,6 +6,7 @@ $wb["active_txt"] = 'Active';
$wb["ip_error_wrong"] = 'The Destination IP address is invalid';
$wb["destination_ip_empty"] = 'The Destination IP is empty.';
$wb["source_ip_empty"] = 'The Source IP is empty.';
$wb["server_empty_error"] = 'The Server is empty.';
$wb["duplicate_mapping_error"] = "Mapping already exists.";
$wb["duplicate_mapping_error"] = "Source IP can not be an IP of the Rewrite-Server";
$wb["ip_mapping_error"] = "Source IP can not be an IP of the Rewrite-Server";
?>
......@@ -6,6 +6,7 @@ $wb["active_txt"] = 'Active';
$wb["ip_error_wrong"] = 'The Destination IP address is invalid';
$wb["destination_ip_empty"] = 'The Destination IP is empty.';
$wb["source_ip_empty"] = 'The Source IP is empty.';
$wb["server_empty_error"] = 'The Server is empty.';
$wb["duplicate_mapping_error"] = "Mapping already exists.";
$wb["duplicate_mapping_error"] = "Source IP can not be an IP of the Rewrite-Server";
$wb["ip_mapping_error"] = "Source IP can not be an IP of the Rewrite-Server";
?>
......@@ -6,6 +6,7 @@ $wb["active_txt"] = 'Active';
$wb["ip_error_wrong"] = 'The Destination IP address is invalid';
$wb["destination_ip_empty"] = 'The Destination IP is empty.';
$wb["source_ip_empty"] = 'The Source IP is empty.';
$wb["server_empty_error"] = 'The Server is empty.';
$wb["duplicate_mapping_error"] = "Mapping already exists.";
$wb["duplicate_mapping_error"] = "Source IP can not be an IP of the Rewrite-Server";
$wb["ip_mapping_error"] = "Source IP can not be an IP of the Rewrite-Server";
?>
......@@ -6,6 +6,7 @@ $wb["active_txt"] = 'Active';
$wb["ip_error_wrong"] = 'The Destination IP address is invalid';
$wb["destination_ip_empty"] = 'The Destination IP is empty.';
$wb["source_ip_empty"] = 'The Source IP is empty.';
$wb["server_empty_error"] = 'The Server is empty.';
$wb["duplicate_mapping_error"] = "Mapping already exists.";
$wb["duplicate_mapping_error"] = "Source IP can not be an IP of the Rewrite-Server";
$wb["ip_mapping_error"] = "Source IP can not be an IP of the Rewrite-Server";
?>
......@@ -6,6 +6,7 @@ $wb["active_txt"] = 'Active';
$wb["ip_error_wrong"] = 'The Destination IP address is invalid';
$wb["destination_ip_empty"] = 'The Destination IP is empty.';
$wb["source_ip_empty"] = 'The Source IP is empty.';
$wb["server_empty_error"] = 'The Server is empty.';
$wb["duplicate_mapping_error"] = "Mapping already exists.";
$wb["duplicate_mapping_error"] = "Source IP can not be an IP of the Rewrite-Server";
$wb["ip_mapping_error"] = "Source IP can not be an IP of the Rewrite-Server";
?>
......@@ -6,6 +6,7 @@ $wb["active_txt"] = 'Active';
$wb["ip_error_wrong"] = 'The Destination IP address is invalid';
$wb["destination_ip_empty"] = 'The Destination IP is empty.';
$wb["source_ip_empty"] = 'The Source IP is empty.';
$wb["server_empty_error"] = 'The Server is empty.';
$wb["duplicate_mapping_error"] = "Mapping already exists.";
$wb["duplicate_mapping_error"] = "Source IP can not be an IP of the Rewrite-Server";
$wb["ip_mapping_error"] = "Source IP can not be an IP of the Rewrite-Server";
?>
......@@ -6,6 +6,7 @@ $wb["active_txt"] = 'Active';
$wb["ip_error_wrong"] = 'The Destination IP address is invalid';
$wb["destination_ip_empty"] = 'The Destination IP is empty.';
$wb["source_ip_empty"] = 'The Source IP is empty.';
$wb["server_empty_error"] = 'The Server is empty.';
$wb["duplicate_mapping_error"] = "Mapping already exists.";
$wb["duplicate_mapping_error"] = "Source IP can not be an IP of the Rewrite-Server";
$wb["ip_mapping_error"] = "Source IP can not be an IP of the Rewrite-Server";
?>
......@@ -6,6 +6,7 @@ $wb["active_txt"] = 'Active';
$wb["ip_error_wrong"] = 'The Destination IP address is invalid';
$wb["destination_ip_empty"] = 'The Destination IP is empty.';
$wb["source_ip_empty"] = 'The Source IP is empty.';
$wb["server_empty_error"] = 'The Server is empty.';
$wb["duplicate_mapping_error"] = "Mapping already exists.";
$wb["duplicate_mapping_error"] = "Source IP can not be an IP of the Rewrite-Server";
$wb["ip_mapping_error"] = "Source IP can not be an IP of the Rewrite-Server";
?>
......@@ -6,6 +6,7 @@ $wb["active_txt"] = 'Active';
$wb["ip_error_wrong"] = 'The Destination IP address is invalid';
$wb["destination_ip_empty"] = 'The Destination IP is empty.';
$wb["source_ip_empty"] = 'The Source IP is empty.';
$wb["server_empty_error"] = 'The Server is empty.';
$wb["duplicate_mapping_error"] = "Mapping already exists.";
$wb["duplicate_mapping_error"] = "Source IP can not be an IP of the Rewrite-Server";
$wb["ip_mapping_error"] = "Source IP can not be an IP of the Rewrite-Server";
?>
......@@ -6,6 +6,7 @@ $wb["active_txt"] = 'Active';
$wb["ip_error_wrong"] = 'The Destination IP address is invalid';
$wb["destination_ip_empty"] = 'The Destination IP is empty.';
$wb["source_ip_empty"] = 'The Source IP is empty.';
$wb["server_empty_error"] = 'The Server is empty.';
$wb["duplicate_mapping_error"] = "Mapping already exists.";
$wb["duplicate_mapping_error"] = "Source IP can not be an IP of the Rewrite-Server";
$wb["ip_mapping_error"] = "Source IP can not be an IP of the Rewrite-Server";
?>
......@@ -6,6 +6,7 @@ $wb["active_txt"] = 'Active';
$wb["ip_error_wrong"] = 'The Destination IP address is invalid';
$wb["destination_ip_empty"] = 'The Destination IP is empty.';
$wb["source_ip_empty"] = 'The Source IP is empty.';
$wb["server_empty_error"] = 'The Server is empty.';
$wb["duplicate_mapping_error"] = "Mapping already exists.";
$wb["duplicate_mapping_error"] = "Source IP can not be an IP of the Rewrite-Server";
$wb["ip_mapping_error"] = "Source IP can not be an IP of the Rewrite-Server";
?>
......@@ -6,6 +6,7 @@ $wb["active_txt"] = 'Active';
$wb["ip_error_wrong"] = 'The Destination IP address is invalid';
$wb["destination_ip_empty"] = 'The Destination IP is empty.';
$wb["source_ip_empty"] = 'The Source IP is empty.';
$wb["server_empty_error"] = 'The Server is empty.';
$wb["duplicate_mapping_error"] = "Mapping already exists.";
$wb["duplicate_mapping_error"] = "Source IP can not be an IP of the Rewrite-Server";
$wb["ip_mapping_error"] = "Source IP can not be an IP of the Rewrite-Server";
?>
......@@ -6,6 +6,7 @@ $wb["active_txt"] = 'Active';
$wb["ip_error_wrong"] = 'The Destination IP address is invalid';
$wb["destination_ip_empty"] = 'The Destination IP is empty.';
$wb["source_ip_empty"] = 'The Source IP is empty.';
$wb["server_empty_error"] = 'The Server is empty.';
$wb["duplicate_mapping_error"] = "Mapping already exists.";
$wb["duplicate_mapping_error"] = "Source IP can not be an IP of the Rewrite-Server";
$wb["ip_mapping_error"] = "Source IP can not be an IP of the Rewrite-Server";
?>
......@@ -42,7 +42,7 @@ $items[] = array( 'title' => 'Server IP addresses',
'link' => 'admin/server_ip_list.php',
'html_id' => 'server_ip_list');
$items[] = array( 'title' => 'Server IP mapping',
$items[] = array( 'title' => 'Server IPv4 mapping',
'target' => 'content',
'link' => 'admin/server_ip_map_list.php',
'html_id' => 'server_ip_map_list');
......
......@@ -59,7 +59,7 @@ class page_action extends tform_actions {
$app->tpl->setVar('server_id', $server_select);
// ip-list
$sql = "SELECT server_ip.server_ip_id, server_ip.ip_address AS ip_address, server.server_name, CONCAT(server_ip.ip_address,' :: [', server.server_name, ']') AS source FROM server_ip, server WHERE (server_ip.server_id = server.server_id AND server.web_server =1 AND mirror_server_id = 0 AND virtualhost = 'y')";
$sql = "SELECT server_ip.server_ip_id, server_ip.ip_address AS ip_address, server.server_name, CONCAT(server_ip.ip_address,' :: [', server.server_name, ']') AS source FROM server_ip, server WHERE (server_ip.server_id = server.server_id AND server.web_server =1 AND mirror_server_id = 0 AND virtualhost = 'y' AND IP_TYPE = 'IPv4')";
$ips = $app->db->queryAllRecords($sql);
$ip_select = "<option value=''></option>";
if(is_array($ips)) {
......@@ -77,9 +77,11 @@ class page_action extends tform_actions {
function onBeforeInsert() {
global $app;
if($this->dataRecord['server_id']=='') $app->tform->errorMessage .= $app->tform->wordbook['server_empty_error'];
$sql = "SELECT * FROM server_ip WHERE server_id = ? and ip_address = ?";
$ip_check=$app->db->queryOneRecord($sql, $this->dataRecord['server_id'], $this->dataRecord['source_ip']);
if (is_array($ip_check)) $app->tform->errorMessage .= $app->tform->wordbook['duplicate_mapping_error'];
if (is_array($ip_check)) $app->tform->errorMessage .= $app->tform->wordbook['ip_mapping_error'];
$sql = 'SELECT count(*) as no FROM server_ip_map WHERE server_id = ? AND source_ip = ? AND destination_ip = ?';
$check = $app->db->queryOneRecord($sql, $this->dataRecord['server_id'], $this->dataRecord['source_ip'], $this->dataRecord['destination_ip']);
......@@ -88,9 +90,12 @@ class page_action extends tform_actions {
function onBeforeUpdate() {
global $app;
if($this->dataRecord['server_id']=='') $app->tform->errorMessage .= $app->tform->wordbook['server_empty_error'];
$sql = "SELECT * FROM server_ip WHERE server_id = ? and ip_address = ?";
$ip_check=$app->db->queryOneRecord($sql, $this->dataRecord['server_id'], $this->dataRecord['source_ip']);
if (is_array($ip_check)) $app->tform->errorMessage .= $app->tform->wordbook['duplicate_mapping_error'];
if (is_array($ip_check)) $app->tform->errorMessage .= $app->tform->wordbook['ip_mapping_error'];
$this->oldDataRecord = $app->tform->getDataRecord($this->id);
if ($this->dataRecord['source_ip'] != $this->oldDataRecord['source_ip'] || $this->dataRecord['destination_ip'] != $this->oldDataRecord['destination_ip']) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment