handy function
authorx2000habouzit <x2000habouzit>
Thu, 23 Sep 2004 17:44:17 +0000 (17:44 +0000)
committerx2000habouzit <x2000habouzit>
Thu, 23 Sep 2004 17:44:17 +0000 (17:44 +0000)
include/xorg.page.inc.php
include/xorg.session.inc.php

index 6321c0c..ac5dbe9 100644 (file)
@@ -18,7 +18,7 @@
  *  Foundation, Inc.,                                                      *
  *  59 Temple Place, Suite 330, Boston, MA  02111-1307  USA                *
  ***************************************************************************
-        $Id: xorg.page.inc.php,v 1.40 2004-09-19 15:50:45 x2000habouzit Exp $
+        $Id: xorg.page.inc.php,v 1.41 2004-09-23 17:44:17 x2000habouzit Exp $
  ***************************************************************************/
 
 require("diogenes.core.page.inc.php");
@@ -100,6 +100,12 @@ class XorgPage extends DiogenesCorePage {
         $this->doAuth();
     }
 
+    function changeTpl($newtpl, $type=SKINNED) {
+       $this->_tpl       = $tpl;
+       $this->_page_type = $type;
+       $this->caching    = ($type == SKINNED);
+    }
+
     function setLang($lang=null) {
        global $globals;
        if(empty($lang)) {
index 2dad330..68bd46d 100644 (file)
@@ -18,7 +18,7 @@
  *  Foundation, Inc.,                                                      *
  *  59 Temple Place, Suite 330, Boston, MA  02111-1307  USA                *
  ***************************************************************************
-        $Id: xorg.session.inc.php,v 1.24 2004-09-05 12:24:41 x2000habouzit Exp $
+        $Id: xorg.session.inc.php,v 1.25 2004-09-23 17:44:17 x2000habouzit Exp $
  ***************************************************************************/
 
 require("diogenes.core.session.inc.php");
@@ -108,12 +108,12 @@ class XorgSession extends DiogenesCoreSession {
      */
     function doLogin(&$page, $new_name=false) {
        if(isset($_COOKIE['ORGaccess']) and isset($_COOKIE['ORGuid']) and !$new_name) {
-           $page->_tpl = 'password_prompt_logged.tpl';
+           $page->changeTpl('password_prompt_logged.tpl');
            $page->assign("xorg_head", "password_prompt_logged.head.tpl");
            $page->assign("xorg_tpl", "password_prompt_logged.tpl");
            $page->run();
        } else {
-           $page->_tpl = 'password_prompt.tpl';
+           $page->changeTpl('password_prompt.tpl');
            $page->assign("xorg_head", "password_prompt.head.tpl");
            $page->assign("xorg_tpl", "password_prompt.tpl");
            $page->run();