本文整理匯總了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.')));
}
}