<?php

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

/**
 * Description of acl_user_delete_observer
 *
 * @author Igor Ratsun
 */
class acl_user_delete_observer implements SplObserver {
    
    public $users = array();

    #[\ReturnTypeWillChange]
    public function update(SplSubject $subject) {
        if ($subject->current_action == 'delete' && $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('Delete users'), implode('", "', $this->users)));

            $save->save();
        }
    }

}