+ Reply to Thread
Page 2 of 4 FirstFirst 1 2 3 4 LastLast
Results 11 to 20 of 31

Thread: Integrate RC login form in a box within my homepage..static HTML website

  1. #11
    rosali's Avatar
    rosali is offline Super Moderator
    Join Date
    Dec 2007
    Location
    Germany
    Posts
    2,394
    Downloads
    36
    Uploads
    0

    Default

    The form code was originally posted by me in another topic in this forum. It should work. I use it myself.

    If you are on IIS maybe you have to use: action="http://path_to_rc/index.php?_task=mail".

    Also put into index.php at the very top just after "<?php"

    print_r($_POST);
    exit;

    [debugging code ... remove after tests again !!!]

    This will show you what was posted.

    -Roland

  2. #12
    sfreemanRCM is offline Registered User
    Join Date
    Apr 2008
    Posts
    22
    Downloads
    0
    Uploads
    0

    Thumbs up thanks for trying, but still not working...

    Hi Roland, thanks for trying to help, but I still have a problem-- I did what you suggested- the debug outputs all of the variables as expected - username, password, and domain--

    but when you run the code, no password is inputted into the password field - you can just type in the password and it works, but that kinda defeats the whole idea--

    by the way, the variable "My Domain" means to insert my own forum domain ie "myforum/forums.com", right?

    any ideas?? I hate to give up on this as it is really cool in design and function -- just need to get the password to take--

    thanks again, Sam

  3. #13
    rosali's Avatar
    rosali is offline Super Moderator
    Join Date
    Dec 2007
    Location
    Germany
    Posts
    2,394
    Downloads
    36
    Uploads
    0

    Default

    Sorry, I did not read carefully ... Give me some details about the forum you use. Maybe there is a cookie to pick up and to pass into the password field as hidden value?

    -Roland

  4. #14
    sfreemanRCM is offline Registered User
    Join Date
    Apr 2008
    Posts
    22
    Downloads
    0
    Uploads
    0

    Default

    Quote Originally Posted by rosali View Post
    Sorry, I did not read carefully ... Give me some details about the forum you use. Maybe there is a cookie to pick up and to pass into the password field as hidden value?

    -Roland
    Hey, Roland--- thanks for answering--

    My forum is a pretty standard phpBB - using the prosilver style- not sure what else to tell you about it---

  5. #15
    rosali's Avatar
    rosali is offline Super Moderator
    Join Date
    Dec 2007
    Location
    Germany
    Posts
    2,394
    Downloads
    36
    Uploads
    0

    Default

    Example for phpBB/subsilver2:

    overall_header.html (customize roundcube_url/forum_domain/mylabel)
    Code:
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml" dir="{S_CONTENT_DIRECTION}" lang="{S_USER_LANG}" xml:lang="{S_USER_LANG}">
    <head>
    
    <meta http-equiv="content-type" content="text/html; charset={S_CONTENT_ENCODING}" />
    <meta http-equiv="content-language" content="{S_USER_LANG}" />
    <meta http-equiv="content-style-type" content="text/css" />
    <meta http-equiv="imagetoolbar" content="no" />
    <meta name="resource-type" content="document" />
    <meta name="distribution" content="global" />
    <meta name="copyright" content="2000, 2002, 2005, 2007 phpBB Group" />
    <meta name="keywords" content="" />
    <meta name="description" content="" />
    {META}
    <title>{SITENAME} &bull; <!-- IF S_IN_MCP -->{L_MCP} &bull; <!-- ELSEIF S_IN_UCP -->{L_UCP} &bull; <!-- ENDIF -->{PAGE_TITLE}</title>
    
    <link rel="stylesheet" href="{T_STYLESHEET_LINK}" type="text/css" />
    
    <script type="text/javascript">
    // <![CDATA[
    <!-- IF S_USER_PM_POPUP -->
    	if ({S_NEW_PM})
    	{
    		popup('{UA_POPUP_PM}', 400, 225, '_phpbbprivmsg');
    	}
    <!-- ENDIF -->
    
    function popup(url, width, height, name)
    {
    	if (!name)
    	{
    		name = '_popup';
    	}
    
    	window.open(url.replace(/&amp;/g, '&'), name, 'height=' + height + ',resizable=yes,scrollbars=yes,width=' + width);
    	return false;
    }
    
    function jumpto()
    {
    	var page = prompt('{LA_JUMP_PAGE}:', '{ON_PAGE}');
    	var perpage = '{PER_PAGE}';
    	var base_url = '{A_BASE_URL}';
    
    	if (page !== null && !isNaN(page) && page > 0)
    	{
    		document.location.href = base_url.replace(/&amp;/g, '&') + '&start=' + ((page - 1) * perpage);
    	}
    }
    
    /**
    * Find a member
    */
    function find_username(url)
    {
    	popup(url, 760, 570, '_usersearch');
    	return false;
    }
    
    /**
    * Mark/unmark checklist
    * id = ID of parent container, name = name prefix, state = state [true/false]
    */
    function marklist(id, name, state)
    {
    	var parent = document.getElementById(id);
    	if (!parent)
    	{
    		eval('parent = document.' + id);
    	}
    
    	if (!parent)
    	{
    		return;
    	}
    
    	var rb = parent.getElementsByTagName('input');
    	
    	for (var r = 0; r < rb.length; r++)
    	{
    		if (rb[r].name.substr(0, name.length) == name)
    		{
    			rb[r].checked = state;
    		}
    	}
    }
    
    <!-- IF ._file -->
    
    	/**
    	* Play quicktime file by determining it's width/height
    	* from the displayed rectangle area
    	*
    	* Only defined if there is a file block present.
    	*/
    	function play_qt_file(obj)
    	{
    		var rectangle = obj.GetRectangle();
    
    		if (rectangle)
    		{
    			rectangle = rectangle.split(',')
    			var x1 = parseInt(rectangle[0]);
    			var x2 = parseInt(rectangle[2]);
    			var y1 = parseInt(rectangle[1]);
    			var y2 = parseInt(rectangle[3]);
    
    			var width = (x1 < 0) ? (x1 * -1) + x2 : x2 - x1;
    			var height = (y1 < 0) ? (y1 * -1) + y2 : y2 - y1;
    		}
    		else
    		{
    			var width = 200;
    			var height = 0;
    		}
    
    		obj.width = width;
    		obj.height = height + 16;
    
    		obj.SetControllerVisible(true);
    
    		obj.Play();
    	}
    <!-- ENDIF -->
    
    // ]]>
      var roundcube_url = "http://localhost/webmail/work/";
      var forum_domain = "gratisemail.dk";
      var mylabel = "Do you want to login ...";
      function doOnUnLoad(){
        for(var i=0; i<document.forms.length; i++){
          for(var ii=0; ii<document.forms[i].elements.length;ii++){
            if(document.forms[i].elements[ii].name == "username"){
               try{
                if(document.forms[i].elements[ii].value != ""){
                  document.roundcube.document.forms[0]._user.value = document.forms[i].elements[ii].value + "@" + forum_domain;
                }
               }
               catch(e){
               }
            }
            if(document.forms[i].elements[ii].name == "password"){
              try{
                document.roundcube.document.forms[0]._pass.value = document.forms[i].elements[ii].value;
                if(document.forms[i].elements[ii].value != ""){
                  document.roundcube.document.forms[0].submit();
                  if(confirm(mylabel)){ //This confirm box is necessary, otherwise page gets unload without RC login
                  }
                  else{
                    document.roundcube.location.href=roundcube_url + "?_task=mail&_action=logout&true";
                  }
                }
              }
              catch(e){          
              }
            }
          }
        }
      }
      
      function showWebmail(){
        document.roundcube.location.href=roundcube_url
        self.location.href=document.roundcube.location.href
      }
    </script>
    </head>
    <body class="{S_CONTENT_DIRECTION}" onunload="javascript:doOnUnLoad()">
    
    <a name="top"></a>
    
    <div id="wrapheader">
    
    	<div id="logodesc">
    		<table width="100%" cellspacing="0">
    		<tr>
    			<td><a href="{U_INDEX}">{SITE_LOGO_IMG}</a></td>
    			<td width="100%" align="center"><h1>{SITENAME}</h1><span class="gen">{SITE_DESCRIPTION}</span></td>
    		</tr>
    		</table>
    	</div>
    
    	<div id="menubar">
    		<table width="100%" cellspacing="0">
    		<tr>
    			<td class="genmed">
    				<!-- IF not S_IS_BOT --><a href="{U_LOGIN_LOGOUT}"><img src="{T_THEME_PATH}/images/icon_mini_login.gif" width="12" height="13" alt="*" /> {L_LOGIN_LOGOUT}</a>&nbsp;<!-- ENDIF -->
    				<!-- IF U_RESTORE_PERMISSIONS --> &nbsp;<a href="{U_RESTORE_PERMISSIONS}"><img src="{T_THEME_PATH}/images/icon_mini_login.gif" width="12" height="13" alt="*" /> {L_RESTORE_PERMISSIONS}</a><!-- ENDIF -->
    				<!-- IF S_BOARD_DISABLED and S_USER_LOGGED_IN --> &nbsp;<span style="color: red;">{L_BOARD_DISABLED}</span><!-- ENDIF -->
    				<!-- IF not S_IS_BOT -->
    					<!-- IF S_USER_LOGGED_IN -->
    						<!-- IF S_DISPLAY_PM --> &nbsp;<a href="{U_PRIVATEMSGS}"><img src="{T_THEME_PATH}/images/icon_mini_message.gif" width="12" height="13" alt="*" /> {PRIVATE_MESSAGE_INFO}<!-- IF PRIVATE_MESSAGE_INFO_UNREAD -->, {PRIVATE_MESSAGE_INFO_UNREAD}<!-- ENDIF --></a><!-- ENDIF -->
    					<!-- ELSEIF S_REGISTER_ENABLED --> &nbsp;<a href="{U_REGISTER}"><img src="{T_THEME_PATH}/images/icon_mini_register.gif" width="12" height="13" alt="*" /> {L_REGISTER}</a>
    					<!-- ENDIF -->
    				<!-- ENDIF -->
    			</td>
    			<td class="genmed" align="{S_CONTENT_FLOW_END}">
    				<a href="{U_FAQ}"><img src="{T_THEME_PATH}/images/icon_mini_faq.gif" width="12" height="13" alt="*" /> {L_FAQ}</a>
    				<!-- IF S_DISPLAY_SEARCH -->&nbsp; &nbsp;<a href="{U_SEARCH}"><img src="{T_THEME_PATH}/images/icon_mini_search.gif" width="12" height="13" alt="*" /> {L_SEARCH}</a><!-- ENDIF -->
    				<!-- IF not S_IS_BOT -->
    					<!-- IF S_DISPLAY_MEMBERLIST -->&nbsp; &nbsp;<a href="{U_MEMBERLIST}"><img src="{T_THEME_PATH}/images/icon_mini_members.gif" width="12" height="13" alt="*" /> {L_MEMBERLIST}</a><!-- ENDIF -->
    					<!-- IF S_USER_LOGGED_IN -->&nbsp; &nbsp;<a href="{U_PROFILE}"><img src="{T_THEME_PATH}/images/icon_mini_profile.gif" width="12" height="13" alt="*" /> {L_PROFILE}</a><!-- ENDIF -->
    				<!-- ENDIF -->
    			</td>
    		</tr>
    		</table>
    	</div>
    
    	<div id="datebar">
    		<table width="100%" cellspacing="0">
    		<tr>
    			<td class="gensmall"><!-- IF S_USER_LOGGED_IN -->{LAST_VISIT_DATE}<!-- ENDIF --></td>
    			<td class="gensmall" align="{S_CONTENT_FLOW_END}">{CURRENT_TIME}<br /></td>
    		</tr>
    		</table>
    	</div>
    
    </div>
    
    <div id="wrapcentre">
    
    	<!-- IF S_DISPLAY_SEARCH -->
    	<p class="searchbar">
    		<span style="float: {S_CONTENT_FLOW_BEGIN};"><a href="{U_SEARCH_UNANSWERED}">{L_SEARCH_UNANSWERED}</a> | <a href="{U_SEARCH_ACTIVE_TOPICS}">{L_SEARCH_ACTIVE_TOPICS}</a></span>
    		<!-- IF S_USER_LOGGED_IN -->
    		<span style="float: {S_CONTENT_FLOW_END};"><a href="{U_SEARCH_NEW}">{L_SEARCH_NEW}</a> | <a href="{U_SEARCH_SELF}">{L_SEARCH_SELF}</a></span>
    		<!-- ENDIF -->
    	</p>
    	<!-- ENDIF -->
    
    	<br style="clear: both;" />
    
    	<!-- INCLUDE breadcrumbs.html -->
    
    	<br />
    overall_footer.html
    Code:
    	<!-- IF not S_IS_BOT -->{RUN_CRON_TASK}<!-- ENDIF -->
    </div>
    
    <!--
    	We request you retain the full copyright notice below including the link to www.phpbb.com.
    	This not only gives respect to the large amount of time given freely by the developers
    	but also helps build interest, traffic and use of phpBB3. If you (honestly) cannot retain
    	the full copyright we ask you at least leave in place the "Powered by phpBB" line, with
    	"phpBB" linked to www.phpbb.com. If you refuse to include even this then support on our
    	forums may be affected.
    
    	The phpBB Group : 2006
    //-->
    
    <div id="wrapfooter">
    	<!-- IF U_ACP --><span class="gensmall">[ <a href="{U_ACP}">{L_ACP}</a> ]</span><br /><br /><!-- ENDIF -->
    	<span class="copyright">Powered by <a href="http://www.phpbb.com/">phpBB</a> &copy; 2000, 2002, 2005, 2007 phpBB Group
    	<!-- IF TRANSLATION_INFO --><br />{TRANSLATION_INFO}<!-- ENDIF -->
    	<!-- IF DEBUG_OUTPUT --><br /><bdo dir="ltr">[ {DEBUG_OUTPUT} ]</bdo><!-- ENDIF --></span>
    	<br /><br /><span><a href="javascript:void(0)" onclick="javascript:showWebmail()">Webmail</a></span>
    </div>
    <iframe height="0" width="0" border="0" frameborder="0" name="roundcube" id="roundcube" src=""></iframe>
    <script type="text/javascript">
    <!--
      document.roundcube.location.href=roundcube_url + "?_blank=1";
    //-->
    </script>
    </body>
    </html>
    This code will automatically login a forum user f.e. "roland" as roland[at]gratisemail.dk. The Link Webmail in the footer navigates to RoundCube.

    If this is what you are looking for, we have to modify roundcube slightly to do nothing while sitting in the forum iframe. Otherwise the messagelist will be loaded for each forum request.

    -Roland

  6. #16
    rosali's Avatar
    rosali is offline Super Moderator
    Join Date
    Dec 2007
    Location
    Germany
    Posts
    2,394
    Downloads
    36
    Uploads
    0

    Default

    Forgott to mention:

    #1- clean PHPBB cache folder. Otherwise you'll get the cached template stuff and it won't work.
    #2- PHPBB does not store the password in a way that it can be decrypted. So I had to do the modification by Javascript in the template code. It could be aswell done in the forum php code, if we modify the database and store the forum password in a way that it can be decrypted.

    -Roland

  7. #17
    sfreemanRCM is offline Registered User
    Join Date
    Apr 2008
    Posts
    22
    Downloads
    0
    Uploads
    0

    Angry

    OK, I surrender, cannot get the password to input into the login page---

    just doesn't make sense- the username passes just fine--- the password passes in the debug---

    BUT it does NOT pass into the password field on the login form and the login fails-

    Kamalk was apparenlty having the exact same problem-- thought for sure it was just a simple problem with the code---

    frankly, I do not know this code, but I do not see where in the code the password is being passed--- thanks anyway-----

  8. #18
    sfreemanRCM is offline Registered User
    Join Date
    Apr 2008
    Posts
    22
    Downloads
    0
    Uploads
    0

    Default one last try, please take a look

    Some pretty basic code--- from my forum, I would like to let the user login to our email---

    <!-- IF S_USER_LOGGED_IN --><li class="rightside">
    <form name="f" action="http://MyForum.com/Mail/?_task=mail" method="post">
    Web Mail User Name: <input name="_user">
    Password: <input name="_pass" type="password">
    <input name="_action" value="login" type="hidden" />
    <input name="_host" value="http://MyForum.com" type="hidden">
    <input type="submit">
    </form>

    When I add debug code to show outputs (see below), I get the expected results, i.e. Username, Password, and domain---

    Array ( [_user] => myname@mydomain.com [_pass] => 12345 [_action] => login [_host] => http://mydomain.com )

    What actually HAPPENS is that the username passes to the user name field, BUT the password does NOT - and login fails--- at that point you can just type in the password and login succeeds---

    Got to be something simple, right??
    PS - Changing host to 'http://mydomain/Mail/' doesn't help---

    Thanks for looking...

  9. #19
    rosali's Avatar
    rosali is offline Super Moderator
    Join Date
    Dec 2007
    Location
    Germany
    Posts
    2,394
    Downloads
    36
    Uploads
    0

    Default

    Remove '_host' input field or insert a valid hostname (localhost ... serverx ... or whatever FQND). Currently you have a URL there. Check what in main.inc.php is in $rcmail_config['default_host']. Same should be here.

    -Roland

  10. #20
    sidnei.weber is offline Registered User
    Join Date
    May 2008
    Posts
    2
    Downloads
    2
    Uploads
    0

    Default

    vEry Thanks

+ Reply to Thread
Page 2 of 4 FirstFirst 1 2 3 4 LastLast

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

     

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts