Subversion Repositories oidplus

Rev

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

Rev 800 Rev 801
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__.'/img/main_icon.png') ? OIDplus::webpath(__DIR__,true).'img/main_icon.png' : '';
168
                        $out['icon'] = file_exists(__DIR__.'/img/main_icon.png') ? OIDplus::webpath(__DIR__,OIDplus::PATH_RELATIVE).'img/main_icon.png' : '';
169
 
169
 
170
                        if (!OIDplus::authUtils()->isAdminLoggedIn()) {
170
                        if (!OIDplus::authUtils()->isAdminLoggedIn()) {
171
                                $out['icon'] = 'img/error.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;
Line 343... Line 343...
343
 
343
 
344
                                                                if ($tmp_information != '') {
344
                                                                if ($tmp_information != '') {
345
                                                                        $tmp_information .= '<br/><br/>';
345
                                                                        $tmp_information .= '<br/><br/>';
346
                                                                }
346
                                                                }
347
 
347
 
348
                                                                $tmp_information .= 'See <a href="'.OIDplus::webpath(null,false).'?goto='.urlencode($id).'">more information</a>.'; // do not translate
348
                                                                $tmp_information .= 'See <a href="'.OIDplus::webpath(null,OIDplus::PATH_ABSOLUTE_CANONICAL).'?goto='.urlencode($id).'">more information</a>.'; // do not translate
349
 
349
 
350
                                                                if (explode(':',$id,2)[0] != 'oid') {
350
                                                                if (explode(':',$id,2)[0] != 'oid') {
351
                                                                        $tmp_information = "Object: $id\n\n" . $tmp_information; // do not translate
351
                                                                        $tmp_information = "Object: $id\n\n" . $tmp_information; // do not translate
352
                                                                }
352
                                                                }
353
 
353
 
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__.'/img/main_icon.png') ? OIDplus::webpath(__DIR__,true).'img/main_icon.png' : '';
442
                        $out['icon'] = file_exists(__DIR__.'/img/main_icon.png') ? OIDplus::webpath(__DIR__,OIDplus::PATH_RELATIVE).'img/main_icon.png' : '';
443
 
443
 
444
                        if (!OIDplus::authUtils()->isAdminLoggedIn()) {
444
                        if (!OIDplus::authUtils()->isAdminLoggedIn()) {
445
                                $out['icon'] = 'img/error.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;
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__.'/img/main_icon.png') ? OIDplus::webpath(__DIR__,true).'img/main_icon.png' : '';
581
                        $out['icon'] = file_exists(__DIR__.'/img/main_icon.png') ? OIDplus::webpath(__DIR__,OIDplus::PATH_RELATIVE).'img/main_icon.png' : '';
582
 
582
 
583
                        if (!OIDplus::authUtils()->isAdminLoggedIn()) {
583
                        if (!OIDplus::authUtils()->isAdminLoggedIn()) {
584
                                $out['icon'] = 'img/error.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;
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__,true).'oidinfo_export.php\',\'_blank\')" value="'._L('Generate XML (all OIDs)').'"></p>';
600
                        $tabcont .= '<p><input type="button" onclick="window.open(\''.OIDplus::webpath(__DIR__,OIDplus::PATH_RELATIVE).'oidinfo_export.php\',\'_blank\')" value="'._L('Generate XML (all OIDs)').'"></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>';
601
                        $tabcont .= '<p><input type="button" onclick="window.open(\''.OIDplus::webpath(__DIR__,OIDplus::PATH_RELATIVE).'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 632... Line 632...
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__.'/img/main_icon16.png')) {
636
                if (file_exists(__DIR__.'/img/main_icon16.png')) {
637
                        $tree_icon = OIDplus::webpath(__DIR__,true).'img/main_icon16.png';
637
                        $tree_icon = OIDplus::webpath(__DIR__,OIDplus::PATH_RELATIVE).'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(
Line 735... Line 735...
735
 
735
 
736
                                if ($elements['information'] != '') {
736
                                if ($elements['information'] != '') {
737
                                        $elements['information'] .= '<br/><br/>';
737
                                        $elements['information'] .= '<br/><br/>';
738
                                }
738
                                }
739
 
739
 
740
                                $elements['information'] .= 'See <a href="'.OIDplus::webpath(null,false).'?goto='.urlencode($id).'">more information</a>.'; // do not translate
740
                                $elements['information'] .= 'See <a href="'.OIDplus::webpath(null,OIDplus::PATH_ABSOLUTE_CANONICAL).'?goto='.urlencode($id).'">more information</a>.'; // do not translate
741
 
741
 
742
                                if (explode(':',$id,2)[0] != 'oid') {
742
                                if (explode(':',$id,2)[0] != 'oid') {
743
                                        $elements['information'] = "Object: $id\n\n" . $elements['information']; // do not translate
743
                                        $elements['information'] = "Object: $id\n\n" . $elements['information']; // do not translate
744
                                }
744
                                }
745
 
745
 
Line 857... Line 857...
857
                        $url = $treffer[3];
857
                        $url = $treffer[3];
858
                        if ((stripos($url,'http:') !== 0) && (stripos($url,'https:') !== 0) && (stripos($url,'ftp:') !== 0)) {
858
                        if ((stripos($url,'http:') !== 0) && (stripos($url,'https:') !== 0) && (stripos($url,'ftp:') !== 0)) {
859
                                if (stripos($url,'www.') === 0) {
859
                                if (stripos($url,'www.') === 0) {
860
                                        $url .= 'http://' . $url;
860
                                        $url .= 'http://' . $url;
861
                                } else {
861
                                } else {
862
                                        $url = OIDplus::webpath() . $url;
862
                                        $url = OIDplus::webpath(null,OIDplus::PATH_ABSOLUTE_CANONICAL) . $url; // TODO: Canonical or not?
863
                                }
863
                                }
864
                        }
864
                        }
865
                        return $treffer[1].$url.$treffer[4];
865
                        return $treffer[1].$url.$treffer[4];
866
                }, $str);
866
                }, $str);
867
                return $str;
867
                return $str;