Enforce admin privileges
This commit is contained in:
@@ -49,12 +49,30 @@
|
||||
<tbody></tbody>
|
||||
</table>
|
||||
</div>
|
||||
<h1>Users</h1>
|
||||
<div id="users">
|
||||
<table>
|
||||
<thead>
|
||||
<tr>
|
||||
<th>[#]lang:id_user[#]</th>
|
||||
<th>[#]lang:name[#]</th>
|
||||
<th>[#]lang:language[#]</th>
|
||||
<th>[#]lang:time_zone[#]</th>
|
||||
<th>[#]lang:clearance[#]</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody></tbody>
|
||||
</table>
|
||||
</div>
|
||||
<h1>ToolBox</h1>
|
||||
<div id="toolbox"></div>
|
||||
<div id="feedback" class="feedback"></div>
|
||||
</div>
|
||||
<script type="text/javascript">
|
||||
oSpot.pageInit = function(asHash) {
|
||||
self.get('admin_get', setProjects);
|
||||
$('#new').addButton('new', 'New Project', 'new', createProject, 'main-btn');
|
||||
$('#toolbox').addButton('refresh', 'Update Project', 'refresh', updateProject, 'main-btn');
|
||||
};
|
||||
|
||||
oSpot.onFeedback = function(sType, sMsg, asContext) {
|
||||
@@ -116,6 +134,13 @@ function setProjects(asElemTypes) {
|
||||
.append($('<td>').text(oElem.name))
|
||||
.append($('<td>').text(oElem.model))
|
||||
break;
|
||||
case 'user':
|
||||
$Elem
|
||||
.append($('<td>').text(oElem.name))
|
||||
.append($('<td>').text(oElem.language))
|
||||
.append($('<td>').text(oElem.timezone))
|
||||
.append($('<td>').text(oElem.clearance))
|
||||
break;
|
||||
}
|
||||
|
||||
$Elem.appendTo($('#'+sElemType+'s').find('table tbody'));
|
||||
@@ -128,6 +153,15 @@ function createProject() {
|
||||
self.get('admin_new', setProjects);
|
||||
}
|
||||
|
||||
function updateProject() {
|
||||
self.get(
|
||||
'update_project',
|
||||
function(asData, sMsg){oSpot.onFeedback('success', sMsg, {'update':'project'});},
|
||||
{},
|
||||
function(sMsg){oSpot.onFeedback('error', sMsg, {'update':'project'});}
|
||||
);
|
||||
}
|
||||
|
||||
function commit(event, $This) {
|
||||
$This = $This || $(this);
|
||||
if(typeof self.tmp('wait') != 'undefined') clearTimeout(self.tmp('wait'));
|
||||
|
||||
Reference in New Issue
Block a user