本文整理汇总了PHP中UserUtil::getAccountSetting方法的典型用法代码示例。如果您正苦于以下问题:PHP UserUtil::getAccountSetting方法的具体用法?PHP UserUtil::getAccountSetting怎么用?PHP UserUtil::getAccountSetting使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类UserUtil
的用法示例。
在下文中一共展示了UserUtil::getAccountSetting方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1:
<link rel="stylesheet" href="<?php
echo STATICURL;
?>
/css/iefix.css?<?php
echo VERHASH;
?>
" />
<![endif]-->
<!-- load css end -->
<!-- JS全局变量-->
<script>
<?php
$gUploadConfig = AttachUtil::getUploadConfig();
$gAccount = UserUtil::getAccountSetting();
?>
var G = {
VERHASH: '<?php
echo VERHASH;
?>
',
SITE_URL: '<?php
echo Ibos::app()->setting->get("siteurl");
?>
',
STATIC_URL: '<?php
echo STATICURL;
?>
',
uid: '<?php
示例2: actionReset
public function actionReset()
{
if (Ibos::app()->user->isGuest) {
Ibos::app()->user->loginRequired();
}
if (EnvUtil::submitCheck("formhash")) {
$original = filter_input(INPUT_POST, "originalpass", FILTER_SANITIZE_SPECIAL_CHARS);
$new = filter_input(INPUT_POST, "newpass", FILTER_SANITIZE_SPECIAL_CHARS);
$newConfirm = filter_input(INPUT_POST, "newpass_confirm", FILTER_SANITIZE_SPECIAL_CHARS);
if ($original == "") {
$this->error(Ibos::lang("Original password require"));
} elseif (strcasecmp(md5(md5($original) . Ibos::app()->user->salt), Ibos::app()->user->password) !== 0) {
$this->error(Ibos::lang("Password is not correct"));
} else {
if (!empty($new) && strcasecmp($new, $newConfirm) !== 0) {
$this->error(Ibos::lang("Confirm password is not correct"));
} else {
$password = md5(md5($new) . Ibos::app()->user->salt);
$success = User::model()->updateByUid(Ibos::app()->user->uid, array("password" => $password, "lastchangepass" => TIMESTAMP));
$success && Ibos::app()->user->logout();
$this->success(Ibos::lang("Reset success"), $this->createUrl("default/login"));
}
}
} else {
$userName = Ibos::app()->user->realname;
$data = array("assetUrl" => $this->getAssetUrl("user"), "account" => UserUtil::getAccountSetting(), "lang" => Ibos::getLangSources(), "unit" => Ibos::app()->setting->get("setting/unit"), "user" => $userName);
$this->renderPartial("reset", $data);
}
}