fixed: in App::CheckIfNeedSSLredirect()
winix made an incorrect redirect from/to SSL git-svn-id: svn://ttmath.org/publicrep/winix/trunk@1009 e52654a7-88a9-db11-a3e9-0013d4bc506e
This commit is contained in:
parent
eb4e7343e7
commit
62f178c2ee
30
core/app.cpp
30
core/app.cpp
|
@ -5,7 +5,7 @@
|
|||
*/
|
||||
|
||||
/*
|
||||
* Copyright (c) 2010-2014, Tomasz Sowa
|
||||
* Copyright (c) 2010-2015, Tomasz Sowa
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
|
@ -308,11 +308,31 @@ void App::CheckIfNeedSSLredirect()
|
|||
|
||||
if( config.use_ssl )
|
||||
{
|
||||
if( !cur.request->using_ssl )
|
||||
if( config.use_ssl_only_for_logged_users )
|
||||
{
|
||||
if( !config.use_ssl_only_for_logged_users ||
|
||||
cur.session->puser ||
|
||||
(cur.request->function && cur.request->function->need_ssl) )
|
||||
if( cur.request->using_ssl )
|
||||
{
|
||||
if( !cur.session->puser )
|
||||
{
|
||||
log << log3 << "App: this operation should NOT be used through SSL" << logend;
|
||||
BaseUrlRedirect(config.use_ssl_redirect_code, true);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if( cur.session->puser )
|
||||
{
|
||||
log << log3 << "App: this operation should be used through SSL" << logend;
|
||||
BaseUrlRedirect(config.use_ssl_redirect_code, true);
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
/*
|
||||
* use ssl for everyone
|
||||
*/
|
||||
if( !cur.request->using_ssl )
|
||||
{
|
||||
log << log3 << "App: this operation should be used through SSL" << logend;
|
||||
BaseUrlRedirect(config.use_ssl_redirect_code, true);
|
||||
|
|
Loading…
Reference in New Issue