Login & Logout problem

Discussion forum for MOD Writers regarding MOD Development.
luckydead
Registered User
Posts: 25
Joined: Fri Jan 20, 2012 7:01 pm

Login & Logout problem

Post by luckydead »

Hello
I have a website and forum system phpbb3
and i wanted to make my login (from website) to login with details from forum (account password)
but login on website not work
also logout too

Example: if i login in web/forum/ (in my forum)
and then go to my website in control panel show me as logged, but when i click button LogOut, nothing happends, the same if i try to login from website panel

Code: Select all

<?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{  
}
?>
Last edited by Oyabun1 on Fri May 22, 2015 8:29 am, edited 1 time in total.
Reason: Moved from 3.0.x Support forum
luckydead
Registered User
Posts: 25
Joined: Fri Jan 20, 2012 7:01 pm

Re: Login & Logout problem

Post by luckydead »

any help please

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