fixed not working rename of account_lid with admin/admin-cli.php, corrupted sqlfs (overwrite /home)

This commit is contained in:
Ralf Becker 2010-04-21 12:28:27 +00:00
parent 69da1000b2
commit 938b7cf391
2 changed files with 5 additions and 2 deletions

View File

@ -57,6 +57,7 @@ class admin_cmd_edit_user extends admin_cmd_change_pw
if ($this->account) // existing account
{
$data['account_id'] = admin_cmd::parse_account($this->account);
$data['old_loginid'] = admin_cmd::$accounts->id2name($data['account_id']);
}
if (!$data['account_lid'] && (!$this->account || !is_null($data['account_lid'])))
{

View File

@ -61,8 +61,10 @@ class vfs_home_hooks
static function editAccount($data)
{
if (self::LOG_LEVEL > 0) error_log(__METHOD__.'('.array2string($data).')');
if ($data['account_lid'] == $data['old_loginid']) return; // nothing to do here
if (empty($data['account_lid']) || empty($data['old_loginid']) || $data['account_lid'] == $data['old_loginid'])
{
return; // nothing to do here
}
// rename the user-dir
egw_vfs::$is_root = true;
egw_vfs::rename('/home/'.$data['old_loginid'],'/home/'.$data['account_lid']);