本文整理汇总了PHP中SessionAccountHandler::getUsername方法的典型用法代码示例。如果您正苦于以下问题:PHP SessionAccountHandler::getUsername方法的具体用法?PHP SessionAccountHandler::getUsername怎么用?PHP SessionAccountHandler::getUsername使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SessionAccountHandler
的用法示例。
在下文中一共展示了SessionAccountHandler::getUsername方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getListLinkForCurrentUser
/**
* Get link to shared list for current user
* @param string $text [optional]
* @return string
*/
public static function getListLinkForCurrentUser($text = null)
{
if (!Configuration::Privacy()->listIsPublic()) {
return '';
}
if (is_null($text)) {
$text = Icon::$ATTACH;
}
return '<a href="shared/' . SessionAccountHandler::getUsername() . '/" target="_blank" ' . Ajax::tooltip('', __('Public list'), false, true) . '>' . $text . '</a>';
}
示例2: _e
echo System::getFullDomain();
?>
" title="Runalyze">Runalyze</a>
<?php
if (SessionAccountHandler::isLoggedIn()) {
?>
<a class="tab right" href="login.php?out" title="<?php
_e('Logout');
?>
">
<i class="fa fa-fw fa-lg fa-sign-out"></i> <?php
_e('Logout');
?>
</a>
<?php
echo Ajax::window('<a class="tab right b" href="' . ConfigTabs::$CONFIG_URL . '?key=config_tab_account"><i class="fa fa-fw fa-lg fa-user"></i>' . NBSP . SessionAccountHandler::getUsername() . '</a>');
?>
<?php
}
?>
<span class="left b">
<?php
echo Ajax::window('<a class="tab" href="' . ConfigTabs::$CONFIG_URL . '"><i class="fa fa-fw fa-lg fa-cog"></i>' . NBSP . __('Configuration') . '</a>');
?>
<?php
echo Ajax::window('<a class="tab" href="' . PluginTool::$DISPLAY_URL . '"><i class="fa fa-fw fa-lg fa-dashboard"></i>' . NBSP . __('Tools') . '</a>');
?>
<?php
echo Ajax::window('<a class="tab" href="' . Frontend::$HELP_URL . '"><i class="fa fa-fw fa-lg fa-question-circle"></i>' . NBSP . __('Help') . '</a>');
?>
示例3: tryToChangePassword
/**
* Try to change password
*/
private function tryToChangePassword()
{
if ($_POST['new_pw'] == $_POST['new_pw_repeat']) {
$Account = DB::getInstance()->query('SELECT `password`, `salt` FROM `' . PREFIX . 'account`' . ' WHERE id = ' . SessionAccountHandler::getId())->fetch();
if (AccountHandler::comparePasswords($_POST['old_pw'], $Account['password'], $Account['salt'])) {
if (strlen($_POST['new_pw']) < AccountHandler::$PASS_MIN_LENGTH) {
ConfigTabs::addMessage(HTML::error(sprintf(__('The password has to contain at least %s characters.'), AccountHandler::$PASS_MIN_LENGTH)));
} else {
AccountHandler::setNewPassword(SessionAccountHandler::getUsername(), $_POST['new_pw']);
ConfigTabs::addMessage(HTML::okay(__('Your password has been changed.')));
}
} else {
ConfigTabs::addMessage(HTML::error(__('You current password is wrong.')));
}
} else {
ConfigTabs::addMessage(HTML::error(__('The passwords have to be the same.')));
}
}