码迷,mamicode.com
首页 > 其他好文 > 详细

ecshop——商城禁止修改管理员邮箱

时间:2014-10-10 16:45:43      阅读:160      评论:0      收藏:0      [点我收藏+]

标签:style   blog   http   color   io   ar   sp   div   2014   

1.点击修改密码的时候,邮箱为只读状态,增加管理员的时候为可编辑状态。

bubuko.com,布布扣

添加管理员:

bubuko.com,布布扣

一、/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‘";
}
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‘";
}

  

修改为

//更新管理员信息
if($pwd_modified)
{
$sql = "UPDATE " .$ecs->table(‘admin_user‘). " SET ".
   "user_name = ‘$admin_name‘, ".
   "ec_salt = ‘$ec_salt‘ ".
   $action_list.
   $role_id.
   $password.
   $nav_list.
   "WHERE user_id = ‘$admin_id‘";
}
else
{
$sql = "UPDATE " .$ecs->table(‘admin_user‘). " SET ".
   "user_name = ‘$admin_name‘ ".
   $action_list.
   $role_id.
   $nav_list.
   "WHERE user_id = ‘$admin_id‘";
}

  

二、/admin/templates/privilege_info.htm中email文本框添加只读属性,将以下代码

<input type="text" name="email" value="{$user.email|escape}" size="34" />{$lang.require_field} 

修改为

 <input type="text" name="email" value="{$user.email|escape}" size="34" {if $action eq "modif"} readonly="readonly" {/if}/>{$lang.require_field}

  

三、/languages/zh_cn/admin/privilege.php中添加

$_LANG[‘unchangeable‘] =  ‘<span class="cannot_mofify">不可修改</span>‘;

  

四、/admin/styles/main.css中添加

span.cannot_mofify {
  margin-left: 1em;
  font: 12px verdana;
  color: #FF0000;
}

自己调整下

privilege_info.htm里emall 只读哪里更改下

ecshop——商城禁止修改管理员邮箱

标签:style   blog   http   color   io   ar   sp   div   2014   

原文地址:http://www.cnblogs.com/meiwei101/p/4015695.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!