本文整理汇总了PHP中GWF_User::saveOption方法的典型用法代码示例。如果您正苦于以下问题:PHP GWF_User::saveOption方法的具体用法?PHP GWF_User::saveOption怎么用?PHP GWF_User::saveOption使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类GWF_User
的用法示例。
在下文中一共展示了GWF_User::saveOption方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: onEditFlags
private function onEditFlags($key, $oldFlag, $bits)
{
$newFlag = Common::getPost($key) !== false;
if ($newFlag === $oldFlag) {
return array();
}
if (false === $this->user->saveOption($bits, $newFlag)) {
GWF_HTML::err('ERR_DATABASE', array(__FILE__, __LINE__), true, true);
return array();
}
$key = sprintf('msg_%s_%s', $key, $newFlag === true ? '1' : '0');
return array($this->module->lang($key));
}
示例2: htmlSendToLogin
require 'key2.key';
$key2 = ob_get_contents();
ob_end_clean();
chdir("../../../");
require_once "challenge/html_head.php";
$title = '2013 New Years Special';
html_head("Install: {$title}");
if (!GWF_User::isAdminS()) {
return htmlSendToLogin("Better be admin !");
}
$solution = false;
$score = 4;
$url = "challenge/quangntenemy/2013NYS/index.php";
$creators = "quangntenemy";
$tags = 'Special,Crypto';
WC_Challenge::installChallenge($title, $solution, $score, $url, $creators, $tags, true, WC_Challenge::CHALL_CASE_I);
if (!($user = GWF_User::getByName('Rudolph2013'))) {
$user = new GWF_User(array('user_id' => '0', 'user_options' => GWF_User::BOT | GWF_User::MAIL_APPROVED | GWF_User::EMAIL_GPG, 'user_name' => 'Rudolph2013', 'user_password' => GWF_Password::hashPasswordS('quangster'), 'user_regdate' => GWF_Time::getDate(), 'user_email' => 'rudolph2013@gizmore.org'));
$user->insert();
} else {
$user->saveOption(GWF_User::EMAIL_GPG, true);
}
GWF_PublicKey::updateKey($user->getID(), $key1);
if (!($user = GWF_User::getByName('Silvester2013'))) {
$user = new GWF_User(array('user_id' => '0', 'user_options' => GWF_User::BOT | GWF_User::MAIL_APPROVED | GWF_User::EMAIL_GPG, 'user_name' => 'Silvester2013', 'user_password' => GWF_Password::hashPasswordS('quangster'), 'user_regdate' => GWF_Time::getDate(), 'user_email' => 'silvester2013@gizmore.org'));
$user->insert();
} else {
$user->saveOption(GWF_User::EMAIL_GPG, true);
}
GWF_PublicKey::updateKey($user->getID(), $key2);
require_once "challenge/html_foot.php";
示例3: changeFlag
private function changeFlag(GWF_User $user, $flagname, $bits)
{
$newFlag = Common::getPost($flagname) !== false;
$oldFlag = $user->isOptionEnabled($bits);
if ($newFlag === $oldFlag) {
return '';
}
if (!$user->saveOption($bits, $newFlag)) {
return GWF_HTML::err('ERR_DATABASE', array(__FILE__, __LINE__));
}
return $this->module->message('msg_' . $flagname . ($newFlag ? '_on' : '_off'));
}