From: x2000habouzit Date: Thu, 23 Sep 2004 17:44:17 +0000 (+0000) Subject: handy function X-Git-Tag: xorg/old~1503 X-Git-Url: http://git.polytechnique.org/?a=commitdiff_plain;h=96ca705756bc999e0327088f6681abe679494d82;p=platal.git handy function --- diff --git a/include/xorg.page.inc.php b/include/xorg.page.inc.php index 6321c0c..ac5dbe9 100644 --- a/include/xorg.page.inc.php +++ b/include/xorg.page.inc.php @@ -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)) { diff --git a/include/xorg.session.inc.php b/include/xorg.session.inc.php index 2dad330..68bd46d 100644 --- a/include/xorg.session.inc.php +++ b/include/xorg.session.inc.php @@ -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();