Login integration

Discussion forum for MOD Writers regarding MOD Development.
Altutto
Registered User
Posts: 19
Joined: Wed Jul 17, 2013 9:11 am

Re: Login integration

Post by Altutto »

But is maintaining it into the /test/test folder right?
User avatar
Lumpy Burgertushie
Registered User
Posts: 69223
Joined: Mon May 02, 2005 3:11 am
Contact:

Re: Login integration

Post by Lumpy Burgertushie »

Altutto wrote:But is maintaining it into the /test/test folder right?
what does that mean? what are you trying to do?
I thought the object was to test how to integrate your login between the board and some other script you have on your site.

if so, then you need to put the login script wherever you want it to be and then edit the root path in it accordingly.


ropbert
Premium phpBB 3.3 Styles by PlanetStyles.net

I am pleased to announce that I have completed the first item on my bucket list. I have the bucket.
Altutto
Registered User
Posts: 19
Joined: Wed Jul 17, 2013 9:11 am

Re: Login integration

Post by Altutto »

Yes, I meant that, sorry, I'm not English.
Anyway, the code still doesn't work and it shows the same error :(
User avatar
Lumpy Burgertushie
Registered User
Posts: 69223
Joined: Mon May 02, 2005 3:11 am
Contact:

Re: Login integration

Post by Lumpy Burgertushie »

post exactly what is in your current test/test/index.php file


robert

edit:

assuming that your set up is ;

your domain.com/f/

yourdomain.com/test/test/index.php

the root path should be just as was posted above.

../../f/

I just tested this here:

phpbbace.com/test/test/index.php

which the root path goes back to the root then to the folder where my board is installed:

../../board/

and your script logs me in and shows me the welcome message.

if you access that page it should show you a please login message.
try it and see.


ropbert
Premium phpBB 3.3 Styles by PlanetStyles.net

I am pleased to announce that I have completed the first item on my bucket list. I have the bucket.
Altutto
Registered User
Posts: 19
Joined: Wed Jul 17, 2013 9:11 am

Re: Login integration

Post by Altutto »

It shows me this:
[phpBB Debug] PHP Warning: in file [ROOT]/includes/session.php on line 1042: Cannot modify header information - headers already sent by (output started at /home/cyberosi/public_html/phpbbace.com/test/test/index.php:1) [phpBB Debug] PHP Warning: in file [ROOT]/includes/session.php on line 1042: Cannot modify header information - headers already sent by (output started at /home/cyberosi/public_html/phpbbace.com/test/test/index.php:1) [phpBB Debug] PHP Warning: in file [ROOT]/includes/session.php on line 1042: Cannot modify header information - headers already sent by (output started at /home/cyberosi/public_html/phpbbace.com/test/test/index.php:1) Please login!
User avatar
Lumpy Burgertushie
Registered User
Posts: 69223
Joined: Mon May 02, 2005 3:11 am
Contact:

Re: Login integration

Post by Lumpy Burgertushie »

I know why it is showing that error and I fixed it. please try again. what I don't know is why it did not show the error to me.
refresh your browser a couple of times if it doesn't work for you.

oh well, the gremlins are at it again.


robert
Premium phpBB 3.3 Styles by PlanetStyles.net

I am pleased to announce that I have completed the first item on my bucket list. I have the bucket.
Altutto
Registered User
Posts: 19
Joined: Wed Jul 17, 2013 9:11 am

Re: Login integration

Post by Altutto »

Now it works, it shows me the text "please login" :)
thank you!
Please could you repeat the code that you used?
User avatar
Lumpy Burgertushie
Registered User
Posts: 69223
Joined: Mon May 02, 2005 3:11 am
Contact:

Re: Login integration

Post by Lumpy Burgertushie »

Altutto wrote:Now it works, it shows me the text "please login" :)
thank you!
Please could you repeat the code that you used?
I used your code but changed the root path to what was posted above.
here is is exactly as you need to put in your index.php file:

Code: Select all

<?php
    define('IN_PHPBB', true);
    $phpbb_root_path = (defined('PHPBB_ROOT_PATH')) ? PHPBB_ROOT_PATH : '../../f/';
    $phpEx = substr(strrchr(__FILE__, '.'), 1);
    include($phpbb_root_path . 'common.' . $phpEx);

    $user->session_begin();
    $auth->acl($user->data);
    $user->setup();

    if ($user->data['user_id'] == ANONYMOUS)
    {
       echo 'Please login!';
    }

    else
    {
       echo 'Thanks for logging in, ' . $user->data['username_clean'];
    }
    ?>
Premium phpBB 3.3 Styles by PlanetStyles.net

I am pleased to announce that I have completed the first item on my bucket list. I have the bucket.
Altutto
Registered User
Posts: 19
Joined: Wed Jul 17, 2013 9:11 am

Re: Login integration

Post by Altutto »

Thank you very much, I'm going to try it tomorrow :)
User avatar
Lumpy Burgertushie
Registered User
Posts: 69223
Joined: Mon May 02, 2005 3:11 am
Contact:

Re: Login integration

Post by Lumpy Burgertushie »

Altutto wrote:Thank you very much, I'm going to try it tomorrow :)
why not today? :D it will only take you 2 minutes and then you will know.


robert
Premium phpBB 3.3 Styles by PlanetStyles.net

I am pleased to announce that I have completed the first item on my bucket list. I have the bucket.
Altutto
Registered User
Posts: 19
Joined: Wed Jul 17, 2013 9:11 am

Re: Login integration

Post by Altutto »

Yes, you're right ;)
It works!!!!!!! :D
Finally! I tried to make it work for days!
Thank you very much!
Altutto
Registered User
Posts: 19
Joined: Wed Jul 17, 2013 9:11 am

Re: Login integration

Post by Altutto »

Sorry again, I've got an other problem :roll:
My script should extract a number from the column livello_ef into the table avphpbb_users and compare it with the column livello_ef into the table Fluent_english, display the matching sentence and checking if it's right.
But it shows "error!".

Code: Select all

<!-- INCLUDE overall_header.html -->

<h2>Fluent English</h2>
<?php
    define('IN_PHPBB', true);
    $phpbb_root_path = (defined('PHPBB_ROOT_PATH')) ? PHPBB_ROOT_PATH : '../../f/';
    $phpEx = substr(strrchr(__FILE__, '.'), 1);
    include($phpbb_root_path . 'common.' . $phpEx);

    $user->session_begin();
    $auth->acl($user->data);
    $user->setup();

    if ($user->data['user_id'] == ANONYMOUS)
    {
       echo 'Please login!';
       die();
    }

    else
    {
       echo 'Logged in!';
$nomeutente="data['user_id']";
    }
$connessione=mysql_connect("localhost", "altutto", "password");
$selezione_db=mysql_select_db("my_altutto", $connessione);
$progressi = "SELECT livello_ef FROM avphpbb_users WHERE id =='$nomeutente';";
$ottieni = "SELECT inglese FROM Fluent_english WHERE livello_ef=='$progressi';";
$mostra ="mysql_query($ottieni);";
       if (!$ris_news) {
 
           exit ('<p> Error!' . mysql_error() . '</p>');
 
                }
 
   while ($news= mysql_fetch_array($ris_news))  
 
   {
 

     echo "<p>Traduci: ".$news['english*']."</p>" ;
 
   }
 
if($_POST['traduzione']==''){echo '<form action="index.php" method="POST">
<label><input type="text" id="traduzione"></label>
<input type="submit" value="Conferma">
</form>';
}
else{ $controlla = "SELECT italiano** FROM Fluent_english WHERE livello_ef=='$progressi';";
$controllo_alternativo = "SELECT italiano_alt*** FROM Fluent_english WHERE livello_ef=='$progressi';";
if($_POST['traduzione']=='$controlla' or $_POST['traduzione']=='$controllo_alternativo'){$aggiungi = "$progressi++";
$query = "UPDATE avphpbb_users SET livello_ef='$aggiungi' WHERE id = data['user_id']"; }
else{echo 'Risposta errata!';}
}
?>
<!-- INCLUDE jumpbox.html -->
<!-- INCLUDE overall_footer.html -->
*the column where the sentences to display are.
**the column where the correct translations are.
***the column where there's an alternative correct translation.
Last edited by Oyabun1 on Wed Sep 04, 2013 9:45 pm, edited 1 time in total.
Reason: Moved from Support
Locked

Return to “[3.0.x] MOD Writers Discussion”