迅睿CMS框架是一款PHP8高性能·简单易用的CMS开源开发框架,基于MIT开源许可协议发布,免费且不限制商业使用,是免费开源的产品,以万端互联为设计理念,支持的微信公众号、小程序、APP客户端、移动端网站、PC网站等多终端式管理系统。
联系官方销售客服
1835022288
028-61286886
会员中心做的密码修改 通过 md5() 加密的 怎么提示密码错误
\Phpcmf\Service::M()->table('member')->update($uid,[ 'password' => md5(dr_safe_password($post['password'])),]);
\Phpcmf\Service::M('member')->edit_password(dr_member_info($uid), $post['password']);
dr_safe_password($post['password'])
public function edit(){ $uid = \Phpcmf\Service::L('input')->get('id'); //会员id $hr = dr_member_info($uid); //获取会员信息 // 初始化自定义字段类 \Phpcmf\Service::L('field')->app(APP_DIR); //获取该组可用字段 $field = []; if ($this->member_cache['field'] && $hr['groupid']) { $fieldid = []; foreach ($hr['groupid'] as $gid) { $this->member_cache['group'][$gid]['field'] && $fieldid = dr_array2array($fieldid, $this->member_cache['group'][$gid]['field']); } if ($fieldid) { foreach ($this->member_cache['field'] as $fname => $t) { in_array($fname, $fieldid) && $field[$fname] = $t; } } } if (IS_POST) { $post = \Phpcmf\Service::L('input')->post('data'); \Phpcmf\Hooks::trigger('member_edit_before', $post); list($data, $return, $attach) = \Phpcmf\Service::L('form')->id($uid)->validation($post, null, $field, $hr); // 输出错误 if ($return) { $this->_json(0, $return['error'], ['field' => $return['name']]); } $data[1]['is_complete'] = 1; \Phpcmf\Service::M()->table('member')->update($uid,[ 'name' => $post['username'], 'username' => $post['username'], 'email' => $post['email'], 'phone' => $post['phone'], 'hrpwd' => $post['password'], 'password' => md5(dr_safe_password($post['password'])), ]); \Phpcmf\Service::M()->table('member_data')->update($uid, $data[1]); // 附件归档 SYS_ATTACHMENT_DB && $attach && \Phpcmf\Service::M('Attachment')->handle( $uid, \Phpcmf\Service::M()->dbprefix('member').'-'.$uid, $attach ); \Phpcmf\Hooks::trigger('member_edit_after', $data[1]); \Phpcmf\Service::L('cache')->del_data('member-info-'.$uid); \Phpcmf\Service::L('cache')->del_data('member-info-name-'.$hr['username']); $this->_json(1, dr_lang('保存成功'), IS_API_HTTP ? \Phpcmf\Service::M('member')->get_member($uid) : []); } \Phpcmf\Service::V()->assign([ 'form' => dr_form_hidden(), 'field' => $field, 'hr' => $hr, 'myfield' => \Phpcmf\Service::L('field')->toform($uid, $field, $hr), ]); \Phpcmf\Service::V()->display('agent_edit_'.get_member_groupid($this->member['groupid']).'.html'); }
public function edit(){ $uid = \Phpcmf\Service::L('input')->get('id'); //会员id $hr = dr_member_info($uid); //获取会员信息 // 初始化自定义字段类 \Phpcmf\Service::L('field')->app(APP_DIR); //获取该组可用字段 $field = []; if ($this->member_cache['field'] && $hr['groupid']) { $fieldid = []; foreach ($hr['groupid'] as $gid) { $this->member_cache['group'][$gid]['field'] && $fieldid = dr_array2array($fieldid, $this->member_cache['group'][$gid]['field']); } if ($fieldid) { foreach ($this->member_cache['field'] as $fname => $t) { in_array($fname, $fieldid) && $field[$fname] = $t; } } } if (IS_POST) { $post = \Phpcmf\Service::L('input')->post('data'); \Phpcmf\Hooks::trigger('member_edit_before', $post); list($data, $return, $attach) = \Phpcmf\Service::L('form')->id($uid)->validation($post, null, $field, $hr); // 输出错误 if ($return) { $this->_json(0, $return['error'], ['field' => $return['name']]); } $data[1]['is_complete'] = 1; \Phpcmf\Service::M()->table('member')->update($uid,[ 'name' => $post['username'], 'username' => $post['username'], 'email' => $post['email'], 'phone' => $post['phone'], 'hrpwd' => $post['password'], ]); \Phpcmf\Service::M('member')->edit_password(dr_member_info($uid), $post['password']); \Phpcmf\Service::M()->table('member_data')->update($uid, $data[1]); // 附件归档 SYS_ATTACHMENT_DB && $attach && \Phpcmf\Service::M('Attachment')->handle( $uid, \Phpcmf\Service::M()->dbprefix('member').'-'.$uid, $attach ); \Phpcmf\Hooks::trigger('member_edit_after', $data[1]); \Phpcmf\Service::L('cache')->del_data('member-info-'.$uid); \Phpcmf\Service::L('cache')->del_data('member-info-name-'.$hr['username']); $this->_json(1, dr_lang('保存成功'), IS_API_HTTP ? \Phpcmf\Service::M('member')->get_member($uid) : []); } \Phpcmf\Service::V()->assign([ 'form' => dr_form_hidden(), 'field' => $field, 'hr' => $hr, 'myfield' => \Phpcmf\Service::L('field')->toform($uid, $field, $hr), ]); \Phpcmf\Service::V()->display('agent_edit_'.get_member_groupid($this->member['groupid']).'.html'); }
具体修改页面