Menu

Login to RC5

2007-06-27
2013-03-26
  • Richard Morency

    Richard Morency - 2007-06-27

    Hi Chris

    I had added this to the end of my last thread (Latest Nightly snap-shot mamook_20070617.tar.) but I did not get a response, so I thought I would start a new thread.

    From what I can see from the code, RC5 will resolve a lot of the problems we have with RC4 and we must get it up so the coop staff can evaluate it before we replace our older version.

    I am now able to bring up the login screen but I can't login. In the old version we used, uses the login script method, but it does not seem to work in this new version. The authentication system seems to be different.

    Any ideas on how we could get the login to work with our script do we need to setup a LDAP sever?

    Thanks.

    Richard Morency 
    BCIT

     
    • Chan

      Chan - 2007-06-27

      Hi Richard,

      Sorry for the late reply. Its been a busy few weeks. In either case, I think I have a solution to authentication. The good news is LDAP is NOT required, and we should be able to use your existing script with a few tweeks.

      1. First, go into mamook/plugins/ and you'll see a directory called MamookInternalDBAuthentication. We're going to use this as a template to build a wrapper for your script. Make a copy of that directory, and call the directory BCITScriptAuthentication or something like that.

      2. Go into your new directory, and rename the MamookInternalDBAuthentication.class.php file to BCITScriptAuthentication.class.php.

      3. Go into that file and change all MamookInternalDBAuthentication instances to BCITScriptAuthentication.class.php

      Here comes the hard part. We're going to step through each function in that file, and I'll tell you what you need to change.

      --function MamookInternalDBAuthentication()--
      Set the author to BCIT, and set the plugin name to whatever you want. Like BCIT Script Authentication.

      --function install()--
      In the first SQL query, "VALUES ('internal_db')" change internal_db to something like bcit_script_auth

      Get rid of the second query that creates a table since we won't need it, because you're authenticating with an external data source.

      --function init()--
      In the first SQL query change "internal_db" to "bcit_script_auth".
      Comment out the two hooks, createaccount and changepassword because I'm guessing those actions are done in your external data source.

      --function authenticate()--
      This is what you have to code. Mamook will give you a user name and password, and you have to somehow pass those values to your script. Your script needs to return true or false.

      --doesLoginExist()--
      Again, you'll need to pass these values to your script. If your data source doesn't allow you check if a login id currently exists, then you can remove this function, and up in the init() function, get rid of the username_exists hook.

      --createUser()--
      You probably won't be creating users through Mamook for staff, so get rid of this function.

      --changePassword()--
      Remove

      --insertAccount()--
      Remove

      --Install your plugin--
      Just run Mamook through the web, and your plugin should automatically install. You can see if it did by looking at the auth_type table and see if your plugin is in there.

      Lastly, you have to configure Mamook to authenticate Office users with your plugin. Make sure in your secured constants, ADMIN_USER_ID is set to your login. Then, go into mamook.php?select=authconfig and set the Office user to your plugin.

      In theory, that should do it. Essentially, we have created a wrapper for your authentication system.

      Hope that helps, again, sorry for the late reply. Unfortunately, I will be away on vacation from June 28 - July 6. Hopefully you don't run into any issues.

      Cheers

      -Chris Chan
      Mamook Core Developer

       
    • Richard Morency

      Richard Morency - 2007-07-05

      Hi Chris

      Thanks, I followed your instructions to the letter. When I launch Mamook the login screen comes up, I then enter admin username I get the main screen with no menus and I am now getting the following error message in the error log:

      Jul 05 12:55:23  [info] PHP User Notice: Install Plugin Failed: Plugin 'BCITScriptAuthentication' has no name. at line 144 in file /var/www/html/mamook_rc5/plugins/PluginCommander.class.php

      Any ideas?

      Thanks.

      Richard Morency 
      BCIT

       
      • Chan

        Chan - 2007-07-08

        Hi Richard,

        So I'm going to assume that you have a file called BCITScriptAuthentication.class.php. In this file, do you have a function called BCITScriptAuthentication()?

        If you don't, it should be the first function that you have, as it's the constructor function, and it should look something like this:

        class BCITScriptAuthentication extends PluginInterface {
            // constructor
            function BCITScriptAuthentication() {
                $this->plugin_version_number = '1.0';
                $this->plugin_author = 'Richard Morency';
                $this->plugin_name = 'BCIT Script Authentication';
                $this->plugin_type = 'auth';
            }
            ...
        }

        Lets see if that helps.

        Cheers

        -Chris Chan

         

Log in to post a comment.

MongoDB Logo MongoDB