Skip to content

Commit

Permalink
Initial commit after migration to github
Browse files Browse the repository at this point in the history
  • Loading branch information
phpipam committed Jun 18, 2015
0 parents commit 22ca203
Show file tree
Hide file tree
Showing 509 changed files with 139,859 additions and 0 deletions.
34 changes: 34 additions & 0 deletions .htaccess
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
<IfModule mod_rewrite.c>

RewriteEngine on

# change rewrite base if not in root
RewriteBase /

# passthroughs
RewriteRule ^(api)($|/) - [L]
RewriteRule ^index.php$ - [L]
RewriteRule ^(css|js|site|test)/.*$ - [L]
RewriteRule site/login/captcha/captchashow.php - [L]

# redirect errors
ErrorDocument 400 /error/400/
ErrorDocument 401 /error/401/
ErrorDocument 403 /error/403/
ErrorDocument 404 /error/404/
ErrorDocument 500 /error/500/

# IE login dashboard fix
RewriteRule ^login/dashboard/$ dashboard/ [R]
RewriteRule ^logout/dashboard/$ dashboard/ [R]
# search override
RewriteRule ^tools/search/(.*)/(.*)/(.*)/(.*)$ index.php?page=tools&section=search&addresses=$1&subnets=$2&vlans=$3&ip=$4 [L]

# Rewrites
RewriteRule ^(.*)/(.*)/(.*)/(.*)/(.*)/$ index.php?page=$1&section=$2&subnetId=$3&sPage=$4&ipaddrid=$5 [L]
RewriteRule ^(.*)/(.*)/(.*)/(.*)/$ index.php?page=$1&section=$2&subnetId=$3&sPage=$4 [L]
RewriteRule ^(.*)/(.*)/(.*)/$ index.php?page=$1&section=$2&subnetId=$3 [L]
RewriteRule ^(.*)/(.*)/$ index.php?page=$1&section=$2 [L]
RewriteRule ^(.*)/$ index.php?page=$1 [L]

</IfModule>
1 change: 1 addition & 0 deletions INSTALL.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
http://phpipam.net/phpipam-installation-guide/
76 changes: 76 additions & 0 deletions README
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
Description
===========
phpipam is an open-source web IP address management application. Its goal is to provide light and simple |P address management application.
It is ajax-based using jQuery libraries, it uses php scripts and javascript and some HTML5/CSS3 features, so some modern browser is preferred to be able to display javascript quickly and correctly...

Features and tools:
- Section / Subnet separation
- Subnet nesting
- IPv4/IPv6 support
- Subnet ICMP/telnet scanning and automatic status updates
- Displays free range and number of clients
- Subnet statistics
- User management
- AD/LDAP/OpenLDAP authentication support
- E-Mail notification with IP details
- Import IP addresses from XLS / CSV file
- Export IP database to XLS file
- IPv4/IPv6 calculator
- Search IP database
- IP request module
- Custom IP address fields
- and much more...

What it does not do:
- Updates DNS server

License
=======
phpipam is released under the GPL v3 license, see misc/gpl-3.0.txt.

Requirements
============
- Apache2 web server with php and mod_rewrite support (set "AllowOverride all" in vhost config)
- Mysql server (5.1+)
- PHP version 5.2+ with following modules (On windows php 5.3 is required!)
+ + mysqli : Adds support for the improved mySQL libraries
+ + session : Adds persistent session support
+ + gmp : Adds support for dev-libs/gmp (GNU MP library) -> to calculate IPv6 networks
+ + ldap : Adds LDAP support (Lightweight Directory Access Protocol)
+ + json : Adds supports for JSON data-interexchange format
+ + SimpleXML : Adds SimpleXML support for parsin XML files
+ + gettext : Add support for gettext translations
- PHP PEAR support (dev-php/pear)

Install
=======
- http://phpipam.net/phpipam-installation-guide/

Update
=======
- see UPDATE file for details

Demo page
============
http://demo.phpipam.net

Default user
============
Admin / ipamadmin

Changelog
=========
See misc/CHANGELOG

Roadmap
=========
See misc/Roadmap

Contact
=======
[email protected]

special thank also to Hosterdam team (http://www.hosterdam.com) for VPS server
that is used for development of phpIPAM and for demo site.

And also to all users that filed a bug report / feature report and helped with feature testing!
50 changes: 50 additions & 0 deletions UPDATE
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
#
# phpipam update instructions
#

phpIPAM supports upgrading only to 2 older release, for example only version >= 0.9 can be upgraded to 1.1.


It is recommended that you backup the old phpipam database before you upgrade to new version (change username and pass to ones in config.php):
/usr/bin/mysqldump -u ipv6 -pipv6admin phpipam > <my_backup_dir>/phpipam_<version>_migration_backup.db

Backup phpipam files:
mv <mywebdir>/phpipam <myphpipamdir>/phpipam-<version>


#
# !!! important !!!
#

since version 0.7 phpipam uses mod_rewrite to handle url's. Please make sure you meet the following requirements:
1.) Apache2 with mod_rewrite support
2.) "AllowOverride all" set in vhost config for mod_rewrite to work

In case your URL for phpipam is not root please set the following variables (example for /phpipam/):
3.) Set BASE in config.php to /phpipam/
4.) RewriteBase /phpipam/ in .htaccess


#
# a) Automatic upgrade procedure
#

1.) Extract files form tar package:
tar -xvf phpipam-1.1.tar
2.) Set database connection settings in config.php;
3.) Open phpipam in browser and update database;



#
# b) Manual upgrade procedure
#
1.) Extract files form tar package:
tar -xvf phpipam-1.1.tar
2.) Set database connection settings in config.php;
3.) Manual database structure update
Update database structure by importing database scheme for your version.
If you have version 1.0 and want to upgrade to 1.1 use all update files form UPDATE-v1.0.sql on;
mysql -u root -p phpipam < db/UPDATE-v1.01.sql
mysql -u root -p phpipam < db/UPDATE-v1.02.sql
...
5 changes: 5 additions & 0 deletions api/.htaccess
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# controller rewrites
RewriteRule ^(.*)/(.*)/(.*)/(.*)/$ ?app_id=$1&controller=$2&id=$3&id2=$4 [L,QSA]
RewriteRule ^(.*)/(.*)/(.*)/$ ?app_id=$1&controller=$2&id=$3 [L,QSA]
RewriteRule ^(.*)/(.*)/$ ?app_id=$1&controller=$2 [L,QSA]
RewriteRule ^(.*)/$ ?app_id=$1 [L,QSA]
11 changes: 11 additions & 0 deletions api/index.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<?php

/**
*
* Default API version links to v2
*
*/

# include
require("v2/index.php");
?>
6 changes: 6 additions & 0 deletions api/v1/.htaccess
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# redirect errors
ErrorDocument 400 error/400/
ErrorDocument 401 error/401/
ErrorDocument 403 error/403/
ErrorDocument 404 error/404/
ErrorDocument 500 error/500/
159 changes: 159 additions & 0 deletions api/v1/README
Original file line number Diff line number Diff line change
@@ -0,0 +1,159 @@
phpIPAM API documentation v 0.1
===============================

phpIPAM provides API server for providing data to clients. It is a webapp and can be called
via HTTP requests by providing appropriate GET parameters that define controller, actions and
additional parameters required for each controller, such as id, name, etc.

Response is in JSON format with success true or false and provided error message or object.

You can find examples of client API calls in folder api/_examples/.

Client based request values must be encrypted with app_id and app_code. You first have to
enable API module in phpipam administration and create an app_id and app_code, that will be
used for external app with appropriate permissions.


Required php extensions for API server:
mcrypt
curl


Available controllers:
--------------------------------
sections
subnets
addresses
vlans
vrfs
//users
//groups

Available actions:
------------------
read
create
update
delete


Output format for subnets and IP addresses
------------------------------------------
You can manually specify output format for subnets and IP addresses:

format=decimal returns in decimal form (default)
format=ip returns in IP address





Per-controller options and examples
===================================

= Sections
----------
= read
all returns all sections
id returns section by id
name returns section by name

example: ?controller=sections&action=read&id=1

= create
not available

= update
not available

= delete
id (mandatory) id of the section to be deleted
subnets will delete also belonging subnets (default = true)
addresses will delete also belonging ips (default = true)

example: ?controller=sections&action=delete&id=1


= Subnets
---------
= read
all returns all subnet
id returns subnet by id
sectionId returns all subnets in specified sectionId
format returns subnet in specified format

example: ?controller=subnets&action=read&id=1

= create
not available

= update
not available

= delete
id (mandatory) subnet id
addresses will delete also belonging ips (default = true)

example: ?controller=addresses&action=delete&id=1


= IP addresses
--------------
= read
subnetId returns all ip addresses in subnet
id returns ip address details by id
format returns ip in specified format

example: ?controller=addresses&action=read&id=1

= create
not available

= update
not available

= delete
id (mandatory)

example: ?controller=addresses&action=delete&id=1


= Vlans
-------
= read
all returns all vlans
id returns vlan details by id
subnets return also ids of all attached subnets

example: ?controller=vlans&action=read&id=1

= create
not available

= update
not available

= delete
id (mandatory)

example: ?controller=vlans&action=delete&id=1

= VRFs
-------
= read
all returns all vrfs
id returns vrf details by id
subnets return also ids of all attached subnets

example: ?controller=vrfs&action=read&id=1

= create
not available

= update
not available

= delete
id (mandatory)

example: ?controller=vrfs&action=delete&id=1
35 changes: 35 additions & 0 deletions api/v1/_examples/addresses/deleteAddress.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
<?php

/**
* Sample API php client application
*
* In this example we will fetch delete ip address
*/

# config
include_once('../apiConfig.php');

# API caller class
include_once('../apiClient.php');

# commands
$req['controller'] = "addresses";
$req['action'] = "delete";
$req['id'] = 1947;

# wrap in try to catch exceptions
try {
# initialize API caller
$apicaller = new ApiCaller($app['id'], $app['enc'], $url, $format);
# send request
$response = $apicaller->sendRequest($req);

print "<pre>";
print_r($response);
}
catch( Exception $e ) {
//catch any exceptions and report the problem
print "Error: ".$e->getMessage();
}

?>
Loading

0 comments on commit 22ca203

Please sign in to comment.