Пример #1
0
 /**
  *
  * 用户更新组
  * 当gid=0时,不论用户所拥有当前组是否可以按照积分升级,则强制根据积分更新用户组.否则请留gid为非0的空值
  */
 public function updategroup($memberid, $gid = '', $groupexpiry = '')
 {
     $uid = intval($memberid);
     if (!$uid) {
         return false;
     }
     if (datecheck($groupexpiry)) {
         $groupexpiry = intval(strtotime($groupexpiry)) + 24 * 3600 - 1;
     } else {
         $groupexpiry = intval($groupexpiry);
     }
     $memberinfo = $this->memberinfo($uid);
     $newgroup = array();
     if ($gid == 0 || empty($gid) && empty($memberinfo['isupdate'])) {
         $newgroup = $this->checkgroup_credits($memberinfo['credits']);
     } elseif (empty($gid) && !empty($memberinfo['isupdate']) && !empty($memberinfo['groupexpiry'])) {
         if (TIMENOW > $memberinfo['groupexpiry']) {
             $newgroup = $this->checkgroup_credits($memberinfo['credits']);
         }
     } elseif (!empty($gid)) {
         if ($gid == $memberinfo['gid'] && empty($memberinfo['isupdate'])) {
             $this->updategroup($uid);
             return;
         }
         $newgroup = array('gid' => $gid);
         if ($groupexpiry) {
             $newgroup['groupexpiry'] = intval($groupexpiry);
         }
     }
     if ($newgroup) {
         if (empty($newgroup)) {
             return false;
         } else {
             $this->updategroup_id($uid, $newgroup['gid'], $newgroup['groupexpiry']);
         }
     }
     return $newgroup;
 }
Пример #2
0
     $memberfieldsql = $authstradd2;
 } elseif ($typeid == 2) {
     $censorexp = '/^(' . str_replace(array('\\*', "\r\n", ' '), array('.*', '|', ''), preg_quote($censoruser = trim($censoruser), '/')) . ')$/i';
     if ($censoruser && (@preg_match($censorexp, $nicknamenew) || @preg_match($censorexp, $cstatusnew))) {
         showmessage('profile_nickname_cstatus_illegal');
     }
     if ($msnnew && !isemail($msnnew)) {
         showmessage('profile_alipay_msn');
     }
     if ($alipaynew && !isemail($alipaynew)) {
         showmessage('profile_alipay_illegal');
     }
     $sitenew = !preg_match("/^http:\\/\\/\$/i", $sitenew) ? dhtmlspecialchars(trim(preg_match("/^https?:\\/\\/.+/i", $sitenew) ? $sitenew : ($sitenew ? 'http://' . $sitenew : ''))) : '';
     $icqnew = preg_match("/^([0-9]+)\$/", $icqnew) && strlen($icqnew) >= 5 && strlen($icqnew) <= 12 ? $icqnew : '';
     $qqnew = preg_match("/^([0-9]+)\$/", $qqnew) && strlen($qqnew) >= 5 && strlen($qqnew) <= 12 ? $qqnew : '';
     $bdaynew = datecheck($bdaynew) ? $bdaynew : '0000-00-00';
     $yahoonew = dhtmlspecialchars($yahoonew);
     $msnnew = dhtmlspecialchars($msnnew);
     $msnnew = "{$msnnew}\t{$member[msn][1]}";
     $taobaonew = dhtmlspecialchars($taobaonew);
     $alipaynew = dhtmlspecialchars($alipaynew);
     $nicknamenew = $allownickname ? cutstr(censor(dhtmlspecialchars($nicknamenew)), 30) : '';
     $cstatusadd = $allowcstatus ? ', customstatus=\'' . cutstr(censor(dhtmlspecialchars($cstatusnew)), 30) . '\'' : '';
     $gendernew = empty($gendernew) ? 0 : intval($gendernew);
     $locationnew = cutstr(censor(dhtmlspecialchars($locationnew)), 30);
     if ($maxsigsize) {
         if (strlen($signaturenew) > $maxsigsize) {
             showmessage('profile_sig_toolong');
         }
     } else {
         $signaturenew = '';
Пример #3
0
             showmessage('register_flood_ctrl', NULL, 'HALTED');
         } else {
             $db->query("UPDATE {$tablepre}regips SET count=count+1 WHERE ip='{$onlineip}' AND count>'0'");
         }
     } else {
         $db->query("INSERT INTO {$tablepre}regips (ip, count, dateline)\r\n\t\t\t\tVALUES ('{$onlineip}', '1', '{$timestamp}')");
     }
 }
 $password = md5($password);
 $secques = quescrypt($questionid, $answer);
 $tppnew = in_array($tppnew, array(10, 20, 30)) ? $tppnew : 0;
 $pppnew = in_array($pppnew, array(5, 10, 15)) ? $pppnew : 0;
 $dateformatnew = ($dateformatnew = intval($dateformatnew)) && !empty($userdateformat[$dateformatnew - 1]) ? $dateformatnew : 0;
 $icq = preg_match("/^([0-9]+)\$/", $icq) && strlen($icq) >= 5 && strlen($icq) <= 12 ? $icq : '';
 $qq = preg_match("/^([0-9]+)\$/", $qq) && strlen($qq) >= 5 && strlen($qq) <= 12 ? $qq : '';
 $bday = datecheck($bday) ? $bday : '0000-00-00';
 //$avatar = dhtmlspecialchars($avatar);
 $yahoo = dhtmlspecialchars($yahoo);
 $taobao = dhtmlspecialchars($taobao);
 $email = dhtmlspecialchars($email);
 $msn = dhtmlspecialchars($msn);
 $alipay = dhtmlspecialchars($alipay);
 $bday = dhtmlspecialchars($bday);
 $signature = censor($signature);
 $sigstatus = $signature ? 1 : 0;
 $sightml = addslashes(discuzcode(stripslashes($signature), 1, 0, 0, 0, $groupinfo['allowsigbbcode'] ? $groupinfo['allowcusbbcode'] ? 2 : 1 : 0, $groupinfo['allowsigimgcode'], 0));
 $bio = censor(dhtmlspecialchars($bio));
 $site = dhtmlspecialchars(trim(preg_match("/^https?:\\/\\/.+/i", $site) ? $site : ($site ? 'http://' . $site : '')));
 $locationnew = cutstr(censor(dhtmlspecialchars($locationnew)), 30);
 $nickname = $groupinfo['allownickname'] ? cutstr(censor(dhtmlspecialchars($nickname)), 30) : '';
 $cstatus = $groupinfo['allowcstatus'] ? cutstr(censor(dhtmlspecialchars($cstatus)), 30) : '';