A5下载文章资讯

分类分类

ecshop管理员密码修改邮件通知

2015-04-10 09:18作者:zhao

修改前,请先解决ecshop邮件模板的一个bug:http://down.admin5.com/info/2015/0410/119846.html

一、执行SQL,注意默认表前缀“ecs_”。

INSERT INTO `ecs_mail_templates` (`template_code`, `is_html`, `template_subject`, `template_content`, `last_modify`, `last_send`, `type`) VALUES

('modify_admin_password', 1, '管理员密码修改通知', '<p>{$user_name}:<br />n<br />n您的密码已修改,请妥善保管!忘记密码,请<a target="_blank" href="{$reset_pwd_url}">点击重置</a>。 <br />n<br />n{$shop_name}<br />n{$send_time}</p>', 0, 0, 'template');

二、编辑/admin/privilege.php

//更新管理员信息

if($pwd_modified)

{

$sql = "UPDATE " .$ecs->table('admin_user'). " SET ".

"user_name = '$admin_name', ".

"email = '$admin_email', ".

"ec_salt = '$ec_salt' ".

$action_list.

$role_id.

$password.

$nav_list.

"WHERE user_id = '$admin_id'";

$db->query($sql);

//发送邮件

$template = get_mail_template('modify_admin_password');

$reset_pwd_url = $ecs->url() . ADMIN_PATH . '/get_password.php?act=forget_pwd';

$smarty->assign('user_name', $admin_name);

$smarty->assign('reset_pwd_url', $reset_pwd_url);

$smarty->assign('shop_name', $_CFG['shop_name']);

$smarty->assign('send_time', local_date($_CFG['time_format']));

$content = $smarty->fetch('str:' . $template['template_content']);

send_mail($admin_name, $admin_email, $template['template_subject'], $content, $template['is_html']);

}

else

{

$sql = "UPDATE " .$ecs->table('admin_user'). " SET ".

"user_name = '$admin_name', ".

"email = '$admin_email' ".

$action_list.

$role_id.

$nav_list.

"WHERE user_id = '$admin_id'";

$db->query($sql);

}

/* 记录管理员操作 */

admin_log($_POST['user_name'], 'edit', 'privilege');

三、编辑/languages/zh_cn/admin/mail_template.php,添加语言项

$_LANG['modify_admin_password'] = '管理员密码修改通知模板';

展开全部

相关

说两句网友评论
    我要跟贴
    取消