コード例 #1
0
ファイル: showitem.role.php プロジェクト: bushvin/wingman
 * showitem.entity.php
 * 
 * showitem.entity dialog
 * 
 */
// enable or disable logging
error_reporting(E_ALL);
ini_set('display_errors', '1');
// 0 - disabled; 1 - enabled
//
$o = new role($data->data->id);
$o->details();
$sql = "SELECT `id`,CONCAT(`name`,' (',`login`,')') `name` FROM `##_auth_user` WHERE `deleted`='0' ORDER BY `name`;";
$DBO->query($sql);
$users = $DBO->result("objectlist");
$sql = "SELECT `a`.*, IF(IFNULL(`b`.`auth_role_id`,-1)>0,1,0) `applied`\n            FROM `##_auth_ace` `a`\n            LEFT JOIN `##_auth_acl` `b` ON (`b`.`auth_ace_id`=`a`.`id` AND `b`.`deleted`=0 AND `b`.`auth_role_id`=" . $o->get("id") . ")\n            WHERE `a`.`deleted`=0\n            ORDER BY `applied` desc, `a`.`name`;";
$DBO->query($sql);
$acl = $DBO->result("objectlist");
?>
<div class="title"><?php 
echo ucwords(ROLE_EDIT_ROLE);
?>
</div>
<div class="form">
    <div class="column">
        <div class="row name">
            <div class="caption"><?php 
echo ucwords(ROLE_NAME);
?>
<input type="hidden" id="id" value="<?php 
echo $o->get('id');
コード例 #2
0
ファイル: admin_roles.php プロジェクト: biow0lf/evedev-kb
    $search = slashfix($_POST['search']);
    $qry = DBFactory::getDBQuery();
    $qry->execute('select usr_login from kb3_user where usr_login like ' . "'%" . $search . "%'");
    while ($row = $qry->getRow()) {
        $hitlist[] = $row['usr_login'];
    }
    $smarty->assignByRef('role', $_POST['role']);
    $smarty->assignByRef('user', $hitlist);
    $smarty->assign('url', edkURI::page("admin_roles"));
    $page->addContext($menubox->generate());
    $page->setContent($smarty->fetch(get_tpl('admin_roles_assign')));
    $page->generate();
} elseif ($_POST['action'] == 'assign') {
    $qry = DBFactory::getDBQuery();
    $tmp = role::_get($_POST['role']);
    var_dump($tmp);
    #$qry->execute('select usr_login from kb3_user where usr_login like '."'%".$search."%'");
} elseif ($_POST['action'] == 'create') {
    $page->addContext($menubox->generate());
    $page->setContent('to be done');
    $page->generate();
} else {
    $hardcoded =& role::get(true);
    $softcoded =& role::get();
    $smarty->assignByRef('hroles', $hardcoded);
    $smarty->assignByRef('sroles', $softcoded);
    $smarty->assign('url', edkURI::page("admin_roles"));
    $page->addContext($menubox->generate());
    $page->setContent($smarty->fetch(get_tpl('admin_roles')));
    $page->generate();
}