/** * 检查该QQ是否已被注册 * @param string qq 用户提交的qq字段 * @access protected * */ protected function checkQq($qq) { $mo = new UsersModel(); if (empty($mo->where(array('qq' => $qq))->find())) { return true; } else { return false; } }
protected function checkInf() { $mo = new UsersModel(); $mo->where(array('uid' => $_POST)['uid']); if (empty($mo->find())) { return true; } else { return false; } }
/** * 校验密码是否正确 * 内置回调函数 * @access protected * @param string $password 提交的密码 * @return boolean * */ protected function checkPassword($password) { $mo = new UsersModel(); $mo->where(array('uid' => $this->uid)); $dbPassword = $mo->getField('password'); $subPassword = crypt($password, $dbPassword); if ($dbPassword != $subPassword) { return false; } else { return true; } }
/** * 查询当前协会编号的状态(users表中的state字段) * @param $uid String(4) 要查询的协会编号 * @return String(3) 当前协会编号的状态 * */ function get_state($uid) { if (empty($uid)) { $uid = cookie('uid'); } $mo = new UsersModel(); $mo->where(array('uid' => $uid)); return $mo->getField('state'); }