Author Topic: hello, good application  (Read 1575 times)

chve

  • Stalker
  • *
  • Posts: 2
  • Karma: +0/-0
  • Newbie :)
    • View Profile
hello, good application
« on: 25-01-2016 16:25 »
Good application to local network, the jukebox mode works really well together VLC. I like, but you need a theme 100% responsive.  :-\


LOGIN_BOOTSTRAP.php
<?php
// 0.8.5: Avoid "not-installed-stuff":
if (!file_exists('db.php')) {
   echo 'It seems like you have not <b>installed</b> AmpJuke, yet.<br>';
   echo 'If that is true, you might try <a href="./">this link</a>.<br>';
   echo 'Please note there is a complete step-by-step installation guide <a href="http://www.ampjuke.org/?id=installation">right here</a> (opens in a new window/tab.';
   die();
}
// 0.7.2: Generate the uuid:
function make_uuid($prefix) {
    $chars = md5(uniqid(rand()));
    $uuid  = substr($chars,0,8) . '-';
    $uuid .= substr($chars,8,4) . '-';
    $uuid .= substr($chars,12,4) . '-';
    $uuid .= substr($chars,16,4) . '-';
    $uuid .= substr($chars,20,12);
    return $prefix . $uuid;
}
require("db.php"); // 0.7.7: Moved here -> banned_ip's are now configurable:

// 0.7.5: Ban IP if number of failed login attempts is higher than X.
// 0.7.7: Only ban if enabled
if ((isset($max_failed_login_enabled)) && ($max_failed_login_enabled=='1')) {
   $count=0;
   if (file_exists('./tmp/banned_ips.txt')) {
      $handle=fopen('./tmp/banned_ips.txt', 'r');
      while (!feof($handle)) {
         $line=fgets($handle);
         if (trim($line)==trim($_SERVER["REMOTE_ADDR"])) {
            $count++;
         }
      }
      fclose($handle);
      if ($count>$max_failed_login_attempts) {
         die('Sorry, too many wrong login attempts. IP-address is banned.');
      }
   }   
}          


// 0.6.3: Remember login ?? Don't display anything - simply redirect right away:
// 0.8.1: ...but ONLY if "login_hide_keep_me_signed_in" isn't set:
if ((isset($_COOKIE['ampjuke_remember_all'])) && ((!isset($login_hide_keep_me_signed_in)) || ($login_hide_keep_me_signed_in<>'1'))) {
    $def_navn=$_COOKIE['ampjuke_username'];
   $def_pass=$_COOKIE['ampjuke_password'];
   echo '<form name="login" method="POST" action="loginvalidate.php">';
   echo '<input type="text" name="login" value="'.$def_navn.'">';
   echo '<input type="password" name="password" value="'.$def_pass.'">';
   echo '<input type="hidden" name="remember_login" value="1">';
   echo '<input type="hidden" name="saved_url_params" value="'.$_SERVER["QUERY_STRING"].'">';

   // 0.7.2: Create temporary file, so loginvalidate.php knows we were here:
    $uuid  = './tmp/'.make_uuid('').'.tmp';
    touch($uuid);
    echo '<input type="hidden" name="uuid" value="'.$uuid.'">';
   
   print '<script language="JavaScript"> document.login.submit(); </script>';
}
// 0.6.1: Login.php now uses css-definitions to ease customization of the loginpage.
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>AmpJuke - Login</title>
<link rel="stylesheet" type="text/css" href="./bootstrap/css/bootstrap.min.css">
<link rel="stylesheet" type="text/css" href="./ampstyles_responsive.css">
</head>
<body>
<div class="container">
<noscript>
<h3 align="center"><font color="red">Please turn on JavaScript - AmpJuke relies on it</h3>
</noscript>
 <div class="logo_img">
  <img src="./ampjukeicons/ampjuke_login.jpg" class="img-responsive" alt="AmpJuke Jukebox">
 </div>

 <form role="form" name="login" method="POST" action="loginvalidate.php">
<?php
// Create temporary file, so loginvalidate.php knows we were here (-> attempt to avoid POSTing from remote site):
$uuid  = './tmp/'.make_uuid('').'.tmp';
touch($uuid);
echo '<input type="hidden" name="uuid" value="'.$uuid.'">';
?>
  <div class="form-group">
    <label for="usuario">USUARIO</label>
    <input type="text" name="login" tabindex=1 class="form-control" id="usuario"
           placeholder="Introduce tu nombre de Usuario">
<?php
if (isset($demo)) { echo ' <i>Demo, - use: <b>ampjuke</b></i>'; }
// 0.8.4: User-registration enabled ?
if ((isset($user_reg_enabled)) && ($user_reg_enabled==1)) {
   echo '<a href="./userreg.php?act=new&uuid='.str_replace('./tmp/','',$uuid);
   echo '">'.$user_reg_display_text.'</a>';
}
?>
  </div>

  <div class="form-group">
    <label for="pass">CONTRASEƑA</label>
    <input type="password" name="password" tabindex=2 class="form-control" id="pass"
           placeholder="Introduce tu ContraseƱa">
<?php
if (isset($demo)) { echo ' <i>Demo, - use: <b>ampjuke</b></i>'; }
// 0.8.4: Enable retrieval of password ?
if ((isset($enable_email_with_lost_password)) && ($enable_email_with_lost_password==1)) {
   echo '<a href="./userreg.php?act=forgot_passwd&uuid='.str_replace('./tmp/','',$uuid).'">';
   echo $enable_email_with_lost_password_text.'</a>';
}
?>
  </div>
<!-- 0.6.3: New, AmpJuke offers "Keep me logged in" -->
<?php
// 0.8.1: This is always displayed, UNLESS 'Hide "Keep me signed in"' is configured in miscellaneous sttings:
if ((!isset($login_hide_keep_me_signed_in)) || ($login_hide_keep_me_signed_in<>'1')) {
  echo '<div class="checkbox">';
  echo '<p>Activa esta casilla para ser Recordado.</p>';
  echo '<label>';
  echo '<input type="checkbox" name="remember_login" tabindex=3> Activo durante 2 Semanas si no deslogeas.';
  echo '</label>';
  echo '</div>';   
}

?>
  <button type="submit" name="Submit" class="btn btn-default" tabindex=4>ACCEDER</button>

 </form>


<!--
NOTE: Do _not_ remove the link to the AmpJuke site below.

Michael H. Iversen. -->

 <p class="text-right">
  <a href="http://www.ampjuke.org" target="_blank">AmpJuke Version 0.8.8</a>
 </p>

<?php
if (isset($demo)) {
   echo '<p class="text-center"><a href="http://www.ampjuke.org"><h4> <-- Return to homepage </h4></a></p>';
}   

print '<form name="login_anonymous" method="POST" action="loginvalidate.php">';
if (isset($allow_anonymous) && ($allow_anonymous==1)) {
   echo '<p class="text-center"><br><hr><br>';
   echo '<input type="hidden" name="login" value="anonymous">';
   echo '<input type="hidden" name="password" value="anonymous">';
    echo '<input type="hidden" name="uuid" value="'.$uuid.'">'; // 0.7.3   
   echo '<input type="submit" name="Submit" value="Login Anonimo (Invitado)" ';
   echo '</p>';
}

echo '</div>';
print '<script language="JavaScript"> document.forms[0].login.focus(); </script>';
?>
</body></html>


ampstyles_responsive.css
.logo_img {
   width: 307px;
        margin: 5% auto 10% auto;
   border: 0;
}


chve

  • Stalker
  • *
  • Posts: 2
  • Karma: +0/-0
  • Newbie :)
    • View Profile
Re: hello, good application
« Reply #1 on: 31-01-2016 16:38 »
Michael, you can offer me information on the structure of contents, that content close tables and cells. I have read that you use the structure GetSimple cms, but i don't know.  ;)

Thanks

devilking

  • Stalker
  • *
  • Posts: 1
  • Karma: +0/-0
  • Newbie :)
    • View Profile
    • Dissertation help
Re: hello, good application
« Reply #2 on: 25-11-2016 09:51 »
yaa it's really nice application

Daisy22

  • Stalker
  • *
  • Posts: 1
  • Karma: +0/-0
  • Newbie :)
    • View Profile
    • Dissertation Help
Re: hello, good application
« Reply #3 on: 16-02-2017 13:25 »
Yes! i agreed with you really amazing application,i used it then i replied here.