* code for task#1580.

This commit is contained in:
xia0ta0
2013-07-19 14:38:26 +08:00
parent d8676d680b
commit 36a90cd70d
8 changed files with 151 additions and 0 deletions
+3
View File
@@ -0,0 +1,3 @@
<?php
$config->sso->create->requiredFields = 'title,code,key,ip';
$config->sso->edit->requiredFields = 'title,key,ip';
+11
View File
@@ -0,0 +1,11 @@
function createKey()
{
var chars = '0123456789abcdefghiklmnopqrstuvwxyz'.split('');
var key = '';
for(var i=0; i < 32; i++)
{
key += chars[Math.floor(Math.random() * chars.length)];
}
$('#key').val(key);
return false;
}
+24
View File
@@ -0,0 +1,24 @@
<?php
$lang->sso->common = 'sso';
$lang->sso->browse = 'Auth list';
$lang->sso->create = 'Create auth';
$lang->sso->edit = 'Edit auth';
$lang->sso->delete = 'Delete auth';
$lang->sso->code = 'Code';
$lang->sso->title = 'Name';
$lang->sso->key = 'Key';
$lang->sso->ip = 'IP list';
$lang->sso->createKey = 'Get new key';
$lang->sso->confirmDelete = 'Are you sure to delete this auth?';
$lang->sso->note = new stdClass();
$lang->sso->note->title = 'site name';
$lang->sso->note->code = 'site code';
$lang->sso->note->ip = "Use comma between two ips, and support ip segment, for example 192.168.1.*";
$lang->sso->error = new stdClass();
$lang->sso->error->title = 'Please input name';
$lang->sso->error->code = 'Please input code';
$lang->sso->error->key = 'Please input key';
$lang->sso->error->ip = 'Please input IP';
+24
View File
@@ -0,0 +1,24 @@
<?php
$lang->sso->common = '单点登录';
$lang->sso->browse = '授权列表';
$lang->sso->create = '创建授权';
$lang->sso->edit = '编辑授权';
$lang->sso->delete = '删除授权';
$lang->sso->code = '代号';
$lang->sso->title = '名称';
$lang->sso->key = '密钥';
$lang->sso->ip = 'IP列表';
$lang->sso->createKey = '重新生成密钥';
$lang->sso->confirmDelete = '您确定删除该授权吗?';
$lang->sso->note = new stdClass();
$lang->sso->note->title = '授权站点名称';
$lang->sso->note->code = '授权站点代号';
$lang->sso->note->ip = "允许该站点使用这些ip访问,多个ip使用逗号隔开。支持IP段,如192.168.1.*";
$lang->sso->error = new stdClass();
$lang->sso->error->title = '名称不能为空';
$lang->sso->error->code = '代号不能为空';
$lang->sso->error->key = '密钥不能为空';
$lang->sso->error->ip = 'IP列表不能为空';
View File
+35
View File
@@ -0,0 +1,35 @@
<?php include '../../common/view/header.html.php';?>
<table class='table-1 fixed colored tablesorter datatable'>
<caption class='caption-tl pb-10px'>
<div class='f-left'><?php echo $lang->sso->browse;?></div>
<div class='f-right'>
<?php common::printIcon('sso', 'create');?>
</div>
</caption>
<thead>
<tr class='colhead'>
<th class='w-100px'><?php echo $lang->sso->title;?></th>
<th class='w-80px'><?php echo $lang->sso->code;?></th>
<th width='350'><?php echo $lang->sso->key;?></th>
<th><?php echo $lang->sso->ip;?></th>
<th class='w-100px'><?php echo $lang->actions;?></th>
</tr>
</thead>
<tbody>
<?php foreach($auths as $code => $auth):?>
<tr class='a-center'>
<td><?php echo $auth->title?></td>
<td><?php echo $code?></td>
<td><?php echo $auth->key?></td>
<td><?php echo $auth->ip?></td>
<td>
<?php
common::printIcon('sso', 'edit', "code=$code");
common::printIcon('sso', 'delete', "code=$code", '', 'list', '', 'hiddenwin');
?>
</td>
</tr>
<?php endforeach;?>
</tbody>
</table>
<?php include '../../common/view/footer.html.php';?>
+27
View File
@@ -0,0 +1,27 @@
<?php include '../../common/view/header.html.php';?>
<form method='post' target='hiddenwin' id='dataform'>
<table class='table-1'>
<caption><?php echo $lang->sso->create;?></caption>
<tr>
<th class='rowhead'><?php echo $lang->sso->title;?></th>
<td><?php echo html::input('title', '', "class='text-3' placeholder='{$lang->sso->note->title}'");?></td>
</tr>
<tr>
<th class='rowhead'><?php echo $lang->sso->code;?></th>
<td><?php echo html::input('code', '', "class='text-3' placeholder='{$lang->sso->note->code}'");?></td>
</tr>
<tr>
<th class='rowhead'><?php echo $lang->sso->key;?></th>
<td>
<?php echo html::input('key', $key, "class='text-3' readonly='readonly'");?>
<?php echo html::a('javascript:void(0)', $lang->sso->createKey, '', 'onclick="createKey()"')?>
</td>
</tr>
<tr>
<th class='rowhead'><?php echo $lang->sso->ip;?></th>
<td><?php echo html::input('ip', '', "class='text-5' placeholder='{$lang->sso->note->ip}'");?></td>
</tr>
<tr><td colspan='2' class='a-center'><?php echo html::submitButton() . html::backButton();?></td></tr>
</table>
</form>
<?php include '../../common/view/footer.html.php';?>
+27
View File
@@ -0,0 +1,27 @@
<?php include '../../common/view/header.html.php';?>
<form method='post' target='hiddenwin' id='dataform'>
<table class='table-1'>
<caption><?php echo $lang->sso->edit;?></caption>
<tr>
<th class='rowhead'><?php echo $lang->sso->title;?></th>
<td><?php echo html::input('title', $auth->title, "class='text-3'");?></td>
</tr>
<tr>
<th class='rowhead'><?php echo $lang->sso->code;?></th>
<td><?php echo $code;?></td>
</tr>
<tr>
<th class='rowhead'><?php echo $lang->sso->key;?></th>
<td>
<?php echo html::input('key', $auth->key, "class='text-3' readonly='readonly'");?>
<?php echo html::a('javascript:void(0)', $lang->sso->createKey, '', 'onclick="createKey()"')?>
</td>
</tr>
<tr>
<th class='rowhead'><?php echo $lang->sso->ip;?></th>
<td><?php echo html::input('ip', $auth->ip, "class='text-5'");?></td>
</tr>
<tr><td colspan='2' class='a-center'><?php echo html::submitButton() . html::backButton();?></td></tr>
</table>
</form>
<?php include '../../common/view/footer.html.php';?>