for more details. * * Copyright 2007-2010 Rejo Zenger * Copyright 2010-2014 Poweradmin Development Team * * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ /** * Script that handles requests to update and list users * * @package Poweradmin * @copyright 2007-2010 Rejo Zenger * @copyright 2010-2014 Poweradmin Development Team * @license http://opensource.org/licenses/GPL-3.0 GPL */ require_once("inc/toolkit.inc.php"); include_once("inc/header.inc.php"); verify_permission('user_view_others') ? $perm_view_others = "1" : $perm_view_others = "0"; verify_permission('user_edit_own') ? $perm_edit_own = "1" : $perm_edit_own = "0"; verify_permission('user_edit_others') ? $perm_edit_others = "1" : $perm_edit_others = "0"; verify_permission('templ_perm_edit') ? $perm_templ_perm_edit = "1" : $perm_templ_perm_edit = "0"; verify_permission('user_is_ueberuser') ? $perm_is_godlike = "1" : $perm_is_godlike = "0"; verify_permission('user_add_new') ? $perm_add_new = "1" : $perm_add_new = "0"; #if (isset($_GET['action']) && $_GET['action'] === "switchuser" && $perm_is_godlike === "1"){ # $_SESSION["userlogin"] = $_GET['username']; # echo ''; #} unset($commit_button); if (isset($_POST['commit'])) { foreach ($_POST['user'] as $user) { update_user_details($user); } } $users = get_user_detail_list(""); echo "

" . _('User administration') . "

\n"; echo "
\n"; echo " \n"; echo " \n"; echo " \n"; echo " \n"; echo " \n"; echo " \n"; echo " \n"; echo " \n"; if ($ldap_use) { echo " \n"; } echo " \n"; echo " \n"; foreach ($users as $user) { if ($user['active'] == "1") { $active = " checked"; } else { $active = ""; } if ($user['use_ldap'] == "1") { $use_ldap = " checked"; } else { $use_ldap = ""; } if (($user['uid'] == $_SESSION["userid"] && $perm_edit_own == "1") || ($user['uid'] != $_SESSION["userid"] && $perm_edit_others == "1" )) { $commit_button = "1"; echo " \n"; echo " \n"; echo " \n"; echo " \n"; echo " \n"; echo " \n"; echo " \n"; if ($ldap_use) { if (( $perm_is_godlike == "1")) { echo " \n"; } else { if ($use_ldap == " checked") { echo " \n"; } else { echo " \n"; } } } if ($user['uid'] != $_SESSION["userid"]) { echo " \n"; } else { echo " \n"; } echo " \n"; } else { echo " \n"; echo " \n"; echo " \n"; echo " \n"; echo " \n"; echo " \n"; echo " \n"; if ($active == " checked") { echo " \n"; } else { echo " \n"; } if ($use_ldap == " checked") { echo " \n"; } else { echo " \n"; } echo " \n"; } } echo "
 " . _('Username') . "" . _('Fullname') . "" . _('Description') . "" . _('Email address') . "" . _('Template') . "" . _('LDAP') . "" . _('Enabled') . "
\n"; echo " \n"; echo " \"[\n"; // do not allow to delete him- or herself if ($user['uid'] != $_SESSION["userid"]) { echo " \"["; } # if ($user['uid'] != $_SESSION["userid"] && $perm_is_godlike == "1") { # echo " \"[\n"; # } echo " \n"; if ($perm_templ_perm_edit == "1") { echo " \n"; } else { echo " \n"; echo " " . $user['tpl_name'] . "\n"; } echo " YesNo
 " . $user['username'] . "" . $user['fullname'] . "" . $user['descr'] . "" . $user['email'] . "" . $user['tpl_name'] . "YesNoYesNo
\n"; if (isset($commit_button) && $commit_button) { echo " \n"; echo " \n"; } echo "
\n"; if ($perm_templ_perm_edit == "1" || $perm_add_new == "1") { echo " \n"; } include_once("inc/footer.inc.php");