本文整理汇总了PHP中DiscussHelper::getToken方法的典型用法代码示例。如果您正苦于以下问题:PHP DiscussHelper::getToken方法的具体用法?PHP DiscussHelper::getToken怎么用?PHP DiscussHelper::getToken使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类DiscussHelper
的用法示例。
在下文中一共展示了DiscussHelper::getToken方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: __construct
public function __construct()
{
$config = DiscussHelper::getConfig();
$this->fullName = "EasyDiscuss";
$this->shortName = "ed";
$this->environment = $config->get('easydiscuss_environment');
$this->mode = $config->get('easydiscuss_mode');
$this->version = DiscussHelper::getLocalVersion();
$this->baseUrl = DiscussHelper::getAjaxURL();
$this->token = DiscussHelper::getToken();
parent::__construct();
}
示例2: _store
private function _store()
{
$mainframe = JFactory::getApplication();
$message = '';
$type = 'success';
if (JRequest::getMethod() == 'POST') {
$model = $this->getModel('Settings');
$postArray = JRequest::get('post');
$saveData = array();
// Unset unecessary data.
unset($postArray['controller']);
unset($postArray['active']);
unset($postArray['child']);
unset($postArray['layout']);
unset($postArray['task']);
unset($postArray['option']);
unset($postArray['c']);
$token = DiscussHelper::getToken();
unset($postArray[$token]);
foreach ($postArray as $index => $value) {
// Filter out the dummy checkbox_display_xxx entry
if (substr($index, 0, 17) == 'checkbox_display_') {
continue;
}
if ($index == 'integration_google_adsense_code') {
$value = str_ireplace(';"', ';', $value);
}
if ($index != 'task') {
}
$saveData[$index] = $value;
if (is_array($value)) {
$saveData[$index] = implode(',', $value);
}
}
// reset the setting 'main_allowdelete' to use from configuration.ini
$saveData['main_allowdelete'] = DiscussHelper::getDefaultConfigValue('main_allowdelete', '');
// reset the setting 'layout_featuredpost_style' to always use from configuration.ini
$saveData['layout_featuredpost_style'] = DiscussHelper::getDefaultConfigValue('layout_featuredpost_style', '0');
if ($model->save($saveData)) {
$message = JText::_('COM_EASYDISCUSS_CONFIGURATION_SAVED');
} else {
$message = JText::_('COM_EASYDISCUSS_CONFIGURATION_SAVE_ERROR');
$type = 'error';
}
} else {
$message = JText::_('COM_EASYDISCUSS_INVALID_FORM_METHOD');
$type = 'error';
}
return array('message' => $message, 'type' => $type);
}
示例3:
?>
</div>
</h2>
</a>
<div class=" mr-5 mt-20 hide-phone pull-right" data-toggle="buttons-radio">
<a href="<?php
echo DiscussRouter::_('index.php?option=com_easydiscuss&controller=conversation&task=unread&' . DiscussHelper::getToken() . '=1&id=' . $conversation->id);
?>
" class="btn btn-mini">
<i class="icon-eye-open"></i> <?php
echo JText::_('COM_EASYDISCUSS_BUTTON_MARK_UNREAD');
?>
</a>
<a href="<?php
echo DiscussRouter::_('index.php?option=com_easydiscuss&controller=conversation&task=archive&' . DiscussHelper::getToken() . '=1&id=' . $conversation->id);
?>
" class="btn btn-mini">
<i class="icon-remove"></i> <?php
echo JText::_('COM_EASYDISCUSS_BUTTON_ARCHIVE');
?>
</a>
</div>
</div>
<a href="<?php
echo DiscussRouter::_('index.php?option=com_easydiscuss&view=conversation');
?>
">« <?php
echo JText::_('COM_EASYDISCUSS_BACK_TO_INBOX');
?>
</a>
示例4: base64_encode
<button class="btn btn-primary" type="submit"><?php
echo JText::_('COM_EASYDISCUSS_BUTTON_LOGIN');
?>
</button>
</div>
</div>
<?php
if (DiscussHelper::getJoomlaVersion() >= '1.6') {
?>
<input type="hidden" value="com_users" name="option">
<input type="hidden" value="user.login" name="task">
<?php
} else {
?>
<input type="hidden" value="com_user" name="option">
<input type="hidden" value="login" name="task">
<?php
}
?>
<input type="hidden" value="<?php
echo base64_encode($redirect);
?>
" name="return" />
<input type="hidden" value="1" name="<?php
echo DiscussHelper::getToken();
?>
" />
</fieldset>
</form>
示例5: ajaxMemberReply
public function ajaxMemberReply($username = null, $password = null, $token = null)
{
$disjax = new Disjax();
$mainframe = JFactory::getApplication();
JRequest::setVar($token, 1);
if (empty($username) || empty($password)) {
$disjax->script("EasyDiscuss.\$('#usertype_status .msg_in').html('" . JText::_('COM_EASYDISCUSS_PLEASE_INSERT_YOUR_USERNAME_AND_PASSWORD') . "');");
$disjax->script("EasyDiscuss.\$('#usertype_status .msg_in').addClass('alert alert-error');");
$disjax->script("EasyDiscuss.\$('#edialog-member-reply').prop('disabled', false);");
$disjax->send();
return false;
}
// Check for request forgeries
if (JRequest::checkToken('request')) {
$credentials = array();
$credentials['username'] = $username;
$credentials['password'] = $password;
$result = $mainframe->login($credentials);
if (!JError::isError($result)) {
$token = DiscussHelper::getToken();
$disjax->script('EasyDiscuss.$(".easydiscuss-token").val("' . $token . '");');
$disjax->script('disjax.closedlg();');
$disjax->script('discuss.reply.submit();');
} else {
$error = JError::getError();
$disjax->script('EasyDiscuss.$(\'#usertype_status .msg_in\').html(\'' . $error->message . '\');');
$disjax->script('EasyDiscuss.$(\'#usertype_status .msg_in\').addClass(\'alert alert-error\');');
$disjax->script('EasyDiscuss.$(\'#edialog-member-reply\').prop(\'disabled\', false);');
}
} else {
$token = DiscussHelper::getToken();
$disjax->script('discuss.login.token = "' . $token . '";');
$disjax->script('EasyDiscuss.$(\'#usertype_status .msg_in\').html(\'' . JText::_('COM_EASYDISCUSS_MEMBER_LOGIN_INVALID_TOKEN') . '\');');
$disjax->script('EasyDiscuss.$(\'#usertype_status .msg_in\').addClass(\'alert alert-error\');');
$disjax->script('EasyDiscuss.$(\'#edialog-reply\').prop(\'disabled\', false);');
}
$disjax->send();
}
示例6:
<li>
<i class="ico"></i><a class="discuss-badges" href="<?php
echo DiscussRouter::_('index.php?option=com_easydiscuss&view=badges' . $menuURL);
?>
"><span><?php
echo JText::_('MOD_EASYDISCUSS_WELCOME_BROWSE_BADGES');
?>
</span></a>
</li>
<?php
}
?>
<li>
<i class="ico"></i><a class="discuss-logout" href="<?php
echo JRoute::_('index.php?option=' . $userComponent->option . '&task=' . $userComponent->logout . '&' . DiscussHelper::getToken() . '=1&return=' . $return);
?>
"><span><?php
echo JText::_('MOD_EASYDISCUSS_WELCOME_SIGN_OUT');
?>
</span></a>
</li>
</ul>
<?php
} else {
if ($params->get('enable_login')) {
?>
<form action="<?php
echo JRoute::_('index.php', true, $params->get('usesecure'));
?>
" method="post" name="login" id="form-login" >