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

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

添加管理员:

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

 

posted @ 2014-10-10 13:48  美味101  阅读(695)  评论(0编辑  收藏  举报