new login field

This commit is contained in:
scholzDaSense 2013-05-21 12:40:49 +02:00
parent e68c4fed17
commit 7512a44190
3 changed files with 38 additions and 13 deletions

View File

@ -10,7 +10,7 @@ class saimod_sys_error extends \SYSTEM\SAI\SaiModule {
$now = microtime(true); $now = microtime(true);
$result = '<table class="table table-hover table-condensed" style="position:absolute; left:0;overflow: auto;">'. $result = '<table class="table table-hover table-condensed" style="overflow: auto;">'.
'<tr>'.'<th>'.'time ago in sec'.'</th>'.'<th>'.'time'.'</th>'.'<th>'.'class'.'</th>'.'<th>'.'message'.'</th>'.'<th>'.'code'.'</th>'.'<th>'.'file'.'</th>'.'<th>'.'line'.'</th>'.'<th>'.'ip'.'</th>'.'<th>'.'querytime'.'</tr>'; '<tr>'.'<th>'.'time ago in sec'.'</th>'.'<th>'.'time'.'</th>'.'<th>'.'class'.'</th>'.'<th>'.'message'.'</th>'.'<th>'.'code'.'</th>'.'<th>'.'file'.'</th>'.'<th>'.'line'.'</th>'.'<th>'.'ip'.'</th>'.'<th>'.'querytime'.'</tr>';
while($r = $res->next()){ while($r = $res->next()){
$result .= '<tr class="'.self::tablerow_class($r['class']).'">'.'<td>'.(int)($now - strtotime($r['time'])).'</td>'.'<td>'.$r['time'].'</td>'.'<td>'.$r['class'].'</td>'.'<td>'.$r['message'].'</td>'.'<td>'.$r['code'].'</td>'.'<td>'.$r['file'].'</td>'.'<td>'.$r['line'].'</td>'.'<td>'.$r['ip'].'</td>'.'<td>'.$r['querytime'].'</tr>'; $result .= '<tr class="'.self::tablerow_class($r['class']).'">'.'<td>'.(int)($now - strtotime($r['time'])).'</td>'.'<td>'.$r['time'].'</td>'.'<td>'.$r['class'].'</td>'.'<td>'.$r['message'].'</td>'.'<td>'.$r['code'].'</td>'.'<td>'.$r['file'].'</td>'.'<td>'.$r['line'].'</td>'.'<td>'.$r['ip'].'</td>'.'<td>'.$r['querytime'].'</tr>';

View File

@ -0,0 +1,21 @@
/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
/* jQuery on document ready */
$(document).ready(function() {
$("#submitButton").click(function(){
$.get('./api.php?call=account&action=login&username='+$('#username').val()+'&password_sha='+$.sha1($('#password').val())+'&password_md5='+hex_md5($('#password').val()), function (data) {
if(data === 1){
$("#loginStatusMsg").html('Login successful!!');
} else {
$("#loginStatusMsg").html('Wrong username or password!');
}
});
});
});

View File

@ -1,18 +1,22 @@
Please login for developer access. Please login for developer access.
</br> </br>
<font color="red">${message}</font> <font color="red">
<span id="loginStatusMsg"></span>
</font>
<form id='login' action='?action=developer&sai_mod=.SYSTEM.SAI.saimod_sys_login' method='post' accept-charset='UTF-8'>
<fieldset>
<legend>Login</legend>
<input type='hidden' name='submitted' id='submitted' value='1'/>
<label for='username' >UserName:</label> <fieldset>
<input type='text' name='username' id='username' maxlength="50" /> <legend>Login</legend>
<input type='hidden' name='submitted' id='submitted' value='1'/>
<label for='password' >Password:</label> <label for='username' >Username:</label>
<input type='password' name='password' id='password' maxlength="50" /> <input type='text' name='username' id='username' maxlength="50" />
<input type='submit' name='Submit' value='Submit' /> <label for='password' >Password:</label>
</fieldset> <input type='password' name='password' id='password' maxlength="50" />
</form> <br />
<button class="btn btn-primary" id="submitButton">Login</button>
</fieldset>
<script src="login.js" type="text/javascript"></script>