Hum, I should have test before pushing.
authorFlorent Bruneau <florent.bruneau@polytechnique.org>
Fri, 11 Jul 2008 17:06:49 +0000 (19:06 +0200)
committerFlorent Bruneau <florent.bruneau@polytechnique.org>
Fri, 11 Jul 2008 17:06:49 +0000 (19:06 +0200)
Signed-off-by: Florent Bruneau <florent.bruneau@polytechnique.org>
include/common.inc.php

index 3b6932e..35296b4 100644 (file)
  *  59 Temple Place, Suite 330, Boston, MA  02111-1307  USA                *
  ***************************************************************************/
 
-function smarty_function_xsrf_token_field($params, &$smarty) {
-    if (S::has('xsrf_token')) {
-        return '<div style="display: none"><input type="hidden" name="token" value="' . S::v('xsrf_token') . '" /></div>';
+function __autoload($cls)
+{
+    if (!pl_autoload($cls)) {
+        $cls = strtolower($cls);
+        if (substr($cls, -3, 3) == 'req') {
+            @include 'validations.inc.php';
+            return;
+        } else if (substr($cls, 0, 6) == 'banana') {
+            require_once 'banana/banana.inc.php';
+            Banana::load(substr($cls, 6));
+            return;
+        }
+        @include "$cls.inc.php";
     }
-    return '';
 }
 
 // vim:set et sw=4 sts=4 sws=4 foldmethod=marker enc=utf-8: