コード例 #1
0
function saveConfig()
{
    $mainframe = JFactory::getApplication();
    $database = JFactory::getDBO();
    $row = new joomla_flash_uploader($database);
    // if magic quotes is on we remove slashes forst because store does quote automatically!
    if (get_magic_quotes_gpc()) {
        $row->bind(array_map("stripslashes", $_POST));
    } else {
        $row->bind($_POST);
    }
    $row->last_modified_date = date("Y-m-d");
    $row->store();
    // now we update the users
    $userstring = JRequest::getVar('list_2_sent', '');
    $userchanged = JRequest::getVar('list_2_changed', '');
    // first we remove all user mappings and then we insert all the new ones.
    $database->setQuery("DELETE FROM #__joomla_flash_uploader_user WHERE location='site' and profile = ({$row->id})");
    $database->query();
    if ($userstring != '') {
        $userstringarray = explode(",", trim($userstring, " ,"));
        foreach ($userstringarray as $singleuser) {
            $rowuser = new joomla_flash_uploader_user($database);
            $rowuser->profile = $row->id;
            $rowuser->user = trim($singleuser);
            $rowuser->location = 'site';
            $rowuser->store();
        }
    }
    addUserGroup('site', 'jgroupfront', 'id', false);
    cleanMessageQueue();
    unset($_SESSION['IM_CHECK']);
    $mainframe->redirect("index.php?option=com_jfuploader&act=config", JText::_('MES_SAVED'));
}
コード例 #2
0
function saveConfig()
{
    global $mainframe;
    $database =& JFactory::getDBO();
    $row = new joomla_flash_uploader($database);
    // if magic quotes is on we remove slashes forst because store does quote automatically!
    if (get_magic_quotes_gpc()) {
        $row->bind(array_map("stripslashes", $_POST));
    } else {
        $row->bind($_POST);
    }
    $row->last_modified_date = date("Y-m-d");
    $row->store();
    cleanMessageQueue();
    $mainframe->redirect("index2.php?option=com_joomla_flash_uploader&act=config", JText::_('MES_SAVED'));
}