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 78... Line 78...
78
                                return;
78
                                return;
79
                        }
79
                        }
80
 
80
 
81
                        $out['text'] .= '<p>'._L('You can make automated calls to your OIDplus account by calling the AJAX API.').'</p>';
81
                        $out['text'] .= '<p>'._L('You can make automated calls to your OIDplus account by calling the AJAX API.').'</p>';
82
                        $out['text'] .= '<p>'._L('The URL for the AJAX script is:').':</p>';
82
                        $out['text'] .= '<p>'._L('The URL for the AJAX script is:').':</p>';
83
                        $out['text'] .= '<p><b>'.OIDplus::getSystemUrl().'ajax.php</b></p>';
83
                        $out['text'] .= '<p><b>'.OIDplus::webpath(null,false).'ajax.php</b></p>';
84
                        $out['text'] .= '<p>'._L('You must at least provide following fields').':</p>';
84
                        $out['text'] .= '<p>'._L('You must at least provide following fields').':</p>';
85
                        $out['text'] .= '<p><pre>';
85
                        $out['text'] .= '<p><pre>';
86
                        $out['text'] .= 'batch_login_username  = "'.htmlentities($ra_email).'"'."\n";
86
                        $out['text'] .= 'batch_login_username  = "'.htmlentities($ra_email).'"'."\n";
87
                        $out['text'] .= 'batch_login_password  = "........."'."\n";
87
                        $out['text'] .= 'batch_login_password  = "........."'."\n";
88
                        $out['text'] .= 'batch_ajax_unlock_key = "'.$this->getUnlockKey($ra_email).'"'."\n";
88
                        $out['text'] .= 'batch_ajax_unlock_key = "'.$this->getUnlockKey($ra_email).'"'."\n";
Line 91... Line 91...
91
                        $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>';
91
                        $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>';
92
                        $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>';
92
                        $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>';
93
 
93
 
94
                        $out['text'] .= '<h2>'._L('Example for adding OID 2.999.123 using JavaScript').'</h2>';
94
                        $out['text'] .= '<h2>'._L('Example for adding OID 2.999.123 using JavaScript').'</h2>';
95
                        $cont = file_get_contents(__DIR__.'/examples/example_js.html');
95
                        $cont = file_get_contents(__DIR__.'/examples/example_js.html');
96
                        $cont = str_replace('<url>', OIDplus::getSystemUrl(false).'ajax.php', $cont);
96
                        $cont = str_replace('<url>', OIDplus::webpath(null,false).'ajax.php', $cont);
97
                        $cont = str_replace('<username>', $ra_email, $cont);
97
                        $cont = str_replace('<username>', $ra_email, $cont);
98
                        $cont = str_replace('<password>', '.........', $cont);
98
                        $cont = str_replace('<password>', '.........', $cont);
99
                        $cont = str_replace('<unlock key>', $this->getUnlockKey($ra_email), $cont);
99
                        $cont = str_replace('<unlock key>', $this->getUnlockKey($ra_email), $cont);
100
                        $out['text'] .= '<pre>'.htmlentities($cont).'</pre>';
100
                        $out['text'] .= '<pre>'.htmlentities($cont).'</pre>';
101
 
101
 
102
                        $out['text'] .= '<h2>'._L('Example for adding OID 2.999.123 using PHP (located at a foreign server)').'</h2>';
102
                        $out['text'] .= '<h2>'._L('Example for adding OID 2.999.123 using PHP (located at a foreign server)').'</h2>';
103
                        $cont = file_get_contents(__DIR__.'/examples/example_php.phps');
103
                        $cont = file_get_contents(__DIR__.'/examples/example_php.phps');
104
                        $cont = str_replace('<url>', OIDplus::getSystemUrl(false).'ajax.php', $cont);
104
                        $cont = str_replace('<url>', OIDplus::webpath(null,false).'ajax.php', $cont);
105
                        $cont = str_replace('<username>', $ra_email, $cont);
105
                        $cont = str_replace('<username>', $ra_email, $cont);
106
                        $cont = str_replace('<password>', '.........', $cont);
106
                        $cont = str_replace('<password>', '.........', $cont);
107
                        $cont = str_replace('<unlock key>', $this->getUnlockKey($ra_email), $cont);
107
                        $cont = str_replace('<unlock key>', $this->getUnlockKey($ra_email), $cont);
108
                        $out['text'] .= '<pre>'.preg_replace("@<br.*>@ismU","",highlight_string($cont,true)).'</pre>';
108
                        $out['text'] .= '<pre>'.preg_replace("@<br.*>@ismU","",highlight_string($cont,true)).'</pre>';
109
 
109
 
110
                        $out['text'] .= '<h2>'._L('Example for adding OID 2.999.123 using VBScript').'</h2>';
110
                        $out['text'] .= '<h2>'._L('Example for adding OID 2.999.123 using VBScript').'</h2>';
111
                        $cont = file_get_contents(__DIR__.'/examples/example_vbs.vbs');
111
                        $cont = file_get_contents(__DIR__.'/examples/example_vbs.vbs');
112
                        $cont = str_replace('<url>', OIDplus::getSystemUrl(false).'ajax.php', $cont);
112
                        $cont = str_replace('<url>', OIDplus::webpath(null,false).'ajax.php', $cont);
113
                        $cont = str_replace('<username>', $ra_email, $cont);
113
                        $cont = str_replace('<username>', $ra_email, $cont);
114
                        $cont = str_replace('<password>', '.........', $cont);
114
                        $cont = str_replace('<password>', '.........', $cont);
115
                        $cont = str_replace('<unlock key>', $this->getUnlockKey($ra_email), $cont);
115
                        $cont = str_replace('<unlock key>', $this->getUnlockKey($ra_email), $cont);
116
                        $out['text'] .= '<pre>'.htmlentities($cont).'</pre>';
116
                        $out['text'] .= '<pre>'.htmlentities($cont).'</pre>';
117
                }
117
                }