コード例 #1
0
            $_POST['port'] = 1521;
            break;
        case 'LDAP':
            $_POST['port'] = 389;
            break;
        case 'LDAPS':
            $_POST['port'] = 636;
            break;
        case 'ADAM':
            $_POST['port'] = 389;
            break;
    }
}
$form_name = ucfirst('add_datasource') . ucfirst('network');
$tpl['PUT:DataSourceType'] = sumo_put_datasources_type($_POST['type'], $form_name);
$tpl['PUT:EncType'] = sumo_put_datasources_enctype($_POST['enctype'], $_POST['type']);
$tpl['PUT:DataSourceName'] = "<input type='text' size='35' name='name' value='" . $_POST['name'] . "'>";
$tpl['PUT:DataSourceHost'] = "<input type='text' size='35' name='host' value='" . $_POST['host'] . "'>";
$tpl['PUT:DataSourcePort'] = "<input type='text' size='7' name='port' value='" . $_POST['port'] . "'>";
$tpl['PUT:DataSourceUser'] = "******" . $_POST['user'] . "'>";
$tpl['PUT:DataSourcePassword'] = "******" . $_POST['password'] . "'>";
$tpl['PUT:DataSourceRePassword'] = "******";
$tpl['PUT:DBName'] = "<input type='text' size='25' name='db_name' value='" . $_POST['db_name'] . "'>";
$tpl['PUT:DBTable'] = "<input type='text' size='35' name='db_table' value='" . $_POST['db_table'] . "'>";
$tpl['PUT:DBFieldUser'] = "******" . $_POST['db_field_user'] . "'>";
$tpl['PUT:DBFieldPassword'] = "******" . $_POST['db_field_password'] . "'>";
$tpl['PUT:LDAPBase'] = "<input type='text' size='35' name='ldap_base' value='" . $_POST['ldap_base'] . "'>";
$tpl['BUTTON:Cancel'] = "<input type='button' class='button-red' value='" . $language["Cancel"] . "' onclick='javascript:sumo_ajax_get(\"network\",\"?module=network&action=dlist\");'>";
$tpl['GET:Form'] = sumo_get_form_req('', 'add_datasource');
$tpl['LINK:Add'] = sumo_get_action_icon('', "add_datasource");
$tpl['LINK:Edit'] = sumo_get_action_icon('', "edit_datasource");
コード例 #2
0
        $tab['port'] = '';
        $tab['db_name'] = '';
        $tab['db_table'] = '';
        $tab['db_field_user'] = '';
        $tab['db_field_password'] = '';
        break;
}
if ($_GET['id'] == 1) {
    $tpl['MESSAGE:M'] = $language['CannotModifyDataSource'];
}
$form_name = ucfirst('modify_datasource') . ucfirst('network');
$msg = sumo_get_simple_rand_string(4, "123456789");
$delete = "<div class='sub-module-icon' " . "onmouseover='this.style.outline=\"1px solid #999999\";this.style.background=\"#FFFFFF\"' " . "onmouseout='this.style.outline=\"\";this.style.background=\"\"'>" . "<a href=\"javascript:" . "sumo_show_message('msg{$msg}', '" . htmlspecialchars(sumo_get_message('AreYouSureDeleteDataSource', $tab['name'])) . "', \n\t\t\t\t\t\t\t 'h', 0, \n\t\t\t\t\t\t\t '" . base64_encode(sumo_get_form_req('', 'erase_datasource', 'id=' . $tab['id'])) . "',\n\t\t\t\t\t\t\t '" . base64_encode('') . "',\n\t\t\t\t\t\t\t '" . base64_encode("<input type='button' value='" . $language['Cancel'] . "' onclick='javascript:sumo_remove_window(\"msg{$msg}\");' class='button'>") . "',\n\t\t\t\t\t\t\t '" . base64_encode("<input type='submit' value='" . $language['Ok'] . "' onclick='javascript:sumo_remove_window(\"msg{$msg}\");' class='button'>") . "'\n\t\t\t\t\t\t\t);\">" . "<img src='themes/" . $SUMO['page']['theme'] . "/images/modules/network/remove_datasource.png' vspace='4'><br>" . $language['Remove'] . "</a>" . "</div>";
$tpl['GET:Form'] = sumo_get_form_req('', 'modify_datasource', 'id=' . $tab['id']);
$tpl['PUT:DataSourceType'] = sumo_put_datasources_type($type, $form_name);
$tpl['PUT:EncType'] = sumo_put_datasources_enctype($tab['enctype'], $type);
$tpl['PUT:DataSourceName'] = "<input type='text' size='35' name='name' value='" . $tab['name'] . "'>";
$tpl['PUT:DataSourceHost'] = "<input type='text' size='35' name='host' value='" . $tab['host'] . "'>";
$tpl['PUT:DataSourcePort'] = "<input type='text' size='7' name='port' value='" . $tab['port'] . "'>";
$tpl['PUT:DataSourceUser'] = "******" . $tab['username'] . "'>";
$tpl['PUT:DataSourcePassword'] = "******" . $tab['password'] . "'>";
$tpl['PUT:DataSourceRePassword'] = "******" . $tab['password'] . "'>";
$tpl['PUT:DBName'] = "<input type='text' size='25' name='db_name' value='" . $tab['db_name'] . "'>";
$tpl['PUT:DBTable'] = "<input type='text' size='35' name='db_table' value='" . $tab['db_table'] . "'>";
$tpl['PUT:DBFieldUser'] = "******" . $tab['db_field_user'] . "'>";
$tpl['PUT:DBFieldPassword'] = "******" . $tab['db_field_password'] . "'>";
$tpl['PUT:LDAPBase'] = "<input type='text' size='35' name='ldap_base' value='" . $tab['ldap_base'] . "'>";
$tpl['BUTTON:Cancel'] = "<input type='button' class='button-red' value='" . $language["Cancel"] . "' onclick='javascript:sumo_ajax_get(\"network\",\"?module=network&action=view_datasource&id=" . $tab['id'] . "\");'>";
$tpl['LINK:Add'] = sumo_verify_permissions(4, 'sumo') ? sumo_get_action_icon("", "add_datasource", "network.content", "?module=network&action=new_datasource&decoration=false") : sumo_get_action_icon("", "add_datasource");
$tpl['LINK:Edit'] = sumo_get_action_icon("", "edit_datasource");
$tpl['LINK:Remove'] = sumo_verify_permissions(4, 'sumo') && $tab['id'] > 1 ? $delete : sumo_get_action_icon("", "remove_datasource");