1
0
Fork 0
mirror of https://github.com/Yetangitu/ampache synced 2025-10-03 17:59:21 +02:00

Fix login form when loading in dynamic page

This commit is contained in:
Afterster 2015-01-28 07:15:31 +01:00
parent 2122fe9531
commit 242f7b830a
4 changed files with 16 additions and 6 deletions

View file

@ -38,7 +38,7 @@ receives the most testing:
* nginx * nginx
* IIS * IIS
* PHP 5.3 or greater. * PHP 5.4 or greater.
* PHP modules: * PHP modules:
* PDO * PDO

View file

@ -36,6 +36,16 @@ class Session
// Rien a faire // Rien a faire
} // __construct } // __construct
/**
* open
*
* This is run on the beginning of a session, nothing to do here for now.
*/
public static function open()
{
return true;
}
/** /**
* close * close
* *
@ -83,7 +93,6 @@ class Session
// Destroy our cookie! // Destroy our cookie!
setcookie(AmpConfig::get('session_name'), null, -1); setcookie(AmpConfig::get('session_name'), null, -1);
session_destroy();
return true; return true;
} }

View file

@ -54,9 +54,9 @@ $(function() {
}); });
$("body").delegate("form", "submit", function(e) { $("body").delegate("form", "submit", function(e) {
// We do not support ajax post with files // We do not support ajax post with files or login form
var $file = $(this).find("input[type=file]"); var $file = $(this).find("input[type=file]");
if (!$file || !$file.val() || $file.val() == "") { if ($(this).attr('name') !== 'login' && (!$file || !$file.val() || $file.val() === "")) {
var postData = $(this).serializeArray(); var postData = $(this).serializeArray();
var formURL = $(this).attr("action"); var formURL = $(this).attr("action");

View file

@ -31,6 +31,7 @@ $htmllang = str_replace("_","-",AmpConfig::get('lang'));
is_rtl(AmpConfig::get('lang')) ? $dir = 'rtl' : $dir = 'ltr'; is_rtl(AmpConfig::get('lang')) ? $dir = 'rtl' : $dir = 'ltr';
$_SESSION['login'] = true; $_SESSION['login'] = true;
define('TABLE_RENDERED', 1);
?> ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
@ -70,13 +71,13 @@ $_SESSION['login'] = true;
<?php Error::display('general'); ?> <?php Error::display('general'); ?>
<div class="formValidation"> <div class="formValidation">
<a class="button" id="lostpasswordbutton" href="<?php echo AmpConfig::get('web_path'); ?>/lostpassword.php"><?php echo T_('Lost password'); ?></a> <a rel="nohtml" class="button" id="lostpasswordbutton" href="<?php echo AmpConfig::get('web_path'); ?>/lostpassword.php"><?php echo T_('Lost password'); ?></a>
<input class="button" id="loginbutton" type="submit" value="<?php echo T_('Login'); ?>" /> <input class="button" id="loginbutton" type="submit" value="<?php echo T_('Login'); ?>" />
<input type="hidden" name="referrer" value="<?php echo scrub_out($_SERVER['HTTP_REFERRER']); ?>" /> <input type="hidden" name="referrer" value="<?php echo scrub_out($_SERVER['HTTP_REFERRER']); ?>" />
<input type="hidden" name="action" value="login" /> <input type="hidden" name="action" value="login" />
<?php if (AmpConfig::get('allow_public_registration')) { ?> <?php if (AmpConfig::get('allow_public_registration')) { ?>
<a class="button" id="registerbutton" href="<?php echo AmpConfig::get('web_path'); ?>/register.php"><?php echo T_('Register'); ?></a> <a rel="nohtml" class="button" id="registerbutton" href="<?php echo AmpConfig::get('web_path'); ?>/register.php"><?php echo T_('Register'); ?></a>
<?php } // end if allow_public_registration ?> <?php } // end if allow_public_registration ?>
</div> </div>
</form> </form>