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