Esempio n. 1
0
 /**
  * Queue file(s) for deletion. File(s) will be deleted later upon cron call (usually every minute).
  * @param $mixedFileId file id or array of file ids.
  * @return number of queued files
  */
 public function queueFilesForDeletion($mixedFileId)
 {
     if (!is_array($mixedFileId)) {
         $mixedFileId = array($mixedFileId);
     }
     bx_import('BxDolForm');
     $oChecker = new BxDolFormCheckerHelper();
     return $this->_oDb->queueFilesForDeletion(array_unique($oChecker->passInt($mixedFileId)));
 }
Esempio n. 2
0
     bx_admin_profile_change_status($_POST['members'], 'Approval');
     echo "<script>window.parent." . BX_DOL_ADM_MP_JS_NAME . ".reload();</script>";
     exit;
 } else {
     if (isset($_POST['adm-mp-ban']) && (bool) $_POST['members']) {
         $iBanDuration = isset($_POST['adm-mp-members-ban-duration']) ? (int) $_POST['adm-mp-members-ban-duration'] : 0;
         foreach ($_POST['members'] as $iId) {
             bx_admin_profile_ban_control($iId, true, $iBanDuration);
         }
         echo "<script>window.parent." . BX_DOL_ADM_MP_JS_NAME . ".reload();</script>";
         exit;
     } else {
         if (isset($_POST['adm-mp-unban']) && (bool) $_POST['members']) {
             bx_import('BxDolForm');
             $oChecker = new BxDolFormCheckerHelper();
             $GLOBALS['MySQL']->query("DELETE FROM `sys_admin_ban_list` WHERE `ProfID` IN ('" . implode("','", $oChecker->passInt($_POST['members'])) . "')");
             echo "<script>window.parent." . BX_DOL_ADM_MP_JS_NAME . ".reload();</script>";
             exit;
         } else {
             if ((isset($_POST['adm-mp-delete']) || isset($_POST['adm-mp-delete-spammer'])) && (bool) $_POST['members']) {
                 $iIdCurr = getLoggedId();
                 foreach ($_POST['members'] as $iId) {
                     $iId = (int) $iId;
                     if ($iIdCurr != $iId) {
                         $bResult = profile_delete($iId, isset($_POST['adm-mp-delete-spammer']));
                     }
                 }
                 echo "<script>window.parent." . BX_DOL_ADM_MP_JS_NAME . ".reload();</script>";
                 exit;
             } else {
                 if (isset($_POST['adm-mp-confirm']) && (bool) $_POST['members']) {
Esempio n. 3
0
 function initChecker($aValues = array(), $aSpecificValues = array())
 {
     if ($iContentId = bx_get('draft_id')) {
         // if adding from draft, fill in existing fields info
         $aContentInfo = $this->_oModule->_oDb->getContentInfoById($iContentId);
         if ($aContentInfo) {
             $aValues = array_merge($aContentInfo, $aValues);
         }
     }
     if ($sProfilesIds = bx_get('profiles')) {
         // if writing directly to some recipients, pre-fill them
         $a = explode(',', $sProfilesIds);
         $a = array_unique(BxDolFormCheckerHelper::passInt($a));
         if ($a) {
             $aValues['recipients'] = array_merge(empty($aValues['recipients']) ? array() : $aValues['recipients'], $a);
         }
     }
     return parent::initChecker($aValues, $aSpecificValues);
 }
Esempio n. 4
0
bx_import('BxDolAlerts');
bx_import('BxDolEmailTemplates');
define('BX_DOL_ADM_MP_CTL', 'qlinks');
define('BX_DOL_ADM_MP_VIEW', 'simple');
define('BX_DOL_ADM_MP_JS_NAME', 'oMP');
define('BX_DOL_ADM_MP_PER_PAGE', 50);
define('BX_DOL_ADM_MP_PER_PAGE_STEP', 16);
$logged['admin'] = member_auth(1, true, true);
$sCtlType = isset($_POST['adm-mp-members-ctl-type']) && in_array($_POST['adm-mp-members-ctl-type'], array('qlinks', 'browse', 'calendar', 'tags', 'search')) ? $_POST['adm-mp-members-ctl-type'] : BX_DOL_ADM_MP_CTL;
$aCtlType = array();
$sViewType = isset($_POST['adm-mp-members-view-type']) && in_array($_POST['adm-mp-members-view-type'], array('geeky', 'simple', 'extended')) ? $_POST['adm-mp-members-view-type'] : BX_DOL_ADM_MP_VIEW;
bx_import('BxDolForm');
$oChecker = new BxDolFormCheckerHelper();
//--- Process Actions ---//
if (isset($_POST['adm-mp-activate']) && (bool) $_POST['members']) {
    $GLOBALS['MySQL']->query("UPDATE `Profiles` SET `Status`='Active' WHERE `ID` IN ('" . implode("','", $oChecker->passInt($_POST['members'])) . "')");
    $oEmailTemplate = new BxDolEmailTemplates();
    foreach ($_POST['members'] as $iId) {
        createUserDataFile((int) $iId);
        reparseObjTags('profile', (int) $iId);
        $aProfile = getProfileInfo($iId);
        $aMail = $oEmailTemplate->parseTemplate('t_Activation', array(), $iId);
        sendMail($aProfile['Email'], $aMail['subject'], $aMail['body'], $iId, array(), 'html', false, true);
        $oAlert = new BxDolAlerts('profile', 'change_status', (int) $iId, 0, array('status' => 'Active'));
        $oAlert->alert();
    }
    echo "<script>window.parent." . BX_DOL_ADM_MP_JS_NAME . ".reload();</script>";
    exit;
} else {
    if (isset($_POST['adm-mp-deactivate']) && (bool) $_POST['members']) {
        $GLOBALS['MySQL']->query("UPDATE `Profiles` SET `Status`='Approval' WHERE `ID` IN ('" . implode("','", $oChecker->passInt($_POST['members'])) . "')");