Forum Index
RegisterSearchFAQMemberlistUsergroupsLog in
Login box
Goto page Previous  1, 2, 3
 
Reply to topic    Forum Index » Additional Downloads View previous topic
View next topic
Login box
Author Message
ivanh



Joined: 16 Aug 2007
Posts: 72

Post Reply with quote
lol no luck at all ;'[
thanks for trying to help tho, much appreciated
kinda odd how this used to work for me =s
i might have to make my site transitional instead of strict and use an iframe in it =(
Tue Apr 29, 2008 8:00 pm View user's profile Send private message Visit poster's website
Guest








Please login to hide the ads.

Partyism



Joined: 25 Sep 2007
Posts: 400

Post Reply with quote
Hi i tried this mod again but i cant seem to logout in any kind of way?!
edit: lol suddenly it works :s
Wed Jun 11, 2008 4:09 pm View user's profile Send private message
Partyism



Joined: 25 Sep 2007
Posts: 400

Post Reply with quote
Well, it stopped working.

When i try to logout i get this error.

Warning: Cannot modify header information - headers already sent by (output started at /home/partyism/domains/partyism.nl/public_html/artikelen/plugins/latest_comments.php:138) in /home/partyism/domains/partyism.nl/public_html/artikelen/loginbox.php on line 61

Warning: Cannot modify header information - headers already sent by (output started at /home/partyism/domains/partyism.nl/public_html/artikelen/plugins/latest_comments.php:138) in /home/partyism/domains/partyism.nl/public_html/artikelen/loginbox.php on line 67

When i deactive the latest comments it just works
any idea?

edit: fixed it myself, by default in latest_comments.php at the end there a two blank lines, just delete those to and the problem is gone. Only the latest comments is generating a url that isnt working: http://partyism.nl/index.php/2008/07/27/%7Blink%7D#1511 any idea?
Thu Jul 31, 2008 7:21 am View user's profile Send private message
scottdallas



Joined: 04 May 2006
Posts: 2214
Location: US

Post Reply with quote
I found that I get that problem if I try to put any css styles or HTML.. basically any code at the beginning of the loginbox.php file or at the top of the file. What I've found if is you change and format the form down in the code later where the html for the form is at it stops the errors.

Are you including or iframing your loginbox? I iframed it, it seems to function smoothest like this so far...

_________________
Follow me: http://www.scodal.com - http://www.twitter.com/scodal - http://scodal.tumblr.com - http://www.scottdizzle.com - http://facebook.com/scodal
Tue Oct 28, 2008 12:34 am View user's profile Send private message Visit poster's website AIM Address
Partyism



Joined: 25 Sep 2007
Posts: 400

Post Reply with quote
Hey Scott,

I only included it and it works fine for me!

index.php
Code:
<?PHP include("artikelen/loginbox.php"); ?>   


loginbox.php
Code:
<?php
///////////////////////////////////////////////////////////////////
//
//Login box by FI-DD
//http://english.cutenews.ru/forum/profile.php?mode=viewprofile&u=2
//Based on:http://www.xs4all.nl/~cvdtak/loginbox_1.0.htm
//
///////////////////////////////////////////////////////////////////

if (!defined('CN_INIT_LOGINBOX')) {

   define('CN_INIT_LOGINBOX', true);

   $echo = cute_lang();
   if(session){
      session_start();
   }
   $username = $_POST['username'];
   $password = $_POST['password'];
   
   if($_POST['act'] == 'dologin'){
      $is_logged_in = false;
         if ($username){
            $cmd5_password = md5x($password);
      
            if (check_login($username, $cmd5_password)){
               $cookie_logged = true;
               
               if(cookie){
                  @setcookie('login_username', $username, time() + 3600 * 24 * 365);
               }
               if(session){
                  session_register('login_username');
                  $_SESSION['login_username'] = $username;
               }
      
            } else {
               $error = '<font color="red">'.$echo['loginError'].'</font>';
               $cookie_logged = false;
            }
         }

      
      if ($cookie_logged){
         $is_logged_in = true;
      
         if ($_POST['act'] == 'dologin'){
            $sql->update(array(
            'table'    => 'users',
            'where'    => array("username = $username"),
            'values' => array('last_visit' => (time() + $config_date_adjust * 60))
            ));
         }
         
         header('Location: '.$PHP_SELF);
      }
   }
   
   if($_GET['act'] == 'logout'){
      if(cookie){
         setcookie('login_username', '', time() - 3600 * 24 * 365);
      }
      if(session){
         @session_destroy();
         @session_unset();
      }
      header('Location: '.$PHP_SELF);
   }
   
   if(cookie){
      if(!$_COOKIE['login_username']){
         $is_logged_in = false;
      }
      else{
         $is_logged_in = true;
      }
   }
   if(session){
      if(!session_is_registered('login_username') || $_SESSION['login_username'] == "") {
         $is_logged_in = false;
      }
      else{
         $is_logged_in = true;
      }
   }

}
else{

   if (!$is_logged_in){
   
   //The login box
   ?>
   <form method="post" action="<?=$PHP_SELF; ?>">
   <table>
      <tr>
         <td>Gebruikersnaam: <input type="text" name="username" size="14"></td>
         <td><td>Wachtwoord: <input type="password" name="password" size="14"></td>
         <td><input type="submit" value="OK"></td>
      <tr>
   </table>
   <input type="hidden" name="act" value="dologin">
</form>
   <?
   
   
   }
   else{
      echo 'Ingelogd als: <strong>'.($username ? $username : (cookie ? $_COOKIE['login_username'] : $_SESSION['login_username'])).'</strong>
      <a href="http://www.mysite.com/cuteru.nl/artikelen/?mod=personal" target="_blank">Profiel wijzigen</a>
      <a href="http://www.mysite.com/leden"><span class="new">Leden</span></a>
      <a href="http://www.mysite.com/cuteru/?mod=addnews" target="_blank">Nieuws Submit</a>
      <a href="http://www.mysite.com/cuteru/index.php?mod=options&action=pm" target="_blank">Inbox ('.count_unread_messages().')</a>
      <a href="'.$PHP_SELF.'?act=logout">Log uit</a>';
   }
   
   echo $error;

}

?>


Make sure you delete the last 2 blank lines in latest_comments.php That solves the error
Tue Oct 28, 2008 8:02 am View user's profile Send private message
scottdallas



Joined: 04 May 2006
Posts: 2214
Location: US

Post Reply with quote
Cool! I just removed the last two lines in /plugins/latest_comments.php and uploaded. I'll have to try to include it instead of iframe it and see how it reacts. The whole page refreshes now doesn't it?

_________________
Follow me: http://www.scodal.com - http://www.twitter.com/scodal - http://scodal.tumblr.com - http://www.scottdizzle.com - http://facebook.com/scodal
Tue Oct 28, 2008 3:34 pm View user's profile Send private message Visit poster's website AIM Address
Partyism



Joined: 25 Sep 2007
Posts: 400

Post Reply with quote
Jep it does
Tue Oct 28, 2008 4:35 pm View user's profile Send private message
faustao



Joined: 28 Nov 2008
Posts: 7
Location: Brazil

Post How to salute to Nickname? Reply with quote
Hi,

How can I make it show "Logged in as '$name'" instead of "Logged in as '$username'" ?

Thanks a lot for your help.
Fri Nov 28, 2008 3:13 pm View user's profile Send private message
FI-DD
Admin


Joined: 22 Sep 2005
Posts: 2973
Location: Germany

Post Reply with quote
Try to change this:
Code:
echo 'Logged in as <b>'.($username ? $username : (cookie ? $_COOKIE['login_username'] : $_SESSION['login_username'])).'</b>. <br /><a href="'.$PHP_SELF.'?act=logout">Log out.</a>';


to this:
Code:
echo 'Logged in as <b>'.($username ? $user_name[$username] : (cookie ? $user_name[$_COOKIE['login_username']] : $user_name[$_SESSION['login_username']])).'</b>. <br /><a href="'.$PHP_SELF.'?act=logout">Log out.</a>';

Fri Dec 05, 2008 6:21 pm View user's profile Send private message
faustao



Joined: 28 Nov 2008
Posts: 7
Location: Brazil

Post Reply with quote
Thank you FI-DD. You are the best.
Sat Dec 06, 2008 4:47 am View user's profile Send private message
Triton



Joined: 10 Mar 2009
Posts: 7

Post Reply with quote
I was having trouble with this one too, but then I think that I fixed it. My problem was related to something brought up in another post, so I posted my fix there:
http://forums.cutenewsru.com/using-log-in-registration-problem-going-between-admin-site-t2461.html#15693
Wed Mar 11, 2009 7:24 am View user's profile Send private message
DarkSlim



Joined: 06 Aug 2009
Posts: 286
Location: IL

Post Reply with quote
It's pretty buggy, but after some work I managed to make it work 100%!
The log in box itself does-not use iframe, but after the login, the welcome
message is in an iframe that I made to look normally (without borders etc')

This is my code (with my design etc' you can change it as you want):


This is the Login Box code that you put where you want it to
show in the page:
Code:

<!------ Login Box------>
<? if (!$is_logged_in){ ?>
<div align="center">
<table border="0" cellspacing="0" cellpadding="0" width="138" align="center">
 <form name="login" action="" method="post" onsubmit="return process_form(this)">
  <tr>
   <td width="55" style="font-size:14px;"><div align="left">User:</div></td>
   <td><input tabindex="1" type="text" name="username" value="<?=$lastusername; ?>" style="width:73px"></td>
  </tr>
  <tr>
   <td  style="font-size:14px;"><div align="left">Password:</div></td>
    <td><input type="password" name="password" style="width:73px"></td>
  </tr>
  <tr>
   <td></td>
   <td><div align="center"><input accesskey="s" type="submit" style="font-size:12px;width:45px;" value="Log In"></div></td>
   </tr>
   <tr>
    <td align="center" colspan="3"><font size="1"><?=$result; ?></td>
  </tr>
 <input type="hidden" name="action" value="dologin">
 </form>
</table></div>


<?
}

elseif ($is_logged_in){
?>

<iframe name="loginbox" src="cms/indexlog.php" width="138" height="100" frameborder="0" marginheight="0" marginwidth="0"  align="center">
  <font size="2">Your browser does not support I-Frames</font>
</iframe>
<?
}
?>
<!------ ENDLogin Box------>



* Change "cms/indexlog.php" to your location of the cutenews ru directory!

Then, make a new file in the cutenews ru directory called: indexlog.php,
and pase this inside (it is a modified version of cnru index.php):

Code:

<?php

$PHP_SELF             = 'indexlog.php';
$config_cutenews_version = 'CuteNews.RU';
$config_cutenews_built    = '2.5.4';

#-------------------------------------------------------------------------------


include_once 'head.php';

@chmoddir($cutepath.'/data', chmod);
@chmoddir($cutepath.'/cache', chmod);
@chmod($cutepath.'/data', 0755);

$timer = new microTimer;
$timer->start();

if ($action == 'logout'){
   setcookie('md5_password', '', time() - 3600 * 24 * 365, '/');
   setcookie('username', '', time() - 3600 * 24 * 365, '/');
   setcookie('login_referer', '');
   @session_destroy();
   @session_unset();
   @setcookie(session_name(), '');
?>

<!-- Javascript redirect -->
<script type="text/javascript">self.location.href="<?=$_SERVER['PHP_SELF']; ?>";</script>

<?
}

b64dck();

// If User is Not Logged In, Display The Logout Message
if (!$is_logged_in){
   if (session){
      @session_destroy();
      @session_unset();
   }

   setcookie('username', '', time() - 3600 * 24 * 365, '/');
   setcookie('password', '');
   setcookie('md5_password', '', time() - 3600 * 24 * 365, '/');
   setcookie('login_referer', '');
   //echoheader('user', $echo['header']);
?>

<!-- The Logout Message -->
<br>You have logged out successfuly!

<?
   //echofooter();
} elseif ($is_logged_in){
   if (check_referer){
      $self = $_SERVER['SCRIPT_NAME'];

      if (!$self){
         $self = $_SERVER['REDIRECT_URL'];
      }

      if (!$self){
         $self = $PHP_SELF;
      }

      if (!eregi($self, $HTTP_REFERER) and $HTTP_REFERER){
         echo sprintf($echo['badReferer'], $PHP_SELF);
         exit;
      }
   }

   //Logged in Message
    echo '<div align="right" dir="rtl"><font size="1px" face="arial"><br><font size="2px">Welcome, <br><b>'.($username ? $username : (cookie ? $_COOKIE['login_username'] : $_SESSION['login_username'])).'</b>. <br /><br><a href="'.$PHP_SELF.'?action=logout">Log Out</a></div>';


}
?>



* I have adjusted it to english and all, but you may still need to change it a little bit (havn't checked)
so it will look perfectly as you want it (as I used it for a "right to left" language)

Thats it, you will be able to show a log in box without an iframe (while not logged in)
and when logging in, it is directing it to load a nice stealth iframe, and when logging out it
goes back to the awesome login box. Very Happy

Hope that helps ^^

_________________
Portfolio: www.Yaniv.tk

Some of my Plugins and Mods and more in the CuteNewsRU Index!

Donations Accepted, Thank you
Mon Oct 12, 2009 4:44 pm View user's profile Send private message Visit poster's website
Goberg



Joined: 18 Jan 2007
Posts: 67

Post Reply with quote
I have a problem with redirecting after logging in.

I have the login box in a file called view-films.php, this is also the file that i am showing the full story articles in. So if anyone is reading an article, say the url to the article is http://www.myurl.com/view-films.php?id=11 . The user could log in from this site but they get redirected to http://www.myurl.com/view-films.php instead of http://www.myurl.com/view-films.php?id=11.

I am using FIDDs original script and it is working good for me, I just want this redirection to work. Any help?
Mon May 31, 2010 3:45 am View user's profile Send private message
DarkSlim



Joined: 06 Aug 2009
Posts: 286
Location: IL

Post Reply with quote
Goberg wrote:
I have a problem with redirecting after logging in.

I have the login box in a file called view-films.php, this is also the file that i am showing the full story articles in. So if anyone is reading an article, say the url to the article is http://www.myurl.com/view-films.php?id=11 . The user could log in from this site but they get redirected to http://www.myurl.com/view-films.php instead of http://www.myurl.com/view-films.php?id=11.

I am using FIDDs original script and it is working good for me, I just want this redirection to work. Any help?


I don't really use FI-DD's login box, but try this:

Find:
Code:

   //The login box
   ?>
   <form method="post" action="<?=$PHP_SELF; ?>">


Now change the: <?=$PHP_SELF; ?>
To: http://www.myurl.com/view-films.php
The page that you want to be transfered to Smile

_________________
Portfolio: www.Yaniv.tk

Some of my Plugins and Mods and more in the CuteNewsRU Index!

Donations Accepted, Thank you
Mon May 31, 2010 7:56 am View user's profile Send private message Visit poster's website
Goberg



Joined: 18 Jan 2007
Posts: 67

Post Reply with quote
DarkSlim wrote:
Find:
Code:

   //The login box
   ?>
   <form method="post" action="<?=$PHP_SELF; ?>">


Now change the: <?=$PHP_SELF; ?>
To: http://www.myurl.com/view-films.php
The page that you want to be transfered to Smile


I don't want it to go to http://www.myurl.com/view-films.php , I want it to go to http://www.myurl.com/view-films.php?id={id} where {id} is the news-item the user is currently viewing.
Mon May 31, 2010 9:41 am View user's profile Send private message
Display posts from previous:    
Reply to topic    Forum Index » Additional Downloads All times are GMT + 1 Hour
Goto page Previous  1, 2, 3
Page 3 of 3

 
Jump to: 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum



Powered by phpBB © 2001, 2005 phpBB Group
Design by Freestyle XL / Music Lyrics.