-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathguifi.module
2926 lines (2734 loc) · 104 KB
/
guifi.module
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
<?php
/**
* @file guifi.module
*/
include_once("guifi_zone.inc.php"); // zone management
include_once("guifi_maintainers.inc.php"); // maintainers
include_once("guifi_funders.inc.php"); // funders
include_once("guifi_ipv4.inc.php"); // ipv4 network management
include_once("guifi_node.inc.php"); // node (location) management
include_once("guifi_service.inc.php"); // services management
include_once("guifi_devices.inc.php"); // device management
include_once("guifi_radios.inc.php"); // radios management
include_once("guifi_switch.inc.php"); // switch management
include_once("guifi_interfaces.inc.php");// interfaces management
include_once("guifi_links.inc.php"); // links management
include_once("guifi_users.inc.php"); // user management
include_once("guifi_graphs.inc.php"); // graphs management
include_once("guifi_unsolclic.inc.php"); // unsolclic generator
include_once("guifi_domains.inc.php"); // Domain name server management
include_once("guifi_hosts.inc.php"); // Host name server management
// include_once("guifi_nodexchange.inc.php");// nodeXchange (XML) generator
include_once("guifi_cnml.inc.php"); // CNML (XML) generator
include_once("guifi_gml.inc.php"); // gml (geographic XML export) generator
include_once("guifi_maps.inc.php"); // maps management
include_once("guifi_includes.inc.php"); // misc. routines
include_once("guifi_networkutils.inc.php"); // network calc routines
include_once("guifi_sql.inc.php"); // database changes
include_once("guifi_ahah.inc.php"); // AHAH functions
include_once("GeoCalc.class.php"); // geographic routines
include_once("guifi_spatial.inc.php"); // spatial searches
include_once("guifi_api.inc.php"); // Guifi public API includes
include_once("libs/GuifiAPI.php"); // Guifi API
/** Implementation of drupal main hooks.
*
/** menu hooks
*/
function guifi_menu() {
$items = array();
//
// ADMINISTRATION settings
//
$items['admin/settings/guifi'] = array(
'title' => 'guifi.net configuration',
'description' => 'Configure guifi.net module',
'page callback' => 'drupal_get_form',
'page arguments' => array('guifi_admin_settings'),
'access arguments' => array('access administration pages'),
'type' => MENU_NORMAL_ITEM,
);
$items['guifi'] = array(
'title' => 'guifi.net main page',
'description' => 'Main menu for guifi.net network management and utilities',
'page callback' => 'guifi_page',
'page arguments' => array('TRUE'),
'access callback' => 'user_access',
'access arguments' => array('access content'),
'type' => MENU_CALLBACK,
);
// Refresh maps callback
$items['guifi/refresh'] = array(
'title' => t('check if data must be refreshed'),
'page callback' => 'guifi_refresh',
'access callback' => 'user_access',
'access arguments' => array('access content'),
'type' => MENU_CALLBACK);
// General guifi menu
$items['guifi/menu'] = array(
'title' => 'guifi.net menus',
'description' => 'Main menu for guifi.net network management and utilities',
'page callback' => 'guifi_page',
'access callback' => 'user_access',
'access arguments' => array('access content'),
);
$items['guifi/menu/compact'] = array(
'title' => 'Compact mode',
'page callback' => 'guifi_menu_compact_page',
'access arguments' => array('access content'),
'type' => MENU_CALLBACK,
);
// General options
$items['guifi/menu/main'] = array(
'title' => 'Main navigation options',
'description' => 'The most important options to browse and use this site',
'page callback' => 'guifi_menu_block_page',
'access arguments' => array('access content'),
'weight' => 0,
);
$items['guifi/menu/main/browse_zones'] = array(
'title' => 'Browse the network',
'description' => 'Browse the network zones starting from the root zone',
'page callback' => 'drupal_goto',
'page arguments' => array('node/'. guifi_zone_root()),
'access arguments' => array('access content'),
);
if (variable_get('guifi_forums', 'forum') != '')
$items['guifi/menu/main/forums'] = array(
'title' => 'Forums',
'description' => 'Do you have questions? Browse the questions or post your own question to the forums',
'page callback' => 'drupal_goto',
'page arguments' => array(variable_get('guifi_forums', 'forum')),
'access arguments' => array('access content'),
);
$items['guifi/menu/main/addnode'] = array(
'title' => 'Create a node',
'description' => 'Join to the network by creating your node',
'page callback' => 'drupal_goto',
'page arguments' => array('node/add/guifi-node'),
'access arguments' => array('access content'),
);
if (variable_get('guifi_faq', '') != '')
$items['guifi/menu/main/faq'] = array(
'title' => 'FAQ',
'description' => 'Browse the most common questions',
'page callback' => 'drupal_goto',
'page arguments' => array(variable_get('guifi_faq', '')),
'access arguments' => array('access content'),
);
if (variable_get('guifi_docs', '') != '')
$items['guifi/menu/main/docs'] = array(
'title' => 'Documentation',
'description' => 'Browse the guide and documentation',
'page callback' => 'drupal_goto',
'page arguments' => array(variable_get('guifi_docs', '')),
'access arguments' => array('access content'),
);
// Database review and pending actions
$items['guifi/menu/workflow'] = array(
'title' => 'Data to review and Pending actions',
'description' => 'Clean and review the database and take the appropriate pending actions',
'page callback' => 'guifi_menu_block_page',
'access arguments' => array('access content'),
'weight' => 1,
);
$items['guifi/menu/workflow/usersqueue'] = array(
'title' => 'Users queue',
'description' => 'Track the users assigned to nodes detected as active, and therefore pending for approval',
'page callback' => 'drupal_goto',
'page arguments' => array('node/' .guifi_zone_root(). '/view/userqueue'),
'access arguments' => array('access content'),
);
$items['guifi/menu/workflow/pending'] = array(
'title' => 'Node queue',
'description' => 'Track the status of the not active nodes, pending for getting connected',
'page callback' => 'drupal_goto',
'page arguments' => array('node/'. guifi_zone_root() .'/view/pending'),
'access arguments' => array('access content'),
);
$items['guifi/menu/workflow/availability'] = array(
'title' => 'Availability report',
'description' => 'Report of the status and availability of all nodes',
'page callback' => 'drupal_goto',
'page arguments' => array('node/'. guifi_zone_root() .'/view/availability'),
'access arguments' => array('access content'),
);
$items['guifi/menu/workflow/datareview'] = array(
'title' => 'Data review',
'description' => '',
'page callback' => 'guifi_tools_datareview',
'access arguments' => array('create guifi nodes'),
'file' => 'guifi_tools.inc.php'
);
// Network management tools
$items['guifi/menu/ip'] = array(
'title' => 'IP and Network management tools',
'description' => 'Utilities toolset for various network addressing and management',
'page callback' => 'guifi_menu_block_page',
'access arguments' => array('access content'),
'weight' => 2,
);
$items['guifi/menu/ip/ipsearch'] = array(
'title' => 'Search IPv4',
'description' => 'Query information about assigned IPv4 addresses',
'page callback' => 'guifi_tools_ip_search',
'access arguments' => array('access content'),
'file' => 'guifi_tools.inc.php',
'weight' => 1
);
$items['guifi/menu/ip/networksearch'] = array(
'title' => 'Available subnetwork range',
'description' => 'Search for a not used range of network addresses at the database',
'page callback' => 'guifi_tools_ip_rangesearch',
'access arguments' => array('access content'),
'file' => 'guifi_tools.inc.php',
'weight' => 2
);
// $items['guifi/menu/ip/availableipsearch'] = array(
// 'title' => 'Free IPv4 in a subnetwork',
// 'description' => 'Search for unused IPv4 addresses in a given range',
// 'page callback' => 'guifi_tools_ip_ipavailable',
// 'access arguments' => array('access content'),
// 'file' => 'guifi_tools.inc.php',
// 'weight' => 3
// );
$items['guifi/menu/ip/macsearch'] = array(
'title' => 'Search MAC',
'description' => 'Query information about existing MAC addresses',
'page callback' => 'guifi_tools_mac_search',
'access arguments' => array('access content'),
'file' => 'guifi_tools.inc.php',
'weight' => 4
);
$items['guifi/menu/ip/mailsearch'] = array(
'title' => 'Find/Replace contact emails',
'description' => 'Search and update existing notification e-mail addresses in all tables.',
'page callback' => 'guifi_tools_mail_search',
'access arguments' => array('create guifi nodes'),
'file' => 'guifi_tools.inc.php',
'weight' => 5
);
$items['guifi/menu/ip/traceroute'] = array(
'title' => 'Traceroute',
'description' => 'Software traceroute. Find out possible routes between devices or discover the closest services.',
'page callback' => 'guifi_traceroute_search',
'access arguments' => array('create guifi nodes'),
'weight' => 6,
'file' => 'guifi_traceroute.inc.php'
);
$items['guifi/menu/ip/liveping'] = array(
'title' => 'live ping',
'description' => 'ping to address',
'page callback' => 'guifi_live_ping',
'access arguments' => array('access content'),
'type' => MENU_CALLBACK,
'file' => 'guifi_traceroute.inc.php'
);
$items['guifi/menu/ip/livetraceroute'] = array(
'title' => 'live traceroute',
'description' => 'traceroute to device',
'page callback' => 'guifi_live_traceroute',
'access arguments' => array('access content'),
'type' => MENU_CALLBACK,
'file' => 'guifi_traceroute.inc.php'
);
$items['guifi/menu/ip/routingmap'] = array(
'title' => 'OSPF Routing Map',
'description' => 'Routing areas map.',
'page callback' => 'guifi_routingmap_init',
'access arguments' => array('create guifi nodes'),
'weight' => 7,
'file' => 'guifi_routingmap.inc.php'
);
$items['guifi/menu/ip/allroutingmap'] = array(
'title' => 'All Routing Map',
'description' => 'Routing areas map.',
'page callback' => 'guifi_routingmap_all_init',
'access arguments' => array('create guifi nodes'),
'weight' => 8,
'file' => 'guifi_routingmap.inc.php'
);
$items['guifi/routingmap/%/%'] = array(
'title' => 'Routing Map',
'page callback' => 'guifi_routingmap',
'page arguments' => array(2, 3),
'access arguments' => array('create guifi nodes'),
'file' => 'guifi_routingmap.inc.php'
);
// Administrator's tools
$items['guifi/menu/admin'] = array(
'title' => 'Administration tools',
'description' => 'Utilities for administrators, use with care, regular users shouldn\'t have this block.',
'page callback' => 'guifi_menu_block_page',
'access arguments' => array('administer site configuration'),
'weight' => 100,
);
$items['guifi/menu/admin/sendnotify'] = array(
'title' => 'Send notifications',
'description' => 'Flush the notification queue by sending all pending messages',
'page callback' => 'guifi_admin_notify',
'access arguments' => array('administer site configuration'),
'weight' => 0,
'file' => 'guifi_tools.inc.php'
);
$items['guifi/menu/admin/viewnotify'] = array(
'title' => 'View notifications',
'description' => 'View the notification queue by printing all pending messages on the screen, this will not flush the queue',
'page callback' => 'guifi_admin_notify',
'page arguments' => array('TRUE'),
'access arguments' => array('administer site configuration'),
'weight' => 1,
'file' => 'guifi_tools.inc.php'
);
$items['guifi/menu/admin/loadstats'] = array(
'title' => 'Load statistics',
'description' => 'Load statistics from remote CNML graph servers into the database',
'page callback' => 'guifi_admin_loadstats',
'access arguments' => array('administer site configuration'),
'weight' => 2,
'file' => 'guifi_tools.inc.php'
);
$items['guifi/menu/admin/guifisettings'] = array(
'title' => 'guifi.net settings',
'description' => 'Change the settings for "guifi.net" module ',
'page callback' => 'drupal_goto',
'page arguments' => array('admin/settings/guifi'),
'access arguments' => array('administer site configuration'),
'weight' => 100,
);
// Developer's tools
$items['guifi/menu/devel'] = array(
'title' => 'Development tools',
'description' => 'Utilities for developers, experimental or under texting, use with care, regular users shouldn\'t have this block.',
'page callback' => 'guifi_menu_block_page',
'access arguments' => array('access devel information'),
'weight' => 100,
);
$items['guifi/menu/devel/device'] = array(
'title' => 'Device Model Specs',
'description' => 'A full list of devices we use in the network, add, edit or delete it.',
'page callback' => 'guifi_devel_devices',
'access arguments' => array('guifi module developer'),
'weight' => 8,
'file' => 'guifi_devel.inc.php'
);
$items['guifi/menu/devel/device/%/%'] = array(
'title' => 'Device Models Specs',
'page callback' => 'guifi_devel_devices',
'page arguments' => array(4, 5),
'access arguments' => array('guifi module developer'),
'file' => 'guifi_devel.inc.php'
);
$items['guifi/menu/devel/service'] = array(
'title' => 'Services',
'description' => 'A full list of services we use in the network, add, edit or delete it.',
'page callback' => 'guifi_devel_services',
'access arguments' => array('guifi module developer'),
'weight' => 8,
'file' => 'guifi_devel.inc.php'
);
$items['guifi/menu/devel/service/%/%'] = array(
'title' => 'Services',
'page callback' => 'guifi_devel_services',
'page arguments' => array(4, 5),
'access arguments' => array('guifi module developer'),
'file' => 'guifi_devel.inc.php'
);
$items['guifi/menu/devel/firmware'] = array(
'title' => 'Firmware',
'description' => 'A full list of firmware we use in the devices, add, edit or delete it.',
'page callback' => 'guifi_devel_firmware',
'access arguments' => array('guifi module developer'),
'weight' => 9,
'file' => 'guifi_devel.inc.php'
);
$items['guifi/menu/devel/firmware/%/%'] = array(
'title' => 'Firmware',
'page callback' => 'guifi_devel_firmware',
'page arguments' => array(4, 5),
'access arguments' => array('guifi module developer'),
'file' => 'guifi_devel.inc.php'
);
$items['guifi/menu/devel/manufacturer'] = array(
'title' => 'Manufacturers',
'description' => 'A full list of manufacturers that made the devices usedon our network, add, edit or delete it.',
'page callback' => 'guifi_devel_manufacturer',
'access arguments' => array('guifi module developer'),
'weight' => 10,
'file' => 'guifi_devel.inc.php'
);
$items['guifi/menu/devel/manufacturer/%/%'] = array(
'title' => 'Manufacturers',
'page callback' => 'guifi_devel_manufacturer',
'page arguments' => array(4, 5),
'access arguments' => array('guifi module developer'),
'file' => 'guifi_devel.inc.php'
);
$items['guifi/menu/devel/parameter'] = array(
'title' => 'Generic Firmware Parameters',
'description' => 'A full list of Generic Firmware parameters that supports certain firmware used on our network, add, edit or delete it.',
'page callback' => 'guifi_devel_parameter',
'access arguments' => array('guifi module developer'),
'weight' => 10,
'file' => 'guifi_devel.inc.php'
);
$items['guifi/menu/devel/parameter/%/%'] = array(
'title' => 'Generic Firmware Parameters',
'page callback' => 'guifi_devel_parameter',
'page arguments' => array(4, 5),
'access arguments' => array('guifi module developer'),
'file' => 'guifi_devel.inc.php'
);
$items['guifi/menu/devel/feature'] = array(
'title' => 'Device Model Features',
'description' => 'A full list of Model Features used on our network, add, edit or delete it.',
'page callback' => 'guifi_devel_modelfeature',
'access arguments' => array('guifi module developer'),
'weight' => 10,
'file' => 'guifi_devel.inc.php'
);
$items['guifi/menu/devel/feature/%/%'] = array(
'title' => 'Device Model Features',
'page callback' => 'guifi_devel_modelfeature',
'page arguments' => array(4, 5),
'access arguments' => array('guifi module developer'),
'file' => 'guifi_devel.inc.php'
);
$items['guifi/menu/devel/configuraciousc'] = array(
'title' => 'Configuracions UnSolclic',
'description' => 'A full list of Configuracions UnSolclic used on our network, add, edit or delete it.',
'page callback' => 'guifi_devel_configuracio_usc',
'access arguments' => array('guifi module developer'),
'weight' => 10,
'file' => 'guifi_devel.inc.php'
);
$items['guifi/menu/devel/configuraciousc/%/%'] = array(
'title' => 'Configuracions UnSolclic',
'page callback' => 'guifi_devel_configuracio_usc',
'page arguments' => array(4, 5),
'access arguments' => array('guifi module developer'),
'file' => 'guifi_devel.inc.php'
);
$items['guifi/menu/devel/paramusc/%/%'] = array(
'title' => 'Configuracions UnSolclic',
'page callback' => 'guifi_devel_paramusc',
'page arguments' => array(4, 5),
'access arguments' => array('guifi module developer'),
'file' => 'guifi_devel.inc.php'
);
$items['guifi/menu/devel/counters'] = array(
'title' => 'counters',
'description' => 'get statistics/counters from the network',
'page callback' => 'guifi_counters_block',
'access arguments' => array('access devel information'),
'weight' => 2,
// 'file' => 'guifi_traceroute.inc.php'
);
$items['guifi/menu/devel/purgue'] = array(
'title' => 'purge',
'description' => 'purge orphan data',
'page callback' => 'guifi_purge',
'page arguments' => array('TRUE'),
'access arguments' => array('access devel information'),
'weight' => 3,
);
$items['guifi/menu/devel/overlap'] = array(
'title' => 'overlap',
'description' => 'check for overlapping routes.',
'page callback' => 'guifi_overlap_check',
'page arguments' => array('TRUE'),
'access arguments' => array('access devel information'),
'weight' => 4,
);
$items['guifi/menu/devel/initdevices'] = array(
'title' => 'Update Device Properties',
'description' => 'Update devices with info from old extra field',
'page callback' => 'guifi_update_devices_fromExtraInfo',
'page arguments' => array('TRUE'),
'access arguments' => array('access devel information'),
'weight' => 5,
);
$items['guifi/menu/devel/checkunsolclics'] = array(
'title' => 'Check UnSolclics',
'description' => 'Check local UnsolClics against a trusted remote server ',
'page callback' => 'guifi_check_unsolclics',
'page arguments' => array('TRUE'),
'access arguments' => array('access devel information'),
'weight' => 5,
);
// Statistics
$items['guifi/menu/stats'] = array(
'title' => 'Statistics',
'description' => 'Statistics',
'page callback' => 'guifi_menu_block_page',
'access arguments' => array('access content'),
'weight' => 100,
);
$items['guifi/menu/stats/growthmap'] = array(
'title' => 'History map',
'description' => 'Display guifi.net network history map.',
'page callback' => 'guifi_stats_growthmap',
'access arguments' => array('access content'),
'weight' => 1,
'file' => 'guifi_stats.inc.php'
);
$items['guifi/menu/stats/nodes'] = array(
'title' => 'Node statistics',
'description' => '',
'page callback' => 'guifi_stats_nodes',
'access arguments' => array('access content'),
'weight' => 2,
'file' => 'guifi_stats.inc.php'
);
$items['guifi/stats/%'] = array(
'title' => 'stats charts',
'page callback' => 'guifi_stats',
'page arguments' => array(2),
'access arguments' => array('access content'),
'file' => 'guifi_stats.inc.php'
);
$items['guifi/stats/%/%'] = array(
'title' => 'stats charts',
'page callback' => 'guifi_stats',
'page arguments' => array(2, 3),
'access arguments' => array('access content'),
'file' => 'guifi_stats.inc.php'
);
// $items['guifi/menu/devel/get_ips_new'] = array(
// 'title' => 'get_ips_new callback',
// 'description' => 'Test for NEW load and sort the ip tables',
// 'page callback' => 'guifi_admin_get_ips_new',
// 'access arguments' => array('access devel information'),
// 'weight' => 0,
// 'file' => 'guifi_tools.inc.php'
// );
//
// ZONE menus and tabs
//
$items['node/%guifi_zone/view/nodes'] = array(
'title' => 'nodes',
'page callback' => 'theme_guifi_zone_nodes',
'page arguments' => array(1),
'access callback' => 'user_access',
'access arguments' => array('access content'),
'type' => MENU_LOCAL_TASK,
);
$items['node/%guifi_zone/view/map'] = array(
'title' => 'map',
'page callback' => 'theme_guifi_zone_map',
'page arguments' => array(1),
'access callback' => 'user_access',
'access arguments' => array('access content'),
'type' => MENU_LOCAL_TASK
);
$items['node/%guifi_zone/view/data'] = array(
'title' => 'data',
'page callback' => 'theme_guifi_zone_data',
'page arguments' => array(1),
'access callback' => 'user_access',
'access arguments' => array('access content'),
'type' => MENU_LOCAL_TASK
);
$items['node/%guifi_zone/view/availability'] = array(
'title' => 'availability',
'page callback' => 'guifi_zone_availability',
'page arguments' => array(1),
'access callback' => 'user_access',
'access arguments' => array('access content'),
'type' => MENU_LOCAL_TASK
);
$items['node/%guifi_zone/view/pending'] = array(
'title' => 'pending/review',
'page callback' => 'guifi_zone_availability',
'page arguments' => array(1, 3),
'access callback' => 'user_access',
'access arguments' => array('access content'),
'type' => MENU_LOCAL_TASK
);
$items['node/%guifi_zone/view/services'] = array(
'title' => 'services',
'page callback' => 'theme_guifi_services_list',
'page arguments' => array(1),
'access callback' => 'user_access',
'access arguments' => array('access content'),
'type' => MENU_LOCAL_TASK
);
$items['node/%guifi_zone/view/ipv4'] = array(
'title' => 'networks',
'page callback' => 'theme_guifi_zone_networks',
'page arguments' => array(1),
'access callback' => 'user_access',
'access arguments' => array('access content'),
'type' => MENU_LOCAL_TASK
);
if (module_exists('budgets')) {
$items['node/%guifi_zone/suppliers'] = array(
'title' => 'Suppliers',
'page callback' => 'budgets_supplier_list_by_zone',
'page arguments' => array(1,3),
'access callback' => 'user_access',
'access arguments' => array('access content'),
'weight'=> 99,
'type' => MENU_LOCAL_TASK
);
$items['node/%guifi_zone/suppliers/all'] = array(
'title' => 'all',
'page callback' => 'budgets_supplier_list_by_zone',
'page arguments' => array(1),
'access callback' => 'user_access',
'access arguments' => array('access content'),
'type' => MENU_LOCAL_TASK
);
$items['node/%guifi_zone/suppliers/caps_services=isp'] = array(
'title' => 'isp',
'page callback' => 'budgets_supplier_list_by_zone',
'page arguments' => array(1,3),
'access callback' => 'user_access',
'access arguments' => array('access content'),
'type' => MENU_LOCAL_TASK
);
$items['node/%guifi_zone/suppliers/role=professional'] = array(
'title' => 'professional',
'page callback' => 'budgets_supplier_list_by_zone',
'page arguments' => array(1,3),
'access callback' => 'user_access',
'access arguments' => array('access content'),
'type' => MENU_LOCAL_TASK
);
$items['node/%guifi_zone/suppliers/role=volunteer'] = array(
'title' => 'volunteer',
'page callback' => 'budgets_supplier_list_by_zone',
'page arguments' => array(1,3),
'access callback' => 'user_access',
'access arguments' => array('access content'),
'type' => MENU_LOCAL_TASK
);
}
$items['node/%guifi_zone/view/userqueue'] = array(
'title' => 'users queue',
'page callback' => 'guifi_users_queue',
'page arguments' => array(1),
'access callback' => 'user_access',
'access arguments' => array('access content'),
'type' => MENU_LOCAL_TASK
);
$items['node/%guifi_zone/view/ipv4/add'] = array(
'title' => 'add ipv4 network',
'page callback' => 'guifi_ipv4_add',
'page arguments' => array(1),
'access callback' => 'user_access',
'access arguments' => array('administer guifi networks'),
'type' => MENU_LOCAL_TASK
);
$items['guifi/ipv4/%/edit'] = array(
'title' => 'edit ipv4 network',
'page callback' => 'guifi_ipv4_edit',
'page arguments' => array(2),
'access callback' => 'user_access',
'access arguments' => array('administer guifi networks'),
'type' => MENU_CALLBACK
);
$items['guifi/ipv4/%/delete'] = array(
'title' => 'delete ipv4 network',
'page callback' => 'guifi_ipv4_delete',
'page arguments' => array(2),
'access callback' => 'user_access',
'access arguments' => array('administer guifi networks'),
'type' => MENU_CALLBACK
);
// node (location) menus
$items['node/%guifi_node/view/distances'] = array(
'title' => 'distances',
'page callback' => 'guifi_node_distances',
'page arguments' => array(1),
'access arguments' => array('access content'),
'type' => MENU_LOCAL_TASK
);
$items['node/%guifi_node/view/distancesmap'] = array(
'title' => 'profiles map',
'page callback' => 'guifi_node_distances_map',
'page arguments' => array(1),
'access arguments' => array('access content'),
'type' => MENU_LOCAL_TASK
);
$items['node/%guifi_node/view/nodedata'] = array(
'title' => 'data',
'page callback' => 'theme_guifi_node_data',
'page arguments' => array(1, 'TRUE'),
'access callback' => 'user_access',
'access arguments' => array('access content'),
'type' => MENU_LOCAL_TASK
);
$items['node/%guifi_node/view/nodeservices'] = array(
'title' => 'services',
'page callback' => 'theme_guifi_services_list',
'page arguments' => array(1),
'access callback' => 'user_access',
'access arguments' => array('access content'),
'type' => MENU_LOCAL_TASK
);
$items['node/%guifi_node/view/devices'] = array(
'title' => 'devices',
'page callback' => 'theme_guifi_node_devices_list',
'page arguments' => array(1, 'TRUE'),
'access callback' => 'user_access',
'access arguments' => array('access content'),
'type' => MENU_LOCAL_TASK
);
$items['node/%guifi_node/view/links'] = array(
'title' => 'links',
'page callback' => 'theme_guifi_node_links',
'page arguments' => array(1, 'TRUE'),
'access callback' => 'user_access',
'access arguments' => array('access content'),
'type' => MENU_LOCAL_TASK
);
$items['node/%guifi_node/view/graphs'] = array(
'title' => 'graphs',
'page callback' => 'theme_guifi_node_graphs_overview',
'page arguments' => array(1, 'TRUE'),
'access callback' => 'user_access',
'access arguments' => array('access content'),
'type' => MENU_LOCAL_TASK
);
$items['node/%guifi_node/view/users'] = array(
'title' => 'users',
'page callback' => 'guifi_users_node_list',
'page arguments' => array(1),
'access callback' => 'user_access',
'access arguments' => array('access content'),
'type' => MENU_LOCAL_TASK
);
$items['node/%guifi_node/user/add'] = array(
'page callback' => 'guifi_user_add',
'page arguments' => array(1),
'access callback' => 'user_access',
'access arguments' => array('access content'),
'type' => MENU_CALLBACK
);
$items['guifi/user/%/edit'] = array(
'page callback' => 'guifi_user_edit',
'page arguments' => array(2),
'access callback' => 'guifi_user_access',
'access arguments' => array('update', 2),
'type' => MENU_CALLBACK
);
$items['guifi/user/%/delete'] = array(
'page callback' => 'guifi_user_delete',
'page arguments' => array(2),
'access callback' => 'guifi_user_access',
'access arguments' => array('update', 2),
'type' => MENU_CALLBACK
);
// service menus
$items['node/%guifi_service/view/servicedata'] = array(
'title' => 'data',
'page callback' => 'theme_guifi_service_data',
'page arguments' => array(1),
'access callback' => 'user_access',
'access arguments' => array('access content'),
'type' => MENU_LOCAL_TASK
);
// TODO:
/*
$items['node/%guifi_service/view/proxyusers'] = array(
'title' => 'users',
'page callback' => 'guifi_users_node_list',
'page arguments' => array(1),
'access callback' => 'user_access',
'access arguments' => array('create guifi nodes'),
'type' => MENU_LOCAL_TASK
);
*/
// TODO: To be deleted in the future to avoid include in the robots.txt
// exclusion lists. In the future, will be /guifi/export/<service>/<export_type>
$items['node/%guifi_service/view/passwd'] = array(
'title' => 'passwd',
'page callback' => 'guifi_users_dump_passwd',
'page arguments' => array(1),
'access callback' => 'user_access',
'access arguments' => array('access content'),
'type' => MENU_CALLBACK
);
$items['node/%guifi_service/view/federated'] = array(
'title' => 'federated',
'page callback' => 'guifi_users_dump_federated',
'page arguments' => array(1),
'access callback' => 'user_access',
'access arguments' => array('access content'),
'type' => MENU_CALLBACK
);
$items['node/%guifi_service/view/federated_md5'] = array(
'title' => 'federated_md5',
'page callback' => 'guifi_users_dump_federated_md5',
'page arguments' => array(1),
'access callback' => 'user_access',
'access arguments' => array('access content'),
'type' => MENU_CALLBACK
);
$items['node/%guifi_service/view/ldif'] = array(
'title' => 'ldif',
'page callback' => 'guifi_users_dump_ldif',
'page arguments' => array(1),
'access callback' => 'user_access',
'access arguments' => array('access content'),
'type' => MENU_CALLBACK
);
// New menu entries to substitute old entries
$items['guifi/export/%guifi_service/passwd'] = array(
'title' => 'passwd',
'page callback' => 'guifi_users_dump_passwd',
'page arguments' => array(2),
'access callback' => 'user_access',
'access arguments' => array('access content'),
'type' => MENU_CALLBACK
);
$items['guifi/export/%guifi_service/federation'] = array(
'title' => 'federation',
'page callback' => 'dump_guifi_proxy_federation',
'page arguments' => array(2),
'access callback' => 'user_access',
'access arguments' => array('access content'),
'type' => MENU_CALLBACK
);
$items['guifi/export/%guifi_service/federated'] = array(
'title' => 'federated',
'page callback' => 'guifi_users_dump_federated',
'page arguments' => array(2),
'access callback' => 'user_access',
'access arguments' => array('access content'),
'type' => MENU_CALLBACK
);
$items['guifi/export/%guifi_service/federated_md5'] = array(
'title' => 'federated_md5',
'page callback' => 'guifi_users_dump_federated_md5',
'page arguments' => array(2),
'access callback' => 'user_access',
'access arguments' => array('access content'),
'type' => MENU_CALLBACK
);
$items['guifi/export/%guifi_service/ldif'] = array(
'title' => 'ldif',
'page callback' => 'guifi_users_dump_ldif',
'page arguments' => array(2),
'access callback' => 'user_access',
'access arguments' => array('access content'),
'type' => MENU_CALLBACK
);
/*
$items['guifi'] = array(
'title' => 'guifi menu page',
'page callback' => 'guifi_main',
'access callback' => 'user_access',
'access arguments' => array('access content'),
'type' => MENU_LOCAL_TASK
); */
// Devices menus
$items['guifi/device/add/%guifi_node/%'] = array(
'title' => 'add device',
'page callback' => 'guifi_device_add',
// 'page arguments' => array(1),
'access callback' => 'user_access',
'access arguments' => array('create guifi nodes'),
'type' => MENU_CALLBACK
);
$items['guifi/device/%guifi_device'] = array(
'title' => 'view device',
'page callback' => 'guifi_device_print',
'page arguments' => array(2),
'access callback' => 'user_access',
'access arguments' => array('access content'),
'type' => MENU_NORMAL_ITEM
);
$items['guifi/device/%guifi_device/edit'] = array(
'title' => 'edit device',
'page callback' => 'guifi_device_edit',
'page arguments' => array(2),
'access callback' => 'guifi_device_access',
'access arguments' => array('update', 2),
'weight' => 1,
'type' => MENU_LOCAL_TASK
);
$items['guifi/device/%guifi_device/delete'] = array(
'title' => 'delete device',
'page callback' => 'guifi_device_delete',
'page arguments' => array(2),
'access callback' => 'guifi_device_access',
'access arguments' => array('update', 2),
'weight' => 2,
'type' => MENU_LOCAL_TASK
);
$items['guifi/device/%guifi_device/view/'] = array(
'title' => 'all',
'access arguments' => array('access content'),
'type' => MENU_LOCAL_TASK
);
$items['guifi/device/%guifi_device/view/unsolclic'] = array(
'title' => 'unsolclic',
'page callback' => 'guifi_unsolclic',
'page arguments' => array(2),
'access callback' => 'user_access',
'access arguments' => array('access content'),
'type' => MENU_LOCAL_TASK
);
$items['guifi/device/%guifi_device/view/services'] = array(
'title' => 'services',
'page callback' => 'guifi_device_print',
'page arguments' => array(2),
'access callback' => 'user_access',
'access arguments' => array('access content'),
'type' => MENU_LOCAL_TASK
);
$items['guifi/device/%guifi_device/view/interfaces'] = array(
'title' => 'interfaces',
'page callback' => 'guifi_device_print',
'page arguments' => array(2),
'access callback' => 'user_access',
'access arguments' => array('access content'),
'type' => MENU_LOCAL_TASK
);
$items['guifi/device/%guifi_device/view/data'] = array(
'title' => 'data',
'page callback' => 'guifi_device_print',
'page arguments' => array(2),
'access callback' => 'user_access',
'access arguments' => array('access content'),
'type' => MENU_LOCAL_TASK
);
$items['guifi/device/%guifi_device/view/comment'] = array(
'title' => 'comment',
'page callback' => 'guifi_device_print',
'page arguments' => array(2),
'access callback' => 'user_access',
'access arguments' => array('access content'),
'type' => MENU_LOCAL_TASK
);
$items['guifi/device/%guifi_device/view/graphs'] = array(
'title' => 'graphs',
'page callback' => 'guifi_device_print',
'page arguments' => array(2),
'access callback' => 'user_access',
'access arguments' => array('access content'),
'type' => MENU_LOCAL_TASK
);
$items['guifi/device/%guifi_device/view/links'] = array(
'title' => 'links',
'page callback' => 'guifi_device_print',
'page arguments' => array(2),
'access callback' => 'user_access',
'access arguments' => array('access content'),
'type' => MENU_LOCAL_TASK
);
$items['guifi/device/%guifi_device/view/traceroute'] = array(
'title' => 'traceroute',
'page callback' => 'guifi_device_traceroute',
'page arguments' => array(2),
'access callback' => 'user_access',
'access arguments' => array('create guifi nodes'),
'type' => MENU_LOCAL_TASK
);
// Domain menus
$items['guifi/domain/add/%guifi_service/%'] = array(
'title' => 'add domain',
'page callback' => 'guifi_domain_add',
// 'page arguments' => array(1),
'access callback' => 'user_access',
'access arguments' => array('create guifi nodes'),
'type' => MENU_CALLBACK
);
$items['guifi/domain/%guifi_domain'] = array(
'title' => 'view domain',
'page callback' => 'guifi_domain_print',
'page arguments' => array(2),
'access callback' => 'user_access',
'access arguments' => array('access content'),
'type' => MENU_NORMAL_ITEM
);
$items['guifi/domain/%guifi_domain/edit'] = array(
'title' => 'edit domain',
'page callback' => 'guifi_domain_edit',
'page arguments' => array(2),
'access callback' => 'guifi_domain_access',
'access arguments' => array('update', 2),
'weight' => 1,
'type' => MENU_LOCAL_TASK
);
$items['guifi/domain/%guifi_domain/delete'] = array(
'title' => 'delete domain',
'page callback' => 'guifi_domain_delete',
'page arguments' => array(2),
'access callback' => 'guifi_domain_access',
'access arguments' => array('update', 2),
'weight' => 2,
'type' => MENU_LOCAL_TASK
);
$items['guifi/domain/%guifi_domain/view/'] = array(
'title' => 'all',
'access arguments' => array('access content'),
'type' => MENU_LOCAL_TASK