mirror of
https://e.coding.net/circlecloud/McAccount.git
synced 2024-11-16 00:48:57 +00:00
修复部分BUG...
Signed-off-by: 502647092 <jtb1@163.com>
This commit is contained in:
parent
67ec2a329a
commit
17a9ae06a2
@ -16,8 +16,8 @@ $Config ['index'] = "index.php";
|
||||
|
||||
$Config ['ConnectTag'] = 'default'; // Mysql连接标识 可同时进行多连接
|
||||
$Config ['Host'] = '127.0.0.1:3306'; // Mysql主机地址
|
||||
$Config ['User'] = 'minecraft'; // Mysql用户
|
||||
$Config ['Password'] = '325325'; // Mysql密码
|
||||
$Config ['User'] = 'root'; // Mysql用户
|
||||
$Config ['Password'] = 'root'; // Mysql密码
|
||||
$Config ['DBname'] = 'minecraft'; // 数据库名称
|
||||
$Config ['CharSet'] = "UTF-8";
|
||||
|
||||
|
@ -12,11 +12,6 @@ class authme extends AmysqlModel {
|
||||
"world" => 'world',
|
||||
"email" => $mail
|
||||
);
|
||||
$ic = array (
|
||||
"username" => $username,
|
||||
"balance" => "30",
|
||||
"hidden" => "0"
|
||||
);
|
||||
$data = array (
|
||||
"address" => $mail,
|
||||
'verify' => '',
|
||||
@ -24,15 +19,11 @@ class authme extends AmysqlModel {
|
||||
'time' => date ( 'Y-m-d' ),
|
||||
"user" => $username
|
||||
);
|
||||
if ($this->_insert ( 'authme', $value ) == 0) {
|
||||
$this->_insert ( 'mail', $data );
|
||||
if ($this->_insert ( 'authme', $value ) != 0)
|
||||
return true;
|
||||
else
|
||||
return false;
|
||||
} else {
|
||||
if ($this->_insert ( 'mail', $data ) == 0) {
|
||||
return false;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
public function login($username, $password) {
|
||||
if ($this->_sum ( "SELECT * FROM `authme` WHERE `username` = '$username' AND `password` = '$password'" ) == 0)
|
||||
|
@ -75,7 +75,7 @@ if (empty ( $_SESSION ['username'] ))
|
||||
<td class="description"><input style="width: 250px;"
|
||||
class="span8 inline-input" id="mail" type="text" disabled="disabled"/></td>
|
||||
<td><button style="width: 90px;" id="submit" type="button"
|
||||
class="btn-glow primary btn-next" disabled="disabled">发送验证码</button></td>
|
||||
class="btn-glow primary btn-next" >发送验证码</button></td>
|
||||
</tr>
|
||||
<!-- row -->
|
||||
<tr>
|
||||
@ -112,9 +112,10 @@ if (empty ( $_SESSION ['username'] ))
|
||||
<script src="View/public/js/select2.min.js"></script>
|
||||
<script src="View/public/js/theme.js"></script>
|
||||
<script type="text/javascript">
|
||||
|
||||
select()
|
||||
var data = "user=<?=$_SESSION['username']?>";
|
||||
function select(){
|
||||
$("#submit").disabled = true;
|
||||
$.ajax({
|
||||
type:"GET",
|
||||
dataType:"json",
|
||||
@ -126,7 +127,7 @@ if (empty ( $_SESSION ['username'] ))
|
||||
if(rdata.status == "success")
|
||||
{
|
||||
$("#mail").val(content.email);
|
||||
$("#submit").attr();
|
||||
$("#submit").disabled = false;
|
||||
}
|
||||
}
|
||||
)},
|
||||
@ -177,7 +178,7 @@ $(document).ready(function(){
|
||||
url:"<?=Url('mail_status','mail')?>",
|
||||
success:function(rdata){
|
||||
switch(rdata.status){
|
||||
case "success" : alert(rdata.info); break;
|
||||
case "success" : alert(rdata.info); location.href = "<?=Url('index','index')?>"; break;
|
||||
case "error" : alert(rdata.info); return false; break;
|
||||
}
|
||||
}
|
||||
|
@ -72,11 +72,7 @@ if (empty ( $_SESSION ['username'] ))
|
||||
type="text" value="" disabled="disabled" /> <span id="status"></span>
|
||||
</div>
|
||||
<div class="field-box">
|
||||
<label>游戏币余额:</label> <input class="span3 inline-input"
|
||||
id="money" type="text" value="" disabled="disabled" />
|
||||
</div>
|
||||
<div class="field-box">
|
||||
<label>服务器信息:</label> 在线人数: <span id="now" ></span>/<span id="max" ></span>
|
||||
<label>服务器信息:</label> 在线人数: <span id="now"></span>/<span id="max"></span>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
@ -93,7 +89,6 @@ if (empty ( $_SESSION ['username'] ))
|
||||
<script type="text/javascript">
|
||||
select();
|
||||
status();
|
||||
current();
|
||||
getinfo();
|
||||
var data = "user=<?=$_SESSION['username']?>";
|
||||
function select(){
|
||||
@ -124,17 +119,14 @@ if (empty ( $_SESSION ['username'] ))
|
||||
data:data,
|
||||
url:"<?=Url('mail_status', "stat")?>",
|
||||
success:function(data){
|
||||
$.each(data.info,function(index,content)
|
||||
{
|
||||
if(content.statu == 0)
|
||||
{
|
||||
$("#status").html("邮箱验证状态:尚未验证");
|
||||
$("#status").css("color", "red");
|
||||
}else{
|
||||
$('#status').html("邮箱验证状态:已验证");
|
||||
$("#status").css("color", "green");
|
||||
}
|
||||
})
|
||||
if(data.status == "success")
|
||||
{
|
||||
$("#status").html("邮箱验证状态:尚未验证 <a href='<?=Url('index', 'mail')?>' onclick='display()'>点击进行验证</a>");
|
||||
$("#status").css("color", "red");
|
||||
}else{
|
||||
$('#status').html("邮箱验证状态:已验证");
|
||||
$("#status").css("color", "green");
|
||||
}
|
||||
},
|
||||
error:function(){
|
||||
alert("邮箱验证状态读取失败");
|
||||
@ -142,26 +134,6 @@ if (empty ( $_SESSION ['username'] ))
|
||||
}
|
||||
})
|
||||
}
|
||||
window.onload = function(){
|
||||
var html = $('#status').html();
|
||||
if(html.indexOf("尚未验证") != -1){
|
||||
$('#status').html($('#status').html()+ " <a href='<?=Url('index', 'mail')?>' onclick='display()'>点击这里进行验证</a>")
|
||||
}
|
||||
}
|
||||
function current(){
|
||||
$.ajax({
|
||||
type:"GET",
|
||||
dataType:"json",
|
||||
data:{user:"<?=$_SESSION['username']?>"},
|
||||
url:"<?=Url('user_current' , 'current')?>",
|
||||
success:function(rdata){
|
||||
$("#money").val( rdata.info );
|
||||
},
|
||||
error:function(){
|
||||
alert("尚未查询到此用户的游戏币余额");
|
||||
}
|
||||
})
|
||||
}
|
||||
function getinfo(){
|
||||
$.ajax({
|
||||
type:"GET",
|
||||
|
@ -76,13 +76,13 @@ $("#register").click(function(){
|
||||
alert("用户名不能为空!");
|
||||
return false;
|
||||
}
|
||||
if(username.val().length < 3){
|
||||
alert("帐号长度不得低于3位!");
|
||||
if(username.val().length < 3 || username.val().length > 16){
|
||||
alert("帐号长度不得低于3位或大于16位!");
|
||||
return;
|
||||
}
|
||||
if(username.val().length > 10){
|
||||
alert("帐号长度不得超过10位!");
|
||||
return false;
|
||||
if(!RegexUserName.test(username.val())){
|
||||
alert("帐号必须以小写字母+数字+下划线组成!");
|
||||
return;
|
||||
}
|
||||
if(pass.val()==""){
|
||||
alert("密码不能为空!");
|
||||
@ -96,10 +96,6 @@ $("#register").click(function(){
|
||||
alert("邮箱不能为空!");
|
||||
return false;
|
||||
}
|
||||
if(!RegexUserName.test(username.val())){
|
||||
alert("帐号必须以小写字母+数字+下划线组成!");
|
||||
return;
|
||||
}
|
||||
if(!RegexEmail.test(email.val())){
|
||||
alert("邮箱格式不正确!");
|
||||
$('#email').val("");
|
||||
|
Loading…
Reference in New Issue
Block a user