本文整理汇总了PHP中UserHelper::getUsersZonal方法的典型用法代码示例。如果您正苦于以下问题:PHP UserHelper::getUsersZonal方法的具体用法?PHP UserHelper::getUsersZonal怎么用?PHP UserHelper::getUsersZonal使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类UserHelper
的用法示例。
在下文中一共展示了UserHelper::getUsersZonal方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: login
function login($epUserdata = null)
{
$credentials = array();
$options = array();
if ($epUserdata == null) {
// Check for request forgeries
//JRequest::checkToken('request') or jexit( 'Invalid Token' );
$credentials['provider'] = JRequest::getVar('provider', null, 'method', 'string');
$credentials['username'] = JRequest::getVar('username', '', 'method', 'username');
$credentials['userid'] = JRequest::getInt('userid', '0', 'method');
$credentials['session'] = JRequest::getVar('session', '', 'method', 'string');
$credentials['oauth_token'] = JRequest::getVar('oauth_token', '', 'method', 'string');
} else {
$credentials['provider'] = $epUserdata['epprovider'];
$credentials['username'] = $epUserdata['epusername'];
$options['userid'] = $epUserdata['userid'];
}
$credentials['provider'] = trim($credentials['provider']);
$credentials['username'] = trim($credentials['username']);
global $mainframe;
$user =& JFactory::getUser();
$registerNewAlias = !$user->guest;
if ($return = JRequest::getVar('return', '', 'method', 'base64')) {
$return = base64_decode($return);
if (!JURI::isInternal($return)) {
$return = '';
}
}
$options['remember'] = JRequest::getBool('remember', false);
$options['return'] = $return;
$credentials['password'] = JRequest::getString('password', '', 'post', JREQUEST_ALLOWRAW);
# agregado por G2P
$options['providerid'] = JRequest::getInt('providerid', '0', 'method');
$options['externalid'] = JRequest::getVar('externalid', '', 'method', 'string');
$options['email'] = JRequest::getVar('email', '', 'method', 'string');
$options['label'] = JRequest::getVar('label', '', 'method', 'string');
##### testing ##########
$db =& JFactory::getDBO();
//preform the login action
$error = $mainframe->login($credentials, $options);
$this->endAuthentication();
if (!JError::isError($error)) {
// Redirect if the return url is not registration or login
if (!$return) {
$return = 'index.php?option=com_user';
}
if ($credentials['userid'] == 0) {
$this->aliasreg($options['providerid'], $options['externalid'], $options['label'], $options['email']);
} else {
try {
$session =& JFactory::getSession();
$selectProvider = 'select p.id from #__providers p where p.name = "' . $credentials['provider'] . '"';
$db->setQuery($selectProvider);
$dbprovider = $db->loadObject();
$this->insertAlias(0, $credentials['userid'], $session->get('externalidentifier'), $dbprovider->id, $session->get('label'), $session->get('email'));
} catch (Exception $ex) {
$message = JText::_("SYSTEM_ALIAS_REGISTERED");
UserHelper::showMessage(ERROR, $message);
}
}
$zonal = UserHelper::getUsersZonal();
require_once JPATH_ROOT . DS . 'components' . DS . 'com_zonales' . DS . 'helper.php';
comZonalesHelper::setZonal($zonal);
$i18nKey = $registerNewAlias ? 'SYSTEM_MESSAGE_SUCCESS_ALIAS_ADDED' : 'SYSTEM_MESSAGE_SUCCESS_LOGIN';
$message = JText::_($i18nKey);
UserHelper::showMessage(SUCCESS, $message);
} else {
$i18nKey = $registerNewAlias ? 'SYSTEM_MESSAGE_ERROR_ALIAS_NOT_ADDED' : 'SYSTEM_MESSAGE_ERROR_LOGIN';
$message = JText::_($i18nKey);
UserHelper::showMessage(ERROR, $message);
}
}