Example #1
0
 public function SetUserBan($nUserId, $nDays = null, $sComment = null)
 {
     if (!$nDays) {
         $nUnlim = 1;
         $dDate = null;
     } else {
         $nUnlim = 0;
         $dDate = date('Y-m-d H:i:s', time() + 3600 * 24 * $nDays);
     }
     $this->Session_Drop($nUserId);
     $bOk = $this->oMapper->SetBanUser($nUserId, $dDate, $nUnlim, $sComment);
     if ($oUser = $this->GetUserById($nUserId)) {
         $this->User_Update($oUser);
         // для сброса кеша
     }
     return $bOk;
 }