Created test vehicle module oauth2test
This commit is contained in:
parent
c444e40c01
commit
7d0c1bb737
43
Zotlabs/Module/Oauth2test.php
Normal file
43
Zotlabs/Module/Oauth2test.php
Normal file
@ -0,0 +1,43 @@
|
||||
<?php
|
||||
|
||||
namespace Zotlabs\Module;
|
||||
|
||||
class Oauth2test extends \Zotlabs\Web\Controller {
|
||||
|
||||
function get() {
|
||||
|
||||
$o .= replace_macros(get_markup_template('oauth2test.tpl'), array(
|
||||
'$baseurl' => z_root(),
|
||||
'$endpoints' => array(
|
||||
array(
|
||||
'oauth2test',
|
||||
array(
|
||||
array(
|
||||
'action', 'create_db'
|
||||
)
|
||||
),
|
||||
'oauth2test_create_db',
|
||||
'Create the OAuth2 database tables'
|
||||
)
|
||||
)
|
||||
));
|
||||
|
||||
return $o;
|
||||
}
|
||||
|
||||
function post() {
|
||||
|
||||
logger(json_encode($_POST), LOGGER_DEBUG);
|
||||
|
||||
switch ($_POST['action']) {
|
||||
case 'create_db':
|
||||
logger('Creating database tables...', LOGGER_DEBUG);
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
4
view/css/mod_oauth2test.css
Normal file
4
view/css/mod_oauth2test.css
Normal file
@ -0,0 +1,4 @@
|
||||
.oath2test-form-box {
|
||||
border: #ccc thin solid;
|
||||
padding: 1em;
|
||||
}
|
13
view/tpl/oauth2test.tpl
Normal file
13
view/tpl/oauth2test.tpl
Normal file
@ -0,0 +1,13 @@
|
||||
<h1>OAuth 2.0 Test Vehicle</h1>
|
||||
|
||||
{{foreach $endpoints as $ept}}
|
||||
<div class="oath2test-form-box">
|
||||
<form action="{{$baseurl}}/{{$ept.0}}" method="post">
|
||||
<h3>{{$ept.3}}</h3>
|
||||
<p>{{$baseurl}}/{{$ept.0}}/?{{foreach $ept.1 as $field}}{{$field.0}}={{$field.1}}&<input type="hidden" name="{{$field.0}}" value="{{$field.1}}" /> {{/foreach}}
|
||||
</p>
|
||||
<button type="submit" name="{{$ept.2}}_submit" value="submit" class="btn btn-med" title="">Submit</button>
|
||||
|
||||
</form>
|
||||
</div>
|
||||
{{/foreach}}
|
Reference in New Issue
Block a user