0
Welcome Guest! Login
0 items Join Now

login module - needing help

    • HLL's Avatar
    • HLL
    • Newbie
    • Posts: 15
    • Thanks: 0

    login module - needing help

    Posted 15 years 11 months ago
    • Hi Everyone,

      I'm trying here to solve what seems to be an impossible mission....I'm getting hopeless with this, but still with a few to ask a kind person to help me on this.

      The issue is this: I'm using the Populus theme and on this template there comes a default login module that is connected to Community Builder. (image is attached)

      It happens that I want to use Jomsocial as my social community.

      How can I turn that specific module, to act in order to login into Jomsocial?

      Please I need this very much!

      I already download and install the JomSocial Redirector. 1.5 Native and seems to work just in the core login, not in the nice Community Builder that comes by default. ..

      I already edit several times the Community Builder file, mod_cblogin.php and could only change successfully, two things: lost password and registration...

      But Its missing the most important, which is to be able to type the username, password, to press login to be able to enter in JomSocial.

      I've insert these links thinking they would work but just the last two do.

      :!: index.php?option=com_user&task=login (doesn't work, because it doesn't login to Jomsocial)

      :arrow: index.php?option=com_user&view=reset (it works, it leads to the lost password)
      :arrow: index.php?option=com_community&view=register&Itemid=44 (it works, it leads to registration)


      Here is a piece from mod_cblogin.php file.
       
       
      } else {    // Login Form :
          // redirect to site url (so cookies are recognized correctly after login):
          if (strncasecmp($mosConfig_live_site, "http://www.", 11)==0 && strncasecmp($mosConfig_live_site, "http://", 7)==0
              && strncasecmp( substr($mosConfig_live_site, 11), substr($login, 7), $len_live_site - 11 ) == 0 ) {
                  $login = "http://www." . substr($login, 7);
          } elseif (strncasecmp($mosConfig_live_site, "https://www.", 12)==0 && strncasecmp($mosConfig_live_site, "https://", 8)==0
              && strncasecmp( substr($mosConfig_live_site, 12), substr($login, 8), $len_live_site - 12 ) == 0 ) {
                  $login = "https://www." . substr($login, 8);
          } elseif (strncasecmp($mosConfig_live_site, "http://", 7)==0 && strncasecmp($mosConfig_live_site, "http://www.", 11)==0
              && strncasecmp( substr($mosConfig_live_site, 7), substr($login, 11), $len_live_site - 7 ) == 0 ) {
                  $login = "http://" . substr($login, 11);
          } elseif (strncasecmp($mosConfig_live_site, "https://", 8)==0 && strncasecmp($mosConfig_live_site, "https://www.", 12)==0
              && strncasecmp( substr($mosConfig_live_site, 8), substr($login, 12), $len_live_site - 8 ) == 0 ) {
                  $login = "https://" . substr($login, 12);
          }
       
          if (strncmp($login, $mosConfig_live_site, $len_live_site) || strncmp($login, "index.php", 9)) {
              $login = sefRelToAbs( $login );
          }
          if (!(strncmp($login, "http:", 5)==0) && !(strncmp($login, "https:", 6)==0)) $login = $mosConfig_live_site . "/" . $login;
       
          if ( $https_post > 1 /* && ! $isHttps */ ) {
              $login = str_replace("http://","https://",$login);
          }
       
          $loginPost = sefRelToAbs("[color=#BF0000]index.php?option=com_user&task=form-login[/color]");
          if ( $https_post /* && ! $isHttps */ ) {
              if ( ( substr($loginPost, 0, 5) != "http:" ) && ( substr($loginPost, 0, 6) != "https:" ) ) {
                  $loginPost = $mosConfig_live_site."/".$loginPost;
              }
              $loginPost = str_replace("http://","https://",$loginPost);
          }
          switch ( cbLoginCheckJversion() ) {
              case -1:
              // Mambo 4.6.x:
                  if (!defined('_USERNAME')) {
                      $strings = array(   '_USERNAME'         => 'Username',
                                          '_PASSWORD'         => 'Password',
                                          '_REMEMBER_ME'      => 'Remember me',
                                          '_BUTTON_LOGIN'     => 'Login',
                                          '_LOST_PASSWORD'    => 'Password Reminder',
                                          '_NO_ACCOUNT'       => 'No account yet?',
                                          '_CREATE_ACCOUNT'   => 'Create one' );
                      foreach ( $strings as $key => $value ) {
                          define( $key, T_( $value ));
                      }
                  }
                  global $mosConfig_locale;
                  $mosConfig_lang =   $mosConfig_locale;
                  break;
              case 1:
              // Joomla 1.5+
                  if (!defined('_USERNAME')) {
                      $lang =& JFactory::getLanguage();
                      $lang->load("mod_login");
                      $strings = array(   '_USERNAME'         => 'Username',
                                          '_PASSWORD'         => 'Password',
                                          '_REMEMBER_ME'      => 'Remember me',
                                          '_BUTTON_LOGIN'     => 'BUTTON_LOGIN',
                                          '_LOST_PASSWORD'    => 'Lost Password?',
                                          '_NO_ACCOUNT'       => 'No account yet?',
                                          '_CREATE_ACCOUNT'   => 'Register' );
                      foreach ( $strings as $key => $value ) {
                          define( $key, JText::_( $value ));
                      }
                  }
                  break;
              default:
                  break;
          }
       
          echo '<form action="'.$loginPost.'" method="post" id="mod_loginform'.$class_sfx.'" ';
      /*
          if ($compact) {
              echo "onsubmit=\""
                  . "return ( ( this.elements['mod_login_username" . $class_sfx . "'].value != '"._USERNAME."')"
                  . "&& ( this.elements['mod_login_password" . $class_sfx . "'].value != 'pasw') )"
                  ."\" ";
          }
      */
          echo 'style="margin:0px;">'."\n";
          echo $pretext."\n";
          if (!$horizontal) echo '<table width="100%" border="0" cellspacing="0" cellpadding="0" class="mod_login'.$class_sfx.'">'."\n"
                              ."<tr><td>";
       
          $txtusername = '<label for="mod_login_username'.$class_sfx.'">'._USERNAME."</label>";
          $txtpassword = '<label for="mod_login_password'.$class_sfx.'">'._PASSWORD."</label>";
          
          if (!$compact)   echo '<span id="mod_login_usernametext'.$class_sfx.'">'.$txtusername.'</span>';
          if ($horizontal) echo "&nbsp;\n"; elseif (!$compact) echo "<br />\n";
          echo '<input type="text" name="username" id="mod_login_username'.$class_sfx.'" class="inputbox'.$class_sfx.'" size="'.$name_lenght.'"';
          if ($compact)    echo " alt=\""._USERNAME."\" value=\""._USERNAME."\" "
                              . "onfocus=\"if (this.value=='"._USERNAME."') this.value=''\" onblur=\"if(this.value=='') { this.value='"._USERNAME."'; return false; }\"";
          echo ' />';
          if ($horizontal) echo "&nbsp;\n"; elseif (!$compact) echo "<br />\n";
          if (!$compact)   echo '<span id="mod_login_passwordtext'.$class_sfx.'">'.$txtpassword.'</span>';
          if ($horizontal) echo "&nbsp;"; else echo "<br />";
          echo '<input type="password" name="passwd" id="mod_login_password'.$class_sfx.'" class="inputbox'.$class_sfx.'" size="'.$pass_lenght.'"';
          if ($compact)    echo " alt=\""._PASSWORD."\" value=\"pasw\" onfocus=\"if (this.value=='pasw') this.value=''\" onblur=\"if(this.value=='') { this.value='pasw'; return false; }\"";
          echo ' />';
          if ($horizontal) echo "&nbsp;\n"; else echo "<br />\n";
       
          echo '<input type="hidden" name="op2" value="login" />'."\n";
          echo '<input type="hidden" name="lang" value="'.$mosConfig_lang.'" />'."\n";
          echo '<input type="hidden" name="force_session" value="1" />'."\n";     // makes sure to create joomla 1.0.11+12 session/bugfix
          echo '<input type="hidden" name="return" value="' . htmlspecialchars( $login ) . '" />'."\n";
          echo '<input type="hidden" name="message" value="' . htmlspecialchars( $message_login ) . '" />'."\n";
          if ( is_callable("josSpoofValue")) {
              $validate = josSpoofValue();
              echo "<input type=\"hidden\" name=\"" .  $validate . "\" value=\"1\" />\n";
          }
       
          switch ($remember_enabled) {
              case 1:
                  echo '<input type="checkbox" name="remember" id="mod_login_remember'.$class_sfx.'" class="inputbox'.$class_sfx.'" value="yes" /> '
                      .'<span id="mod_login_remembermetext'.$class_sfx.'"><label for="mod_login_remember'.$class_sfx.'">'._REMEMBER_ME."</label></span>";
                  if ($horizontal) echo "&nbsp;\n"; else echo "<br />\n";
              break;
              case 2:
                  echo '<input type="hidden" name="remember" value="yes" />';
              break;
              case 3:
                  echo '<input type="checkbox" name="remember" id="mod_login_remember'.$class_sfx.'" class="inputbox'.$class_sfx.'" value="yes" checked="checked" /> '
                      .'<span id="mod_login_remembermetext'.$class_sfx.'"><label for="mod_login_remember'.$class_sfx.'">'._REMEMBER_ME."</label></span>";
                  if ($horizontal) echo "&nbsp;\n"; else echo "<br />\n";
              break;
              default:
              break;
          }
          echo '<input type="submit" name="Submit" class="button'.$class_sfx.'" value="'._BUTTON_LOGIN.'" />';
          if ($horizontal) echo "&nbsp;&nbsp;\n"; else echo "</td></tr>\n<tr><td>";
          
          if ($show_lostpass) {
              $loginPost = sefRelToAbs("[color=#BF0000]index.php?option=com_user&view=reset[/color]");
              if ( $https_post /* && ! $isHttps */ ) {
                  if ( ( substr($loginPost, 0, 5) != "http:" ) && ( substr($loginPost, 0, 6) != "https:" ) ) {
                      $loginPost = $mosConfig_live_site."/".$loginPost;
                  }
                  $loginPost = str_replace("http://","https://",$loginPost);
              }
              echo '<a href="'.$loginPost.'" class="mod_login'.$class_sfx.'">';
              if ($compact) echo _UE_FORGOT_PASSWORD; 
              else echo _LOST_PASSWORD;
              echo '</a>';
              if ($horizontal) {
                  if ($compact) echo "&nbsp;|";
                  else echo "&nbsp;\n"; 
              } else echo "</td></tr>\n";
          }
          if ( ! $registration_enabled ) {
              include_once( $absolute_path."/administrator/components/com_comprofiler/ue_config.php" );
              if ( isset($ueConfig['reg_admin_allowcbregistration']) && $ueConfig['reg_admin_allowcbregistration'] == '1' ) {
                  $registration_enabled = true;
              }
          }
          if ($registration_enabled && $show_newaccount) {
              if ($horizontal) echo '&nbsp;<span id="mod_login_noaccount'.$class_sfx.'">'; else echo "<tr><td>";
              if (!$compact)   echo _NO_ACCOUNT." ";
              $loginPost = sefRelToAbs("[color=#BF0000]index.php?option=com_community&view=register&Itemid=44[/color]");
              if ( $https_post /* && ! $isHttps */ ) {
                  if ( ( substr($loginPost, 0, 5) != "http:" ) && ( substr($loginPost, 0, 6) != "https:" ) ) {
                      $loginPost = $mosConfig_live_site."/".$loginPost;
                  }
                  $loginPost = str_replace("http://","https://",$loginPost);
              }
              echo '<a href="'.$loginPost.'" class="mod_login'.$class_sfx.'">';
              if ($compact) echo _UE_REGISTER;
              else echo _CREATE_ACCOUNT;
              echo '</a>';
              if ($horizontal) echo "</span>\n"; else echo "</td></tr>\n";
          }
          if (!$horizontal) echo "</table>";
          if ($posttext) echo $posttext."\n";
          echo "</form>";
      }
      ?>
       


      Thanks in advance and I'll be grateful for any suggestion.

      Regards,

      Hélio

Time to create page: 0.074 seconds