public function __construct() { //core_templates::view('test.html'); //$sta = 'shiyili@eyou.com&2223'; //print_r(explode('&',$sta)); $str = libs_tools::encrypt('shiyili@eyou.com&223'); echo $str; echo '<br>'; $str1 = libs_tools::decrypt($str); print_r(explode('&', $str1)); echo $str1; $ada = new remind_models_data_member(); $ada->regCookie($str); //$ada->loginOut(); echo '<br>---'; $cookie = $ada->getCookie(); if ($cookie) { echo 'yes you are loin'; } else { echo 'who are you'; } echo '<pre>'; $str2 = '<img src="http://www.baidu.com">'; $strs = libs_tools::filterXss($str2); var_dump($strs); }
public function checkLogin() { if ($this->getCookie()) { $cookieinfo = $this->getCookie(); return explode('&', libs_tools::decrypt($cookieinfo)); } else { return array(); } }
public function addUser($username, $passwd) { $filedsArr['logintime'] = $filedsArr['regtime'] = $_SERVER['REQUEST_TIME']; $filedsArr['ip'] = libs_tools::getIp(); $filedsArr['username'] = $username; $filedsArr['passwd'] = $passwd; $filedsArr['phone'] = ''; $filedsArr['status'] = 1; return $this->insert($filedsArr); }
public function addFeedback($username, $comment) { $filedsArr['logintime'] = $_SERVER['REQUEST_TIME']; $filedsArr['ip'] = libs_tools::getIp(); $filedsArr['username'] = $username; $filedsArr['useragent'] = $_SERVER['HTTP_USER_AGENT']; $filedsArr['comment'] = $comment; $filedsArr['status'] = 0; return $this->insert($filedsArr); }
public function adduser() { //if(isset($_POST['username']) && !empty($_POST['username']) && isset($_POST['passwd']) && !empty($_POST['passwd'])){ if (isset($_GET['username']) && !empty($_GET['username']) && isset($_GET['passwd']) && !empty($_GET['passwd'])) { if (libs_tools::checkEmail($_GET['username'])) { if ($this->dataObj->checkUsername($_GET['username'])) { echo '邮箱己被注册,请更换'; } else { $username = $_GET['username']; $resdata = $this->dataObj->adduser($username, $_GET['passwd']); echo $resdata; } } else { echo '邮箱格式错误'; } } else { echo '缺少参数'; } }
public function addfeedback() { if (!isset($_GET['username']) && !empty($_GET['username']) && !isset($_GET['comment']) && !empty($_GET['comment'])) { echo '提交参数错误'; } if (libs_tools::checkEmail($_GET['username'])) { $username = $_GET['username']; } else { echo '用户名错误'; return; } $feedback = array(); /*if($_GET['uid']){ $feedback['uid'] = $_GET['uid']; }else{ $_GET['uid'] = 0; }*/ $comment = libs_tools::filterXss($_GET['comment']); return $this->dataObj->addFeedback($_GET['username'], $comment); }
public function addtags() { if (!isset($_GET['username']) && !empty($_GET['username']) && !isset($_GET['tagname']) && !empty($_GET['tagname'])) { echo '提交参数错误'; } if (libs_tools::checkEmail($_GET['username'])) { $username = $_GET['username']; } else { echo '用户名错误'; return; } $tagname = libs_tools::filterXss($_GET['tagname']); $status = $this->dataObj->checkTag($tagname); //判断该tag是否己有,己有tag reference+1 else add new tag if ($status) { $this->dataObj->updateTagRef($tagname); return $status; } else { return $this->dataObj->addTag($tagname, $_GET['username']); } }
public function addbookmark() { //检测用户是否己登录 $logininfo = $this->userObj->needLogin(); //判断用户提交参数是否合法 if (!isset($_GET['uid']) && !empty($_GET['uid']) && !isset($_GET['name']) && !empty($_GET['name']) && !isset($_GET['location']) && !empty($_GET['location']) && !isset($_GET['tags']) && !empty($_GET['tags']) && !isset($_GET['notes']) && !empty($_GET['notes']) && !isset($_GET['public']) && !empty($_GET['public'])) { echo '提交参数错误'; } //对提交信息进行安全过滤 $uid = intval($_GET['uid']); //判断登录ID与提交ID是否一致 if ($uid != $logininfo[1]) { echo '非法提交信息'; return; } $name = libs_tools::filterXss($_GET['name']); $location = libs_tools::filterXss($_GET['location']); $tags = libs_tools::filterXss($_GET['tags']); $notes = libs_tools::filterXss($_GET['notes']); $public = intval($_GET['public']); //执行插入 $resdata = $this->dataObj->addBookMark($uid, $name, $location, $tags, $notes, $public); }