Ejemplo n.º 1
0
    $DB =& ADONewConnection(DB_TYPE);
    $result = $DB->Connect(DB_SERVER, DB_USERNAME, DB_PASSWORD, DB_NAME);
    if (!$result) {
        echo 'Initialise: Cannot connect to database. Check database configuration. Application stopped.';
        // TODO: isolate message to language file
        exit;
    }
    $DB->debug = OOO_DEBUG ? true : false;
    // get system configuration from db
    include_once OOO_CORE . '/SystemConfig.php';
    $systemconfig = new SystemConfig();
    $config['theme'] = $systemconfig->getThemesByDB($DB);
    $config['lang'] = $systemconfig->getLangByDB($DB, $_SESSION["session_lang"]);
    include_once OOO_CORE . '/Config.php';
    include_once OOO_CORE . '/gui/SmartyUtil.php';
    $smartyutil = new SmartyUtil();
    $configobject = new Config($DB);
    $arr_data = $configobject->selectAllConfig();
    $arr_config = $smartyutil->toSmartyArray($arr_data, 'config_value', 'config_name');
}
// configuration of phpgacl
if (OOO_USEGACL) {
    $gacl_options = array('items_per_page' => 100, 'max_select_box_items' => 100, 'max_search_return_items' => 200, 'db_type' => DB_TYPE, 'db_host' => DB_SERVER, 'db_user' => DB_USERNAME, 'db_password' => DB_PASSWORD, 'db_name' => DB_NAME, 'db_table_prefix' => 'ooo_', 'caching' => FALSE, 'force_cache_expire' => TRUE, 'cache_dir' => '/tmp/phpgacl_cache', 'cache_expire_time' => 600);
    $gacl_options['debug'] = OOO_DEBUG ? true : false;
}
// Language data file
include_once OOO_APP_THEMES . $config['theme']['dir'] . '/languages' . $config['lang']['dir'] . '/data.php';
// URI manager
include_once OOO_CORE . '/Uri.php';
$uri = new Uri();
// Set document content type
$gacl_api = new gacl_api($gacl_options);
$id = $gacl_api->get_group_id($group_id, $group_id, 'ARO');
//aro group_id
$arr_user = $gacl_api->get_group_objects($id, 'aro');
//aro object value
$group = new usergroup($DB);
if (is_array($arr_user)) {
    if (count($arr_user)) {
        $arr_in = $group->selectInUser($arr_user['users'], 1);
        $arr_out = $group->selectInUser($arr_user['users'], 0);
    } else {
        $user = new user($DB);
        $arr_out = $user->selectAlluser(1000, 1);
    }
}
$smartyutil = new SmartyUtil();
$arr_newin = $smartyutil->toSmartyArray($arr_in, 'name', 'id');
$arr_newout = $smartyutil->toSmartyArray($arr_out, 'name', 'id');
$form = new Form('form1', 'index.php', 'post');
$form->addRule('select_all(document.form1.select2);');
$select1 =& $form->addElement('select');
$select1->setAttribute('id', 'select1');
$select1->setAttribute('name', 'newuser[]');
$select1->setAttribute('option', $arr_newout);
$select1->setAttribute('extra', 'multiple');
$select2 =& $form->addElement('select');
$select2->setAttribute('id', 'select2');
$select2->setAttribute('name', 'user[]');
$select2->setAttribute('option', $arr_newin);
$select2->setAttribute('extra', 'multiple');
$allleft =& $form->addElement('button');