Changes adopted from version 0.4

master v0.4
Thomas Hooge 2 years ago
parent 8d00ee5e1b
commit faf5f368f5
  1. 44
      about.php
  2. 34
      asset.php
  3. 32
      assetadd.php
  4. 28
      assetclass.php
  5. 32
      assetclassadd.php
  6. 30
      assetclassdel.php
  7. 30
      assetclassedit.php
  8. 53
      assetclassgroup.php
  9. 43
      assetclassgroupadd.php
  10. 52
      assetclassgroupdel.php
  11. 53
      assetclassgroupedit.php
  12. 49
      assetclassgroupview.php
  13. 47
      assetclassview.php
  14. 30
      assetdel.php
  15. 30
      assetedit.php
  16. 45
      assetview.php
  17. 59
      assigniptoasset.php
  18. 39
      assigniptonode.php
  19. 25
      assignlocationtosubnet.php
  20. 58
      assignsubnettolocation.php
  21. 25
      assignvlantosubnet.php
  22. 46
      comments.php
  23. 125
      config.php
  24. 25
      dbconnect.php
  25. 21
      error.php
  26. 21
      footer.php
  27. 95
      functions.php
  28. 621
      gpl-3.0.txt
  29. 35
      header.php
  30. 16
      image.php
  31. BIN
      images/add.gif
  32. BIN
      images/arrow.gif
  33. BIN
      images/black.jpg
  34. BIN
      images/blue.jpg
  35. BIN
      images/check.gif
  36. BIN
      images/comments.gif
  37. BIN
      images/cross.jpg
  38. BIN
      images/del.gif
  39. BIN
      images/edit.gif
  40. BIN
      images/green.jpg
  41. BIN
      images/grey.jpg
  42. BIN
      images/next.gif
  43. BIN
      images/orange.jpg
  44. BIN
      images/prev.gif
  45. BIN
      images/red.jpg
  46. BIN
      images/save.gif
  47. BIN
      images/search.gif
  48. BIN
      images/warning.gif
  49. 83
      includes.php
  50. 25
      index.php
  51. 199
      install/install.sql
  52. 14
      install/install.txt
  53. 38
      lang/en.php
  54. 32
      location.php
  55. 32
      locationadd.php
  56. 30
      locationdel.php
  57. 30
      locationedit.php
  58. 50
      locationview.php
  59. 93
      login.php
  60. 21
      logout.php
  61. 28
      nodeadd.php
  62. 30
      nodedel.php
  63. 50
      nodeedit.php
  64. 33
      nodelist.php
  65. 47
      nodeview.php
  66. 40
      options.php
  67. 25
      search.php
  68. 39
      style.css
  69. 688
      submit.php
  70. 28
      subnet.php
  71. 28
      subnetadd.php
  72. 30
      subnetdel.php
  73. 30
      subnetedit.php
  74. 65
      subnetview.php
  75. 73
      tpl/about.tpl
  76. 21
      tpl/asset.tpl
  77. 23
      tpl/assetadd.tpl
  78. 10
      tpl/assetclass.tpl
  79. 20
      tpl/assetclassadd.tpl
  80. 18
      tpl/assetclassdel.tpl
  81. 18
      tpl/assetclassedit.tpl
  82. 22
      tpl/assetclassgroup.tpl
  83. 35
      tpl/assetclassgroupadd.tpl
  84. 28
      tpl/assetclassgroupdel.tpl
  85. 36
      tpl/assetclassgroupedit.tpl
  86. 42
      tpl/assetclassgroupview.tpl
  87. 34
      tpl/assetclassview.tpl
  88. 24
      tpl/assetdel.tpl
  89. 21
      tpl/assetedit.tpl
  90. 36
      tpl/assetview.tpl
  91. 22
      tpl/assigniptoasset.tpl
  92. 11
      tpl/assigniptonode.tpl
  93. 7
      tpl/comments.tpl
  94. 12
      tpl/error.tpl
  95. 9
      tpl/header.tpl
  96. 2
      tpl/index.tpl
  97. 12
      tpl/location.tpl
  98. 25
      tpl/locationadd.tpl
  99. 22
      tpl/locationdel.tpl
  100. 19
      tpl/locationedit.tpl
  101. Some files were not shown because too many files have changed in this diff Show More

@ -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");
?>

@ -1,6 +1,34 @@
<?php
include("header.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("asset", $config_auth_assetview, 0);
// start output
include("header.php");
// set template
$tp = new Template("tpl/asset.tpl");
@ -8,10 +36,12 @@
$tp->setvars($lang);
// get asset info
$result = mysql_query("SELECT asset_id, asset_name FROM asset ORDER BY asset_name") or die(mysql_error());
$result = mysql_query("SELECT a.asset_id, a.asset_name, a.assetclass_id, ac.assetclass_name FROM asset a, assetclass ac WHERE ac.assetclass_id=a.assetclass_id ORDER BY a.asset_name") or die(mysql_error());
for ($i=0;$row=mysql_fetch_object($result);$i++) {
$tp->set("asset_id", $row->asset_id);
$tp->set("asset_name", $row->asset_name);
$tp->set("assetclass_id", $row->assetclass_id);
$tp->set("assetclass_name", $row->assetclass_name);
$tp->parse("assetrow");
}
if (($i>0) ? $tp->parse("asset") : $tp->hide("asset"));

@ -1,4 +1,35 @@
<?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
if((isset($_GET['assetclass_id'])) ? $assetclass_id = $_GET['assetclass_id'] : $assetclass_id = "");
// check authorisation
$auth = auth("asset", $config_auth_assetadd, 0);
// start output
include("header.php");
// set template
@ -10,6 +41,7 @@
// get assetclassgroup information
$result = mysql_query("SELECT assetclass_id, assetclass_name FROM assetclass ORDER BY assetclass_name") or die(mysql_error());
for ($i=0;$row=mysql_fetch_object($result);$i++) {
if (($row->assetclass_id==$assetclass_id) ? $tp->set("assetclass_selected", "selected") : $tp->set("assetclass_selected", ""));
$tp->set("assetclass_id", $row->assetclass_id);
$tp->set("assetclass_name", $row->assetclass_name);
$tp->parse("assetclassrow");

@ -1,4 +1,32 @@
<?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("assetclass", $config_auth_assetclassview, 0);
// start output
include("header.php");
// set template

@ -1,4 +1,35 @@
<?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
if((isset($_GET['assetclassgroup_id'])) ? $assetclassgroup_id = $_GET['assetclassgroup_id'] : $assetclassgroup_id = "");
// check authorisation
$auth = auth("assetclass", $config_auth_assetclassadd, $assetclass_id);
// start output
include("header.php");
// set template
@ -10,6 +41,7 @@
// get assetclassgroup information
$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++) {
if (($row->assetclassgroup_id==$assetclassgroup_id) ? $tp->set("assetclassgroup_selected", "selected") : $tp->set("assetclassgroup_selected", ""));
$tp->set("assetclassgroup_id", $row->assetclassgroup_id);
$tp->set("assetclassgroup_name", $row->assetclassgroup_name);
$tp->parse("assetclassgrouprow");

@ -1,9 +1,37 @@
<?php
include("header.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
$assetclass_id = $_GET['assetclass_id'];
// check authorisation
$auth = auth("assetclass", $config_auth_assetclassdel, $assetclass_id);
// start output
include("header.php");
// set template
$tp = new Template("tpl/assetclassdel.tpl");

@ -1,9 +1,37 @@
<?php
include("header.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
$assetclass_id = $_GET['assetclass_id'];
// check authorisation
$auth = auth("assetclass", $config_auth_assetclassedit, $assetclass_id);
// start output
include("header.php");
// set template
$tp = new Template("tpl/assetclassedit.tpl");

@ -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,18 +1,47 @@
<?php
include("header.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_assetclassgroupview, $assetclassgroup_id);
// start output
include("header.php");
// set template
$tp = new Template("tpl/assetclassgroupview.tpl");
// set language variables
$tp->setvars($lang);
// get assetclassgroup info
$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);
@ -23,21 +52,7 @@
$tp->parse("assetclassrow");
}
if (($i>0) ? $tp->parse("assetclass") : $tp->hide("assetclass"));
// display options
if($_SESSION['suser_level'] >= $config_userlevel_assetclassgroupedit) {
$tp->set("assetclassgroup_id", $assetclassgroup_id);
$tp->parse("assetclassgroupedit");
} else {
$tp->hide("assetclassgroupedit");
}
if($_SESSION['suser_level'] >= $config_userlevel_assetclassgroupdel) {
$tp->set("assetclassgroup_id", $assetclassgroup_id);
$tp->parse("assetclassgroupdel");
} else {
$tp->hide("assetclassgroupdel");
}
// output
$tp->parse();
$tp->spit();

@ -1,8 +1,36 @@
<?php
include("header.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
$assetclass_id = $_GET['assetclass_id'];
// check authorisation
$auth = auth("assetclass", $config_auth_assetclassview, $assetclass_id);
// start output
include("header.php");
// set template
$tp = new Template("tpl/assetclassview.tpl");
@ -13,6 +41,7 @@
// get assetclassgroup info
$result = mysql_query("SELECT ac.assetclassgroup_id, ac.assetclass_name, acg.assetclassgroup_name FROM assetclass ac, assetclassgroup acg WHERE ac.assetclass_id='$assetclass_id' AND acg.assetclassgroup_id=ac.assetclassgroup_id") or die(mysql_error());
$row = mysql_fetch_object($result);
$tp->set("assetclass_id", $assetclass_id);
$tp->set("assetclass_name", $row->assetclass_name);
$tp->set("assetclassgroup_id", $row->assetclassgroup_id);
$tp->set("assetclassgroup_name", $row->assetclassgroup_name);
@ -25,21 +54,7 @@
$tp->parse("assetrow");
}
if (($i>0) ? $tp->parse("asset") : $tp->hide("asset"));
// display options
if($_SESSION['suser_level'] >= $config_userlevel_assetclassedit) {
$tp->set("assetclass_id", $assetclass_id);
$tp->parse("assetclassedit");
} else {
$tp->hide("assetclassedit");
}
if($_SESSION['suser_level'] >= $config_userlevel_assetclassdel) {
$tp->set("assetclass_id", $assetclass_id);
$tp->parse("assetclassdel");
} else {
$tp->hide("assetclassdel");
}
// output
$tp->parse();
$tp->spit();

@ -1,9 +1,37 @@
<?php
include("header.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
$asset_id = $_GET['asset_id'];
// check authorisation
$auth = auth("asset", $config_auth_assetdel, $asset_id);
// start output
include("header.php");
// set template
$tp = new Template("tpl/assetdel.tpl");

@ -1,9 +1,37 @@
<?php
include("header.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
$asset_id = $_GET['asset_id'];
// check authorisation
$auth = auth("asset", $config_auth_assetedit, $asset_id);
// start output
include("header.php");
// set template
$tp = new Template("tpl/assetedit.tpl");

@ -1,9 +1,37 @@
<?php
include("header.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
$asset_id = $_GET['asset_id'];
// check authorisation
auth("asset", $config_auth_assetview, $asset_id);
// start output
include("header.php");
// set template
$tp = new Template("tpl/assetview.tpl");
@ -13,6 +41,7 @@
// get asset info
$result = mysql_query("SELECT a.asset_name, a.hostname, a.asset_info, ac.assetclass_id, ac.assetclass_name FROM asset a, assetclass ac WHERE a.asset_id='$asset_id' AND ac.assetclass_id=a.assetclass_id") or die(mysql_error());
$row=mysql_fetch_object($result);
$tp->set("asset_id", $asset_id);
$tp->set("asset_name", $row->asset_name);
$tp->set("hostname", $row->hostname);
$tp->set("asset_info", nl2br($row->asset_info));
@ -35,20 +64,6 @@
$tp->parse("noderow");
}
if (($i>0) ? $tp->parse("node") : $tp->hide("node"));
// display options
if($_SESSION['suser_level'] >= $config_userlevel_assetedit) {
$tp->set("asset_id", $asset_id);
$tp->parse("assetedit");
} else {
$tp->hide("assetedit");
}
if($_SESSION['suser_level'] >= $config_userlevel_assetdel) {
$tp->set("asset_id", $asset_id);
$tp->parse("assetdel");
} else {
$tp->hide("assetdel");
}
// output
$tp->parse();

@ -1,10 +1,39 @@
<?php
include("header.php");
/*****************************************************************************
IP Reg, a PHP/MySQL IPAM tool
Copyright (C) 2008 Wietse Warendorff
// get ip and id
if((isset($_GET['subnet_id'])) ? $subnet_id = $_GET['subnet_id'] : $subnet_id = "");
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 asset_id, ip or subnet_id
if((isset($_GET['asset_id'])) ? $asset_id = $_GET['asset_id'] : $asset_id = "");
if((isset($_GET['ip'])) ? $ip = $_GET['ip'] : $ip = "");
if((isset($_GET['subnet_id'])) ? $subnet_id = $_GET['subnet_id'] : $subnet_id = "");
// check authorisation
$auth = auth("assigniptoasset", $config_auth_assigniptoasset, 0);
// start output
include("header.php");
// set template
$tp = new Template("tpl/assigniptoasset.tpl");
@ -12,31 +41,33 @@
$tp->setvars($lang);
// set variables
$tp->set("asset_id", $asset_id);
$tp->set("ip", $ip);
$tp->set("subnet_id", $subnet_id);
$tp->set("config_dns1suffix", $config_dns1suffix);
$tp->set("config_dns2suffix", $config_dns2suffix);
// get subnet info
$result = mysql_query("SELECT subnet_id, subnet_address, subnet_mask FROM subnet ORDER BY INET_ATON(subnet_address)") or die(mysql_error());
for ($i=0;$row=mysql_fetch_object($result);$i++) {
if (($row->subnet_id==$subnet_id) ? $tp->set("selected", "selected") : $tp->set("selected", ""));
$tp->set("subnet_id", $row->subnet_id);
$tp->set("subnet_address", $row->subnet_address);
$tp->set("subnet_mask", $row->subnet_mask);
$tp->parse("subnetrow");
}
if (($i>0) ? $tp->parse("subnet") : $tp->hide("subnet"));
// get asset info
$result = mysql_query("SELECT asset_id, asset_name FROM asset ORDER BY asset_name") or die(mysql_error());
for ($i=0;$row=mysql_fetch_object($result);$i++) {
if (($row->asset_id==$asset_id) ? $tp->set("asset_selected", "selected") : $tp->set("asset_selected", ""));
$tp->set("asset_id", $row->asset_id);
$tp->set("asset_name", $row->asset_name);
$tp->parse("assetrow");
}
if (($i>0) ? $tp->parse("asset") : $tp->hide("asset"));
// get subnet info
$result = mysql_query("SELECT subnet_id, subnet_address, subnet_mask FROM subnet ORDER BY INET_ATON(subnet_address)") or die(mysql_error());
for ($i=0;$row=mysql_fetch_object($result);$i++) {
if (($row->subnet_id==$subnet_id) ? $tp->set("subnet_selected", "selected") : $tp->set("subnet_selected", ""));
$tp->set("subnet_id", $row->subnet_id);
$tp->set("subnet_address", $row->subnet_address);
$tp->set("subnet_mask", $row->subnet_mask);
$tp->parse("subnetrow");
}
if (($i>0) ? $tp->parse("subnet") : $tp->hide("subnet"));
// output
$tp->parse();
$tp->spit();

@ -1,4 +1,29 @@
<?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");
// get ip and id
@ -20,19 +45,7 @@
$row = mysql_fetch_object($result);
$tp->set("subnet_address", $row->subnet_address);
$tp->set("subnet_mask", $row->subnet_mask);
// display options
if($_SESSION['suser_level'] >= $config_userlevel_assigniptonode) {
$tp->parse("assigniptonode");
} else {
$tp->hide("assigniptonode");
}
if($_SESSION['suser_level'] >= $config_userlevel_nodeadd) {
$tp->parse("nodeadd");
} else {
$tp->hide("nodeadd");
}
// output
$tp->parse();
$tp->spit();

@ -1,4 +1,29 @@
<?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");
// get id

@ -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('&nbsp;&nbsp;&nbsp;',$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");
?>

@ -1,4 +1,29 @@
<?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

@ -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");
?>

@ -1,4 +1,25 @@
<?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
*****************************************************************************/
// set template
$tp = new Template("tpl/footer.tpl");

@ -1,13 +1,34 @@
<?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
*****************************************************************************/
// strip mac address to 12 char string
function strip_mac($mac) {
$mac = str_replace('-', '', $mac);
$mac = str_replace(':', '', $mac);
$mac = str_replace('.', '', $mac);
$mac = str_replace(',', '', $mac);
$mac = str_replace(' ', '', $mac);
// strip chars we don't need
$mac = preg_replace("|[^a-fA-F0-9]|", "", $mac);
// capotolize (just because it looks better eh)
$mac = strtoupper($mac);
// and return
return ($mac);
}
@ -17,24 +38,22 @@
// if the MAC is empty, or for whatever reason incorrect, just return
return $mac;
} else {
// length is good, continue
$mac1 = substr($mac, 0, 2);
$mac2 = substr($mac, 2, 2);
$mac3 = substr($mac, 4, 2);
$mac4 = substr($mac, 6, 2);
$mac5 = substr($mac, 8, 2);
$mac6 = substr($mac, 10, 2);
// length is ok, continue
// strip mac to pieces
for($i=0;$i<12;$i++) {
${"mac".$i} = $mac{$i};
}
// get user preference
$user_mac = $_SESSION['suser_mac'];
// check session for preference (if 0, do nothing), if changed: update useredit.php too!
if ($_SESSION['suser_mac']==1) {
$mac = $mac1 . '-' . $mac2 . '-' . $mac3 . '-' . $mac4 . '-' . $mac5 . '-' . $mac6;
} else if ($_SESSION['suser_mac']==2) {
$mac = $mac1 . ':' . $mac2 . ':' . $mac3 . ':' . $mac4 . ':' . $mac5 . ':' . $mac6;
} else if ($_SESSION['suser_mac']==3) {
$mac = $mac1 . $mac2 . $mac3 . '-' . $mac4 . $mac5 . $mac6;
// replace user preference with pieces
for($i=0;$i<12;$i++) {
$user_mac = preg_replace("/x/", ${"mac".$i}, $user_mac, 1);
}
return $mac;
// and return
return $user_mac;
}
}
@ -43,4 +62,40 @@
header("location: " . $location);
exit;
}
// authorisation check
function auth($item, $min_auth, $item_id) {
// get user_id
$suser_id = $_SESSION['suser_id'];
// set base auth to 0
$auth = 0;
// check for global rights
$result = mysql_query("SELECT uc.auth FROM userclassauth uc, useruserclass u WHERE u.user_id='$suser_id' AND uc.userclass_id=u.userclass_id AND uc.item='ipreg' AND uc.id=0 ORDER BY uc.ordering DESC LIMIT 1") or die(mysql_error());
while ($row = mysql_fetch_object($result)) {
$auth = $row->auth;
}
// check specific auth for this item
$result = mysql_query("SELECT uc.auth FROM userclassauth uc, useruserclass u WHERE u.user_id='$suser_id' AND uc.userclass_id=u.userclass_id AND uc.item='$item' AND uc.id=0 ORDER BY uc.ordering DESC LIMIT 1") or die(mysql_error());
while ($row = mysql_fetch_object($result)) {
$auth = $row->auth;
}
// and for a specific ID (if set)
if($item_id>0) {
$result = mysql_query("SELECT uc.auth FROM userclassauth uc, useruserclass u WHERE u.user_id='$suser_id' AND uc.userclass_id=u.userclass_id AND uc.item='$item' AND uc.id='$item_id' ORDER BY uc.ordering DESC LIMIT 1") or die(mysql_error());
while ($row = mysql_fetch_object($result)) {
$auth = $row->auth;
}
}
if($auth<$min_auth) {
// not allowed -> redirect
header_location("comments.php?comments=notallowed");
} else {
return $auth;
}
}
?>

@ -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