parent
8d00ee5e1b
commit
faf5f368f5
@ -0,0 +1,44 @@ |
||||
<?php |
||||
/***************************************************************************** |
||||
IP Reg, a PHP/MySQL IPAM tool |
||||
Copyright (C) 2008 Wietse Warendorff |
||||
|
||||
This program is free software: you can redistribute it and/or modify |
||||
it under the terms of the GNU General Public License as published by |
||||
the Free Software Foundation, either version 3 of the License, or |
||||
(at your option) any later version. |
||||
|
||||
This program is distributed in the hope that it will be useful, |
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of |
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
||||
GNU General Public License for more details. |
||||
|
||||
You should have received a copy of the GNU General Public License |
||||
along with this program. If not, see <http://www.gnu.org/licenses/>. |
||||
|
||||
For more information, visit http://sourceforge.net/projects/ipreg, |
||||
or contact me at wietsew@users.sourceforge.net |
||||
*****************************************************************************/ |
||||
|
||||
// includes |
||||
include("includes.php"); |
||||
|
||||
// start output |
||||
include("header.php"); |
||||
|
||||
// set template |
||||
$tp = new Template("tpl/about.tpl"); |
||||
|
||||
// set language variables |
||||
$tp->setvars($lang); |
||||
|
||||
// set vars |
||||
$tp->set("config_version", $config_version); |
||||
|
||||
// output |
||||
$tp->parse(); |
||||
$tp->spit(); |
||||
|
||||
// end output |
||||
include("footer.php"); |
||||
?> |
@ -0,0 +1,53 @@ |
||||
<?php |
||||
/***************************************************************************** |
||||
IP Reg, a PHP/MySQL IPAM tool |
||||
Copyright (C) 2008 Wietse Warendorff |
||||
|
||||
This program is free software: you can redistribute it and/or modify |
||||
it under the terms of the GNU General Public License as published by |
||||
the Free Software Foundation, either version 3 of the License, or |
||||
(at your option) any later version. |
||||
|
||||
This program is distributed in the hope that it will be useful, |
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of |
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
||||
GNU General Public License for more details. |
||||
|
||||
You should have received a copy of the GNU General Public License |
||||
along with this program. If not, see <http://www.gnu.org/licenses/>. |
||||
|
||||
For more information, visit http://sourceforge.net/projects/ipreg, |
||||
or contact me at wietsew@users.sourceforge.net |
||||
*****************************************************************************/ |
||||
|
||||
// includes |
||||
include("includes.php"); |
||||
|
||||
// check authorisation |
||||
$auth = auth("assetclassgroup", $config_auth_assetclassgroupview, 0); |
||||
|
||||
// start output |
||||
include("header.php"); |
||||
|
||||
// set template |
||||
$tp = new Template("tpl/assetclassgroup.tpl"); |
||||
|
||||
// set language variables |
||||
$tp->setvars($lang); |
||||
|
||||
// get asset info |
||||
$result = mysql_query("SELECT assetclassgroup_id, assetclassgroup_name FROM assetclassgroup ORDER BY assetclassgroup_name") or die(mysql_error()); |
||||
for ($i=0;$row=mysql_fetch_object($result);$i++) { |
||||
$tp->set("assetclassgroup_id", $row->assetclassgroup_id); |
||||
$tp->set("assetclassgroup_name", $row->assetclassgroup_name); |
||||
$tp->parse("assetclassgrouprow"); |
||||
} |
||||
if (($i>0) ? $tp->parse("assetclassgroup") : $tp->hide("assetclassgroup")); |
||||
|
||||
// output |
||||
$tp->parse(); |
||||
$tp->spit(); |
||||
|
||||
// end output |
||||
include("footer.php"); |
||||
?> |
@ -0,0 +1,43 @@ |
||||
<?php |
||||
/***************************************************************************** |
||||
IP Reg, a PHP/MySQL IPAM tool |
||||
Copyright (C) 2008 Wietse Warendorff |
||||
|
||||
This program is free software: you can redistribute it and/or modify |
||||
it under the terms of the GNU General Public License as published by |
||||
the Free Software Foundation, either version 3 of the License, or |
||||
(at your option) any later version. |
||||
|
||||
This program is distributed in the hope that it will be useful, |
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of |
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
||||
GNU General Public License for more details. |
||||
|
||||
You should have received a copy of the GNU General Public License |
||||
along with this program. If not, see <http://www.gnu.org/licenses/>. |
||||
|
||||
For more information, visit http://sourceforge.net/projects/ipreg, |
||||
or contact me at wietsew@users.sourceforge.net |
||||
*****************************************************************************/ |
||||
|
||||
// includes |
||||
include("includes.php"); |
||||
|
||||
// check authorisation |
||||
$auth = auth("assetclassgroup", $config_auth_assetclassgroupadd, 0); |
||||
|
||||
// start output |
||||
include("header.php"); |
||||
|
||||
// set template |
||||
$tp = new Template("tpl/assetclassgroupadd.tpl"); |
||||
|
||||
// set language variables |
||||
$tp->setvars($lang); |
||||
|
||||
// output |
||||
$tp->parse(); |
||||
$tp->spit(); |
||||
|
||||
include("footer.php"); |
||||
?> |
@ -0,0 +1,52 @@ |
||||
<?php |
||||
/***************************************************************************** |
||||
IP Reg, a PHP/MySQL IPAM tool |
||||
Copyright (C) 2008 Wietse Warendorff |
||||
|
||||
This program is free software: you can redistribute it and/or modify |
||||
it under the terms of the GNU General Public License as published by |
||||
the Free Software Foundation, either version 3 of the License, or |
||||
(at your option) any later version. |
||||
|
||||
This program is distributed in the hope that it will be useful, |
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of |
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
||||
GNU General Public License for more details. |
||||
|
||||
You should have received a copy of the GNU General Public License |
||||
along with this program. If not, see <http://www.gnu.org/licenses/>. |
||||
|
||||
For more information, visit http://sourceforge.net/projects/ipreg, |
||||
or contact me at wietsew@users.sourceforge.net |
||||
*****************************************************************************/ |
||||
|
||||
// includes |
||||
include("includes.php"); |
||||
|
||||
// get id |
||||
$assetclassgroup_id = $_GET['assetclassgroup_id']; |
||||
|
||||
// check authorisation |
||||
$auth = auth("assetclassgroup", $config_auth_assetclassgroupdel, $assetclassgroup_id); |
||||
|
||||
// start output |
||||
include("header.php"); |
||||
|
||||
// set template |
||||
$tp = new Template("tpl/assetclassgroupdel.tpl"); |
||||
|
||||
// set language variables |
||||
$tp->setvars($lang); |
||||
|
||||
// get assetclass info |
||||
$result = mysql_query("SELECT assetclassgroup_id, assetclassgroup_name FROM assetclassgroup WHERE assetclassgroup_id='$assetclassgroup_id'") or die(mysql_error()); |
||||
$row=mysql_fetch_object($result); |
||||
$tp->set("assetclassgroup_id", $row->assetclassgroup_id); |
||||
$tp->set("assetclassgroup_name", $row->assetclassgroup_name); |
||||
|
||||
// output |
||||
$tp->parse(); |
||||
$tp->spit(); |
||||
|
||||
include("footer.php"); |
||||
?> |
@ -0,0 +1,53 @@ |
||||
<?php |
||||
/***************************************************************************** |
||||
IP Reg, a PHP/MySQL IPAM tool |
||||
Copyright (C) 2008 Wietse Warendorff |
||||
|
||||
This program is free software: you can redistribute it and/or modify |
||||
it under the terms of the GNU General Public License as published by |
||||
the Free Software Foundation, either version 3 of the License, or |
||||
(at your option) any later version. |
||||
|
||||
This program is distributed in the hope that it will be useful, |
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of |
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
||||
GNU General Public License for more details. |
||||
|
||||
You should have received a copy of the GNU General Public License |
||||
along with this program. If not, see <http://www.gnu.org/licenses/>. |
||||
|
||||
For more information, visit http://sourceforge.net/projects/ipreg, |
||||
or contact me at wietsew@users.sourceforge.net |
||||
*****************************************************************************/ |
||||
|
||||
// includes |
||||
include("includes.php"); |
||||
|
||||
// get id |
||||
$assetclassgroup_id = $_GET['assetclassgroup_id']; |
||||
|
||||
// check authorisation |
||||
$auth = auth("assetclassgroup", $config_auth_assetclassgroupedit, $assetclassgroup_id); |
||||
|
||||
// start output |
||||
include("header.php"); |
||||
|
||||
// set template |
||||
$tp = new Template("tpl/assetclassgroupedit.tpl"); |
||||
|
||||
// set language variables |
||||
$tp->setvars($lang); |
||||
|
||||
// get assetclass information |
||||
$result = mysql_query("SELECT assetclassgroup_name, color FROM assetclassgroup WHERE assetclassgroup_id='$assetclassgroup_id'") or die(mysql_error()); |
||||
$row=mysql_fetch_object($result); |
||||
$tp->set("assetclassgroup_id", $assetclassgroup_id); |
||||
$tp->set("assetclassgroup_name", $row->assetclassgroup_name); |
||||
$tp->set("color", $row->color); |
||||
|
||||
// output |
||||
$tp->parse(); |
||||
$tp->spit(); |
||||
|
||||
include("footer.php"); |
||||
?> |
@ -1,58 +0,0 @@ |
||||
<?php |
||||
include("header.php"); |
||||
|
||||
// display only if admin |
||||
if($_SESSION['suser_level'] >= 2) { |
||||
|
||||
// check for submit |
||||
if ($_SERVER['REQUEST_METHOD']=="POST" ) { |
||||
$location_id = $_POST['location_id']; |
||||
$subnet_id = $_POST['subnet_id']; |
||||
|
||||
mysql_query("INSERT INTO subnetlocation (location_id, subnet_id) VALUE ('$location_id', '$subnet_id')") or die(mysql_error()); |
||||
|
||||
header("Location: subnetview.php?subnet_id=" . $subnet_id); |
||||
} |
||||
|
||||
$subnet_id = $_GET['subnet_id']; |
||||
?> |
||||
|
||||
<form method="POST" action="assignsubnettolocation.php"> |
||||
<input type="hidden" name="subnet_id" value="<?php echo $subnet_id; ?>">
|
||||
<table border="0"> |
||||
<tr> |
||||
<td> |
||||
<b>Assign to:</b><br> |
||||
</td> |
||||
<td> |
||||
<select name="location_id"> |
||||
|
||||
<?php |
||||
function display_children($parent, $level) { |
||||
$result = mysql_query("SELECT location_id, location_name FROM location WHERE parent='$parent' ORDER BY location_name") or die(mysql_error()); |
||||
while ($row = mysql_fetch_object($result)) { |
||||
echo '<option value="' . $row->location_id . '">' . str_repeat(' ',$level) . $row->location_name . '</option>'; |
||||
display_children($row->location_id, $level+1); |
||||
} |
||||
} |
||||
|
||||
display_children('',0); |
||||
?> |
||||
|
||||
</select> |
||||
</td> |
||||
</tr> |
||||
<tr> |
||||
<td colspan="2" align="right"> |
||||
<input type="submit" value="Submit"><input type="reset" value="Reset"> |
||||
</td> |
||||
</tr> |
||||
</table> |
||||
</form> |
||||
|
||||
<?php |
||||
// end display only if admin |
||||
} |
||||
|
||||
include("footer.php"); |
||||
?> |
@ -0,0 +1,46 @@ |
||||
<?php |
||||
/***************************************************************************** |
||||
IP Reg, a PHP/MySQL IPAM tool |
||||
Copyright (C) 2008 Wietse Warendorff |
||||
|
||||
This program is free software: you can redistribute it and/or modify |
||||
it under the terms of the GNU General Public License as published by |
||||
the Free Software Foundation, either version 3 of the License, or |
||||
(at your option) any later version. |
||||
|
||||
This program is distributed in the hope that it will be useful, |
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of |
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
||||
GNU General Public License for more details. |
||||
|
||||
You should have received a copy of the GNU General Public License |
||||
along with this program. If not, see <http://www.gnu.org/licenses/>. |
||||
|
||||
For more information, visit http://sourceforge.net/projects/ipreg, |
||||
or contact me at wietsew@users.sourceforge.net |
||||
*****************************************************************************/ |
||||
|
||||
// includes |
||||
include("includes.php"); |
||||
|
||||
// start output |
||||
include("header.php"); |
||||
|
||||
// set template |
||||
$tp = new Template("tpl/comments.tpl"); |
||||
|
||||
// set language variables |
||||
$tp->setvars($lang); |
||||
|
||||
// get error |
||||
$comments = $_GET['comments']; |
||||
|
||||
// set veriables |
||||
$tp->set("comments", $lang['lang_comments_' . $comments]); |
||||
|
||||
// output |
||||
$tp->parse(); |
||||
$tp->spit(); |
||||
|
||||
include("footer.php"); |
||||
?> |
@ -1,52 +1,89 @@ |
||||
<?php
|
||||
/***************************************************************************** |
||||
IP Reg, a PHP/MySQL IPAM tool |
||||
Copyright (C) 2008 Wietse Warendorff |
||||
|
||||
This program is free software: you can redistribute it and/or modify |
||||
it under the terms of the GNU General Public License as published by |
||||
the Free Software Foundation, either version 3 of the License, or |
||||
(at your option) any later version. |
||||
|
||||
This program is distributed in the hope that it will be useful, |
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of |
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
||||
GNU General Public License for more details. |
||||
|
||||
You should have received a copy of the GNU General Public License |
||||
along with this program. If not, see <http://www.gnu.org/licenses/>. |
||||
|
||||
For more information, visit http://sourceforge.net/projects/ipreg, |
||||
or contact me at wietsew@users.sourceforge.net |
||||
*****************************************************************************/ |
||||
|
||||
// version |
||||
$config_version = 'v0.3'; |
||||
$config_version = 'v0.4b'; |
||||
|
||||
// db connection |
||||
$mysql_host = "localhost"; |
||||
$mysql_username = "db_user"; |
||||
$mysql_password = "db_pass"; |
||||
$mysql_dbname = "db_name"; |
||||
$config_mysql_host = "localhost"; |
||||
$config_mysql_username = ''; |
||||
$config_mysql_password = ''; |
||||
$config_mysql_dbname = ''; |
||||
|
||||
// standard password for new users |
||||
$config_user_lang = "en"; |
||||
$config_user_pass = "welcome"; |
||||
|
||||
// set userlevels |
||||
$config_userlevel_assetadd = 2; |
||||
$config_userlevel_assetdel = 2; |
||||
$config_userlevel_assetedit = 2; |
||||
$config_userlevel_assetview = 1; |
||||
$config_userlevel_assetclassadd = 2; |
||||
$config_userlevel_assetclassdel = 2; |
||||
$config_userlevel_assetclassedit = 2; |
||||
$config_userlevel_assetclassview = 1; |
||||
$config_userlevel_assetclassgroupadd = 2; |
||||
$config_userlevel_assetclassgroupdel = 2; |
||||
$config_userlevel_assetclassgroupedit = 2; |
||||
$config_userlevel_assetclassgroupview = 1; |
||||
$config_userlevel_locationadd = 2; |
||||
$config_userlevel_locationdel = 2; |
||||
$config_userlevel_locationedit = 2; |
||||
$config_userlevel_locationview = 1; |
||||
$config_userlevel_nodeadd = 2; |
||||
$config_userlevel_nodedel = 2; |
||||
$config_userlevel_nodeedit = 2; |
||||
$config_userlevel_nodeview = 1; |
||||
$config_userlevel_subnetadd = 2; |
||||
$config_userlevel_subnetdel = 2; |
||||
$config_userlevel_subnetedit = 2; |
||||
$config_userlevel_subnetview = 1; |
||||
$config_userlevel_useradd = 2; |
||||
$config_userlevel_userdel = 2; |
||||
$config_userlevel_useredit = 2; |
||||
$config_userlevel_userview = 1; |
||||
$config_userlevel_vlanadd = 2; |
||||
$config_userlevel_vlandel = 2; |
||||
$config_userlevel_vlanedit = 2; |
||||
$config_userlevel_vlanview = 1; |
||||
// default settings for new users |
||||
$config_user_lang = 'en'; |
||||
$config_user_pass = 'welcome'; |
||||
|
||||
// domain suffix for dns input fields |
||||
$config_dns1suffix = '.yourdomain.com'; |
||||
$config_dns2suffix = '.yourdomain.com'; |
||||
$config_dns1suffix = '.domain.com'; |
||||
$config_dns2suffix = '.domain.com'; |
||||
|
||||
// default colors for IP blocks |
||||
$config_color_blocked = 'FFFFFF'; |
||||
$config_color_unused = 'D3D3D3'; |
||||
|
||||
// set userlevels |
||||
$config_auth_assetadd = 2; |
||||
$config_auth_assetdel = 2; |
||||
$config_auth_assetedit = 2; |
||||
$config_auth_assetview = 1; |
||||
$config_auth_assetclassadd = 2; |
||||
$config_auth_assetclassdel = 2; |
||||
$config_auth_assetclassedit = 2; |
||||
$config_auth_assetclassview = 1; |
||||
$config_auth_assetclassgroupadd = 2; |
||||
$config_auth_assetclassgroupdel = 2; |
||||
$config_auth_assetclassgroupedit = 2; |
||||
$config_auth_assetclassgroupview = 1; |
||||
$config_auth_assigniptoasset = 2; |
||||
$config_auth_assigniptonode = 2; |
||||
$config_auth_assignlocationtosubnet = 2; |
||||
$config_auth_assignvlantosubnet = 2; |
||||
$config_auth_locationadd = 2; |
||||
$config_auth_locationdel = 2; |
||||
$config_auth_locationedit = 2; |
||||
$config_auth_locationview = 1; |
||||
$config_auth_nodeadd = 2; |
||||
$config_auth_nodedel = 2; |
||||
$config_auth_nodeedit = 2; |
||||
$config_auth_nodeview = 1; |
||||
$config_auth_subnetadd = 2; |
||||
$config_auth_subnetdel = 2; |
||||
$config_auth_subnetedit = 2; |
||||
$config_auth_subnetview = 1; |
||||
$config_auth_useradd = 2; |
||||
$config_auth_userdel = 2; |
||||
$config_auth_useredit = 2; |
||||
$config_auth_userview = 1; |
||||
$config_auth_userclassadd = 2; |
||||
$config_auth_userclassdel = 2; |
||||
$config_auth_userclassedit = 2; |
||||
$config_auth_userclassview = 1; |
||||
$config_auth_userclassauthadd = 2; |
||||
$config_auth_userclassauthdel = 2; |
||||
$config_auth_userclassauthedit = 2; |
||||
$config_auth_userclassauthview = 1; |
||||
$config_auth_vlanadd = 2; |
||||
$config_auth_vlandel = 2; |
||||
$config_auth_vlanedit = 2; |
||||
$config_auth_vlanview = 1; |
||||
?> |
@ -1,4 +1,25 @@ |
||||
<?php |
||||
mysql_connect($mysql_host,$mysql_username,$mysql_password); |
||||
mysql_select_db($mysql_dbname); |
||||
/***************************************************************************** |
||||
IP Reg, a PHP/MySQL IPAM tool |
||||
Copyright (C) 2008 Wietse Warendorff |
||||
|
||||
This program is free software: you can redistribute it and/or modify |
||||
it under the terms of the GNU General Public License as published by |
||||
the Free Software Foundation, either version 3 of the License, or |
||||
(at your option) any later version. |
||||
|
||||
This program is distributed in the hope that it will be useful, |
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of |
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
||||
GNU General Public License for more details. |
||||
|
||||
You should have received a copy of the GNU General Public License |
||||
along with this program. If not, see <http://www.gnu.org/licenses/>. |
||||
|
||||
For more information, visit http://sourceforge.net/projects/ipreg, |
||||
or contact me at wietsew@users.sourceforge.net |
||||
*****************************************************************************/ |
||||
|
||||
mysql_connect($config_mysql_host,$config_mysql_username,$config_mysql_password); |
||||
mysql_select_db($config_mysql_dbname); |
||||
?> |
@ -1,21 +0,0 @@ |
||||
<?php |
||||
include("header.php"); |
||||
|
||||
// set template |
||||
$tp = new Template("tpl/error.tpl"); |
||||
|
||||
// set language variables |
||||
$tp->setvars($lang); |
||||
|
||||
// get error |
||||
$error = $_GET['error']; |
||||
|
||||
// set veriables |
||||
$tp->set("error", $lang['lang_error_' . $error]); |
||||
|
||||
// output |
||||
$tp->parse(); |
||||
$tp->spit(); |
||||
|
||||
include("footer.php"); |
||||
?> |
@ -0,0 +1,621 @@ |
||||
GNU GENERAL PUBLIC LICENSE |
||||
Version 3, 29 June 2007 |
||||
|
||||
Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/> |
||||
Everyone is permitted to copy and distribute verbatim copies |
||||
of this license document, but changing it is not allowed. |
||||
|
||||
Preamble |
||||
|
||||
The GNU General Public License is a free, copyleft license for |
||||
software and other kinds of works. |
||||
|
||||
The licenses for most software and other practical works are designed |
||||
to take away your freedom to share and change the works. By contrast, |
||||
the GNU General Public License is intended to guarantee your freedom to |
||||
share and change all versions of a program--to make sure it remains free |
||||
software for all its users. We, the Free Software Foundation, use the |
||||
GNU General Public License for most of our software; it applies also to |
||||
any other work released this way by its authors. You can apply it to |
||||
your programs, too. |
||||
|
||||
When we speak of free software, we are referring to freedom, not |
||||
price. Our General Public Licenses are designed to make sure that you |
||||
have the freedom to distribute copies of free software (and charge for |
||||
them if you wish), that you receive source code or can get it if you |
||||
want it, that you can change the software or use pieces of it in new |
||||
|