function publicAdminManager_list()
{
    checkPerm('view');
    require_once _base_ . '/lib/lib.table.php';
    $lang =& DoceboLanguage::createInstance('adminrules', 'framework');
    $lang =& DoceboLanguage::createInstance('public_admin_manager', 'framework');
    $aclManager = new DoceboACLManager();
    // get users to show --------------------------------------------------
    $admin_group_idst = $aclManager->getGroupST(ADMIN_GROUP_PUBLICADMIN);
    $arr_admin_idst = $aclManager->getGroupUMembers($admin_group_idst);
    $arr_admin_id = array_flip($aclManager->getArrUserST($arr_admin_idst));
    $pm =& PlatformManager::createInstance();
    $lms_is_active = $pm->isLoaded("lms");
    /*$cms_is_active = $pm->isLoaded("cms");*/
    // print table --------------------------------------------------------
    $table = new Table(Get::sett('visuItem'), $lang->def('_PUBLIC_ADMIN_USER'), $lang->def('_PUBLIC_ADMIN_USER'));
    $table->initNavBar('ini', 'link');
    $table->setLink('index.php?modname=public_admin_manager&op=view&ini=');
    $ini = $table->getSelectedElement();
    $GLOBALS['page']->add(getTitleArea($lang->def('_ADMIN_MANAGMENT'), 'admin_managmer', $lang->def('_ADMIN_MANAGMENT')) . '<div class="std_block">', 'content');
    $contentH = array($lang->def('_USERNAME'), '<img src="' . getPathImage() . 'admin_manager/man_pref.gif" alt="' . $lang->def('_ADMIN_PREFERENCES_TITLE', 'adminrules') . '" ' . 'title="' . $lang->def('_ADMIN_PREFERENCES_TITLE', 'adminrules') . '" />', '<img src="' . getPathImage() . 'admin_manager/man_menu.gif" alt="' . $lang->def('_ASSIGN_USERS', 'adminrules') . '" ' . 'title="' . $lang->def('_ASSIGN_USERS', 'adminrules') . '" />', '<img src="' . getPathImage() . 'directory/tree.gif" alt="' . $lang->def('_ASSIGN_USERS', 'adminrules') . '" ' . 'title="' . $lang->def('_ASSIGN_USERS', 'adminrules') . '" />');
    $typeH = array('', 'image', 'image', 'image');
    if ($lms_is_active) {
        $contentH[] = '<img src="' . getPathImage() . 'admin_manager/man_course.gif" alt="' . $lang->def('_ASSIGN_USERS', 'adminrules') . '" ' . 'title="' . $lang->def('_ASSIGN_USERS', 'adminrules') . '" />';
        $typeH[] = 'image';
    }
    $table->setColsStyle($typeH);
    $table->addHead($contentH);
    $maxItem = count($arr_admin_id) < $ini + Get::sett('visuItem') ? count($arr_admin_id) : $ini + Get::sett('visuItem');
    for ($index = $ini; $index < $maxItem; $index++) {
        $admin_userid = substr($arr_admin_id[$arr_admin_idst[$index]], 1);
        $rowContent = array($admin_userid);
        // Edit preferences
        $rowContent[] = '<a href="index.php?modname=public_admin_manager&amp;op=edit_preferences&amp;adminidst=' . $arr_admin_idst[$index] . '"
						 title="' . $lang->def('_ADMIN_PREFERENCES_TITLE', 'adminrules') . ' : ' . $admin_userid . '">' . '<img src="' . getPathImage() . 'admin_manager/man_pref.gif"' . ' alt="' . $lang->def('_ADMIN_PREFERENCES_TITLE', 'adminrules') . ' : ' . $admin_userid . '" /></a>';
        // Edit menu
        $rowContent[] = '<a href="index.php?modname=public_admin_manager&amp;op=edit_menu&amp;adminidst=' . $arr_admin_idst[$index] . '"
						 title="' . $lang->def('_ASSIGN_USERS', 'adminrules') . ' : ' . $admin_userid . '">' . '<img src="' . getPathImage() . 'admin_manager/man_menu.gif"' . ' alt="' . $lang->def('_ASSIGN_USERS', 'adminrules') . ' : ' . $admin_userid . '" /></a>';
        // Edit user
        $rowContent[] = '<a href="index.php?modname=public_admin_manager&amp;op=assign_tree&amp;adminidst=' . $arr_admin_idst[$index] . '"
		 					title="' . $lang->def('_ASSIGN_USERS', 'adminrules') . ' : ' . $admin_userid . '">' . '<img src="' . getPathImage() . 'directory/tree.gif" ' . 'alt="' . $lang->def('_ASSIGN_USERS', 'adminrules') . ' : ' . $admin_userid . '" /></a>';
        // Edit course
        if ($lms_is_active) {
            $rowContent[] = '<a href="index.php?modname=public_admin_manager&amp;op=edit_course&amp;adminidst=' . $arr_admin_idst[$index] . '&amp;load=1"
								 title="' . $lang->def('_ASSIGN_USERS', 'adminrules') . ' : ' . $admin_userid . '">' . '<img src="' . getPathImage() . 'admin_manager/man_course.gif"' . ' alt="' . $lang->def('_ASSIGN_USERS', 'adminrules') . ' : ' . $admin_userid . '" /></a>';
        }
        $table->addBody($rowContent);
    }
    $GLOBALS['page']->add($table->getTable() . $table->getNavBar($ini, count($arr_admin_id)), 'content');
    $GLOBALS['page']->add('</div>', 'content');
}
示例#2
0
function adminManager_list()
{
    checkPerm('view');
    require_once _base_ . '/lib/lib.table.php';
    $lang =& DoceboLanguage::createInstance('adminrules', 'framework');
    $aclManager = new DoceboACLManager();
    // get users to show --------------------------------------------------
    $admin_group_idst = $aclManager->getGroupST(ADMIN_GROUP_ADMIN);
    $arr_admin_idst = $aclManager->getGroupUMembers($admin_group_idst);
    $arr_admin_id = array_flip($aclManager->getArrUserST($arr_admin_idst));
    $usres_info =& $aclManager->getUsers($arr_admin_idst);
    $pm =& PlatformManager::createInstance();
    $lms_is_active = $pm->isLoaded("lms");
    $cms_is_active = $pm->isLoaded("cms");
    // print table --------------------------------------------------------
    $table = new Table(Get::sett('visuItem'), $lang->def('_ADMIN_USER'), $lang->def('_ADMIN_USER'));
    $table->initNavBar('ini', 'link');
    $table->setLink('index.php?modname=admin_manager&amp;op=view&amp;ini=');
    $ini = $table->getSelectedElement();
    $GLOBALS['page']->add(getTitleArea($lang->def('_ADMIN_MANAGMENT'), 'admin_managmer', $lang->def('_ADMIN_MANAGMENT')) . '<div class="std_block">', 'content');
    $contentH = array($lang->def('_USERNAME'), $lang->def('_EMAIL'), '<img src="' . getPathImage() . 'admin_manager/man_pref.gif" alt="' . $lang->def('_ADMIN_PREFERENCES_TITLE') . '" ' . 'title="' . $lang->def('_ADMIN_PREFERENCES_TITLE') . '" />', '<img src="' . getPathImage() . 'admin_manager/man_menu.gif" alt="' . $lang->def('_ASSIGN_USERS') . '" ' . 'title="' . $lang->def('_ADMIN_MENU_TITLE') . '" />', '<img src="' . getPathImage() . 'directory/tree.gif" alt="' . $lang->def('_ASSIGN_USERS') . '" ' . 'title="' . $lang->def('_ASSIGN_USERS') . '" />', '<img src="' . getPathImage() . 'admin_manager/lang_lang.gif" alt="' . $lang->def('_ASSIGN_USERS') . '" ' . 'title="' . $lang->def('_ASSIGN_USERS') . '" />');
    $typeH = array('', '', 'image', 'image', 'image', 'image');
    if ($lms_is_active) {
        $contentH[] = '<img src="' . getPathImage() . 'admin_manager/man_course.gif" alt="' . $lang->def('_ASSIGN_USERS') . '" ' . 'title="' . $lang->def('_ASSIGN_USERS') . '" />';
        $typeH[] = 'image';
    }
    if ($cms_is_active) {
        // Cms Pages
        $contentH[] = '<img src="' . getPathImage() . 'admin_manager/pagetree.png" alt="' . $lang->def('_ASSIGN_CMS_PAGES') . '" ' . 'title="' . $lang->def('_ASSIGN_CMS_PAGES') . '" />';
        $typeH[] = 'image';
        // Cms News
        $contentH[] = '<img src="' . getPathImage() . 'admin_manager/newstree.png" alt="' . $lang->def('_NEWS') . '" ' . 'title="' . $lang->def('_NEWS') . '" />';
        $typeH[] = 'image';
        // Cms Documents
        $contentH[] = '<img src="' . getPathImage() . 'admin_manager/docstree.png" alt="' . $lang->def('_ASSIGN_CMS_DOCS') . '" ' . 'title="' . $lang->def('_ASSIGN_CMS_DOCS') . '" />';
        $typeH[] = 'image';
        // Cms Media
        $contentH[] = '<img src="' . getPathImage() . 'admin_manager/mediatree.png" alt="' . $lang->def('_ASSIGN_CMS_MEDIA') . '" ' . 'title="' . $lang->def('_ASSIGN_CMS_MEDIA') . '" />';
        $typeH[] = 'image';
        // Cms Contents
        $contentH[] = '<img src="' . getPathImage() . 'admin_manager/contenttree.png" alt="' . $lang->def('_ASSIGN_CMS_CONTENT') . '" ' . 'title="' . $lang->def('_ASSIGN_CMS_CONTENT') . '" />';
        $typeH[] = 'image';
    }
    $table->setColsStyle($typeH);
    $table->addHead($contentH);
    $maxItem = count($arr_admin_id) < $ini + Get::sett('visuItem') ? count($arr_admin_id) : $ini + Get::sett('visuItem');
    for ($index = $ini; $index < $maxItem; $index++) {
        $admin_userid = substr($arr_admin_id[$arr_admin_idst[$index]], 1);
        $rowContent = array($admin_userid, $usres_info[$arr_admin_idst[$index]][ACL_INFO_EMAIL]);
        // Edit preferences
        $rowContent[] = '<a href="index.php?modname=admin_manager&amp;op=edit_preferences&amp;adminidst=' . $arr_admin_idst[$index] . '"
						 title="' . $lang->def('_ADMIN_PREFERENCES_TITLE') . ' : ' . $admin_userid . '">' . '<img src="' . getPathImage() . 'admin_manager/man_pref.gif"' . ' alt="' . $lang->def('_ADMIN_PREFERENCES_TITLE') . ' : ' . $admin_userid . '" /></a>';
        // Edit menu
        $rowContent[] = '<a href="index.php?modname=admin_manager&amp;op=edit_menu&amp;adminidst=' . $arr_admin_idst[$index] . '"
						 title="' . $lang->def('_ADMIN_MENU_TITLE') . ' : ' . $admin_userid . '">' . '<img src="' . getPathImage() . 'admin_manager/man_menu.gif"' . ' alt="' . $lang->def('_ADMIN_MENU_TITLE') . ' : ' . $admin_userid . '" /></a>';
        // Edit user
        $rowContent[] = '<a href="index.php?modname=admin_manager&amp;op=assign_tree&amp;adminidst=' . $arr_admin_idst[$index] . '"
		 					title="' . $lang->def('_ASSIGN_USERS') . ' : ' . $admin_userid . '">' . '<img src="' . getPathImage() . 'directory/tree.gif" ' . 'alt="' . $lang->def('_ASSIGN_USERS') . ' : ' . $admin_userid . '" /></a>';
        // Edit lang
        $rowContent[] = '<a href="index.php?modname=admin_manager&amp;op=edit_lang&amp;adminidst=' . $arr_admin_idst[$index] . '"
						 	title="' . $lang->def('_ASSIGN_USERS') . ' : ' . $admin_userid . '">' . '<img src="' . getPathImage() . 'admin_manager/lang_lang.gif"' . ' alt="' . $lang->def('_ASSIGN_USERS') . ' : ' . $admin_userid . '" /></a>';
        // Edit course
        if ($lms_is_active) {
            $rowContent[] = '<a href="index.php?modname=admin_manager&amp;op=edit_course&amp;adminidst=' . $arr_admin_idst[$index] . '&amp;load=1"
								 title="' . $lang->def('_ASSIGN_USERS') . ' : ' . $admin_userid . '">' . '<img src="' . getPathImage() . 'admin_manager/man_course.gif"' . ' alt="' . $lang->def('_ASSIGN_USERS') . ' : ' . $admin_userid . '" /></a>';
        }
        // Assign cms trees permissions
        if ($cms_is_active) {
            // Cms Pages
            $img = "<img src=\"" . getPathImage() . "admin_manager/pagetree.png\" alt=\"" . $lang->def("_ASSIGN_CMS_PAGES") . "\" ";
            $img .= "title=\"" . $lang->def("_ASSIGN_CMS_PAGES") . "\" />";
            $url = "index.php?modname=admin_manager&amp;op=assign_cmspag&amp;adminidst=" . $arr_admin_idst[$index];
            $rowContent[] = "<a href=\"" . $url . "\">" . $img . "</a>\n";
            // Cms News
            $img = "<img src=\"" . getPathImage() . "admin_manager/newstree.png\" alt=\"" . $lang->def("_NEWS") . "\" ";
            $img .= "title=\"" . $lang->def("_NEWS") . "\" />";
            $url = "index.php?modname=admin_manager&amp;op=assign_cmsnews&amp;adminidst=" . $arr_admin_idst[$index];
            $rowContent[] = "<a href=\"" . $url . "\">" . $img . "</a>\n";
            // Cms Documents
            $img = "<img src=\"" . getPathImage() . "admin_manager/docstree.png\" alt=\"" . $lang->def("_ASSIGN_CMS_DOCS") . "\" ";
            $img .= "title=\"" . $lang->def("_ASSIGN_CMS_DOCS") . "\" />";
            $url = "index.php?modname=admin_manager&amp;op=assign_cmsdocs&amp;adminidst=" . $arr_admin_idst[$index];
            $rowContent[] = "<a href=\"" . $url . "\">" . $img . "</a>\n";
            // Cms Media
            $img = "<img src=\"" . getPathImage() . "admin_manager/mediatree.png\" alt=\"" . $lang->def("_ASSIGN_CMS_MEDIA") . "\" ";
            $img .= "title=\"" . $lang->def("_ASSIGN_CMS_MEDIA") . "\" />";
            $url = "index.php?modname=admin_manager&amp;op=assign_cmsmedia&amp;adminidst=" . $arr_admin_idst[$index];
            $rowContent[] = "<a href=\"" . $url . "\">" . $img . "</a>\n";
            // Cms Contents
            $img = "<img src=\"" . getPathImage() . "admin_manager/contenttree.png\" alt=\"" . $lang->def("_ASSIGN_CMS_CONTENT") . "\" ";
            $img .= "title=\"" . $lang->def("_ASSIGN_CMS_CONTENT") . "\" />";
            $url = "index.php?modname=admin_manager&amp;op=assign_cmscontent&amp;adminidst=" . $arr_admin_idst[$index];
            $rowContent[] = "<a href=\"" . $url . "\">" . $img . "</a>\n";
        }
        $table->addBody($rowContent);
    }
    $GLOBALS['page']->add($table->getTable() . $table->getNavBar($ini, count($arr_admin_id)), 'content');
    $GLOBALS['page']->add('</div>', 'content');
}
示例#3
0
function savemembers()
{
    checkPerm('subscribe');
    require_once _base_ . '/lib/lib.userselector.php';
    $id_group = importVar('id_group', true, 0);
    $acl_man = new DoceboACLManager();
    $user_select = new UserSelector();
    $user_selected = $user_select->getSelection($_POST);
    $old_users = $acl_man->getGroupUMembers($id_group);
    $add_members = array_diff($user_selected, $old_users);
    $del_members = array_diff($old_users, $user_selected);
    $re = true;
    if ($user_selected === $old_users) {
        Util::jump_to('index.php?modname=groups&op=groups&result=ok');
        return;
    }
    if (count($add_members)) {
        while (list(, $idst_user) = each($add_members)) {
            $re &= $acl_man->addToGroup($id_group, $idst_user);
        }
    }
    if (count($del_members)) {
        while (list(, $idst_user) = each($del_members)) {
            $re &= $acl_man->removeFromGroup($id_group, $idst_user);
        }
    }
    if (!$re) {
        Util::jump_to('index.php?modname=groups&op=groups&result=err');
    }
    Util::jump_to('index.php?modname=groups&op=groups&result=ok');
}