diff --git a/assets/css/profile.style.css b/assets/css/profile.style.css new file mode 100644 index 00000000..e7e0eddc --- /dev/null +++ b/assets/css/profile.style.css @@ -0,0 +1,100 @@ +/* +* @Author: prpr +* @Date: 2016-02-03 17:11:53 +* @Last Modified by: prpr +* @Last Modified time: 2016-02-03 17:18:56 +*/ +.pure-form > *, .pure-button { + width: 100%; + margin: 10px 0 !important; +} +.container { + margin: 0 auto; + position: relative !important; +} +@media screen and (min-width: 48em) { + .container { + width: 85%; + } +} +body { + color: #444; +} +@media screen and (max-width: 550px) { + .pure-g:first-child { + margin-top: 100px !important; + } +} +.pure-g:first-child { + margin-top: 75px; +} +.panel-default { + border-color: #ddd!important; +} +.panel-danger { + border-color: #ebccd1!important; +} +.panel { + background-color: #fff; + border: 1px solid transparent; + border-radius: 4px; + -webkit-box-shadow: 0 1px 1px rgba(0,0,0,.05); + box-shadow: 0 1px 1px rgba(0,0,0,.05); + width: 90%; + margin: 0 auto 20px; +} +.panel-danger>.panel-heading { + color: #a94442; + background-color: #f2dede; + border-color: #ebccd1; +} +.panel-default>.panel-heading { + color: #333; + background-color: #f5f5f5; + border-color: #ddd; +} +.panel-heading { + padding: 10px 15px; + border-bottom: 1px solid transparent; + border-top-left-radius: 3px; + border-top-right-radius: 3px; +} +.panel-body { + padding: 10px 15px 15px; +} + +.home-menu-blur { + position: absolute; + top: 0; + left: 0; + width: 100%; + height: 100%; + z-index: -100; +} +.home-menu-wrp { + height: 100%; + background-color: rgba(255,255,255,0.4); +} +.home-menu-bg { + background-image: url("../images/bg_stone.png"); + background-repeat: repeat; + width: 100%; + height: 100%; + z-index: -1; + filter: blur(2px); + -webkit-filter: blur(2px); + -moz-filter: blur(2px); + -o-filter: blur(2px); + -ms-filter: blur(2px); + box-shadow: rgba(0,0,0,0.1) 0 1px 2px; +} + +body { + background-image: + url("../images/bg_stone.png"); + background-repeat: repeat; +} +.pure-button-error { + background: rgb(202, 60, 60); + color: #fff; +} diff --git a/assets/css/style.css b/assets/css/style.css index 01f11639..ec8fbc60 100755 --- a/assets/css/style.css +++ b/assets/css/style.css @@ -2,7 +2,7 @@ * @Author: prpr * @Date: 2016-01-21 07:57:38 * @Last Modified by: prpr -* @Last Modified time: 2016-01-21 20:33:40 +* @Last Modified time: 2016-02-03 17:04:36 */ @font-face { @@ -22,6 +22,10 @@ html { font-family: "Helvetica Neue", Helvetica, Arial, sans-serif; } +p { + margin: 10px 0; +} + .home-menu { padding: 0; text-align: center; diff --git a/assets/css/user.style.css b/assets/css/user.style.css index a78492c3..d1029a78 100644 --- a/assets/css/user.style.css +++ b/assets/css/user.style.css @@ -2,7 +2,7 @@ * @Author: prpr * @Date: 2016-01-21 19:12:06 * @Last Modified by: prpr -* @Last Modified time: 2016-01-21 22:09:28 +* @Last Modified time: 2016-02-03 16:39:42 */ .home-menu-blur { @@ -31,7 +31,7 @@ box-shadow: rgba(0,0,0,0.1) 0 1px 2px; } -.container { +body { background-image: url("../images/bg_stone.png"); background-repeat: repeat; diff --git a/assets/js/profile.utils.js b/assets/js/profile.utils.js new file mode 100644 index 00000000..83fd84fe --- /dev/null +++ b/assets/js/profile.utils.js @@ -0,0 +1,9 @@ +/* +* @Author: prpr +* @Date: 2016-02-03 17:21:46 +* @Last Modified by: prpr +* @Last Modified time: 2016-02-03 17:21:54 +*/ + +'use strict'; + diff --git a/includes/user.class.php b/includes/user.class.php index 934dd428..2cd76da2 100644 --- a/includes/user.class.php +++ b/includes/user.class.php @@ -3,7 +3,7 @@ * @Author: printempw * @Date: 2016-01-16 23:01:33 * @Last Modified by: prpr - * @Last Modified time: 2016-02-03 15:52:29 + * @Last Modified time: 2016-02-03 18:06:13 */ class user @@ -37,6 +37,10 @@ class user } } + public function changePasswd($new_passwd) { + $this->db->update($this->uname, 'password', md5($new_passwd)); + } + public function getToken() { return $this->token; } @@ -55,9 +59,11 @@ class user } public function unRegister() { - utils::remove("./textures/".$this->getTexture('skin')); - utils::remove("./textures/".$this->getTexture('cape')); - return utils::delete($this->uname); + if (is_null($this->getTexture('skin'))) + utils::remove("./textures/".$this->getTexture('skin')); + if (is_null($this->getTexture('skin'))) + utils::remove("./textures/".$this->getTexture('cape')); + return $this->db->delete($this->uname); } public function getTexture($type) { diff --git a/user/index.php b/user/index.php index 336ece93..919a1ab9 100644 --- a/user/index.php +++ b/user/index.php @@ -13,17 +13,17 @@ require "$dir/config.php"; $action = isset($_GET['action']) ? $_GET['action'] : ""; if(isset($_COOKIE['uname']) && isset($_COOKIE['token'])) { - $_SESSION['uname'] = $_COOKIE['uname']; - $_SESSION['token'] = $_COOKIE['token']; + $_SESSION['uname'] = $_COOKIE['uname']; + $_SESSION['token'] = $_COOKIE['token']; } if (isset($_SESSION['uname'])) { - $user = new user($_SESSION['uname']); - if ($_SESSION['token'] != $user->getToken()) { - header('Location: ../index.php?msg=Invalid token. Please login.'); - } + $user = new user($_SESSION['uname']); + if ($_SESSION['token'] != $user->getToken()) { + header('Location: ../index.php?msg=Invalid token. Please login.'); + } } else { - header('Location: ../index.php?msg=Illegal access. Please login.'); + header('Location: ../index.php?msg=Illegal access. Please login.'); } ?> @@ -45,17 +45,20 @@ if (isset($_SESSION['uname'])) {