static function casLoginProcess() { global $config, $message, $ui; self::init(); /* Reset error messages */ $message = ''; //~ phpCAS::setDebug(); // Initialize phpCAS phpCAS::client(CAS_VERSION_2_0, $config->get_cfg_value('casHost', 'localhost'), (int) $config->get_cfg_value('casPort', 443), $config->get_cfg_value('casContext', '')); // Set the CA certificate that is the issuer of the cert phpCAS::setCasServerCACert($config->get_cfg_value('casServerCaCertPath')); //~ phpCAS::setNoCasServerValidation(); // force CAS authentication phpCAS::forceAuthentication(); self::$username = phpCAS::getUser(); $ldap = $config->get_ldap_link(); $ldap->cd($config->current['BASE']); $verify_attr = explode(',', $config->get_cfg_value('loginAttribute', 'uid')); $filter = ''; foreach ($verify_attr as $attr) { $filter .= '(' . $attr . '=' . self::$username . ')'; } $ldap->search('(&(|' . $filter . ')(objectClass=inetOrgPerson))'); $attrs = $ldap->fetch(); if ($ldap->count() < 1) { msg_dialog::display(_('Error'), sprintf(_('CAS user "%s" could not be found in the LDAP'), self::$username), FATAL_ERROR_DIALOG); exit; } elseif ($ldap->count() > 1) { msg_dialog::display(_('Error'), sprintf(_('CAS user "%s" match several users in the LDAP'), self::$username), FATAL_ERROR_DIALOG); exit; } $ui = new userinfo($config, $attrs['dn']); $ui->loadACL(); $success = self::runSteps(array('loginAndCheckExpired', 'runSchemaCheck', 'checkForLockingBranch')); if ($success) { /* Everything went well, redirect to main.php */ self::redirect(); } }
/** * Update the specified resource in storage. * * @param \Illuminate\Http\Request $request * @param int $id * @return \Illuminate\Http\Response */ public function update(Request $request, $id) { $user = Auth::user(); $user->fill($request->all()); $user->save(); $validator = Validator::make($request->all(), ['fname' => 'required|max:50', 'lname' => 'required|max:50', 'username' => 'required|max:50', 'information' => 'max:500']); if ($validator->fails()) { return back()->withErrors($validator)->withInput(); } $user = new userinfo(); $user->ID = $user->id(); $user->fname = $request->get('fname'); $user->lname = $request->get('lname'); $user->username = $request->get('username'); $user->information = $request->get('information'); $user->save(); return back()->withMessage('Info updated!'); // }
</head> <body> <script type="text/javascript" src="minify.php?files=js/menu.js"></script> <div id="dhtmltooltip"></div> <script type="text/javascript" src="js/tooltip.js"></script> <?php require "login.php"; require "classes/error_class.php"; require "classes/user_class.php"; require "classes/levguide.inc.php"; // Initial handlers $error = new error_handle(); if ($logged_in == true) { $user = new userinfo(); $user->fetch_info($_SESSION['username'], $_SESSION['password']); $user->get_info(); $user->get_header_info(); $user->get_bonus($user->id); } $ip = $_SERVER['REMOTE_ADDR']; $ban = mysql_num_rows(mysql_query("SELECT * from banned where ip='{$ip}'")); if ($ban >= '1') { $error->error_text(3, NULL, NULL); } if (isset($_SERVER['HTTP_X_MOZ']) && $_SERVER['HTTP_X_MOZ'] == 'prefetch') { // This is a prefetch request. Block it. header('HTTP/1.0 403 Forbidden'); echo '403: Forbidden<br><br>Prefetching not allowed here.'; die;
$this->online = $this->user['online']; $this->warning = $this->user['warning']; $this->proplayer = $this->user['proplayer']; $this->parent = $this->user['parent']; $this->linggrowth = $this->user['linggrowth']; $this->linggyest = $this->user['linggyest']; } function getworldinfo() { $this->worldroom = $this->user['wroom']; $this->maxwbank = $this->user['maxwbank']; } function getbountyinfo() { $this->bounty = $this->user['bounty']; $this->bountiedby = $this->user['bountyplaceby']; } function getbonus($owner) { $power = mysql_query("select owner,CAST(SUM(shop.atk*qty) as unsigned) as atka,CAST(SUM(shop.def*qty) as unsigned) as defa from inventory, shop where `inventory`.owner='{$owner}' and `shop`.sid=`inventory`.itemid group by `inventory`.owner"); $power1 = mysql_fetch_assoc($power); $itempow = mysql_query("select owner,CAST(SUM(iteminv.atk) as unsigned) as atkb,CAST(SUM(iteminv.def) as unsigned) as defb from iteminv where `iteminv`.owner='{$owner}' and iteminv.status='E' group by `iteminv`.owner"); $itempow1 = mysql_fetch_assoc($itempow); } } $info = new userinfo(); $info->fetchinfo(1); $info->getinfo(); echo $info->id; echo $info->username; include "includes/footer.inc.php";
} $tpl->assign('p', $p); //读取父版块信息 $fIndex = $bbs->fatherForumMeta($fid, 'id,name,parent_id,notopic'); $tpl->assign('fName', $fIndex[count($fIndex) - 1]['name']); $tpl->assign('fIndex', $fIndex); //读取帖子元信息 $tMeta = $bbs->topicMeta($tid, 'title,read_count,uid,ctime,mtime', 'WHERE id=?', $fid); if (!$tMeta) { throw new bbsException('帖子 id=' . $tid . ' 不存在!', 2404); } $tpl->assign('tMeta', $tMeta); //读取帖子内容 $tContents = $bbs->topicContents($tid, $p, 20, 'uid,ctime,mtime,content,floor'); foreach ($tContents as &$v) { $uinfo = new userinfo(); $uinfo->uid($v['uid']); $v['uinfo'] = $uinfo; } $tpl->assign('tContents', $tContents); //var_dump($tContents);die; $ubb = new ubbdisplay(); $tpl->assign('ubb', $ubb); //获取token if ($USER->islogin) { $token = new token($USER); $token->create(); $tpl->assign('token', $token); } //显示帖子 $tpl->display('tpl:topic');
/** * 取得指定uid的信息,并存储在属性内。 * 若$this->update非空,则禁止操作 */ public function uid($uid, $getinfo = false) { $this->canchange(); return parent::uid($uid, $getinfo); }