[Openupload-svn-update] SF.net SVN: openupload:[33] trunk/lib/main.inc.php
Status: Beta
Brought to you by:
tsdogs
|
From: <ts...@us...> - 2008-10-18 11:02:33
|
Revision: 33
http://openupload.svn.sourceforge.net/openupload/?rev=33&view=rev
Author: tsdogs
Date: 2008-10-18 11:02:31 +0000 (Sat, 18 Oct 2008)
Log Message:
-----------
fix a redirection loop when default action is not allowed.
Modified Paths:
--------------
trunk/lib/main.inc.php
Modified: trunk/lib/main.inc.php
===================================================================
--- trunk/lib/main.inc.php 2008-10-17 18:24:09 UTC (rev 32)
+++ trunk/lib/main.inc.php 2008-10-18 11:02:31 UTC (rev 33)
@@ -285,6 +285,23 @@
$group = $this->user->group();
if ($this->checkACL($group,$mname,$this->action)!='allow') {
+ if ($this->config['defaultaction']==$this->action) {
+ /* this is the default action, but the user does not have permissions on it */
+ /* check if login is allowed (it should always be */
+ if ($this->checkACL($group,'auth','login')!='allow') {
+ /* Login is not allowed there is an error, display the default page with a warning */
+ $this->tpl->assign('user',$this->user->info());
+ $this->tpl->assign('langs',$this->langs);
+ unset($_SESSION['user']['messages']);
+ unset($_SESSION['user']['errors']);
+ $this->page['content']=tr('THERE HAS BEEN A PERMISSION ERROR. PLEASE TRY ONE OF THE ALLOWED OPTIONS!');
+ $this->tpl->assign('page',$this->page);
+ $this->display($this->mainPage);
+ exit(0);
+ } else {
+ redirect('?action=login');
+ }
+ }
redirect();
}
$this->initPlugins();
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|