id = $user_id; $user->email = get_input('admin_user_email_'.$user_id); $user->firstname = get_input('admin_user_firstname_'.$user_id); $user->lastname = get_input('admin_user_lastname_'.$user_id); $user->fullname = $user->firstname . " " . $user->lastname; $level = get_input('admin_user_level_'.$user_id); if ($level) { $user->level = $level; } else { $user->level = 1; } if ($user->approve()) { $Dippler->add_system_message(_("User approved.")); // Send message to user Mailer::sendAccountApproved($user); } else { $Dippler->add_system_message(_("User not approved."), 'error'); } } } else if (get_input('unapprove')) { foreach($admin_user as $user_id) { $user = new User(); $user->id = $user_id; if ($user->unapprove()) { $Dippler->add_system_message(_("User unapproved.")); } else { $Dippler->add_system_message(_("User not unapproved."), 'error'); } } } elseif (get_input('edit')) { foreach($admin_user as $user_id) { $user = new User(); $user->id = $user_id; $level = get_input('admin_user_level_'.$user_id); if ($level) { $user->level = $level; } else { $user->level = 1; } if ($user->changeRole()) { $Dippler->add_system_message(_("User role changed.")); } else { $Dippler->add_system_message(_("User role not changed."), 'error'); } } } elseif (get_input('delete')) { foreach($admin_user as $user_id) { $user = new User(); $user->id = $user_id; $user->load(); if ($user->deleteUser()) { $Dippler->add_system_message(sprintf(_("User %s removed."), $user->getFullname())); } else { $Dippler->add_system_message(sprintf(_("User account for %s could not be removed."), $user->getFullname()), 'error'); } } } else { $Dippler->add_system_message(_("No action."), 'error'); forward($forward_location); } } else { $Dippler->add_system_message(_("No users selected."), 'error'); forward($forward_location); } // Clear cache $Dippler->clearSessionInputValues(); forward($forward_location); ?>