本文整理汇总了PHP中GWF_User类的典型用法代码示例。如果您正苦于以下问题:PHP GWF_User类的具体用法?PHP GWF_User怎么用?PHP GWF_User使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了GWF_User类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: mark
public static function mark(GWF_User $user, GWF_Links $link, $bool)
{
$userid = $user->getID();
$linkid = $link->getID();
$is_fav = self::table(__CLASS__)->getRow($userid, $linkid) !== false;
if ($is_fav === $bool) {
return true;
}
$row = new self(array('lf_uid' => $userid, 'lf_lid' => $linkid));
if ($bool) {
if (!$row->replace()) {
return false;
}
} else {
if (!$row->delete()) {
return false;
}
}
if (false === $link->increase('link_favcount', $bool ? 1 : -1)) {
return false;
}
if (false === $link->onCalcPopularity()) {
return false;
}
return true;
}
示例2: onUserVote
private function onUserVote(GWF_User $user)
{
if (false !== ($err = $this->votescore->onUserVoteSafe($this->score, $user->getID()))) {
return $err;
}
return $this->onVoted($user);
}
示例3: onAssign
public function onAssign(GWF_HelpdeskTicket $ticket, GWF_User $user)
{
if (false === $ticket->saveVars(array('hdt_worker' => $user->getID(), 'hdt_status' => 'working'))) {
return GWF_HTML::err('ERR_DATABASE', array(__FILE__, __LINE__));
}
return $this->module->message('msg_assigned', array($ticket->getID(), $user->displayUsername()));
}
示例4: isEnabledLyrics
public static function isEnabledLyrics(Slay_Song $song, GWF_User $user)
{
if (false === ($row = self::getByIDs($song->getID(), $user->getID()))) {
return true;
}
return $row->isOptionEnabled(self::ENABLED);
}
示例5: markSolved
public static function markSolved(GWF_User $user, WC_Warchall $chall)
{
if (!self::table(__CLASS__)->insertAssoc(array('wc_wcid' => $chall->getID(), 'wc_uid' => $user->getID(), 'wc_solved_at' => GWF_Time::getDate(14)))) {
return false;
}
return true;
}
示例6: contactData
private function contactData(GWF_User $user)
{
require_once GWF_CORE_PATH . 'module/Profile/GWF_Profile.php';
if (false === ($p = GWF_Profile::getProfile($user->getID()))) {
return GWF_HTML::err('ERR_DATABASE', array(__FILE__, __LINE__));
}
if ($p->isGuestHidden() || $p->isHiddenLevel(0)) {
return '';
}
$back = '';
if ('' !== ($v = $p->getVar('prof_firstname'))) {
$back .= 'FirstName:' . $v . PHP_EOL;
}
if ('' !== ($v = $p->getVar('prof_lastname'))) {
$back .= 'LastName:' . $v . PHP_EOL;
}
if ('' !== ($v = $p->getVar('prof_street'))) {
$back .= 'Street:' . $v . PHP_EOL;
}
if ('' !== ($v = $p->getVar('prof_city'))) {
$back .= 'City:' . $v . PHP_EOL;
}
if ('' !== ($v = $p->getVar('prof_zip'))) {
$back .= 'ZIPCode:' . $v . PHP_EOL;
}
if ($p->isContactHiddenLevel(0)) {
return $back;
}
if ($user->isOptionEnabled(GWF_User::SHOW_EMAIL)) {
if ('' !== ($v = $user->displayEMail())) {
$back .= 'EMail:' . $v . PHP_EOL;
}
}
if ('' !== ($v = $p->getVar('prof_tel'))) {
$back .= 'Tel:' . $v . PHP_EOL;
}
if ('' !== ($v = $p->getVar('prof_mobile'))) {
$back .= 'Mobile:' . $v . PHP_EOL;
}
if ('' !== ($v = $p->getVar('prof_icq'))) {
$back .= 'ICQ:' . $v . PHP_EOL;
}
if ('' !== ($v = $p->getVar('prof_msn'))) {
$back .= 'MSN:' . $v . PHP_EOL;
}
if ('' !== ($v = $p->getVar('prof_jabber'))) {
$back .= 'Jabber:' . $v . PHP_EOL;
}
if ('' !== ($v = $p->getVar('prof_skype'))) {
$back .= 'Skype:' . $v . PHP_EOL;
}
if ('' !== ($v = $p->getVar('prof_yahoo'))) {
$back .= 'Yahoo!:' . $v . PHP_EOL;
}
if ('' !== ($v = $p->getVar('prof_aim'))) {
$back .= 'AIM:' . $v . PHP_EOL;
}
return $back;
}
示例7: mayAddTag
public static function mayAddTag(GWF_User $user)
{
if ($user->isStaff()) {
return true;
}
$uid = $user->getID();
return self::table(__CLASS__)->selectFirst('1', "st_uid={$uid}") === false;
}
示例8: createPMOptions
private static function createPMOptions(GWF_User $user)
{
$row = new self(array('pmo_uid' => $user->getVar('user_id'), 'pmo_options' => 0, 'pmo_auto_folder' => 0, 'pmo_signature' => '', 'pmo_level' => 0));
if (false === $row->replace()) {
return false;
}
// $row->setVar('pmo_uid', $user);
return $row;
}
示例9: onCrossLoginB
private function onCrossLoginB(GWF_User $user)
{
if ($user->isDeleted()) {
return GWF_HTML::err('ERR_NO_PERMISSION');
}
if (false === GWF_Session::onLogin($user, false, true)) {
return $this->module->error('ERR_GENERAL', array(__FILE__, __LINE__));
}
return $this->module->message('msg_cross_login');
}
示例10: insertFirstLink
public static function insertFirstLink(GWF_User $user, WC_Site $site, $onsitename, $onsitescore)
{
$table = self::table(__CLASS__);
$siteid = $site->getVar('site_id');
if (false !== $table->getRow($onsitename, $siteid)) {
return true;
}
$entry = new self(array('fili_onsitename' => $onsitename, 'fili_sid' => $siteid, 'fili_date' => GWF_Time::getDate(GWF_Date::LEN_DAY), 'fili_uid' => $user->getVar('user_id'), 'fili_username' => $user->getVar('user_name'), 'fili_sitename' => $site->getVar('site_name'), 'fili_percent' => $site->getPercent($onsitescore)));
// echo GWF_HTML::message('DEBUG', 'Insert First Link...');
return $entry->insert();
}
示例11: installPMBot
private static function installPMBot(Module_PM $module)
{
$user = new GWF_User(array('user_name' => '_GWF_PM_BOT_', 'user_password' => 'x', 'user_regdate' => GWF_Time::getDate(GWF_Date::LEN_SECOND), 'user_regip' => GWF_IP6::getIP(GWF_IP_EXACT, '127.0.0.1'), 'user_email' => GWF_BOT_EMAIL, 'user_birthdate' => GWF_Time::getDate(GWF_Time::LEN_DAY), 'user_countryid' => 0, 'user_langid' => 0, 'user_options' => GWF_User::BOT, 'user_lastactivity' => time()));
if (false === $user->insert()) {
return GWF_HTML::err('ERR_DATABASE', array(__FILE__, __LINE__));
}
if (false === GWF_ModuleLoader::saveModuleVar($module, 'pm_bot_uid', $user->getID())) {
return GWF_HTML::err('ERR_DATABASE', array(__FILE__, __LINE__));
}
return '';
}
示例12: getGroupSelect
private function getGroupSelect(GWF_User $user)
{
$groups = GDO::table('GWF_Group')->selectAll('group_id, group_name');
$data = array();
$data[] = array('0', $this->module->lang('sel_group'));
foreach ($groups as $group) {
if (!$user->isInGroupID($group['group_id'])) {
$data[] = array($group['group_id'], $group['group_name']);
}
}
return GWF_Select::display('groups', $data, intval(Common::getPost('groups')));
}
示例13: insertNote
public static function insertNote(GWF_User $user, $note)
{
# no empty notes
if ($note === '') {
return false;
}
# insert it
$entry = new self(array('accrm_uid' => $user->getVar('user_id'), 'accrm_note' => $note));
if (false === $entry->replace()) {
return false;
}
return $note;
}
示例14: convert
public static function convert(GWF_User $user, $password)
{
if (false === ($row = self::table(__CLASS__)->getRow($user->getID()))) {
return true;
}
$oldHash = self::oldHash($password);
if ($oldHash !== $row->getVar('pmap_password')) {
return GWF_Module::getModule('WeChall')->error('err_password');
}
$row->delete();
$user->saveVar('user_password', GWF_Password::hashPasswordS($password));
return true;
}
示例15: onMailTicketB
private function onMailTicketB(GWF_HelpdeskTicket $ticket, GWF_HelpdeskMsg $message, GWF_User $user)
{
if ('' === ($rec = $user->getValidMail())) {
return;
}
$mail = new GWF_Mail();
$mail->setSender(GWF_BOT_EMAIL);
$mail->setReceiver($rec);
$mail->setSubject($this->module->langUser($user, 'subj_nt', array($ticket->getID())));
$href_work = Common::getAbsoluteURL($this->module->getMethodURL('AssignWork', '&ticket=' . $ticket->getID() . '&worker=' . $user->getID() . '&token=' . $ticket->getHashcode()), false);
$mail->setBody($this->module->langUser($user, 'body_nt', array($user->displayUsername(), $ticket->getCreator()->displayUsername(), $ticket->displayTitle($user), $message->displayMessage(), $href_work)));
return $mail->sendToUser($user);
}