Bravo List
Register
Go Back   > Bravo List > Source Code > Archived Trackers > TBDev > Mods & Themes
Reply
  #1  
Old 14th August 2011, 19:16
ddshow's Avatar
ddshow ddshow is offline
Senior Member
 
Join Date: Sep 2010
P2P
Posts: 25
Default Alternative Login Page TBDEV
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 "<br /><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 .="<br /><p><b>{$lang['login_cookies']}</b><br />
   <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' />        
     <br /><br />
      </tr><br /><br />"
;
   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><br /><br />';
   
$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><br />
   <select name="passhint">'
.$passhint.'</select>
   <br />
   <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'].'<br />'.$lang['signup_this_answer1'].'</font><br /><br />
   <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.='<br /><input type="checkbox" name="rulesverify" value="yes" /> '.$lang['signup_rules'].'<br />
   <input type="checkbox" name="faqverify" value="yes" /> '
.$lang['signup_faq'].'<br />
   <input type="checkbox" name="ageverify" value="yes" /> '
.$lang['signup_age'].'<br />';
     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('&amp;''&'$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.
Attached Files
File Type: rar login.rar (177.1 KB, 148 views)

Last edited by ddshow; 19th August 2011 at 09:42.
Reply With Quote
The Following 2 Users Say Thank You to ddshow For This Useful Post:
BEST (11th September 2011), bolzen (29th August 2011)
  #2  
Old 27th December 2011, 20:42
GuldlocK's Avatar
GuldlocK GuldlocK is offline
Senior Member
 
Join Date: Feb 2010
P2P
Posts: 22
Default screens ?
screens ?
Reply With Quote
  #3  
Old 30th December 2011, 15:04
ddshow's Avatar
ddshow ddshow is offline
Senior Member
 
Join Date: Sep 2010
P2P
Posts: 25
Default
Demo

http://web-kreation.com/demos/Slidin...panel_jquery/#
Reply With Quote
  #4  
Old 30th December 2011, 22:30
wdq's Avatar
wdq wdq is offline
Senior Member
 
Join Date: Mar 2010
P2P
Posts: 45
Smile Great JOB
Quote:
Originally Posted by ddshow View Post
Great job mate Thanks for this great login
Reply With Quote
  #5  
Old 3rd January 2012, 09:26
DAKz's Avatar
DAKz DAKz is offline
Black Cobra Hosting
 
Join Date: Jul 2009
P2P
Posts: 380
Talking This is really nice
Thanks m8, way to go
Reply With Quote
  #6  
Old 3rd January 2012, 12:26
unkn0wn's Avatar
unkn0wn unkn0wn is offline
Senior Member
 
Join Date: Jan 2012
Micronesia, Federated States of
Posts: 29
Default
looks good mate, hope i can get some use out of it :D
Reply With Quote
  #7  
Old 7th January 2012, 23:37
night's Avatar
night night is offline
Member
 
Join Date: Jan 2012
P2P
Posts: 1
Default
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
Reply With Quote
Reply

Tags
alternative , login , page , tbdev

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump



All times are GMT +2. The time now is 06:42. vBulletin skin by ForumMonkeys. Powered by vBulletin® Version 3.8.11 Beta 3
Copyright ©2000 - 2022, vBulletin Solutions Inc.