<?php if (!defined('BASEPATH')) exit('No direct script access allowed');

/**
 * Description of acl_user_edit_observer
 *
 * @author Igor Ratsun
 */
class acl_user_edit_observer implements SplObserver {

    #[\ReturnTypeWillChange]
    public function update(SplSubject $subject) {
        if ($subject->current_action == 'rtgrid_action_save' && $subject->current_action_return) {
            $CI = & get_instance();
            $CI->load->helper('ciext/observer');
            $CI->lang->load('ciext/observers/acl_user');
            $save = new saveObserver();
            $save->set_access('acl', 'edit_user');
            $save->set_text(sprintf($CI->lang->line('Change user data'), $subject->post['login']));
            $save->save();
        }
    }

}