<tr> <td><?php et('Upload Folder URL'); ?> </td> <td> <input class="text-input wide-input" type="text" name="uploadUrl" id="uploadUrl" value="<?php echo htmlencode($SETTINGS['uploadUrl']); ?> " size="60" onkeyup="updateUploadPathPreviews('url', this.value, 0)" onchange="updateUploadPathPreviews('url', this.value, 0)" /> <div style="line-height: 1.3"> <?php et('Preview:'); ?> <span id="uploadUrlPreview"><?php echo htmlencode(getUploadPathPreview('url', $SETTINGS['uploadUrl'], false, false)); ?> </span><br/> Example: uploads or ../uploads (relative to current URL)<br/> </div><br/> </td> </tr> <tr> <td><?php et("Server Upload Settings"); ?> </td> <td> <div id="serverUploadLimits" style="padding: 5px 0px;"><div style="border: solid 1px #999; padding: 10px; background-color: #EEE"> <table width="100%">
<tr class="customUploadRow" style="display: <?php echo $customUploadRowDisplay; ?> "> <td>Folder Url</td> <td> <input class="text-input" type="text" name="customUploadUrl" id="customUploadUrl" value="<?php echo htmlencode(@$field['customUploadUrl']); ?> " size="50" onkeyup="updateUploadPathPreviews('url', this.value, 1)" onchange="updateUploadPathPreviews('url', this.value, 1)" /><br/> <small> <?php et('Preview:'); ?> <span id="uploadUrlPreview"><?php echo htmlencode(getUploadPathPreview('url', @$field['customUploadUrl'], true, false)); ?> </span><br/> <?php et('Example: custom or ../custom (relative to <a href="?menu=admin&action=general" target="_top">Upload URL</a> in General Settings)'); ?> <br/> </small> </td> </tr> </table> </div> <div style="display: none" class="fieldOption customColumnType clear"><br/>
function admin_dispatchAction($action) { if ($action == 'general') { showInterface('admin/general.php'); } elseif ($action == 'adminSave') { admin_saveSettings('admin/general.php'); } elseif ($action == 'vendor') { showInterface('admin/vendor.php'); } elseif ($action == 'vendorSave') { admin_saveSettings('admin/vendor.php'); } elseif ($action == 'phpinfo') { disableInDemoMode('', 'admin/general.php'); phpinfo(); print "<h2>get_loaded_extensions()</h2>\n" . implode("<br/>\n", get_loaded_extensions()) . "\n"; if (function_exists('apache_get_modules')) { print "<h2>apache_get_modules()</h2>\n" . implode("<br/>\n", apache_get_modules()) . "\n"; } print "<h2>get_defined_constants()</h2>\n<xmp>" . print_r(get_defined_constants(), true) . "</xmp>\n"; // $mbInfo = mb_get_info(); ksort($mbInfo); print "<h2>mb_get_info()</h2>\n<xmp>" . print_r($mbInfo, true) . "</xmp>\n"; exit; } elseif ($action == 'ulimit') { disableInDemoMode('', 'admin/general.php'); print "<h2>Soft Resource Limits (ulimit -a -S)</h2>\n"; list($maxCpuSeconds, $memoryLimitKbytes, $maxProcessLimit, $ulimitOutput) = getUlimitValues('soft'); showme($ulimitOutput); print "<h2>Hard Resource Limits (ulimit -a -H)</h2>\n"; list($maxCpuSeconds, $memoryLimitKbytes, $maxProcessLimit, $ulimitOutput) = getUlimitValues('soft'); showme($ulimitOutput); exit; } elseif ($action == 'updateDate') { getAjaxDate(); } elseif ($action == 'getUploadPathPreview') { getUploadPathPreview(@$_REQUEST['dirOrUrl'], @$_REQUEST['inputValue'], @$_REQUEST['isCustomField'], true); } elseif ($action == 'plugins') { // allow disabling plugins if (file_exists("{$GLOBALS['PROGRAM_DIR']}/plugins/_disable_all_plugins.txt")) { alert('Development Mode: Plugins are disabled. Remove or rename /plugins/_disable_all_plugins.txt to enable.<br/>'); } else { } showInterface('admin/plugins.php'); } elseif ($action == 'pluginHooks') { showInterface('admin/pluginHooks.php'); } elseif ($action == 'deactivatePlugin') { security_dieUnlessPostForm(); security_dieUnlessInternalReferer(); security_dieOnInvalidCsrfToken(); disableInDemoMode('plugins', 'admin/plugins.php'); deactivatePlugin(@$_REQUEST['file']); redirectBrowserToURL('?menu=admin&action=plugins', true); exit; } elseif ($action == 'activatePlugin') { security_dieUnlessPostForm(); security_dieUnlessInternalReferer(); security_dieOnInvalidCsrfToken(); disableInDemoMode('plugins', 'admin/plugins.php'); activatePlugin(@$_REQUEST['file']); redirectBrowserToURL('?menu=admin&action=plugins', true); exit; } elseif ($action == 'backup') { security_dieUnlessPostForm(); security_dieUnlessInternalReferer(); security_dieOnInvalidCsrfToken(); disableInDemoMode('', 'admin/general.php'); $filename = backupDatabase(null, @$_REQUEST['backupTable']); notice(sprintf(t('Created backup file %1$s (%2$s seconds)'), $filename, showExecuteSeconds(true))); showInterface('admin/general.php'); exit; } elseif ($action == 'restore') { security_dieUnlessPostForm(); security_dieUnlessInternalReferer(); security_dieOnInvalidCsrfToken(); disableInDemoMode('', 'admin/general.php'); $filename = @$_REQUEST['file']; restoreDatabase(DATA_DIR . '/backups/' . $filename); notice("Restored backup file /data/backups/{$filename}"); makeAllUploadRecordsRelative(); showInterface('admin/general.php'); exit; } elseif ($action == 'bgtasksLogsClear') { security_dieUnlessPostForm(); security_dieUnlessInternalReferer(); security_dieOnInvalidCsrfToken(); disableInDemoMode('', 'admin/general.php'); mysql_delete('_cron_log', null, 'true'); notice(t("Background Task logs have been cleared.")); showInterface('admin/general.php'); exit; } else { showInterface('admin/general.php'); } }