Subversion Repositories oidplus

Rev

Rev 790 | Rev 801 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 790 Rev 800
Line 163... Line 163...
163
                        $tab = 'export';
163
                        $tab = 'export';
164
                }
164
                }
165
                if ($id === 'oidplus:oidinfo_compare_export') {
165
                if ($id === 'oidplus:oidinfo_compare_export') {
166
                        $handled = true;
166
                        $handled = true;
167
                        $out['title'] = _L('List OIDs in your system which are missing at oid-info.com');
167
                        $out['title'] = _L('List OIDs in your system which are missing at oid-info.com');
168
                        $out['icon'] = file_exists(__DIR__.'/icon_big.png') ? OIDplus::webpath(__DIR__).'icon_big.png' : '';
168
                        $out['icon'] = file_exists(__DIR__.'/img/main_icon.png') ? OIDplus::webpath(__DIR__,true).'img/main_icon.png' : '';
169
 
169
 
170
                        if (!OIDplus::authUtils()->isAdminLoggedIn()) {
170
                        if (!OIDplus::authUtils()->isAdminLoggedIn()) {
171
                                $out['icon'] = 'img/error_big.png';
171
                                $out['icon'] = 'img/error.png';
172
                                $out['text'] = '<p>'._L('You need to <a %1>log in</a> as administrator.',OIDplus::gui()->link('oidplus:login$admin')).'</p>';
172
                                $out['text'] = '<p>'._L('You need to <a %1>log in</a> as administrator.',OIDplus::gui()->link('oidplus:login$admin')).'</p>';
173
                                return;
173
                                return;
174
                        }
174
                        }
175
 
175
 
176
                        $query = self::QUERY_LIST_OIDINFO_OIDS_V1;
176
                        $query = self::QUERY_LIST_OIDINFO_OIDS_V1;
Line 228... Line 228...
228
                        $out['text'] = '<p><a '.OIDplus::gui()->link('oidplus:datatransfer$export').'><img src="img/arrow_back.png" width="16" alt="'._L('Go back').'"> '._L('Go back to data transfer main page').'</a></p>';
228
                        $out['text'] = '<p><a '.OIDplus::gui()->link('oidplus:datatransfer$export').'><img src="img/arrow_back.png" width="16" alt="'._L('Go back').'"> '._L('Go back to data transfer main page').'</a></p>';
229
 
229
 
230
                        $json = @json_decode($res, true);
230
                        $json = @json_decode($res, true);
231
 
231
 
232
                        if (!$json) {
232
                        if (!$json) {
233
                                $out['icon'] = 'img/error_big.png';
233
                                $out['icon'] = 'img/error.png';
234
                                $out['text'] .= _L('JSON reply from ViaThinkSoft decoding error: %1',$res);
234
                                $out['text'] .= _L('JSON reply from ViaThinkSoft decoding error: %1',$res);
235
                                return;
235
                                return;
236
                        }
236
                        }
237
 
237
 
238
                        if (isset($json['error']) || ($json['status'] < 0)) {
238
                        if (isset($json['error']) || ($json['status'] < 0)) {
239
                                $out['icon'] = 'img/error_big.png';
239
                                $out['icon'] = 'img/error.png';
240
                                if (isset($json['error'])) {
240
                                if (isset($json['error'])) {
241
                                        $out['text'] .= _L('Received error: %1',$json['error']);
241
                                        $out['text'] .= _L('Received error: %1',$json['error']);
242
                                } else {
242
                                } else {
243
                                        $out['text'] .= _L('Received error status code: %1',$json['status']);
243
                                        $out['text'] .= _L('Received error status code: %1',$json['status']);
244
                                }
244
                                }
Line 437... Line 437...
437
                }
437
                }
438
 
438
 
439
                if ($id === 'oidplus:oidinfo_compare_import') {
439
                if ($id === 'oidplus:oidinfo_compare_import') {
440
                        $handled = true;
440
                        $handled = true;
441
                        $out['title'] = _L('List OIDs at oid-info.com which are missing in your system');
441
                        $out['title'] = _L('List OIDs at oid-info.com which are missing in your system');
442
                        $out['icon'] = file_exists(__DIR__.'/icon_big.png') ? OIDplus::webpath(__DIR__).'icon_big.png' : '';
442
                        $out['icon'] = file_exists(__DIR__.'/img/main_icon.png') ? OIDplus::webpath(__DIR__,true).'img/main_icon.png' : '';
443
 
443
 
444
                        if (!OIDplus::authUtils()->isAdminLoggedIn()) {
444
                        if (!OIDplus::authUtils()->isAdminLoggedIn()) {
445
                                $out['icon'] = 'img/error_big.png';
445
                                $out['icon'] = 'img/error.png';
446
                                $out['text'] = '<p>'._L('You need to <a %1>log in</a> as administrator.',OIDplus::gui()->link('oidplus:login$admin')).'</p>';
446
                                $out['text'] = '<p>'._L('You need to <a %1>log in</a> as administrator.',OIDplus::gui()->link('oidplus:login$admin')).'</p>';
447
                                return;
447
                                return;
448
                        }
448
                        }
449
 
449
 
450
                        $query = self::QUERY_LIST_OIDINFO_OIDS_V1;
450
                        $query = self::QUERY_LIST_OIDINFO_OIDS_V1;
Line 502... Line 502...
502
                        $out['text'] = '<p><a '.OIDplus::gui()->link('oidplus:datatransfer$import').'><img src="img/arrow_back.png" width="16" alt="'._L('Go back').'"> '._L('Go back to data transfer main page').'</a></p>';
502
                        $out['text'] = '<p><a '.OIDplus::gui()->link('oidplus:datatransfer$import').'><img src="img/arrow_back.png" width="16" alt="'._L('Go back').'"> '._L('Go back to data transfer main page').'</a></p>';
503
 
503
 
504
                        $json = @json_decode($res, true);
504
                        $json = @json_decode($res, true);
505
 
505
 
506
                        if (!$json) {
506
                        if (!$json) {
507
                                $out['icon'] = 'img/error_big.png';
507
                                $out['icon'] = 'img/error.png';
508
                                $out['text'] .= _L('JSON reply from ViaThinkSoft decoding error: %1',$res);
508
                                $out['text'] .= _L('JSON reply from ViaThinkSoft decoding error: %1',$res);
509
                                return;
509
                                return;
510
                        }
510
                        }
511
 
511
 
512
                        if (isset($json['error']) || ($json['status'] < 0)) {
512
                        if (isset($json['error']) || ($json['status'] < 0)) {
513
                                $out['icon'] = 'img/error_big.png';
513
                                $out['icon'] = 'img/error.png';
514
                                if (isset($json['error'])) {
514
                                if (isset($json['error'])) {
515
                                        $out['text'] .= _L('Received error: %1',$json['error']);
515
                                        $out['text'] .= _L('Received error: %1',$json['error']);
516
                                } else {
516
                                } else {
517
                                        $out['text'] .= _L('Received error status code: %1',$json['status']);
517
                                        $out['text'] .= _L('Received error status code: %1',$json['status']);
518
                                }
518
                                }
Line 576... Line 576...
576
                }
576
                }
577
 
577
 
578
                if ($id === 'oidplus:datatransfer') {
578
                if ($id === 'oidplus:datatransfer') {
579
                        $handled = true;
579
                        $handled = true;
580
                        $out['title'] = _L('Data Transfer');
580
                        $out['title'] = _L('Data Transfer');
581
                        $out['icon'] = file_exists(__DIR__.'/icon_big.png') ? OIDplus::webpath(__DIR__).'icon_big.png' : '';
581
                        $out['icon'] = file_exists(__DIR__.'/img/main_icon.png') ? OIDplus::webpath(__DIR__,true).'img/main_icon.png' : '';
582
 
582
 
583
                        if (!OIDplus::authUtils()->isAdminLoggedIn()) {
583
                        if (!OIDplus::authUtils()->isAdminLoggedIn()) {
584
                                $out['icon'] = 'img/error_big.png';
584
                                $out['icon'] = 'img/error.png';
585
                                $out['text'] = '<p>'._L('You need to <a %1>log in</a> as administrator.',OIDplus::gui()->link('oidplus:login$admin')).'</p>';
585
                                $out['text'] = '<p>'._L('You need to <a %1>log in</a> as administrator.',OIDplus::gui()->link('oidplus:login$admin')).'</p>';
586
                                return;
586
                                return;
587
                        }
587
                        }
588
 
588
 
589
                        $out['text'] = '<br><div id="dataTransferArea" style="visibility: hidden"><div id="dataTransferTab" class="container" style="width:100%;">';
589
                        $out['text'] = '<br><div id="dataTransferArea" style="visibility: hidden"><div id="dataTransferTab" class="container" style="width:100%;">';
Line 595... Line 595...
595
                        $out['text'] .= OIDplus::gui()->tabBarEnd();
595
                        $out['text'] .= OIDplus::gui()->tabBarEnd();
596
                        $out['text'] .= OIDplus::gui()->tabContentStart();
596
                        $out['text'] .= OIDplus::gui()->tabContentStart();
597
                        // ---------------- "Export" tab
597
                        // ---------------- "Export" tab
598
                        $tabcont  = '<h2>'._L('Generate XML file containing all OIDs').'</h2>';
598
                        $tabcont  = '<h2>'._L('Generate XML file containing all OIDs').'</h2>';
599
                        $tabcont .= '<p>'._L('These XML files are following the <a %1>XML schema</a> of <b>oid-info.com</b>. They can be used for various purposes though.','href="http://www.oid-info.com/oid.xsd" target="_blank"').'</p>';
599
                        $tabcont .= '<p>'._L('These XML files are following the <a %1>XML schema</a> of <b>oid-info.com</b>. They can be used for various purposes though.','href="http://www.oid-info.com/oid.xsd" target="_blank"').'</p>';
600
                        $tabcont .= '<p><input type="button" onclick="window.open(\''.OIDplus::webpath(__DIR__).'oidinfo_export.php\',\'_blank\')" value="'._L('Generate XML (all OIDs)').'"></p>';
600
                        $tabcont .= '<p><input type="button" onclick="window.open(\''.OIDplus::webpath(__DIR__,true).'oidinfo_export.php\',\'_blank\')" value="'._L('Generate XML (all OIDs)').'"></p>';
601
                        $tabcont .= '<p><input type="button" onclick="window.open(\''.OIDplus::webpath(__DIR__).'oidinfo_export.php?online=1\',\'_blank\')" value="'._L('Generate XML (only OIDs which do not exist at oid-info.com)').'"></p>';
601
                        $tabcont .= '<p><input type="button" onclick="window.open(\''.OIDplus::webpath(__DIR__,true).'oidinfo_export.php?online=1\',\'_blank\')" value="'._L('Generate XML (only OIDs which do not exist at oid-info.com)').'"></p>';
602
                        $tabcont .= '<p><a href="http://www.oid-info.com/submit.htm" target="_blank">'._L('Upload XML files manually to oid-info.com').'</a></p>';
602
                        $tabcont .= '<p><a href="http://www.oid-info.com/submit.htm" target="_blank">'._L('Upload XML files manually to oid-info.com').'</a></p>';
603
                        $tabcont .= '<br><p>'._L('Attention: Do not use this XML Export/Import to exchange, backup or restore data between OIDplus systems!<br>It will cause various loss of information, e.g. because Non-OIDs like GUIDs are converted in OIDs and can\'t be converted back.').'</p>';
603
                        $tabcont .= '<br><p>'._L('Attention: Do not use this XML Export/Import to exchange, backup or restore data between OIDplus systems!<br>It will cause various loss of information, e.g. because Non-OIDs like GUIDs are converted in OIDs and can\'t be converted back.').'</p>';
604
                        $tabcont .= '<h2>'._L('Automatic export to oid-info.com').'</h2>';
604
                        $tabcont .= '<h2>'._L('Automatic export to oid-info.com').'</h2>';
605
                        $privacy_level = OIDplus::config()->getValue('reg_privacy');
605
                        $privacy_level = OIDplus::config()->getValue('reg_privacy');
606
                        if ($privacy_level == 0) {
606
                        if ($privacy_level == 0) {
Line 631... Line 631...
631
        }
631
        }
632
 
632
 
633
        public function tree(&$json, $ra_email=null, $nonjs=false, $req_goto='') {
633
        public function tree(&$json, $ra_email=null, $nonjs=false, $req_goto='') {
634
                if (!OIDplus::authUtils()->isAdminLoggedIn()) return false;
634
                if (!OIDplus::authUtils()->isAdminLoggedIn()) return false;
635
 
635
 
636
                if (file_exists(__DIR__.'/treeicon.png')) {
636
                if (file_exists(__DIR__.'/img/main_icon16.png')) {
637
                        $tree_icon = OIDplus::webpath(__DIR__).'treeicon.png';
637
                        $tree_icon = OIDplus::webpath(__DIR__,true).'img/main_icon16.png';
638
                } else {
638
                } else {
639
                        $tree_icon = null; // default icon (folder)
639
                        $tree_icon = null; // default icon (folder)
640
                }
640
                }
641
 
641
 
642
                $json[] = array(
642
                $json[] = array(