diff --git a/Amysql/Amysql.php b/Amysql/Amysql.php index 02a3dd7..88679eb 100644 --- a/Amysql/Amysql.php +++ b/Amysql/Amysql.php @@ -35,7 +35,7 @@ class Amysql { * ********************************************** * * 总进程对象 - * + * * @param Object $ControllerName * @param string $ControllerName * @param string $ActionName @@ -89,7 +89,7 @@ class AmysqlProcess { * ********************************************** * * 控制器逻辑层 (C) - * + * * @param Object $DB * @param Array $DBConfig * @param Array $AmysqlModel @@ -114,7 +114,7 @@ class AmysqlController { /** * 设置数据库配置 - * + * * @param Array $Config */ function _DBSet($_Config = NULL) { @@ -127,7 +127,7 @@ class AmysqlController { /** * 模板赋值 - * + * * @param string $name * @param string $value */ @@ -137,7 +137,7 @@ class AmysqlController { /** * 数组模板赋值 - * + * * @param Array $array */ public function _array($array) { @@ -149,7 +149,7 @@ class AmysqlController { /** * 加载自定义类文件 - * + * * @param string $file * @param string $ClassName * @return Object $ClassName() 类对象 @@ -173,7 +173,7 @@ class AmysqlController { /** * 加载模型文件 - * + * * @param string $file * @param string $ClassName * @return Object $ClassName() 模型对象 @@ -186,10 +186,9 @@ class AmysqlController { include_once ($file); if (! class_exists ( $ClassName )) Amysql::AmysqlNotice ( $ClassName . ' 模型对象不存在' ); - $this->DBConfig ['ModelTag'] = $ModelTag = $ClassName . '_' . $this->DBConfig ['ConnectTag']; // 模型标识 - if (! isset ( $this->AmysqlModel [$ModelTag] )) // 不存在模型 -{ + // 不存在模型 + if (! isset ( $this->AmysqlModel [$ModelTag] )) { $this->AmysqlModel [$ModelTag] = new $ClassName (); if (! isset ( $this->DB->DBS [$ModelTag] )) $this->DB->DBConnect ( $this->DBConfig ); // 没连接就进行数据库连接 @@ -203,7 +202,7 @@ class AmysqlController { /** * 获得相关文件数据(模板目录) - * + * * @param string $file * @return string 数据 */ @@ -218,7 +217,7 @@ class AmysqlController { /** * 数据调试 - * + * * @param $data 数据 */ public function _echo($data) { @@ -253,7 +252,7 @@ class AmysqlController { * ********************************************** * * 视图表现层 (V) - * + * * @param Array $TemplateValue * */ @@ -282,7 +281,7 @@ class AmysqlTemplates { * ********************************************** * * 模型数据层 (M) - * + * * @param Object $MysqlConnect * @param String $Affected * @param String $InsertId @@ -299,7 +298,7 @@ class AmysqlModel { /** * 基本查询 - * + * * @param string $sql * @return Object 结果集 */ @@ -321,7 +320,7 @@ class AmysqlModel { /** * 插入数据 - * + * * @param string $table * @param Array $data * @return int InsertId 新增ID @@ -343,12 +342,15 @@ class AmysqlModel { /** * 更新数据 - * - * @param string $table 表名 - * @param Array $data 数据 - * @param string $where 更新数据依据 + * + * @param string $table + * 表名 + * @param Array $data + * 数据 + * @param string $where + * 更新数据依据 * @return int Affected 影响数 - * + * */ public function _update($table, $data, $where = '') { $this->Affected = 0; @@ -366,7 +368,7 @@ class AmysqlModel { /** * 取得一排数据 - * + * * @param string $sql * @param string $result_type * @return Array $row 数据 @@ -383,7 +385,7 @@ class AmysqlModel { /** * 取得所有数据 - * + * * @param string $sql * @param string $result_type * @return Array $row 数据 @@ -404,7 +406,7 @@ class AmysqlModel { /** * 取得数据总数 - * + * * @param string $sql * @return int 数量 */ @@ -417,7 +419,7 @@ class AmysqlModel { /** * 释放结果集 - * + * * @param Object $rs */ public function _free($rs) { @@ -429,7 +431,7 @@ class AmysqlModel { * ********************************************** * * 数据库对象 - * + * * @param Object $DBS */ class DB { diff --git a/Controller/index.php b/Controller/index.php index 5ace8db..29480b3 100644 --- a/Controller/index.php +++ b/Controller/index.php @@ -1,37 +1,28 @@ - title = 'Minecraft 用户中心'; // 直接赋值模板 - $this -> _view('message'); // 载入index模板 - } - - function login(){ - $this -> title = "Minecraft 用户登陆"; - - $this -> _view('login'); - - } - function register(){ - $this -> title = "Minecraft 帐号注册"; - $this -> _view("register"); - } - - function pass(){ - $this -> title = "Minecraft 修改密码"; - $this -> _view("password"); - } - - function mail(){ - $this -> title = "Minecraft 邮箱验证"; - $this -> _View("mail/mailstatus"); - } - function forge(){ - $this -> title = "Minecraft 密码找回"; - $this -> _View("forge"); - } - +title = 'Minecraft 用户中心'; // 直接赋值模板 + $this->_view ( 'message' ); // 载入index模板 + } + function login() { + $this->title = "Minecraft 用户登陆"; + $this->_view ( 'login' ); + } + function register() { + $this->title = "Minecraft 帐号注册"; + $this->_view ( "register" ); + } + function pass() { + $this->title = "Minecraft 修改密码"; + $this->_view ( "password" ); + } + function mail() { + $this->title = "Minecraft 邮箱验证"; + $this->_View ( "mail/mailstatus" ); + } + function forge() { + $this->title = "Minecraft 密码找回"; + $this->_View ( "forge" ); + } } \ No newline at end of file diff --git a/Controller/mail_status.php b/Controller/mail_status.php index 02e814a..a6bfb8e 100644 --- a/Controller/mail_status.php +++ b/Controller/mail_status.php @@ -23,7 +23,7 @@ class mail_status extends AmysqlController { JsonError ( '验证码不对!请重试' ); exit ( 0 ); } - if ($this->_model ( "mail_model" )->mail ( @$_REQUEST ['mail'], $verify, @$_SESSION ['username'] )) + if ($this->_model ( "mail_model" )->mail ( @$_REQUEST ['mail'], @$_SESSION ['username'] )) JsonSuccess ( '验证成功' ); else JsonError ( "验证失败" ); diff --git a/Controller/server_status.php b/Controller/server_status.php deleted file mode 100644 index c943d79..0000000 --- a/Controller/server_status.php +++ /dev/null @@ -1,8 +0,0 @@ - _model('server_model') -> QueryMinecraft( $_REQUEST ['ip'], $_REQUEST ['port'] ); - return $info; - } -} -?> \ No newline at end of file diff --git a/Model/mail_model.php b/Model/mail_model.php index 71b53be..6149a70 100644 --- a/Model/mail_model.php +++ b/Model/mail_model.php @@ -4,21 +4,14 @@ class mail_model extends AmysqlModel { $sql = "SELECT email FROM `authme` WHERE `username` = '" . $where . "'"; return $this->_all ( $sql ); } - public function mail($mail, $verify, $user) { + public function mail($mail, $user) { $data = array ( "address" => $mail, - "verify" => $verify, "statu" => '1', "time" => date ( "Y-m-d" ) ); // var_dump($data); - $num = $this->_update ( 'mail', $data, "WHERE user='" . $user . "'" ); - // var_dump($num); - if ($num == 0) { - return false; - } else { - return true; - } + return $this->_update ( 'mail', $data, "WHERE user='" . $user . "'" ) != 0; } public function status($user) { $sql = "SELECT * FROM `mail` WHERE `user` = '" . $user . "'"; diff --git a/Model/server_model.php b/Model/server_model.php deleted file mode 100644 index d34514b..0000000 --- a/Model/server_model.php +++ /dev/null @@ -1,67 +0,0 @@ - ( int ) $Timeout, - 'usec' => 0 - ) ); - Socket_Set_Option ( $Socket, SOL_SOCKET, SO_RCVTIMEO, array ( - 'sec' => ( int ) $Timeout, - 'usec' => 0 - ) ); - - if ($Socket === FALSE || @Socket_Connect ( $Socket, $IP, ( int ) $Port ) === FALSE) { - return FALSE; - } - - Socket_Send ( $Socket, "\xFE\x01", 2, 0 ); -// Socket_Send ( $Socket, "\x0F\0x00\x04\x09\x31\x32\x37\x2E\x30\x2E\x30\x2E\x31\x63\xDD\x01", 16, 0); -// Socket_Send ( $Socket, "\x01\x00", 2, 0 ); - $Len = Socket_Recv ( $Socket, $Data, 1024, 0 ); - Socket_Close ( $Socket ); - -// return FALSE; -// if ($Len < 4 || $Data [0] !== "\xFF") { -// return FALSE; -// } - -// $Data = SubStr ( $Data, 3 ); - echo($Len); - echo("

"); - -// $Data = iconv( 'UTF-16BE', 'UTF-8', $Data ); - print_r($Data); - echo("

"); - $zData = Explode ( "\x00", $Data ); - echo(count($zData)); - echo("

"); - print_r($zData); - echo("

"); - $aData = Explode ( "\xA7", $Data ); - echo(count($aData)); - echo("

"); - print_r($aData); -// if ($Data [1] === "\xA7" && $Data [2] === "\x31") { -// $Data = Explode ( "\x00", $Data ); -// var_dump($Data [3]); -// return Array ( -// 'HostName' => $Data [3], -// 'Players' => IntVal ( $Data [4] ), -// 'MaxPlayers' => IntVal ( $Data [5] ), -// 'Protocol' => IntVal ( $Data [1] ), -// 'Version' => $Data [2] -// ); -// } - -// $Data = Explode ( "\xA7", $Data ); -// return Array ( -// 'HostName' => SubStr ( $Data [0], 0, - 1 ), -// 'Players' => isset ( $Data [1] ) ? IntVal ( $Data [1] ) : 0, -// 'MaxPlayers' => isset ( $Data [2] ) ? IntVal ( $Data [2] ) : 0, -// 'Protocol' => 0, -// 'Version' => '1.3' -// ); - } -} \ No newline at end of file