/** * Bans the given email or ip for an ammount of time * * @param string|int $time Takes a string, "+1 day", or a number of seconds * @param null|string|true $ip Null to ignore IP, string to specify the ip, true to automatically load the ip * @param null|string $email */ public function ban($time, $ip = null, $email = null) { if ($ip == null && $email == null) { throw new \InvalidArgumentException('Both IP and Email cannot be null'); } //Load the right IP if ($ip && !is_string($ip)) { $ip = \Input::ip(); } //Create a correct expire time $expireTime = 0; if (is_string($time)) { $expireTime = strtotime($time); } else { $expireTime = time() + $time; } $model = new Model_Ban(); $model->ip = $ip; $model->email = $email; $model->expires = $expireTime; $model->save(); }
if (empty($_SESSION['tyuser'])) { header("Location:./login.php"); die; } //当前登录用户信息 $userRow = $userModel->find($_SESSION['tyuser']['id']); $smarty->assign('userRow', $userRow); if (!$userRow['pid']) { $smarty->assign('nowanshan', 1); } //未完善资料 } } } //判断是否禁登录 $banModel = new Model_Ban('ban'); $ban_res_login = $banModel->no_login_rights($userRow); if ($ban_res_login) { setCookie('tyuid', '', time() - 1); $smarty->assign('info', '您的账号还有' . ceil($ban_res_login / 3600) . '小时解禁'); $smarty->setLayout('')->setTpl('mobile/templates/no_data.html')->display(); die; } //设置订单满多少额度包邮 $moneyToFree = 68; $smarty->assign('moneyToFree', $moneyToFree); //设置运费 $yunfei = 9; $smarty->assign('yunfei', $yunfei); //路由 $_GET['m'] ? $controllerName = $_GET['m'] : ($controllerName = 'index');
} //同一个工作日不能报名两次 $result1 = $signModel->where("is_valid!=2 and uid=" . $data['num']['uid'] . " and task_date='" . $tempWorkArr[0] . "'")->dataRow(); if ($result1) { die('chongfu'); } $res = $signModel->add($data); $res ? die('suc') : die('err'); } } //评论 if ($_REQUEST['a'] == 'reply') { $replyModel = new Model_Subtable('sub_reply'); if ($_GET['tid'] && $_GET['content']) { //是否禁言 $banModel = new Model_Ban('ban'); $ban_res_say = $banModel->no_rights($userRow, 2); if ($ban_res_say) { die('err'); } $memberModel = new Model_Member(); $data['num']['tid'] = $_GET['tid']; $data['num']['uid'] = $userRow['id']; $data['info']['name'] = $userRow['nicheng']; $data['info']['head_pic'] = $memberModel->getPic($userRow['fromuser']); $data['str']['content'] = $_GET['content']; //管理员回复 if ($_GET['at']) { $atArr = explode('-', $_GET['at']); $data['str']['tomanid'] = $atArr[0]; $data['str']['tomanname'] = $atArr[1];
foreach ($listArr as $key => $value) { $listArr[$key]['introduce'] = cut_str(deletehtml($value['introduce']), 15); } echo json_encode($listArr); die; } else { echo json_encode('err'); die; } } //评论 if ($_REQUEST['a'] == 'reply') { $replyModel = new Model_Subtable('sub_pic_reply'); if ($_GET['pid'] && $_GET['content']) { //是否禁言 $banModel = new Model_Ban('ban'); $ban_res_say = $banModel->no_rights($userRow, 2); if ($ban_res_say) { die('err'); } //是否禁登录 $ban_res_login = $banModel->no_login_rights($userRow); if ($ban_res_login) { die('err'); } $memberModel = new Model_Member(); $data['num']['pid'] = $_GET['pid']; $data['info']['fromuser'] = $_SESSION['picuser']['fromuser']; $data['info']['name'] = $_SESSION['picuser']['nickname']; $data['info']['head_pic'] = $_SESSION['picuser']['headimgurl']; $data['str']['content'] = $_GET['content'];