[Openupload-svn-update] SF.net SVN: openupload:[36] trunk/lib
Status: Beta
Brought to you by:
tsdogs
|
From: <ts...@us...> - 2008-10-18 11:48:53
|
Revision: 36
http://openupload.svn.sourceforge.net/openupload/?rev=36&view=rev
Author: tsdogs
Date: 2008-10-18 11:48:45 +0000 (Sat, 18 Oct 2008)
Log Message:
-----------
Make the requested url the default redirect after login
Modified Paths:
--------------
trunk/lib/main.inc.php
trunk/lib/modules/default/auth.inc.php
trunk/lib/user.inc.php
Modified: trunk/lib/main.inc.php
===================================================================
--- trunk/lib/main.inc.php 2008-10-18 11:23:05 UTC (rev 35)
+++ trunk/lib/main.inc.php 2008-10-18 11:48:45 UTC (rev 36)
@@ -299,9 +299,12 @@
$this->display($this->mainPage);
exit(0);
} else {
+ /* save the requested url */
redirect('?action=login');
}
- }
+ }
+ if ($_SERVER['QUERY_STRING']!='')
+ $_SESSION['requested_url']='?'.$_SERVER['QUERY_STRING'];
redirect();
}
$this->initPlugins();
Modified: trunk/lib/modules/default/auth.inc.php
===================================================================
--- trunk/lib/modules/default/auth.inc.php 2008-10-18 11:23:05 UTC (rev 35)
+++ trunk/lib/modules/default/auth.inc.php 2008-10-18 11:48:45 UTC (rev 36)
@@ -68,7 +68,12 @@
return false; /* never reached */
}
/* authentication was successfull */
- redirect();
+ $url = '';
+ if (isset($_SESSION['requested_url'])) {
+ $url = $_SESSION['requested_url'];
+ unset($_SESSION['requested_url']);
+ }
+ redirect($url);
}
function logout() {
Modified: trunk/lib/user.inc.php
===================================================================
--- trunk/lib/user.inc.php 2008-10-18 11:23:05 UTC (rev 35)
+++ trunk/lib/user.inc.php 2008-10-18 11:48:45 UTC (rev 36)
@@ -81,7 +81,7 @@
/* retrieve user info */
$_SESSION['user'] = $this->auth->info($username);;
/* make the post not be resent on refresh */
- redirect();
+ return true;
} else {
// set the error message for the login
app()->error(tr('Login incorrect!'));
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|