rhymix/widgets/login_info/login_info.class.php
mosmartin 4d272994dd english comments added
git-svn-id: http://xe-core.googlecode.com/svn/branches/1.5.0_english@8278 201d5d3c-b55e-5fd7-737f-ddc643e51545
2011-04-06 16:48:06 +00:00

42 lines
1.6 KiB
PHP

<?php
/**
* @class login_info
* @author NHN (developers@xpressengine.com)
* @version 0.1
* @brief Widget to display log-in form
*
* $Pre-configured by using $logged_info
**/
class login_info extends WidgetHandler {
/**
* @brief Widget execution
* Get extra_vars declared in ./widgets/widget/conf/info.xml as arguments
* After generating the result, do not print but return it.
**/
function proc($args) {
// Set a path of the template skin (values of skin, colorset settings)
$tpl_path = sprintf('%sskins/%s', $this->widget_path, $args->skin);
Context::set('colorset', $args->colorset);
// Specify a template file
if(Context::get('is_logged')) $tpl_file = 'login_info';
else $tpl_file = 'login_form';
// Get the member configuration
$oModuleModel = &getModel('module');
$this->member_config = $oModuleModel->getModuleConfig('member');
Context::set('member_config', $this->member_config);
// Set a flag to check if the https connection is made when using SSL and create https url
$ssl_mode = false;
if($this->member_config->enable_ssl == 'Y') {
if(preg_match('/^https:\/\//i',Context::getRequestUri())) $ssl_mode = true;
}
Context::set('ssl_mode',$ssl_mode);
// Compile a template
$oTemplate = &TemplateHandler::getInstance();
return $oTemplate->compile($tpl_path, $tpl_file);
}
}
?>