Пример #1
0
 case "browseFiles":
     browseUploaded($kunena_db, $option, 0);
     break;
 case "replaceImage":
     replaceImage($kunena_db, $option, JRequest::getVar('img', ''), JRequest::getInt('OxP', 1));
     break;
 case "deleteFile":
     deleteFile($kunena_db, $option, JRequest::getVar('fileName', ''));
     break;
 case "showAdministration":
     showAdministration($option);
     break;
 case 'recount':
     CKunenaTools::reCountBoards();
     // Also reset the name info stored with messages
     CKunenaTools::updateNameInfo();
     $app->redirect(JURI::base() . 'index2.php?option=com_kunena', _KUNENA_RECOUNTFORUMS_DONE);
     break;
 case "showsmilies":
     showsmilies($option);
     break;
 case "editsmiley":
     editsmiley($option, $cid[0]);
     break;
 case "savesmiley":
     savesmiley($option, $id);
     break;
 case "deletesmiley":
     deletesmiley($option, $cid);
     break;
 case "newsmiley":
Пример #2
0
function douserssync($kunena_db, $option)
{
    $usercache = JRequest::getBool('usercache', 0);
    $useradd = JRequest::getBool('useradd', 0);
    $userdel = JRequest::getBool('userdel', 0);
    $userrename = JRequest::getBool('userrename', 0);
    $kunena_app =& JFactory::getApplication();
    $kunena_db =& JFactory::getDBO();
    if (!JRequest::checkToken()) {
        $kunena_app->enqueueMessage(JText::_('COM_KUNENA_ERROR_TOKEN'), 'error');
        while (@ob_end_clean()) {
        }
        $kunena_app->redirect(JURI::base() . "index.php?option={$option}&task=syncusers");
        return;
    }
    if ($usercache) {
        //reset access rights
        $kunena_db->setQuery("UPDATE #__kunena_sessions SET allowed='na'");
        $kunena_db->query();
        if (KunenaError::checkDatabaseError()) {
            return;
        }
        $kunena_app->enqueueMessage(JText::_('COM_KUNENA_SYNC_USERS_DO_CACHE'));
    }
    if ($useradd) {
        $kunena_db->setQuery("INSERT INTO #__kunena_users (userid) SELECT a.id FROM #__users AS a LEFT JOIN #__kunena_users AS b ON b.userid=a.id WHERE b.userid IS NULL");
        $kunena_db->query();
        if (KunenaError::checkDatabaseError()) {
            return;
        }
        $kunena_app->enqueueMessage(JText::_('COM_KUNENA_SYNC_USERS_DO_ADD') . ' ' . $kunena_db->getAffectedRows());
    }
    if ($userdel) {
        $kunena_db->setQuery("DELETE a FROM #__kunena_users AS a LEFT JOIN #__users AS b ON a.userid=b.id WHERE b.username IS NULL");
        $kunena_db->query();
        if (KunenaError::checkDatabaseError()) {
            return;
        }
        $kunena_app->enqueueMessage(JText::_('COM_KUNENA_SYNC_USERS_DO_DEL') . ' ' . $kunena_db->getAffectedRows());
    }
    if ($userrename) {
        $cnt = CKunenaTools::updateNameInfo();
        $kunena_app->enqueueMessage(JText::_('COM_KUNENA_SYNC_USERS_DO_RENAME') . " {$cnt}");
    }
    while (@ob_end_clean()) {
    }
    $kunena_app->redirect(JURI::base() . "index.php?option={$option}&task=syncusers");
}
Пример #3
0
function douserssync($kunena_db, $option)
{
    $usercache = JRequest::getBool('usercache', 0);
    $useradd = JRequest::getBool('useradd', 0);
    $userdel = JRequest::getBool('userdel', 0);
    $userrename = JRequest::getBool('userrename', 0);
    $app =& JFactory::getApplication();
    $kunena_db =& JFactory::getDBO();
    if ($usercache) {
        //reset access rights
        $kunena_db->setQuery("UPDATE #__fb_sessions SET allowed='na'");
        $kunena_db->query();
        check_dberror("Unable to update sessions.");
        $app->enqueueMessage(_KUNENA_SYNC_USERS_DO_CACHE);
    }
    if ($useradd) {
        $kunena_db->setQuery("INSERT INTO #__fb_users (userid) SELECT a.id FROM #__users AS a LEFT JOIN #__fb_users AS b ON b.userid=a.id WHERE b.userid IS NULL");
        $kunena_db->query();
        check_dberror('Unable to create user profiles.');
        $app->enqueueMessage(_KUNENA_SYNC_USERS_DO_ADD . ' ' . $kunena_db->getAffectedRows());
    }
    if ($userdel) {
        $kunena_db->setQuery("DELETE a FROM #__fb_users AS a LEFT JOIN #__users AS b ON a.userid=b.id WHERE b.username IS NULL");
        $kunena_db->query();
        check_dberror("Unable to delete user profiles.");
        $app->enqueueMessage(_KUNENA_SYNC_USERS_DO_DEL . ' ' . $kunena_db->getAffectedRows());
    }
    if ($userrename) {
        $cnt = CKunenaTools::updateNameInfo();
        $app->enqueueMessage(_KUNENA_SYNC_USERS_DO_RENAME . " {$cnt}");
    }
    $app->redirect(JURI::base() . "index.php?option={$option}&task=syncusers");
}