Skip to content

Commit 22ca203

Browse files
committed
Initial commit after migration to github
0 parents  commit 22ca203

File tree

509 files changed

+139859
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

509 files changed

+139859
-0
lines changed

Diff for: .htaccess

+34
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
<IfModule mod_rewrite.c>
2+
3+
RewriteEngine on
4+
5+
# change rewrite base if not in root
6+
RewriteBase /
7+
8+
# passthroughs
9+
RewriteRule ^(api)($|/) - [L]
10+
RewriteRule ^index.php$ - [L]
11+
RewriteRule ^(css|js|site|test)/.*$ - [L]
12+
RewriteRule site/login/captcha/captchashow.php - [L]
13+
14+
# redirect errors
15+
ErrorDocument 400 /error/400/
16+
ErrorDocument 401 /error/401/
17+
ErrorDocument 403 /error/403/
18+
ErrorDocument 404 /error/404/
19+
ErrorDocument 500 /error/500/
20+
21+
# IE login dashboard fix
22+
RewriteRule ^login/dashboard/$ dashboard/ [R]
23+
RewriteRule ^logout/dashboard/$ dashboard/ [R]
24+
# search override
25+
RewriteRule ^tools/search/(.*)/(.*)/(.*)/(.*)$ index.php?page=tools&section=search&addresses=$1&subnets=$2&vlans=$3&ip=$4 [L]
26+
27+
# Rewrites
28+
RewriteRule ^(.*)/(.*)/(.*)/(.*)/(.*)/$ index.php?page=$1&section=$2&subnetId=$3&sPage=$4&ipaddrid=$5 [L]
29+
RewriteRule ^(.*)/(.*)/(.*)/(.*)/$ index.php?page=$1&section=$2&subnetId=$3&sPage=$4 [L]
30+
RewriteRule ^(.*)/(.*)/(.*)/$ index.php?page=$1&section=$2&subnetId=$3 [L]
31+
RewriteRule ^(.*)/(.*)/$ index.php?page=$1&section=$2 [L]
32+
RewriteRule ^(.*)/$ index.php?page=$1 [L]
33+
34+
</IfModule>

Diff for: INSTALL.txt

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
http://phpipam.net/phpipam-installation-guide/

Diff for: README

+76
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
Description
2+
===========
3+
phpipam is an open-source web IP address management application. Its goal is to provide light and simple |P address management application.
4+
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...
5+
6+
Features and tools:
7+
- Section / Subnet separation
8+
- Subnet nesting
9+
- IPv4/IPv6 support
10+
- Subnet ICMP/telnet scanning and automatic status updates
11+
- Displays free range and number of clients
12+
- Subnet statistics
13+
- User management
14+
- AD/LDAP/OpenLDAP authentication support
15+
- E-Mail notification with IP details
16+
- Import IP addresses from XLS / CSV file
17+
- Export IP database to XLS file
18+
- IPv4/IPv6 calculator
19+
- Search IP database
20+
- IP request module
21+
- Custom IP address fields
22+
- and much more...
23+
24+
What it does not do:
25+
- Updates DNS server
26+
27+
License
28+
=======
29+
phpipam is released under the GPL v3 license, see misc/gpl-3.0.txt.
30+
31+
Requirements
32+
============
33+
- Apache2 web server with php and mod_rewrite support (set "AllowOverride all" in vhost config)
34+
- Mysql server (5.1+)
35+
- PHP version 5.2+ with following modules (On windows php 5.3 is required!)
36+
+ + mysqli : Adds support for the improved mySQL libraries
37+
+ + session : Adds persistent session support
38+
+ + gmp : Adds support for dev-libs/gmp (GNU MP library) -> to calculate IPv6 networks
39+
+ + ldap : Adds LDAP support (Lightweight Directory Access Protocol)
40+
+ + json : Adds supports for JSON data-interexchange format
41+
+ + SimpleXML : Adds SimpleXML support for parsin XML files
42+
+ + gettext : Add support for gettext translations
43+
- PHP PEAR support (dev-php/pear)
44+
45+
Install
46+
=======
47+
- http://phpipam.net/phpipam-installation-guide/
48+
49+
Update
50+
=======
51+
- see UPDATE file for details
52+
53+
Demo page
54+
============
55+
http://demo.phpipam.net
56+
57+
Default user
58+
============
59+
Admin / ipamadmin
60+
61+
Changelog
62+
=========
63+
See misc/CHANGELOG
64+
65+
Roadmap
66+
=========
67+
See misc/Roadmap
68+
69+
Contact
70+
=======
71+
72+
73+
special thank also to Hosterdam team (http://www.hosterdam.com) for VPS server
74+
that is used for development of phpIPAM and for demo site.
75+
76+
And also to all users that filed a bug report / feature report and helped with feature testing!

Diff for: UPDATE

+50
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
#
2+
# phpipam update instructions
3+
#
4+
5+
phpIPAM supports upgrading only to 2 older release, for example only version >= 0.9 can be upgraded to 1.1.
6+
7+
8+
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):
9+
/usr/bin/mysqldump -u ipv6 -pipv6admin phpipam > <my_backup_dir>/phpipam_<version>_migration_backup.db
10+
11+
Backup phpipam files:
12+
mv <mywebdir>/phpipam <myphpipamdir>/phpipam-<version>
13+
14+
15+
#
16+
# !!! important !!!
17+
#
18+
19+
since version 0.7 phpipam uses mod_rewrite to handle url's. Please make sure you meet the following requirements:
20+
1.) Apache2 with mod_rewrite support
21+
2.) "AllowOverride all" set in vhost config for mod_rewrite to work
22+
23+
In case your URL for phpipam is not root please set the following variables (example for /phpipam/):
24+
3.) Set BASE in config.php to /phpipam/
25+
4.) RewriteBase /phpipam/ in .htaccess
26+
27+
28+
#
29+
# a) Automatic upgrade procedure
30+
#
31+
32+
1.) Extract files form tar package:
33+
tar -xvf phpipam-1.1.tar
34+
2.) Set database connection settings in config.php;
35+
3.) Open phpipam in browser and update database;
36+
37+
38+
39+
#
40+
# b) Manual upgrade procedure
41+
#
42+
1.) Extract files form tar package:
43+
tar -xvf phpipam-1.1.tar
44+
2.) Set database connection settings in config.php;
45+
3.) Manual database structure update
46+
Update database structure by importing database scheme for your version.
47+
If you have version 1.0 and want to upgrade to 1.1 use all update files form UPDATE-v1.0.sql on;
48+
mysql -u root -p phpipam < db/UPDATE-v1.01.sql
49+
mysql -u root -p phpipam < db/UPDATE-v1.02.sql
50+
...

Diff for: api/.htaccess

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# controller rewrites
2+
RewriteRule ^(.*)/(.*)/(.*)/(.*)/$ ?app_id=$1&controller=$2&id=$3&id2=$4 [L,QSA]
3+
RewriteRule ^(.*)/(.*)/(.*)/$ ?app_id=$1&controller=$2&id=$3 [L,QSA]
4+
RewriteRule ^(.*)/(.*)/$ ?app_id=$1&controller=$2 [L,QSA]
5+
RewriteRule ^(.*)/$ ?app_id=$1 [L,QSA]

Diff for: api/index.php

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
<?php
2+
3+
/**
4+
*
5+
* Default API version links to v2
6+
*
7+
*/
8+
9+
# include
10+
require("v2/index.php");
11+
?>

Diff for: api/v1/.htaccess

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
# redirect errors
2+
ErrorDocument 400 error/400/
3+
ErrorDocument 401 error/401/
4+
ErrorDocument 403 error/403/
5+
ErrorDocument 404 error/404/
6+
ErrorDocument 500 error/500/

Diff for: api/v1/README

+159
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,159 @@
1+
phpIPAM API documentation v 0.1
2+
===============================
3+
4+
phpIPAM provides API server for providing data to clients. It is a webapp and can be called
5+
via HTTP requests by providing appropriate GET parameters that define controller, actions and
6+
additional parameters required for each controller, such as id, name, etc.
7+
8+
Response is in JSON format with success true or false and provided error message or object.
9+
10+
You can find examples of client API calls in folder api/_examples/.
11+
12+
Client based request values must be encrypted with app_id and app_code. You first have to
13+
enable API module in phpipam administration and create an app_id and app_code, that will be
14+
used for external app with appropriate permissions.
15+
16+
17+
Required php extensions for API server:
18+
mcrypt
19+
curl
20+
21+
22+
Available controllers:
23+
--------------------------------
24+
sections
25+
subnets
26+
addresses
27+
vlans
28+
vrfs
29+
//users
30+
//groups
31+
32+
Available actions:
33+
------------------
34+
read
35+
create
36+
update
37+
delete
38+
39+
40+
Output format for subnets and IP addresses
41+
------------------------------------------
42+
You can manually specify output format for subnets and IP addresses:
43+
44+
format=decimal returns in decimal form (default)
45+
format=ip returns in IP address
46+
47+
48+
49+
50+
51+
Per-controller options and examples
52+
===================================
53+
54+
= Sections
55+
----------
56+
= read
57+
all returns all sections
58+
id returns section by id
59+
name returns section by name
60+
61+
example: ?controller=sections&action=read&id=1
62+
63+
= create
64+
not available
65+
66+
= update
67+
not available
68+
69+
= delete
70+
id (mandatory) id of the section to be deleted
71+
subnets will delete also belonging subnets (default = true)
72+
addresses will delete also belonging ips (default = true)
73+
74+
example: ?controller=sections&action=delete&id=1
75+
76+
77+
= Subnets
78+
---------
79+
= read
80+
all returns all subnet
81+
id returns subnet by id
82+
sectionId returns all subnets in specified sectionId
83+
format returns subnet in specified format
84+
85+
example: ?controller=subnets&action=read&id=1
86+
87+
= create
88+
not available
89+
90+
= update
91+
not available
92+
93+
= delete
94+
id (mandatory) subnet id
95+
addresses will delete also belonging ips (default = true)
96+
97+
example: ?controller=addresses&action=delete&id=1
98+
99+
100+
= IP addresses
101+
--------------
102+
= read
103+
subnetId returns all ip addresses in subnet
104+
id returns ip address details by id
105+
format returns ip in specified format
106+
107+
example: ?controller=addresses&action=read&id=1
108+
109+
= create
110+
not available
111+
112+
= update
113+
not available
114+
115+
= delete
116+
id (mandatory)
117+
118+
example: ?controller=addresses&action=delete&id=1
119+
120+
121+
= Vlans
122+
-------
123+
= read
124+
all returns all vlans
125+
id returns vlan details by id
126+
subnets return also ids of all attached subnets
127+
128+
example: ?controller=vlans&action=read&id=1
129+
130+
= create
131+
not available
132+
133+
= update
134+
not available
135+
136+
= delete
137+
id (mandatory)
138+
139+
example: ?controller=vlans&action=delete&id=1
140+
141+
= VRFs
142+
-------
143+
= read
144+
all returns all vrfs
145+
id returns vrf details by id
146+
subnets return also ids of all attached subnets
147+
148+
example: ?controller=vrfs&action=read&id=1
149+
150+
= create
151+
not available
152+
153+
= update
154+
not available
155+
156+
= delete
157+
id (mandatory)
158+
159+
example: ?controller=vrfs&action=delete&id=1

Diff for: api/v1/_examples/addresses/deleteAddress.php

+35
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
<?php
2+
3+
/**
4+
* Sample API php client application
5+
*
6+
* In this example we will fetch delete ip address
7+
*/
8+
9+
# config
10+
include_once('../apiConfig.php');
11+
12+
# API caller class
13+
include_once('../apiClient.php');
14+
15+
# commands
16+
$req['controller'] = "addresses";
17+
$req['action'] = "delete";
18+
$req['id'] = 1947;
19+
20+
# wrap in try to catch exceptions
21+
try {
22+
# initialize API caller
23+
$apicaller = new ApiCaller($app['id'], $app['enc'], $url, $format);
24+
# send request
25+
$response = $apicaller->sendRequest($req);
26+
27+
print "<pre>";
28+
print_r($response);
29+
}
30+
catch( Exception $e ) {
31+
//catch any exceptions and report the problem
32+
print "Error: ".$e->getMessage();
33+
}
34+
35+
?>

0 commit comments

Comments
 (0)