DLSconnect Drupal 6 module allows to intgrate drupal with DLS (Distance Learning System) Servers.

This is a very special module and maybe used for only one or a few customers of the company e/t/s (see DLS-link above). But it's a demonstration of a strategy to secure SOAP communications with short time passwords which are pushed into a LDAP database where the DLS Server is checking the passwords from the other side.

For the LDAP operations a custom hook can be used maybe for direct PHP LDAP commands or the API of LDAPcontrol module can be used.

The modules DLSconnect and LDAPcontrol are already used on the Q-Online community platform (more information on sandbox page).

Quicklinks:

New Reviews of other projects:

Reviews of other projects:

Comments

dirk.westrup’s picture

Hi,

we are already using this module to connect our community with a DLS server (www.q-online.de). The module works fine, the short time passwords (nearly one time, because it is only valid through one soap request and randomly changed afterwards) help us to protect our Drupal installation, because some DLS Server are not configured for using a SSL connection.

So, I hope, that permission will be granted to create a full dlsconnect project.

Kind regards,
Dirk

klausi’s picture

Status: Needs review » Needs work

* Git release branch missing, see http://drupal.org/node/1015226
* lines in README.txt should not exceed 80 characters
* Remove all old CVS $Id tags, not needed anymore
* "// special client soap user: have to be created manually on DLS server" comments should be on their own line, start capitalized and end with ".", see http://drupal.org/node/1354#inline
* "$parameters = array( 'ApiLogin' => $apilogin," the first array entry should be on a separate line
* dlsconnect_init(): Are you sure you need hook_init()? It is called on literally every page request, even if your module is not needed on that page.

c-logemann’s picture

Assigned: Unassigned » c-logemann

Hello klausi,
I will work on all points and report here.

Thank you for the review!
Carsten

misc’s picture

@C_Logemann has been contacted to ask if the application is abandoned.

After ten weeks with a status of needs work: the applicant may be contacted by a reviewer to determine whether the application was indeed abandoned. The action taken by the reviewer should be documented in the project application issue.

http://drupal.org/node/894256

c-logemann’s picture

Hello,
sorry I was very busy in other customer projects.
Now I am working on this module again.
kind regards
Carsten

c-logemann’s picture

Status: Needs work » Needs review

Everything of #2 is fixed except for the last point:

* dlsconnect_init(): Are you sure you need hook_init()? It is called on literally every page request, even if your module is not needed on that page.

You are right with avoiding hook_init(). I have a new strategy to handle settings but this will have an influence on the webproject where dlsconnect is already in use. So this is my plan for the future:

  • I will left hook_init() for in the current branch 6.x-1.x and will only create a dev build.
  • In a new branch (6.x-2.x) I will make a lot of changes and move code to an API project. This will be the base for dlsconnect and a moodle integration I am currently working on. There I will try to avoid hook_init().
patrickd’s picture

Assigned: c-logemann » Unassigned

Please don't assign the issue to your self, only the current reviewer should do this.

Sorry for the delay,
as there are currently many applications in queue we need more reviewers,
so think about getting a review bonus and we will come back to your application sooner.

c-logemann’s picture

Issue summary: View changes

added pareview direct link

c-logemann’s picture

Issue tags: +PAreview: review bonus

added PAReview: review bonus

itsekhmistro’s picture

Hi,

There are still some errors in automated review http://ventral.org/pareview/httpgitdrupalorgsandboxclogemann1245466git :

FILE: ...st_candidate/dlsconnect_feature/dlsconnect_feature.features.content.inc
--------------------------------------------------------------------------------
FOUND 2 ERROR(S) AFFECTING 2 LINE(S)
--------------------------------------------------------------------------------
195 | ERROR | Array indentation error, expected 4 spaces but found 0
327 | ERROR | Array indentation error, expected 4 spaces but found 0
--------------------------------------------------------------------------------

Manual review:

1) The function dlsconnect_block

case 'list':
      $blocks[0]['info'] = t('DLS client information');
      $blocks[1]['info'] = t('DLS group information');
      $blocks[2]['info'] = t('DLS user links (SSO)');
      return $blocks;

It doesn't look as a good idea to identify these blocks by number. Please, to prevent confilcts define some const like
define('DSLCONNECT_CLIENT_INFO', 'dslconnect_client_info');
and make it like

      $blocks[DSLCONNECT_CLIENT_INFO]['info'] = t('DLS client information');

2) the function dlsconnect_init

 // Activate default function.
  $settings = dlsconnect_dlsconnect_settings();
  foreach (module_implements('dlsconnect_settings') as $module) {

    // Override if hook_ldapimp_db is set other modules,
    // mostly one custom.module.
    if ($module != 'dlsconnect') {
      $settings = module_invoke($module, 'dlsconnect_settings');
    }
  }

It probably makes sence to replace it with drupal_alter(...), don't you think?

Apart from mentioned, it looks ok for me.

c-logemann’s picture

@itsekhmistro
Thank you for reviewing.

* About major changes in this module
As described in comment #6 the module is already used in a productive project and I will do no major changes in branch 6.x-1.x.
There will be a new Branch 6.x-2.x in near future but there is currently no active test system.
Testing and developing of this module needs some special infrastructure (LDAP-Server and a DLS-Server).
The old test system at my customers infrastructure is not longer available and a new is not ready yet.
The new thing concerning comment #6 is another strategy of Moodle integration. See MOODLEconnect Sandbox: http://drupal.org/sandbox/C_Logemann/1460070

* About the reported errors in dlsconnect_feature.features.content.inc
The analyzer is reporting "Array indentation error". But this is the content of an exported cck field which needs a line break as a delimiter of the next option.
I already discussed this with Patrick. In his opinion I don't have to fix coding issues of features.
In the next version I will remove the features submodule and will make the usage of content types and fields more flexible as I already realized in MOODLEconnect.

* About dlsconnect_block
I think it's normal block programming in Drupal 6. Are you sure that this new and good D7 strategy is working in D6?
http://api.drupal.org/api/drupal/developer%21hooks%21core.php/function/h...

* About hook_init()
In MOODLEconnect I have already changed this strategy. I will also avoid hook_init() this in the next version. drupal_alter() is new to me. I will take a look, how this can help.

c-logemann’s picture

Issue summary: View changes

Added "Reviews of other projects"

c-logemann’s picture

Issue summary: View changes

Review link added

misc’s picture

I do not think that you have to take care of the errors that the Feature module creates.

I have to agree with @itsekhmistro on dlsconnect_block - here you could get conflicts with other modules.

c-logemann’s picture

@MiSc and @itsekhmistro,
can you give me an example where this strategy is used in a Drupal 6 module.
Even D6 core modules are working in this way. For example the user.module (comments and blank lines removed):

if ($op == 'list') {
    $blocks[0]['info'] = t('User login');
    $blocks[0]['cache'] = BLOCK_NO_CACHE;
    $blocks[1]['info'] = t('Navigation');
    $blocks[1]['cache'] = BLOCK_NO_CACHE;
    $blocks[2]['info'] = t('Who\'s new');
    $blocks[3]['info'] = t('Who\'s online');
    $blocks[3]['cache'] = BLOCK_NO_CACHE;
    return $blocks;
  }
itsekhmistro’s picture

According to http://api.drupal.org/api/drupal/developer%21hooks%21core.php/function/h...

In hook_block(), each block your module provides is given a unique identifier referred to as "delta" (the array key in the return value for the 'list' operation). Delta values only need to be unique within your module, and they are used in the following ways:

Passed into the other hook_block() operations as an argument to identify the block being configured or viewed.
Used to construct the default HTML ID of "block-MODULE-DELTA" applied to each block when it is rendered (which can then be used for CSS styling or JavaScript programming).
Used to define a theming template suggestion of block__MODULE__DELTA, for advanced theming possibilities.
The values of delta can be strings or numbers, but because of the uses above it is preferable to use descriptive strings whenever possible, and only use a numeric identifier if you have to (for instance if your module allows users to create several similar blocks that you identify within your module code with numeric IDs).

The values of delta can be strings or numbers, but because of the uses above it is preferable to use descriptive strings whenever possible, and only use a numeric identifier if you have to (for instance if your module allows users to create several similar blocks that you identify within your module code with numeric IDs).

It's only a suggestion.

itsekhmistro’s picture

According to http://api.drupal.org/api/drupal/developer%21hooks%21core.php/function/h...

In hook_block(), each block your module provides is given a unique identifier referred to as "delta" (the array key in the return value for the 'list' operation). Delta values only need to be unique within your module, and they are used in the following ways:

Passed into the other hook_block() operations as an argument to identify the block being configured or viewed.
Used to construct the default HTML ID of "block-MODULE-DELTA" applied to each block when it is rendered (which can then be used for CSS styling or JavaScript programming).
Used to define a theming template suggestion of block__MODULE__DELTA, for advanced theming possibilities.
The values of delta can be strings or numbers, but because of the uses above it is preferable to use descriptive strings whenever possible, and only use a numeric identifier if you have to (for instance if your module allows users to create several similar blocks that you identify within your module code with numeric IDs).

The values of delta can be strings or numbers, but because of the uses above it is preferable to use descriptive strings whenever possible, and only use a numeric identifier if you have to (for instance if your module allows users to create several similar blocks that you identify within your module code with numeric IDs).

It's only a suggestion.

c-logemann’s picture

Ok, using descriptive strings is possible in drupal 6.
I think it's a good strategy to avoid conflicts in a module especially if you are using more than 3 blocks.
I will keep this in mind for future versions and other projects.
But there is no risk of conflict with other modules:
Delta values only need to be unique within your module

c-logemann’s picture

Issue summary: View changes

Added a review link.

c-logemann’s picture

Issue summary: View changes

improvement of description and added git clone command

misc’s picture

I stand corrected.

klausi’s picture

Status: Needs review » Needs work
Issue tags: -PAreview: review bonus +PAreview: security

manual review:

  1. if you require nusoap then you should implement hook_requirements() to check if it is available. Also, why don't you rely on the more common PHP SOAP?
  2. "variable_del('ldapprov_debug');": all your variables need to be prefixed with the name of your module to avoid name collissions.
  3. "$settings['soaplib'] = 'sites/all/libraries/nusoap/lib/nusoap.php';": do not hardcode that library path. The Libraries API module is a recommended method for adding 3rd party dependencies without directly including the code on Drupal.org.
  4. _dlsconnect_pass(): Yep, you should really use drupal_alter(), so that other modules can change what you provide on default.
  5. If your module invokes its own hooks you should provide an .api.php file for documentation and usage of those. See http://drupal.org/node/161085#api_php
  6. dlsconnect_dlsconnect_actions(): empty return statement at the end of a function is not needed. Also elsewhere.
  7. "t('Soapuser exists in DB and LDAP with DLS name: ') . $dlsusercreate": do not concatenate translatable strings, use placeholders instead. Also elsewhere.
  8. "drupal_set_message(t('There is a Problem with creating DLS name for Soap User: '), 'warning');": does not contain a user after the ":"?
  9. _dlsconnect_page_client_deletegroups_confirm(): All the markup should probably go to a theme function, so that it can be overridden.
  10. "$output .= '<li class="dlsconnect-listitem-clientname">' . t('DLS client') . ': ' . $clientdata['title'] . '</li>';": this is vulnerable to XSS exploits if the title contains script tags or what not. You must sanitize user provided input before printing it, see http://drupal.org/node/28984
  11. _dlsconnect_page_client_deletegroups_confirm(): use theme('item_list', ...) to build list markup.
  12. Instead of using _dlsconnect_page_error_access() you could just use drupal_access_denied().
  13. dlsconnect_admin_settings_submit(): the second declaration of $values is never used.
  14. dlsconnect_admin_settings(): you could use system_settings_form() here, then you don't need the submit callback.

Removing review bonus tag, you can add it again if you have done another 3 reviews of other projects.

c-logemann’s picture

@klausi,
Thank you for your manual review work.

This was my first development project with SOAP and I started this module with coding examples of the DLS Programmers based on NUSOAP. On my next project with SOAP I will keep PHP SOAP in mind. But I will work on a better integration with libraries and the other problems you found.

Comment #17 list to organize my work:

  • sub issue 1
  • sub issue 2
  • sub issue 3
  • sub issue 4 Won't fix, see comment #19
  • sub issue 5
  • sub issue 6
  • sub issue 7
  • sub issue 8 Removed the ':' because in this case there is any DLS name. This is a warning message.
  • sub issue 9
  • sub issue 10 check_plain() inserted in _dlsconnect_clientdata()
  • sub issue 11
  • sub issue 12
  • sub issue 13
  • sub issue 14 Very helpful hint: especially for extending the settings.
c-logemann’s picture

About my hook strategy

I have checked all my own hooks and currently I don't see any case where drupal_alter() is needed. The concept these hooks is to provide a possibility of special configuration in a custom module (see README.txt and drupalconnect.api.php).
If somebody has an idea of another contrib module based on this I can change my strategy.
The password generation hook is build on a special security idea or improving performance with lower security. But a modification is not needed at this time and I have removed this.

Complete change of settings strategy

  • removed dlsconnect_dlsconnect_settings and imporved admin_settings
  • removed dlsconnect_init() removed (see comment #2)
  • changeable cck fields and features submodule removed (see comment #9)
c-logemann’s picture

Status: Needs work » Needs review

And finally a complete rewrite of each output with theme functions.

There is currently a Test System with LDAP and DLS Server connected. So if someone wants to check this module working I can provide access to this test system.

c-logemann’s picture

Issue summary: View changes

The module is used on production site

c-logemann’s picture

Issue summary: View changes

Added next review

c-logemann’s picture

Issue summary: View changes

Added next review link

c-logemann’s picture

Issue tags: +PAreview: review bonus

added Tag PAReview: review bonus

klausi’s picture

Assigned: Unassigned » tim.plunkett
Status: Needs review » Reviewed & tested by the community
Issue tags: -PAreview: review bonus

Thanks for your reviews!

manual review:

  1. "drupal_set_message($msg, 'warninh');" Should be "warning", right?
  2. Usage of check_plain(): Does not always make sense to me. You should only use it if you are printing something to the user and you should do check_plain() as late as possible to not mess up the data while it is passed around. Example: dlsconnect_nodeapi() or _dlsconnect_groupuser_add() where you don't print anything.
  3. _dlsconnect_show_clientinfo(): do not create link markup yourself, use l() instead.

But otherwise this looks RTBC to me. Assigning to tim.plunkett as he might have time to finally approve this. Removing review bonus tag, you can add it again if you have done another 3 reviews of other projects.

c-logemann’s picture

@klausi: Thanks a lot for review and the RTBC status.

fixed 1,2,3 of #22 and
fixed a new error on joining/leaving a group that I produced by myself on my last changes.

patrickd’s picture

Assigned: tim.plunkett » Unassigned
Status: Reviewed & tested by the community » Fixed

Looks good for me,

Thanks for your contribution, C_Logemann! Welcome to the community of project contributors on drupal.org!! :)

I've granted you the git vetted user role which will let you promote this to a full project and also create new projects as either sandbox or "full" projects depending on which you feel is best.

Thanks, also, for your patience with the review process. Anyone is welcome to participate in the review process. Please consider reviewing other projects that are pending review. I encourage you to learn more about that process and join the group of reviewers.

As you continue to work on your module, keep in mind: Commit messages - providing history and credit and Release naming conventions.

Thanks to the dedicated reviewer(s) as well.

c-logemann’s picture

Many thanks to all reviewers especially for the patience.

Automatically closed -- issue fixed for 2 weeks with no activity.

Anonymous’s picture

Issue summary: View changes

Added Review link

avpaderno’s picture

Title: dlsconnect » [D6] dlsconnect