来源:自学PHP网 时间:2015-04-15 15:00 作者: 阅读:次
[导读] rt详细说明:看到 app controller user class php修改会员资料处public function update() {$_Obj = M ( user );if (($_POST [info] [password] !== $_POST [password1])) {StringUtil...
看到 /app/controller/user.class.php
public function update() { $_Obj = M ( 'user' ); if (($_POST ['info'] ['password'] !== $_POST ['password1'])) { StringUtil::msgbox ( Config::lang ( "PWDNOTTHESAME" ), 'index.php?ac=users_info', 1 ); exit (); } $_Obj->create (); if ($_POST ['info'] ['password'] != "" && ($_POST ['info'] [password] == $_POST ['password1'])) { $_Obj->password = strlen ( $_POST ['info'] ['password'] ) > 15 ? $_POST ['info'] ['password'] : md5 ( $_POST ['info'] ['password'] ); } if (empty ( $_POST ['info'] ['area'] )) { $_Obj->area = ""; } if (empty ( $_POST ['info'] ['city'] )) { $_Obj->city = ""; } //禁止修改管理员 $userObj = get ( "user", $_Obj->id ); if ($userObj->grade == 1 || $_POST["info"]["grade"] == 1) { self::checkIsAdmin (); } //禁止修改别人的 $IsSelfData = Authen::checkIsSelfData ( $_Obj->id ); if (! $IsSelfData) { $this->setValue ( "error", Config::lang ( "NOTRIGHT" ) ); $this->forward ( "error.html" ); exit (); } $_Obj->update (); StringUtil::msgbox ( Config::lang ( "MODIFYSUCCESS" ), 'index.php?ac=user_info', 1 ); }
public function update() { $pKey = $this->PRI; $this->db->Set($this->table, $this->data, 'where ' . $this->PRI . " = " . intval($this->$pKey), ''); $affected_rows = $this->db->affected_rows(); return $affected_rows; }
public function Set($Table, $Data, $Condition = '', $unQuot = array()) { if (is_array ( $Data )) { $unQuot = is_array ( $unQuot ) ? $unQuot : explode ( ',', $unQuot ); foreach ( $Data as $key => $val ) { $val = ($val || $val == 0) ? mysql_real_escape_string ( $val ) : ''; $Values .= "`" . $key . '`=' . (in_array ( $key, $unQuot ) ? "{$val}," : "'{$val}',"); } $Values = rtrim ( $Values, ',' ); } else { $Values = mysql_real_escape_string ( $Data ); } return $this->query ( "UPDATE `{$Table}` SET {$Values} {$Condition}" ); }
public function adminLogin($username, $password) { $sql = "select * from " . $this->table . " where username='$username' and password='$password' and isadmin = 1 and status=1";
修复方案:修复~ |
自学PHP网专注网站建设学习,PHP程序学习,平面设计学习,以及操作系统学习
京ICP备14009008号-1@版权所有www.zixuephp.com
网站声明:本站所有视频,教程都由网友上传,站长收集和分享给大家学习使用,如由牵扯版权问题请联系站长邮箱904561283@qq.com