0) { if (in_array($conf['guest_id'], $collection)) { array_push($page['errors'], l10n('UAM_Guest cannot be pwdreset')); $template->append('errors', l10n('UAM_Guest cannot be pwdreset')); } if (($conf['guest_id'] != $conf['default_user_id']) and in_array($conf['default_user_id'], $collection)) { array_push($page['errors'], l10n('UAM_Default user cannot be pwgreset')); $template->append('errors', l10n('UAM_Default user cannot be pwgreset')); } if (in_array($conf['webmaster_id'], $collection)) { array_push($page['errors'], l10n('UAM_Webmaster cannot be pwdreset')); $template->append('errors', l10n('UAM_Webmaster cannot be pwdreset')); } if (in_array($user['id'], $collection)) { array_push($page['errors'], l10n('UAM_You cannot pwdreset your account')); $template->append('errors', l10n('UAM_You cannot pwdreset your account')); } if (count($page['errors']) == 0) { if (isset($_POST['confirm_pwdreset']) and 1 == $_POST['confirm_pwdreset']) { foreach ($collection as $user_id) { UAM_Set_PwdReset($user_id); } array_push( $page['infos'], l10n_dec( 'UAM %d user pwdreseted', 'UAM %d users pwdreseted', count($collection) ) ); $template->append('infos', l10n_dec( 'UAM %d user pwdreseted', 'UAM %d users pwdreseted', count($collection))); foreach ($page['filtered_users'] as $filter_key => $filter_user) { if (in_array($filter_user['id'], $collection)) { unset($page['filtered_users'][$filter_key]); } } } else { array_push($page['errors'], l10n('UAM_You need to confirm pwdreset')); $template->append('errors', l10n('UAM_You need to confirm pwdreset')); } } } $template->set_prefilter('user_list', 'UAM_PwdReset_Prefilter'); } /** * UAM_PwdReset_Prefilter * Adds action field for password reset in user_list.tpl */ function UAM_PwdReset_Prefilter($content, &$smarty) { $search = '
{\'Deletions\'|@translate}
'; $addon = '
{\'UAM_PwdReset\'|@translate}
'; $replacement = $addon.$search; return str_replace($search, $replacement, $content); } } ?>