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 » Mon Sep 02, 2013 5:52 pm

But is maintaining it into the /test/test folder right?

User avatar
Lumpy Burgertushie
Registered User
Posts: 66339
Joined: Mon May 02, 2005 3:11 am
Contact:

Re: Login integration

Post by Lumpy Burgertushie » Mon Sep 02, 2013 7:26 pm

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
I'm baaaaaccckkkk. still doing work on donation basis. PM your needs.

Premium phpBB 3.2 Styles by PlanetStyles.net

If a tree falls in the forest and nobody is there, does it make a sound?

Altutto
Registered User
Posts: 19
Joined: Wed Jul 17, 2013 9:11 am

Re: Login integration

Post by Altutto » Mon Sep 02, 2013 7:45 pm

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: 66339
Joined: Mon May 02, 2005 3:11 am
Contact:

Re: Login integration

Post by Lumpy Burgertushie » Mon Sep 02, 2013 7:49 pm

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
I'm baaaaaccckkkk. still doing work on donation basis. PM your needs.

Premium phpBB 3.2 Styles by PlanetStyles.net

If a tree falls in the forest and nobody is there, does it make a sound?

Altutto
Registered User
Posts: 19
Joined: Wed Jul 17, 2013 9:11 am

Re: Login integration

Post by Altutto » Mon Sep 02, 2013 7:59 pm

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: 66339
Joined: Mon May 02, 2005 3:11 am
Contact:

Re: Login integration

Post by Lumpy Burgertushie » Mon Sep 02, 2013 8:04 pm

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
I'm baaaaaccckkkk. still doing work on donation basis. PM your needs.

Premium phpBB 3.2 Styles by PlanetStyles.net

If a tree falls in the forest and nobody is there, does it make a sound?

Altutto
Registered User
Posts: 19
Joined: Wed Jul 17, 2013 9:11 am

Re: Login integration

Post by Altutto » Mon Sep 02, 2013 8:11 pm

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: 66339
Joined: Mon May 02, 2005 3:11 am
Contact:

Re: Login integration

Post by Lumpy Burgertushie » Mon Sep 02, 2013 8:22 pm

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'];
    }
    ?>
I'm baaaaaccckkkk. still doing work on donation basis. PM your needs.

Premium phpBB 3.2 Styles by PlanetStyles.net

If a tree falls in the forest and nobody is there, does it make a sound?

Altutto
Registered User
Posts: 19
Joined: Wed Jul 17, 2013 9:11 am

Re: Login integration

Post by Altutto » Mon Sep 02, 2013 8:24 pm

Thank you very much, I'm going to try it tomorrow :)

User avatar
Lumpy Burgertushie
Registered User
Posts: 66339
Joined: Mon May 02, 2005 3:11 am
Contact:

Re: Login integration

Post by Lumpy Burgertushie » Mon Sep 02, 2013 8:25 pm

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
I'm baaaaaccckkkk. still doing work on donation basis. PM your needs.

Premium phpBB 3.2 Styles by PlanetStyles.net

If a tree falls in the forest and nobody is there, does it make a sound?

Altutto
Registered User
Posts: 19
Joined: Wed Jul 17, 2013 9:11 am

Re: Login integration

Post by Altutto » Mon Sep 02, 2013 8:32 pm

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 » Wed Sep 04, 2013 6:17 pm

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”