Results 1 to 10 of 10

Thread: [RESOLVED] Login & Logout problem

  1. #1

    Thread Starter
    Fanatic Member
    Join Date
    Jul 2009
    Posts
    524

    Resolved [RESOLVED] Login & Logout problem

    In this code Login and LogOut not work

    Code:
    <?php
    if ($user->data['user_id'] == ANONYMOUS)
    {
    echo"
    <div align='center'>
    Здравей, непознати човеко :)
    <form action=\"". append_sid("{$phpbb_root_path}ucp.$phpEx", 'mode=login', true, $user->session_id) . "\" method=\"post\">
    <input type=\"hidden\" name=\"mode\" value=\"login\"  />
    <br />
    <input type=\"text\" name=\"username\" class=\"textbox\" value=\"Потребител\" onfocus=\"if (this.value==this.defaultValue) this.value=''\" onblur=\"if (this.value=='') this.value=this.defaultValue\"  /><br /><br />
    &nbsp;<input type=\"password\" name=\"password\" onfocus=\"if (this.value==this.defaultValue) this.value=''\" onblur=\"if (this.value=='') this.value=this.defaultValue\" value=\"Парола\"  class=\"textbox\" />
    <input type=\"hidden\" name=\"autologin\" value=\"1\" /><br /><br />
    <label for='autologin'>Запомни ме? </label><input type='checkbox' name='autologin'  id='autologin'>
    <input type=\"submit\" value=\"Влез\" class=\"button\"  name=\"login\"  />
    <input type=\"hidden\" name=\"redirect\"  value=\"../index.$phpEx\" />
    </form>
    <div style='padding-top: 7px'>
    <form action=\"forum/ucp.php?mode=sendpassword\">
    <input type=\"submit\" class=\"button\" name=\"loss\" value=\" Забравена Парола \" />
    </form>
    
    <form action=\"forum/ucp.php?mode=register\"  > 
    <Input type=\"submit\" name=\"reg\" class=\"button\" value=\" Регистрация \" />
    </form>
    
    </div>
    </div>
    ";
    }
    else {
    }
    if($user->data['is_registered'])
    {
       include("$phpbb_root_path/includes/functions_display.php");
       echo '<div align="center">Здравей, <b><span style="color: #'. $user->data['user_colour'].' ">' . $user->data['username'] .'</span></b>!<br />';
       
       $ua = $user->data['user_avatar'];
       if (empty($ua))
       {
          echo '<br><img src="images/icons/no_avatar.gif" title="Нямаш аватар" width="90" height="90" alt=""/>';
       }else
       {
          echo get_user_avatar($ua, $user->data['user_avatar_type'], $user->data['user_avatar_width'], $user->data['user_avatar_height']);
       }
       echo '<br />';
       echo '<br />';
       echo '<img src="images/icons/post.png" title="коментари" alt="мнения"/> Брой мнения:  <b>' . $user->data['user_posts'] . '</b><br />';
       echo '<img src="images/icons/pm.png" title="лични съобщения" alt="ЛС-та"/> Нови лични съобщения:  <b>' . $user->data['user_new_privmsg'] . '</b><br />';
       echo '<img src="images/icons/message_16.png" title="невидяни" alt="непрочетени""/> Непрочетени:  <b>' . $user->data['user_unread_privmsg'] . '</b><br />';
       echo '<img src="images/icons/ip.gif" title="Твоят IP адрес" alt="Your IP adress"/> Твоето IP:  <b>' . $user->data['session_ip'] . '</b><br />';
       echo '<img src="images/icons/ban.png" title="Предупреждения" alt="warnings"/> Предупреждения:  <b>' . $user->data['user_warnings'] . '</b>';	
       
    $level = $user->data['group_id']; 
    $level = str_replace("1", "Анонимен", "$level"); 
    $level = str_replace("2", "Потребител", "$level"); 
    $level = str_replace("4", "Модератор", "$level"); 
    $level = str_replace("5", "Администратор", "$level"); 
    $level = str_replace("8", "VIP", "$level");
    $level = str_replace("9", "Server ADMIN", "$level");
    $level = str_replace("14", "Собственик", "$level");
    echo "<br /><img src=\"images/icons/rank.png\" title='Ранг' alt=\"Титла\"/> Ранг: <b>$level</b><br />";
    $level = $user->data['group_id'];
    $sid = $user->data['session_id'];
    if ($level == 5) { echo  " <font color='#FFFFFF'></font><a href=\"forum/adm/index.php?sid=$sid\"><b>[ Админ панел Форум ]</b></a><font color='#FFFFFF'></font>"; }//линк към админ панела
    echo "<br />";
    if ($level == 5) { echo  " <font color='#FFFFFF'></font><a href=\"admin/\"><b>[ Админ панел Сайт ]</b></a><font color='#FFFFFF'></font>"; }//линк към админ панела сайт
    if ($level == 14) { echo  " <font color='#FFFFFF'></font><a href=\"forum/adm/index.php?sid=$sid\"><b>[ Админ панел Форум ]</b></a><font color='#FFFFFF'></font>"; }//линк към админ панела
    else if ($level == 4) { echo  " <font color='#FFFFFF'></font><a href=\"forum/mcp.php?sid=$sid\"><b>[ Модераторски панел ]</b></a><font color='#FFFFFF'></font>"; }//линк към мод панела
    
    echo "<a href='/forum/ucp.php'><b><br>[ Редактирай профила ]</b></a><br />";
    
    
    echo"
    <form action=\"". append_sid("{$phpbb_root_path}ucp.$phpEx", 'mode=logout', true, $user->session_id) . "\" method=\"post\">
    <input type=\"hidden\" name=\"mode\" value=\"logout\"  />
    <div style='padding-top: 7px'><input type=\"submit\" value=\"Log Out\" class=\"button\" name=\"logout\"  /></div>
    <br> </br>
    </form></div>
    ";
    }
    else{  
    }
    ?>

  2. #2

    Thread Starter
    Fanatic Member
    Join Date
    Jul 2009
    Posts
    524

    Re: Login & Logout problem

    maybe cant connect good with phpbb forum ?

  3. #3
    Fanatic Member
    Join Date
    Jun 2008
    Posts
    1,023

    Re: Login & Logout problem

    I would suggest using the official phpbb forum for this, since we do not know the code used in the functions. I see a lot of html stuff here, but no actual code to make sense out of anything.

    https://www.phpbb.com/community/

  4. #4

    Thread Starter
    Fanatic Member
    Join Date
    Jul 2009
    Posts
    524

    Re: Login & Logout problem

    i use original phpbb forum but i cant manage to make in my website index login panel integrated with the phpbb

  5. #5

    Thread Starter
    Fanatic Member
    Join Date
    Jul 2009
    Posts
    524

    Re: Login & Logout problem

    here is my phpbb integrate
    Code:
    define('IN_PHPBB', true);
    $phpbb_root_path = (defined('PHPBB_ROOT_PATH')) ? PHPBB_ROOT_PATH : 'forum/';
    $phpEx = substr(strrchr(__FILE__, '.'), 1);
    include($phpbb_root_path . 'common.' . $phpEx);
    
    // Start session management
    $user->session_begin();
    $auth->acl($user->data);
    $user->setup();
    i had changed login.php with simply test and it shows connected or please login, so somewhere in this login that i presented has error for login and logout

  6. #6

    Thread Starter
    Fanatic Member
    Join Date
    Jul 2009
    Posts
    524

    Re: Login & Logout problem

    any fix how to make it work this login panel and logout with phpbb3 ?

  7. #7
    Fanatic Member
    Join Date
    Jun 2008
    Posts
    1,023

    Re: Login & Logout problem

    I meant you should register on the official phpbb community and ask your question there, because the people there will be more experienced on this specific subject.

  8. #8

    Thread Starter
    Fanatic Member
    Join Date
    Jul 2009
    Posts
    524

    Re: Login & Logout problem

    already writed there but nobody reply

  9. #9
    Freelancer akhileshbc's Avatar
    Join Date
    Jun 2008
    Location
    Trivandrum, Kerala, India
    Posts
    7,652

    Re: Login & Logout problem

    I am not sure whether this will help you or not! I found this while doing a quick search in Google:

    https://www.phpbb.com/support/docs/e...s-integration/


    If my post was helpful to you, then express your gratitude using Rate this Post.
    And if your problem is SOLVED, then please Mark the Thread as RESOLVED (see it in action - video)
    My system: AMD FX 6100, Gigabyte Motherboard, 8 GB Crossair Vengance, Cooler Master 450W Thunder PSU, 1.4 TB HDD, 18.5" TFT(Wide), Antec V1 Cabinet

    Social Group: VBForums - Developers from India


    Skills: PHP, MySQL, jQuery, VB.Net, Photoshop, CodeIgniter, Bootstrap,...

  10. #10

    Thread Starter
    Fanatic Member
    Join Date
    Jul 2009
    Posts
    524

    Re: Login & Logout problem

    i had tested it
    and it shows message you are logged (if first i loged in forum then open main website)
    but with this script something is not right

Posting Permissions

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



Click Here to Expand Forum to Full Width