Subversion Repositories oidplus

Rev

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

Rev 426 Rev 496
Line 75... Line 75...
75
                                return;
75
                                return;
76
                        }
76
                        }
77
 
77
 
78
                        $out['text'] .= '<p>'._L('You can make automated calls to your OIDplus account by calling the AJAX API.').'</p>';
78
                        $out['text'] .= '<p>'._L('You can make automated calls to your OIDplus account by calling the AJAX API.').'</p>';
79
                        $out['text'] .= '<p>'._L('The URL for the AJAX script is:').':</p>';
79
                        $out['text'] .= '<p>'._L('The URL for the AJAX script is:').':</p>';
80
                        $out['text'] .= '<p><b>'.OIDplus::getSystemUrl().'ajax.php</b></p>';
80
                        $out['text'] .= '<p><b>'.OIDplus::webpath(null,false).'ajax.php</b></p>';
81
                        $out['text'] .= '<p>'._L('You must at least provide following fields').':</p>';
81
                        $out['text'] .= '<p>'._L('You must at least provide following fields').':</p>';
82
                        $out['text'] .= '<p><pre>';
82
                        $out['text'] .= '<p><pre>';
83
                        $out['text'] .= 'batch_login_username  = "admin"'."\n";
83
                        $out['text'] .= 'batch_login_username  = "admin"'."\n";
84
                        $out['text'] .= 'batch_login_password  = "........."'."\n";
84
                        $out['text'] .= 'batch_login_password  = "........."'."\n";
85
                        $out['text'] .= 'batch_ajax_unlock_key = "'.$this->getUnlockKey('admin').'"'."\n";
85
                        $out['text'] .= 'batch_ajax_unlock_key = "'.$this->getUnlockKey('admin').'"'."\n";
Line 88... Line 88...
88
                        $out['text'] .= '<p>'._L('The batch-fields will automatically perform a one-time-login to fulfill the request. The other fields are the normal fields which are called during the usual operation of OIDplus.').'</p>';
88
                        $out['text'] .= '<p>'._L('The batch-fields will automatically perform a one-time-login to fulfill the request. The other fields are the normal fields which are called during the usual operation of OIDplus.').'</p>';
89
                        $out['text'] .= '<p>'._L('Currently, there is no documentation for the AJAX calls. However, you can look at the <b>script.js</b> files of the plugins to see the field names being used. You can also enable network analysis in your web browser debugger (F12) to see the request headers sent to the server during the operation of OIDplus.').'</p>';
89
                        $out['text'] .= '<p>'._L('Currently, there is no documentation for the AJAX calls. However, you can look at the <b>script.js</b> files of the plugins to see the field names being used. You can also enable network analysis in your web browser debugger (F12) to see the request headers sent to the server during the operation of OIDplus.').'</p>';
90
 
90
 
91
                        $out['text'] .= '<h2>'._L('Example for adding OID 2.999.123 using JavaScript').'</h2>';
91
                        $out['text'] .= '<h2>'._L('Example for adding OID 2.999.123 using JavaScript').'</h2>';
92
                        $cont = file_get_contents(__DIR__.'/examples/example_js.html');
92
                        $cont = file_get_contents(__DIR__.'/examples/example_js.html');
93
                        $cont = str_replace('<url>', OIDplus::getSystemUrl(false).'ajax.php', $cont);
93
                        $cont = str_replace('<url>', OIDplus::webpath(null,false).'ajax.php', $cont);
94
                        $cont = str_replace('<username>', 'admin', $cont);
94
                        $cont = str_replace('<username>', 'admin', $cont);
95
                        $cont = str_replace('<password>', '.........', $cont);
95
                        $cont = str_replace('<password>', '.........', $cont);
96
                        $cont = str_replace('<unlock key>', $this->getUnlockKey('admin'), $cont);
96
                        $cont = str_replace('<unlock key>', $this->getUnlockKey('admin'), $cont);
97
                        $out['text'] .= '<pre>'.htmlentities($cont).'</pre>';
97
                        $out['text'] .= '<pre>'.htmlentities($cont).'</pre>';
98
 
98
 
99
                        $out['text'] .= '<h2>'._L('Example for adding OID 2.999.123 using PHP (located at a foreign server)').'</h2>';
99
                        $out['text'] .= '<h2>'._L('Example for adding OID 2.999.123 using PHP (located at a foreign server)').'</h2>';
100
                        $cont = file_get_contents(__DIR__.'/examples/example_php.phps');
100
                        $cont = file_get_contents(__DIR__.'/examples/example_php.phps');
101
                        $cont = str_replace('<url>', OIDplus::getSystemUrl(false).'ajax.php', $cont);
101
                        $cont = str_replace('<url>', OIDplus::webpath(null,false).'ajax.php', $cont);
102
                        $cont = str_replace('<username>', 'admin', $cont);
102
                        $cont = str_replace('<username>', 'admin', $cont);
103
                        $cont = str_replace('<password>', '.........', $cont);
103
                        $cont = str_replace('<password>', '.........', $cont);
104
                        $cont = str_replace('<unlock key>', $this->getUnlockKey('admin'), $cont);
104
                        $cont = str_replace('<unlock key>', $this->getUnlockKey('admin'), $cont);
105
                        $out['text'] .= '<pre>'.preg_replace("@<br.*>@ismU","",highlight_string($cont,true)).'</pre>';
105
                        $out['text'] .= '<pre>'.preg_replace("@<br.*>@ismU","",highlight_string($cont,true)).'</pre>';
106
 
106
 
107
                        $out['text'] .= '<h2>'._L('Example for adding OID 2.999.123 using VBScript').'</h2>';
107
                        $out['text'] .= '<h2>'._L('Example for adding OID 2.999.123 using VBScript').'</h2>';
108
                        $cont = file_get_contents(__DIR__.'/examples/example_vbs.vbs');
108
                        $cont = file_get_contents(__DIR__.'/examples/example_vbs.vbs');
109
                        $cont = str_replace('<url>', OIDplus::getSystemUrl(false).'ajax.php', $cont);
109
                        $cont = str_replace('<url>', OIDplus::webpath(null,false).'ajax.php', $cont);
110
                        $cont = str_replace('<username>', 'admin', $cont);
110
                        $cont = str_replace('<username>', 'admin', $cont);
111
                        $cont = str_replace('<password>', '.........', $cont);
111
                        $cont = str_replace('<password>', '.........', $cont);
112
                        $cont = str_replace('<unlock key>', $this->getUnlockKey('admin'), $cont);
112
                        $cont = str_replace('<unlock key>', $this->getUnlockKey('admin'), $cont);
113
                        $out['text'] .= '<pre>'.htmlentities($cont).'</pre>';
113
                        $out['text'] .= '<pre>'.htmlentities($cont).'</pre>';
114
                }
114
                }