Menu

disable logon

Help
Marco Otto
2013-11-18
2013-11-20
  • Marco Otto

    Marco Otto - 2013-11-18

    Hi,
    we have been using wikindx 3.x on our webserver within a platform where users have to be registered.Now we like to upgrade to 4.2. Is there any way to disable/work around the logon and pass user name and password directly to wikindx?
    We solved this in in wikindx 3.8 but in 4.2 things have changed a lot:-).

    Regards
    Marco

     
  • Mark Grimshaw

    Mark Grimshaw - 2013-11-18

    Hi Marco,

    I don't know. I imagine there would be -- how have you done it in 3.8?

    Mark

     
  • Marco Otto

    Marco Otto - 2013-11-20

    Hi Mark,

    this is how we did it in 3.8 ($_SESSION is the Session variable for our one platform it looks like wikindx uses the same name to keep information of a user session - maybe thats some how conflicting):

    INDEX.PHP

    // set language at line 34 by adding
    
       If (isset($_GET['lang']) AND ($_GET['lang'] == 'en' OR $_GET['lang'] == 'fr') )
           $_SESSION[$WIKINDX_DB.'_setup_language'] = $_GET['lang'];
       elseif (!isset($_SESSION[$WIKINDX_DB.'_setup_language']) )
           $_SESSION[$WIKINDX_DB.'_setup_language'] = 'en';
    
    // set POST-variable before the "include_once("core/authorize/AUTHORIZE.php");" 
    // command at line 61 to force login
        [...]
        If(!isset($_SESSION['login_literature']))
               {
                $_POST['action']   = 'logon';
                $_POST['submit']   = 'submit';
                $_POST['username'] = $_SESSION['ini']['literature']['login'];
                $_POST['password'] = $_SESSION['ini']['literature']['password'];
                $_SESSION['login_literature'] = 'login';
               };
        include_once("core/authorize/AUTHORIZE.php");
        [...]
    

    Any help is greatly appreciated.

    Marco

     
  • Mark Grimshaw

    Mark Grimshaw - 2013-11-20

    Hi Marco,

    In the middle of an apartment move for the next week or so so will get back to you asap. $_SESSION, btw, is the standard name for PHP session variables. If you stick in a
    print_r($_SESSION);
    you can see all sessions in your environment.

    But, as you've spotted, I did put in $WIKINDX_DB as a prefix to session variables to try to keep things separate.

    Regards,

    Mark

     
    • Marco Otto

      Marco Otto - 2013-11-20

      Hi Mark,

      thanx for the rapid reply!!!
      We found it out by our self. Here is what we did in the AUTHORIZE.php

      public function gatekeep()
      {
          // we overwrite $this to jump to else if(($this->vars["action"] == 'logon') 
          $this->vars["action"]='logon';
                  $this->vars["username"]=$_SESSION['ini']['literature']['login'];
                  $this->vars["password"]=$_SESSION['ini']['literature']['password'];
                  if(array_key_exists("action", $this->vars))
          [...]
      

      $_SESSION['ini']['literature'][....]
      There we we store the username (login) and password for the wikindx ('literature'). It is hard coded in the config.php of wikindx.
      So each individual user will work with the same wikindx user.
      I dont know how this will work out at the end but it seems to be the simplest way of doing it. We will test it in the upcoming week.

      happy moving :-)

      Marco

       

Log in to post a comment.