예제 #1
0
 function __SpeedFileCheckMessages($userID)
 {
     $userID = IntVal($userID);
     if ($userID <= 0) {
         return;
     }
     $cnt = 0;
     $dbResult = $GLOBALS["DB"]->Query("SELECT COUNT(ID) as CNT " . "FROM b_sonet_user2group " . "WHERE USER_ID = " . $userID . " " . "\tAND ROLE = '" . $GLOBALS["DB"]->ForSql(SONET_ROLES_REQUEST, 1) . "' " . "\tAND INITIATED_BY_TYPE = '" . $GLOBALS["DB"]->ForSql(SONET_INITIATED_BY_GROUP, 1) . "' ");
     if ($arResult = $dbResult->Fetch()) {
         $cnt = IntVal($arResult["CNT"]);
     }
     if ($cnt > 0) {
         CSocNetUserToGroup::__SpeedFileCreate($userID);
     } else {
         CSocNetUserToGroup::__SpeedFileDelete($userID);
     }
 }