<?php //loading EUser if (!EUser::logged()) { $output = "\n\t<li class=\"dropdown\">\n <a href=\"#\"\n class=\"dropdown-toggle\"\n data-toggle=\"dropdown\">\n Account\n <b class=\"caret\"></b>\n </a>\n <ul class=\"dropdown-menu\">\n <li><a data-toggle=\"modal\" href=\"#loginModal\" id=\"loginButton\" class=\"modalButton\" target=\"/loginModal.php\">Login</a></li>\n <li class=\"divider\"></li>\n <li><a data-toggle=\"modal\" href=\"#registerModal\" id=\"registerButton\" class=\"modalButton\" target=\"/registerModal.php\">Register</a></li>\n <li><a href=\"#\">Forgot password</a></li>\n </ul>\n </li>\n \n <div class=\"modal hide\" id=\"loginModal\">\n </div>\n \n <div class=\"modal hide\" id=\"registerModal\">\n </div>\n "; } else { $output = "\n\t<li class=\"dropdown\">\n <a href=\"#\"\n class=\"dropdown-toggle\"\n data-toggle=\"dropdown\">\n Welcome " . EUser::nick() . "!\n <b class=\"caret\"></b>\n </a>\n <ul class=\"dropdown-menu\">\n <li><a href=\"/gamelist.php/user/" . EUser::nick() . "\">My games</a></li>\n <li><a data-toggle=\"modal\" href=\"#addGameModal\" class=\"modalButton\" target=\"/addGameModal.php\">Add game</a></li>\n <li class=\"divider\"></li>\n <li><a data-toggle=\"modal\" href=\"#viewSelfProfileModal\" class=\"modalButton\" target=\"/viewProfileModal.php?id=" . EUser::id() . "\">View profile</a></li>\n <li class=\"divider\"></li>\n <li><a href=\"/logout.php\">Logout</a></li>\n </ul>\n </li>\n \n <div class=\"modal hide\" id=\"viewSelfProfileModal\"></div>\n <div class=\"modal hide\" id=\"addGameModal\"></div>\n \n\t"; } echo "<div class=\"modal hide\" id=\"genericModal\"></div>"; echo $output;
public static function refresh() { $r = EDatabase::q("SELECT * FROM ocs_person WHERE login='******' AND password='******' LIMIT 1"); while ($row = mysql_fetch_array($r)) { EUser::$nick = $_SESSION['nick'] = $row['login']; EUser::$id = $_SESSION['id'] = $row['id']; EUser::$group = $_SESSION['group'] = $row['tgroup']; EUser::$logged = true; EUser::$mail = $_SESSION['mail'] = $row['email']; } return EUser::$logged(); }
<?php include "gfx3/lib.php"; $id = EHeaderDataParser::db_get("id"); $users = new EData("users"); $user_info = $users->find("firstname,lastname,email,password", "where id=" . EUser::id() . ""); $user_info = $user_info[0]; //taking first element echo "\n<div class=\"modal-header\">\n <button type=\"button\" class=\"close\" data-dismiss=\"modal\">×</button>\n <h3>Edit personal info of " . $user_info["firstname"] . " " . $user_info["lastname"] . "</h3>\n</div>\n\n <form class=\"form-horizontal\" action=\"updateprofileinfo.php\" target=\"_self\" method=\"post\">\n <div class=\"modal-body\">\n <fieldset>\n \n <div class=\"control-group\">\n <label class=\"control-label\" for=\"password\">Password</label>\n <div class=\"controls\">\n <input type=\"password\" name=\"password\" class=\"input-xlarge\" id=\"password\" value=\"" . $user_info["password"] . "\">\n <input type=\"hidden\" name=\"id\" value=\"" . EUser::id() . "\">\n <p class=\"help-block\">* must be a minimum of 8 characters</p>\n </div>\n </div>\n \n <div class=\"control-group\">\n <label class=\"control-label\" for=\"email\">E-Mail</label>\n <div class=\"controls\">\n <input type=\"text\" name=\"email\" class=\"input-xlarge\" id=\"email\" value=" . $user_info["email"] . ">\n <p class=\"help-block\">* must be a valid email</p>\n </div>\n </div>\n \n <div class=\"control-group\">\n <label class=\"control-label\" for=\"firstname\">Firstname</label>\n <div class=\"controls\">\n <input type=\"text\" name=\"firstname\" class=\"input-xlarge\" id=\"firstname\" value=" . $user_info["firstname"] . ">\n </div>\n </div>\n \n <div class=\"control-group\">\n <label class=\"control-label\" for=\"lastname\">Lastname</label>\n <div class=\"controls\">\n <input type=\"text\" name=\"lastname\" class=\"input-xlarge\" id=\"lastname\" value=" . $user_info["lastname"] . ">\n </div>\n </div>\n \n </fieldset>\n \n \n </div>\n <div class=\"modal-footer\" style=\"background-color:#FFFFFF;\">\n <input type=\"submit\" class=\"btn btn-primary\" value=\"Save\">\n </div>\n \n </form>\n\n ";