root/dev/common/admin/admin_roles.php

Revision 361, 1.4 KB (checked in by beans, 14 years ago)

* Updated the admin panel. Should now be more "easy" to use.

Line 
1<?php
2$page = new Page();
3$page->setAdmin();
4$page->setTitle('Administration - Role Management');
5
6if ($_REQUEST['action'] == 'search')
7{
8    $hitlist = array();
9    $search = slashfix($_REQUEST['search']);
10    $qry = new DBQuery();
11    $qry->execute('select usr_login from kb3_user where usr_login like '."'%".$search."%'");
12    while ($row = $qry->getRow())
13    {
14        $hitlist[] = $row['usr_login'];
15    }
16
17    $smarty->assign_by_ref('role', $_REQUEST['role']);
18    $smarty->assign_by_ref('user', $hitlist);
19
20    $page->addContext($menubox->generate());
21    $page->setContent($smarty->fetch(get_tpl('admin_roles_assign')));
22    $page->generate();
23}
24elseif ($_REQUEST['action'] == 'assign')
25{
26    $qry = new DBQuery();
27    $tmp = role::_get($_REQUEST['role']);
28    var_dump($tmp);
29    #$qry->execute('select usr_login from kb3_user where usr_login like '."'%".$search."%'");
30}
31elseif ($_REQUEST['action'] == 'create')
32{
33    $page->addContext($menubox->generate());
34    $page->setContent('to be done');
35    $page->generate();
36}
37else
38{
39    $hardcoded = &role::get(true);
40    $softcoded = &role::get();
41
42    $smarty->assign_by_ref('hroles', $hardcoded);
43    $smarty->assign_by_ref('sroles', $softcoded);
44
45    $page->addContext($menubox->generate());
46    $page->setContent($smarty->fetch(get_tpl('admin_roles')));
47    $page->generate();
48}
49?>
Note: See TracBrowser for help on using the browser.