Bravo List

Bravo List (http://www.bvlist.com/index.php)
-   Mods & Themes (http://www.bvlist.com/forumdisplay.php?f=109)
-   -   Alternative Login Page TBDEV (http://www.bvlist.com/showthread.php?t=6863)

ddshow 14th August 2011 19:16

Alternative Login Page TBDEV
 
1 Attachment(s)
PHP Code:

 <?php
/**
Modified From U-232 
 for TBDEV(2009) BY STECKEL(ddshow)
 **/
//== Code from Webkreations
//= Alt login by mindless
require_once("/include/bittorrent.php");
require_once(
"/include/user_functions.php");
require_once(
"/include/class/page_verify.php");
require_once(
"/cache/timezones.php");
dbconn(false);

  
$lang array_mergeload_language('global'), load_language('signup') , load_language('login'));
  
$newpage = new page_verify(); 
  
$newpage->create('take_forms');
  if (
get_row_count('users') >= $TBDEV['maxusers'])
    
stderr($lang['stderr_errorhead'], sprintf($lang['stderr_ulimit'], $TBDEV['maxusers']));
  
$htmlout $passhint $year $month $day '';

  
//== shorten timezone 
  
function CutName_TZ ($txt$len=38){
  return (
strlen($txt)>$len substr($txt,0,$len-1) .'...':$txt);
  }

 
//== 09 failed logins
    
function left ()
    {
    global 
$TBDEV;
    
$total 0;
    
$ip sqlesc(getip());
    
$fail mysql_query("SELECT SUM(attempts) FROM failedlogins WHERE ip={$ip}") or sqlerr(__FILE____LINE__);
    list(
$total) = mysql_fetch_row($fail);
    
$left $TBDEV['failedlogins'] - $total;
    if (
$left <= 2)
    
$left "<font color='red' size='4'>{$left}</font>";
    else
    
$left "<font color='green' size='4'>{$left}</font>";
    return 
$left;
    }
    
//== End Failed logins
  //==timezone
  
$offset = (string)$TBDEV['time_offset'];
  
$time_select "<select name='user_timezone'>";
  foreach( 
$TZ as $off => $words )
  {
  if ( 
preg_match("/^time_(-?[\d\.]+)$/"$off$match))
  {
  
$time_select .= $match[1] == $offset "<option value='{$match[1]}' selected='selected'>".CutName_TZ($words)."</option>\n" "<option value='{$match[1]}'>".CutName_TZ($words)."</option>\n";
  }
  }
  
$time_select .= "</select>";
  
//==
   //== Normal Entry Point...
   //== click X by Retro
   
$value = array('...','...','...','...','...','...');
   
$value[rand(1,count($value)-1)] = 'X';
   
$htmlout .="<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\"
     \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">
     <html xmlns='http://www.w3.org/1999/xhtml'>
     <head>
   <meta name='generator' content='TBDEV' />
     <meta name='MSSmartTagsPreventParsing' content='TRUE' />
     <title>Login</title>
   <link rel='stylesheet' href='css/start.css' type='text/css' media='screen' />
   <script src='js/jquery.js' type='text/javascript'></script>
   <script src='js/slide.js' type='text/javascript' ></script>
   <script src='js/jquery.simpleCaptcha-0.2.js' type='text/javascript'></script>
   <script src='js/jquery.pstrength-min.1.2.js' type='text/javascript'></script>
   <script src='js/check.js' type='text/javascript'></script>
   <script src='captcha/captcha.js' type='text/javascript'></script>
   </head><body>"
;
   
$htmlout .="
   <script type='text/javascript'>
     /*<=!=[=C=D=A=T=A=[*/
     $(document).ready(function () {
     $('#captchalogin').simpleCaptcha();
   });
   /*]=]=>*/
   </script>
   <!-- Panel -->
   <div id='toppanel'>
   <div id='panel'>
     <div class='content clearfix'>
   <div class='left'>"
;
   unset(
$returnto);
   if (!empty(
$_GET["returnto"])) {
   
$returnto htmlspecialchars($_GET["returnto"]);
   if (!isset(
$_GET["nowarn"])) 
   {
   
$htmlout .= "<label class='grey'>{$lang['login_not_logged_in']}</label>\n";
   
$htmlout .= "<label class='grey'>{$lang['login_error']}</label>";
   }
   }
   
$htmlout .="<p><b>{$lang['login_cookies']}</b>
   <b>[
{$TBDEV['failedlogins']}]</b> {$lang['login_failed']}</p>
   <p>
{$lang['login_failed_1']} <b>".left()."</b> {$lang['login_failed_2']}</p>
   </div>
   <!-- Login Form -->    
     <div class='left'>
     <form class='clearfix' action='../takelogin.php' method='post'>
     <noscript>
{$lang['login_noscript']}</noscript>
     <h1>
{$lang['login_member']}</h1>
     <label class='grey'><b>
{$lang['login_username']}</b></label>
     <input class='field' type='text' name='username' size='23' />
     <label class='grey'><b>
{$lang['login_password']}</b></label>
     <input class='field' type='password' name='password' size='23' />        
     
      </tr>"
;
   for (
$i=0$i count($value); $i++) {
   
$htmlout .="<input name=\"submitme\" type=\"submit\" value=\"".$value[$i]."\" class=\"btn\" />";
   }
   
$htmlout .='<div class="clear"></div>
   <label class="grey"><b>'
.$lang['login_click'].' <strong>'.$lang['login_x'].'</strong></b></label>
   '
.$lang['login_forgot_1'].'</form></div>';
   
//==Signup begins
   
$htmlout .="
   <script type='text/javascript'>
   /*<=!=[=C=D=A=T=A=[*/
   $(function() {
   $('.password').pstrength();
   });
   /*]=]=>*/
   </script>"
;
   
//== click X by Retro
   
$value_s = array('...','...','...','...','...','...');
   
$value_s[rand(1,count($value_s)-1)] = 'X';
   
$htmlout .='<!-- Register Form -->    
     <div class="left right">            
     <form action="../takesignup.php" method="post">
     <h1>'
.$lang['signup_sgnup'].'</h1>                
     <label class="grey"><b>'
.$lang['signup_uname'].'</b></label>    
     <input class="field" type="text" size="40" name="wantusername" id="wantusername" onblur="checkit();" />
     <div id="namecheck"></div>
     <label class="grey"><b>'
.$lang['signup_pass'].'</b></label>
     <label class="grey"><input class="password" type="password" size="40" name="wantpassword" /></label>
     <label class="grey"><b>'
.$lang['signup_passa'].'</b></label>
     <input class="field" type="password" size="23" name="passagain" />                    
     <label class="grey"><b>'
.$lang['signup_email'].'</b></label>
     <input class="field" type="text" size="23" name="email" />
     <label>'
.$lang['signup_valemail'].'</label>';
   
$questions = array(
     array(
"id"=> "1""question"=> "{$lang['signup_q1']}"),
     array(
"id"=> "2""question"=> "{$lang['signup_q2']}"),
     array(
"id"=> "3""question"=> "{$lang['signup_q3']}"),
     array(
"id"=> "4""question"=> "{$lang['signup_q4']}"),
     array(
"id"=> "5""question"=> "{$lang['signup_q5']}"),
     array(
"id"=> "6""question"=> "{$lang['signup_q6']}"));
   foreach(
$questions as $sph) {
   
$passhint .= "<option value='" $sph['id'] . "'>" $sph['question'] . "</option>\n";
   }
   
$htmlout .='<label class="grey"><b>'.$lang['signup_select'].'</b></label>
   <select name="passhint">'
.$passhint.'</select>
   
   <label class="grey"><b>'
.$lang['signup_enter'].'</b></label>
   <input class="field" type="text" size="23"  name="hintanswer" /><br/>
   <font class="small">'
.$lang['signup_this_answer'].''.$lang['signup_this_answer1'].'</font>
   <div id="captchaimage">
   <a href="'
.$_SERVER['PHP_SELF'].'" onclick="refreshimg(); return false;" title="Click to refresh">
   <img class="cimage" src="captcha/GD_Security_image2.php?'
.time().'" alt="Oops,missing ATM" />
   </a>
   </div>
     <label class="grey"><b>'
.$lang['captcha_pin'].'</b></label> 
     <input class="field" type="text" size="23" maxlength="6" name="captcha" id="captcha" onblur="checks(); return false;"/>
   <label class="grey"><b>'
.$lang['signup_timez'].'</b></label> 
   <div class="field">'
.$time_select.'</div>';
   
$htmlout.='<input type="checkbox" name="rulesverify" value="yes" /> '.$lang['signup_rules'].'
   <input type="checkbox" name="faqverify" value="yes" /> '
.$lang['signup_faq'].'
   <input type="checkbox" name="ageverify" value="yes" /> '
.$lang['signup_age'].'';
     for (
$i=0$i count($value_s); $i++) {
   
$htmlout .="<input name=\"submitme\" type=\"submit\" value=\"".$value_s[$i]."\" class=\"btn\" />";
   }
   
$htmlout .='<div class="clear"></div>
   <label class="grey"><b>'
.$lang['signup_click'].' <strong>'.$lang['signup_x'].'</strong> '.$lang['signup_click1'].'</b></label>
     </form>        
     </div>
     </div>    
   </div> 
   <!-- The tab on top -->
   <div class="tab">
     <ul class="login">
     <li class="left">&nbsp;</li>
     <li>'
.$lang['signup_guest'].'</li>
     <li class="sep">|</li>
     <li id="toggle">
     <a id="open" class="open" href="#">'
.$lang['signup_u_panel'].'</a>
     <a id="close" style="display: none;" class="close" href="#">'
.$lang['signup_c_panel'].'</a>            
     </li>
     <li class="right">&nbsp;</li>
     </ul> 
     </div><!-- / top --></div><!--panel -->'
;
   if (isset(
$returnto))
   
$htmlout .="<input type=\"hidden\" name=\"returnto\" value=\"" htmlspecialchars($returnto) . "\" />\n";
   
$htmlout .='</body></html>';
echo  
$htmlout;
?>

Add to lang/en/lang_login.php :

PHP Code:

'login_cookies' => "Note: You need cookies enabled to sign up or log in.",
'login_cookies1' => "Note: if your experiencing login issues delete your old cookies.",
'login_failed' => "failed logins in a row will result in banning your ip",
'login_failed_1' => "You have",
'login_failed_2' => "login attempt(s) remaining.",
'login_click' => "Now click the button marked ",
'login_x' => "X",
'login_use_ssl' => "Use ssl",
'login_ssl1' => "Browse the site using a secure connection just this session",
'login_ssl2' => "Browse the site using a secure connection permanently",
'login_member' => "Member Login",
'login_noscript' => "Javascript must be enabled to login and use this site.",
'login_forgot_1' => "<a class=\"lost-pwd\" href=\"../resetpw.php\">Lost your password?</a>"

Edit:

PHP Code:

'login_error' => "<p><b>Error:</b> The page you tried to view can only be used when you're logged in.</p>\n"

to

PHP Code:

'login_error' => "<b>Error:</b> The page you tried to view can only be used when you're logged in.\n"

Add to lang/en/lang_signup.php :

PHP Code:

'signup_guest' => "Hello Guest!",
'signup_u_panel' => "User panel",
'signup_c_panel' => "Close panel",
'signup_sgnup' => "Sign up",
'signup_birth' => 'Birthday',
'signup_click' => "Now click the button marked",
'signup_x' => "X",
'signup_click1' => "to complete the sign up!",
'signup_noscript' => "Javascript must be enabled to login and use this site.",
'signup_year' => "Year",
'signup_month' => "Month",
'signup_jan' => "January",
'signup_feb' => "Febuary",
'signup_mar' => "March",
'signup_apr' => "April",
'signup_may' => "May",
'signup_jun' => "June",
'signup_jul' => "July",
'signup_aug' => "August",
'signup_sep' => "September",
'signup_oct' => "October",
'signup_nov' => "November",
'signup_dec' => "December",
'signup_day' => "Day"

takesignup.php find :

PHP Code:

foreach( array('wantusername','wantpassword','passagain','email','captchaSelection','submitme','passhint','hintanswer') as $x )
    {
      if( !isset(
$_POST$x ]) )
      {
        
stderr($lang['takesignup_user_error'], $lang['takesignup_form_data']);
      }
      
      ${
$x} = $_POST$x ];
    } 

to
PHP Code:

foreach( array('wantusername','wantpassword','passagain','email','captcha','submitme','passhint','hintanswer') as $x )
    {
      if( !isset(
$_POST$x ]) )
      {
        
stderr($lang['takesignup_user_error'], $lang['takesignup_form_data']);
      }
      
      ${
$x} = $_POST$x ];
    } 

And this in include/class/page_verify.php

PHP Code:

 <?php
/**
 *   Licence Info: GPL
 *   Copyright (C) 2010 U-232
 **/
// session so that repeated access of this page cannot happen without the calling script.
//
// You use the create function with the sending script, and the check function with the
// receiving script...
//
// You need to pass the value of $task from the calling script to the receiving script. While
// this may appear dangerous, it still only allows a one shot at the receiving script, which
// effectively stops flooding.
     
      
class page_verify
      
{
      function 
page_verify ()
      {
      if (
session_id () == '')
      {
      
session_start ();
      }
      }
    
      function 
create ($task_name 'Default')
      {
      global 
$CURUSER;
      
$_SESSION['Task_Time'] = time ();
      
$_SESSION['Task'] = md5('user_id:' $CURUSER['id'] . '::taskname-' $task_name '::' $_SESSION['Task_Time']);
      
$_SESSION['HTTP_USER_AGENT'] = $_SERVER['HTTP_USER_AGENT'];
      }
      
      function 
check ($task_name 'Default')
      {
      global 
$CURUSER$TBDEV$lang;
      
$returl = (isset($_SERVER['HTTP_REFERER'])?htmlspecialchars($_SERVER['HTTP_REFERER']):$TBDEV['baseurl']."/login.php");
      
$returl str_replace('&''&'$returl); 
      if (isset(
$_SESSION['HTTP_USER_AGENT']) && $_SESSION['HTTP_USER_AGENT'] != $_SERVER['HTTP_USER_AGENT'])
      
stderr("Error""Please resubmit the form. <a href='".$returl."'>Click HERE</a>",false);
      
//if (isset($_SESSION['Task']) != md5('user_id:' . $CURUSER['id'] . '::taskname-' . $task_name . '::' . isset($_SESSION['Task_Time'])))
      
if ($_SESSION['Task'] != md5('user_id:' $CURUSER['id'] . '::taskname-' $task_name '::' $_SESSION['Task_Time']))
      
stderr("Error""Please resubmit the form. <a href='".$returl."'>Click HERE</a>",false);
      
$this->create ();
      }
      }
?>

That is all. Is not full tested ,if dont work post and i edit the post.

GuldlocK 27th December 2011 20:42

screens ?
 
screens ?

ddshow 30th December 2011 15:04

Demo

http://web-kreation.com/demos/Slidin...panel_jquery/#

wdq 30th December 2011 22:30

Great JOB
 
Quote:

Originally Posted by ddshow (Post 31937)

Great job mate Thanks for this great login

DAKz 3rd January 2012 09:26

This is really nice
 
Thanks m8, way to go:drink:

unkn0wn 3rd January 2012 12:26

looks good mate, hope i can get some use out of it :D

night 7th January 2012 23:37

can anyone help me, where I find this script?

PHP Code:

    $value = array('...','...','...','...','...','...');
    
$value[rand(1,count($value)-1)] = 'X';


     <
td align='center' colspan='2'>Now click the button marked <strong>X</strong></td



All times are GMT +2. The time now is 18:03.

Powered by vBulletin® Version 3.8.11 Beta 3
Copyright ©2000 - 2024, vBulletin Solutions Inc.