Pluf Framework

Pluf Framework Commit Details


Date:2009-07-15 03:51:54 (15 years 5 months ago)
Author:Loic d'Anterroches
Branch:develop, master
Commit:820daf22e6ce01a36a3c86010ec70da8bec8aee2
Parents: f275abbf0ccdd3daaea4b44d71b8f649e5190750
Message:Added a new SSL precondition.

Changes:

File differences

src/Pluf/Precondition.php
101101
102102
103103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
104122
return new Pluf_HTTP_Response_Forbidden($request);
}
/**
* Requires SSL to access the view.
*
* It will redirect the user to the same URL but over SSL if the
* user is not using SSL, if POST request, the data are lost, so
* handle it with care.
*
* @param Pluf_HTTP_Request
* @return mixed
*/
static public function sslRequired($request)
{
if (empty($_SERVER['HTTPS']) or $_SERVER['HTTPS'] == 'off') {
return new Pluf_HTTP_Response_Redirect('https://'.$request->http_host.$request->uri);
}
return true;
}
}

Archive Download the corresponding diff file

Branches

Tags

Number of commits:
Page rendered in 0.05558s using 13 queries.