private function saveKey($c) { $c = self::getKeyName($c); $sql = "INSERT INTO {$this->T('www_cache_key')} SET `type`='{$c['type']}', `key`='{$c['key']}', `key_`='{$c['key_']}', `expire`='{$c['expire']}' ON DUPLICATE KEY UPDATE `type`='{$c['type']}', `expire`='{$c['expire']}'"; odb::db()->query($sql); }
/** * 密码修改 * @param unknown_type $user 用户名 * @param unknown_type $password 旧密码 * @param unknown_type $newPassword 新密码 */ public function uppassword($user, $password, $newPassword) { if (strlen($user) > 35 || strlen($password) > 16 || strlen($newPassword) > 16) { return false; } $user = odb::db()->escape($user); $password = md5($this->secure . $password); $newPassword = md5($this->secure . $newPassword); $sql = "UPDATE {$this->T('www_admin')} SET password='******' WHERE user='******' AND password='******' LIMIT 1"; odb::db()->query($sql); return odb::db()->affectedRows(); }