function handle_themeselect($updated) { global $prefs; $theme = Util::getFormData('theme'); if (!is_null($theme)) { $prefs->setValue('theme', $theme); $updated = true; } return $updated; }
<?php /** * $Horde: horde/services/images/pixel.php,v 1.10 2004/01/05 22:45:47 slusarz Exp $ * * Copyright 2002-2004 Chuck Hagenbuch <*****@*****.**> * * See the enclosed file COPYING for license information (LGPL). If you * did not receive this file, see http://www.fsf.org/copyleft/lgpl.html. */ define('HORDE_BASE', dirname(__FILE__) . '/../..'); require_once HORDE_BASE . '/lib/base.php'; require_once HORDE_LIBS . 'Horde/Image.php'; $gif =& Horde_Image::factory('gif', array('rgb' => Util::getFormData('c'))); header('Content-type: image/gif'); header('Expires: Wed, 21 Aug 1969 11:11:11 GMT'); header('Cache-Control: no-cache'); header('Cache-Control: must-revalidate'); echo $gif->makePixel();
} } if (Auth::isAuthenticated()) { if ($browser->isMobile()) { require HORDE_BASE . '/services/portal/mobile.php'; } else { require HORDE_BASE . '/services/portal/index.php'; } exit; } $login_screen = $auth->_getLoginScreen(); if (Util::removeParameter($login_screen, array('url', 'nocache')) != Util::removeParameter(Horde::url(Horde::selfUrl(), true), array('url', 'nocache'))) { if ($url_param) { $login_screen = Util::addParameter($login_screen, 'url', $url_param); } $login_screen = Util::addParameter($login_screen, 'frameset', Util::getFormData('frameset')); header('Location: ' . $login_screen); exit; } if ($browser->isMobile()) { require_once HORDE_LIBS . 'Horde/Mobile.php'; require HORDE_TEMPLATES . '/login/mobile.inc'; exit; } /* Build the <select> widget containing the available languages. */ if (!$prefs->isLocked('language')) { $_SESSION['horde_language'] = NLS::select(); $langs = '<select name="new_lang" onchange="selectLang()">'; foreach ($nls['languages'] as $key => $val) { $sel = $key == $_SESSION['horde_language'] ? ' selected="selected"' : ''; $langs .= "<option value=\"{$key}\"{$sel}>{$val}</option>";
<?php /** * $Horde: horde/services/download/index.php,v 1.6 2004/01/01 15:17:01 jan Exp $ * * Copyright 2002-2004 Michael Slusarz <*****@*****.**> * * See the enclosed file COPYING for license information (LGPL). If you * did not receive this file, see http://www.fsf.org/copyleft/lgpl.html. */ include_once '../../lib/base.php'; if (!($module = Util::getFormData('module')) || !file_exists($registry->getParam('fileroot', $module))) { Horde::fatal('Do not call this script directly.', __FILE__, __LINE__); } include $registry->getParam('fileroot', $module) . '/view.php';
<?php /** * $Horde: horde/scripts/http_login_refer.php,v 1.3 2004/01/01 15:16:54 jan Exp $ * * Copyright 1999-2004 Charles J. Hagenbuch <*****@*****.**> * Copyright 1999-2004 Jon Parise <*****@*****.**> * * See the enclosed file COPYING for license information (LGPL). If you * did not receive this file, see http://www.fsf.org/copyleft/lgpl.html. */ require_once '../lib/base.php'; $auth =& Auth::singleton($conf['auth']['driver']); // Check for HTTP auth. if (empty($_SERVER['PHP_AUTH_USER']) || empty($_SERVER['PHP_AUTH_PW']) || !$auth->authenticate($_SERVER['PHP_AUTH_USER'], array('password' => $_SERVER['PHP_AUTH_PW']))) { header('WWW-Authenticate: Basic realm="' . $auth->getParam('realm') . '"'); header('HTTP/1.0 401 Unauthorized'); exit('Forbidden'); } if ($url = Util::getFormData('url')) { header('Location: ' . $url); } else { header('Location: ' . Horde::applicationUrl('login.php')); }
require_once HORDE_LIBS . 'Horde/Form/Renderer.php'; if (!Auth::isAdmin()) { Horde::authenticationFailureRedirect(); } $groups =& Group::singleton(); $auth =& Auth::singleton($conf['auth']['driver']); /* Set up the form variables. */ $vars =& Variables::getDefaultVariables(); $cid = $vars->get('cid'); $category = $vars->get('category'); $permission =& $perms->getPermissionById($cid); /* See if we need to (and are supposed to) autocreate the * permission. */ if ($category !== null) { $permission =& $perms->getPermission($category); if (is_a($permission, 'PEAR_Error') && Util::getFormData('autocreate')) { $parent = $vars->get('parent'); $permission =& $perms->newPermission($category); $result = $perms->addPermission($permission, $parent); if (!is_a($result, 'PEAR_Error')) { $form = 'edit.inc'; } } } else { $permission =& $perms->getPermissionById($cid); } /* If the permission fetched is an error return to the permissions * list. */ if (is_a($permission, 'PEAR_Error')) { $notification->push(_("Attempt to edit a non-existent permission."), 'horde.error'); $url = Horde::applicationUrl('admin/perms/index.php', true);
@define('NWNADMIN_BASE', dirname(__FILE__)); require_once NWNADMIN_BASE . '/lib/base.php'; require_once NWNADMIN_BASE . '/lib/ModuleForms.php'; // script global variables global $nwndriver; $admin = Auth::isAdmin('nwnadmin:admin'); $adminDelete = Auth::isAdmin('nwnadmin:admin', PERMS_DELETE); $moduleDir = NWNAdmin::getModulePath(); $moduleDirWritable = is_writable($moduleDir); $serverUp = $nwndriver->serverRunning(); if ($admin && !$serverUp) { $notification->push(_("The server is down; module loading is unavailable.")); } // figure out what to do $actionId = Util::getFormData('actionId'); $moduleName = Util::getFormData('moduleName'); if (isset($actionId) && !isset($moduleName)) { $notification->push(_("Invalid options! Try again..."), 'horde.warning'); } else { switch ($actionId) { case 'delete': if ($adminDelete && strpos($conf['server']['root'], $moduleName) == 0) { $moduleName = str_replace('../', '', $moduleName); $result = unlink(escapeshellcmd($moduleName)); if (!$result) { $notification->push(_("Could not delete the module."), 'horde.error'); } else { $notification->push(_("Successfully deleted the module."), 'horde.success'); } } break;
exit; } else { $url = Util::getFormData('url'); $initial_app = $prefs->getValue('initial_application'); if (!empty($url)) { $main_page = $url; } elseif (!empty($initial_app) && !($GLOBALS['perms']->exists($initial_app) && !$GLOBALS['perms']->hasPermission($initial_app, Auth::getAuth(), PERMS_READ))) { $main_page = Horde::url($registry->getInitialPage($initial_app)); } elseif (isset($registry->applications['horde']['initial_page'])) { $main_page = Horde::applicationUrl($registry->applications['horde']['initial_page']); } elseif (Auth::getAuth()) { $main_page = Horde::applicationUrl('services/portal/'); } else { $main_page = Horde::applicationUrl('login.php'); } if (!Util::getFormData('frameset') && ($conf['menu']['always'] || $conf['menu']['display'] && Auth::getAuth() && $prefs->getValue('show_sidebar'))) { if ($browser->hasQuirk('scrollbar_in_way')) { $scrollbar = 'yes'; } else { $scrollbar = 'auto'; } $main_page = Util::addParameter($main_page, 'frameset', 1); require HORDE_TEMPLATES . '/index/frames_index.inc'; } else { header('Location: ' . $main_page); exit; } } } else { define('HORDE_LIBS', ''); require HORDE_BASE . '/lib/Test.php';
if (strlen($log) > 80) { $shortLog .= "..."; } } require CHORA_TEMPLATES . '/directory/file.inc'; } /* Display the options control panel at the bottom */ $formwhere = $scriptName . '/' . $where; require CHORA_TEMPLATES . '/directory/footer.inc'; require $registry->getParam('templates', 'horde') . '/common-footer.inc'; } elseif ($VC->isFile($fullname)) { $fl =& $VC->getFileObject($where); $title = sprintf(_("Source Log for %s"), Text::htmlAllSpaces($where)); $upwhere = preg_replace('|[^/]+$|', '', $where); $onb = Util::getFormData('onb', 0); $r1 = Util::getFormData('r1', 0); $isBranch = isset($onb) && isset($fl->branches[$onb]) ? $fl->branches[$onb] : ''; $extraLink = Chora::getFileViews(); require CHORA_TEMPLATES . '/common-header.inc'; Chora::menu(); require CHORA_TEMPLATES . '/headerbar.inc'; $mimeType = MIME_Magic::filenameToMIME($fullname); $defaultTextPlain = $mimeType == 'text/plain'; foreach ($fl->logs as $lg) { $rev = $lg->rev; /* Are we sticking only to one branch ? */ if ($onb && VC_Revision::valid($onb)) { /* If so, if we are on the branch itself, let it through */ if (substr($rev, 0, strlen($onb)) != $onb) { /* We are not on the branch, see if we are on a trunk * branch below the branch */
Horde::fatal('Forbidden.', __FILE__, __LINE__); } $title = _("SQL Shell"); require HORDE_TEMPLATES . '/common-header.inc'; require HORDE_TEMPLATES . '/admin/common-header.inc'; ?> <form name="sqlshell" action="<?php echo $_SERVER['PHP_SELF']; ?> " method="post"> <?php Util::pformInput(); ?> <?php if ($command = trim(Util::getFormData('sql'))) { // Keep a cache of prior queries for convenience. if (!isset($_SESSION['_sql_query_cache'])) { $_SESSION['_sql_query_cache'] = array(); } if (($key = array_search($command, $_SESSION['_sql_query_cache'])) !== false) { unset($_SESSION['_sql_query_cache'][$key]); } array_unshift($_SESSION['_sql_query_cache'], $command); while (count($_SESSION['_sql_query_cache']) > 20) { array_pop($_SESSION['_sql_query_cache']); } echo '<div class="header">' . _("SQL Query") . ':</div><br />'; echo '<table cellpadding="4" border="0"><tr><td class="text"><pre>' . htmlspecialchars($command) . '</pre></td></tr></table>'; echo '<br /><div class="header">' . _("Results") . ':</div><br />'; echo '<table cellpadding="2" border="0"><tr><td class="control">';
<?php /* * $Horde: horde/services/images/colorpicker.php,v 1.14 2004/01/01 16:17:37 jan Exp $ * * Copyright 2002-2004 Michael Cochrane <*****@*****.**> * * See the enclosed file COPYING for license information (LGPL). If you * did not receive this file, see http://www.fsf.org/copyleft/lgpl.html. */ @define('HORDE_BASE', dirname(__FILE__) . '/../..'); require_once HORDE_BASE . '/lib/base.php'; $title = _("Color Picker"); require HORDE_TEMPLATES . '/common-header.inc'; $form = Util::getFormData('form'); $target = Util::getFormData('target'); echo Horde::img('colorpicker.png', '', 'id="colorpicker" onclick="changeColor(getColor(event)); return false;" onmousemove="demoColor(getColor(event)); return false;" style="cursor:crosshair;background-color:white;padding:1px"'); ?> <div id="colorDemo" style="background-color:white;width:100px;height:20px;padding:1px"></div> <script language="Javascript" type="text/javascript"> <!-- function changeColor(color) { if (parent.opener.closed) { alert("<?php echo addslashes(_("The Options window has closed. Exiting.")); ?> "); this.close(); return;
if ($info['app'] != $newapp || $info['block'] != $newtype) { // Change app or type. $info = array(); $info['app'] = $newapp; $info['block'] = $newtype; $info['params'] = Util::getFormData('params'); $params = $blocks->getParams($newapp, $newtype); foreach ($params as $newparam) { if (is_null($info['params'][$newparam])) { $info['params'][$newparam] = $blocks->getDefaultValue($newapp, $newtype, $newparam); } } $layout->setBlockInfo($row, $col, $info); } else { // Change values. $layout->setBlockInfo($row, $col, array('params' => Util::getFormData('params', array()))); } } $layout->save(); if ($action == 'save') { break; } // Make a block the current block for editing. // Make a block the current block for editing. case 'edit': $edit_row = $row; $edit_col = $col; break; } $title = _("My Portal Layout"); require HORDE_TEMPLATES . '/common-header.inc';
$registry =& Registry::singleton(); /* Figure out which application we're setting preferences for. */ $app = Util::getFormData('app', 'horde'); $appbase = $registry->getParam('fileroot', $app); /* Load $app's base environment. */ require_once $appbase . '/lib/base.php'; /* Load $app's preferences, if any. */ if (file_exists($appbase . '/config/prefs.php')) { require $appbase . '/config/prefs.php'; } /* Load custom preference handlers for $app, if present. */ if (file_exists($appbase . '/lib/prefs.php')) { require_once $appbase . '/lib/prefs.php'; } /* See if we have a preferences group set. */ $group = Util::getFormData('group'); if (Prefs_UI::handleForm($group)) { require $appbase . '/config/prefs.php'; } $title = _("User Options"); require $registry->getParam('templates', $app) . '/common-header.inc'; if ($app == 'horde') { require $appbase . '/services/portal/navbar.php'; } else { if (isset($menu) && is_a($menu, 'Menu')) { /* App has a defined menu object and can return a menu * array. */ $menu = $menu->getMenu(); /* Use the default menu template to output this menu array. */ require $registry->getParam('templates', 'horde') . '/menu/menu.inc'; } else {
/* Initialise the form variables correctly. * If r1/r2 are empty, then use the corresponding text field instead */ $r1 = Util::getFormData('r1', 0); $r2 = Util::getFormData('r2', 0); if (!$r1) { $r1 = Util::getFormData('tr1'); } if (!$r2) { $r2 = Util::getFormData('tr2'); } /* If no context-size has been specified, default to 3. */ $num = Util::getFormData('num', 3); /* If no type has been specified, then default to human readable. */ $ty = Util::getFormData('ty', 'h'); /* Unless otherwise specified, show whitespace differences. */ $ws = Util::getFormData('ws', 1); /* Figure out what type of diff has been requested. */ switch ($ty) { case 's': $type = 'column'; break; case 'c': $type = 'context'; break; case 'e': $type = 'ed'; break; case 'u': case 'h': default: $type = 'unified';
$vars->set('password', array('original' => $info['password'], 'confirm' => $info['password'])); unset($info['password']); $vars->set('extra', $info); $vars->set('removeQueuedSignup', true); $addForm->addHidden('', 'removeQueuedSignup', 'boolean', true); break; case 'removequeued_f': $f_user_name = Util::getFormData('user_name'); $removequeued_form = true; break; case 'removequeued': $result = $signup->removeQueuedSignup(Util::getFormData('user_name')); if (is_a($result, 'PEAR_Error')) { $notification->push($result); } else { $notification->push(sprintf(_("The signup request for %s has been removed."), Util::getFormData('user_name'))); } break; } $title = _("User Administration"); require HORDE_TEMPLATES . '/common-header.inc'; require HORDE_TEMPLATES . '/admin/common-header.inc'; $notification->notify(array('listeners' => 'status')); if (isset($update_form) && $auth->hasCapability('list')) { require_once HORDE_LIBS . 'Horde/Identity.php'; $identity =& Identity::singleton('none', $f_user_name); require HORDE_TEMPLATES . '/admin/user/update.inc'; } elseif (isset($remove_form) && $auth->hasCapability('list') && $auth->hasCapability('remove')) { require HORDE_TEMPLATES . '/admin/user/remove.inc'; } elseif (isset($removequeued_form)) { require HORDE_TEMPLATES . '/admin/user/removequeued.inc';
} @define('AUTH_HANDLER', true); @define('HORDE_BASE', dirname(__FILE__) . '/../..'); require_once HORDE_BASE . '/lib/base.php'; require_once HORDE_LIBS . 'Horde/Menu.php'; require_once HORDE_LIBS . 'Horde/Help.php'; if (!Auth::getAuth() && !$conf['menu']['always']) { Horde::authenticationFailureRedirect(); } Horde::addScriptFile('menu.js'); Menu::useAccessKeys(false); if ($browser->hasQuirk('scrollbar_in_way')) { $notification->push('correctWidthForScrollbar()', 'javascript'); } $bodyClass = 'sidebar'; if (Util::getFormData('mozbar')) { $target = '_content'; $bodyClass .= ' nomargin'; } else { $target = 'horde_main'; } require HORDE_TEMPLATES . '/common-header.inc'; // Build the array so we have parents and children all lined up. buildMenu(); // Loop through the registry and create the <div>s. $menutext = ''; // Variable for the HTML output. $i = 0; // Counter for looping through the registry. $last_group = -1; // To track groups of menus to make <div>s.
<?php /** * Simple script to help with regex construction/debugging. Put it somewhere * on your webserver and point your browser to it. * * Based on: http://myfluffydog.com/programming/php/scripts/regexp.php */ require 'Horde/Util.php'; $regexp = Util::getFormData('regexp'); $subject = Util::getFormData('subject'); $submit = Util::getFormData('submit'); set_time_limit(2); function unhtmlentities($string) { $trans_tbl = get_html_translation_table(HTML_ENTITIES); $trans_tbl = array_flip($trans_tbl); return strtr($string, $trans_tbl); } if ($submit == "Test") { // doing a reg expression search -- get variables $unescapedRegexp = unhtmlentities($regexp); // for search $escapedRegexp = htmlentities($regexp); // for showing on page and in textarea $text = $subject; $text = stripslashes($text); $text = unhtmlentities($text); // for search $escapedText = htmlentities($text); // for textarea
<?php /** * $Horde: horde/util/barcode.php,v 1.6 2004/01/05 22:45:44 slusarz Exp $ * * Copyright 2002-2004 Chuck Hagenbuch <*****@*****.**> * * See the enclosed file COPYING for license information (LGPL). If you * did not receive this file, see http://www.fsf.org/copyleft/lgpl.html. */ define('HORDE_BASE', dirname(__FILE__) . '/..'); require_once HORDE_BASE . '/lib/base.php'; require_once HORDE_LIBS . 'Horde/Image.php'; header('Pragma: public'); $image =& Horde_Image::factory(Util::getFormData('type', 'png')); $image->headers(); echo $image->makeBarcode(Util::getFormData('barcode', 'test'));
* Copyright 1999-2004 Chuck Hagenbuch <*****@*****.**> * * See the enclosed file COPYING for license information (LGPL). If you * did not receive this file, see http://www.fsf.org/copyleft/lgpl.html. */ define('HORDE_BASE', dirname(__FILE__) . '/..'); require_once HORDE_BASE . '/lib/base.php'; require_once HORDE_LIBS . 'Horde/Menu.php'; require_once HORDE_LIBS . 'Horde/Help.php'; if (!Auth::isAdmin()) { Horde::fatal('Forbidden.', __FILE__, __LINE__); } $title = _("Command Shell"); require HORDE_TEMPLATES . '/common-header.inc'; require HORDE_TEMPLATES . '/admin/common-header.inc'; if ($command = trim(Util::getFormData('cmd'))) { echo '<div class="header">' . _("Command") . ':</div><br />'; echo '<table cellpadding="4" border="0"><tr><td class="text"><code>' . nl2br(htmlspecialchars($command)) . '</code></td></tr></table>'; echo '<br /><div class="header">' . _("Results") . ':</div><br />'; echo '<table cellpadding="4" border="0"><tr><td class="text"><pre>'; $cmds = explode("\n", $command); foreach ($cmds as $cmd) { $cmd = trim($cmd); if (strlen($cmd)) { unset($results); flush(); echo htmlspecialchars(shell_exec($cmd)); } } echo '</pre></td></tr></table><br />'; }
<?php @define('NWNADMIN_BASE', dirname(__FILE__)); require_once NWNADMIN_BASE . '/lib/base.php'; // script global variables global $nwndriver; $admin = Auth::isAdmin('nwnadmin:admin'); $adminDelete = Auth::isAdmin('nwnadmin:admin', PERMS_DELETE); $serverUp = $nwndriver->serverRunning(); if (!$serverUp) { $notification->push(_("The server is down; player info is unavailable. ")); } // figure out what to do $actionId = Util::getFormData('actionId'); $playerId = Util::getFormData('playerId'); $valid = false; $unban = false; switch ($actionId) { case 'unbanip': case 'unbanname': case 'unbankey': $unban = true; case 'banip': case 'banname': case 'bankey': case 'kick': $valid = true; } if ($valid && $admin && $serverUp) { $result = $nwndriver->sendCommand($actionId . ' ' . $playerId); if (is_a($result, 'PEAR_Error')) {
?> "<?php if ($application == $app) { echo ' selected="selected"'; } ?> ><?php echo $registry->getParam('name', $app); ?> </option> <?php } ?> </select><br /><br /> <?php if ($command = trim(Util::getFormData('php'))) { if (@file_exists($registry->getParam('fileroot', $applicatio) . '/lib/base.php')) { include $registry->getParam('fileroot', $application) . '/lib/base.php'; } else { $registry->pushApp($application); } require_once HORDE_LIBS . 'Horde/MIME/Viewer.php'; require_once HORDE_LIBS . 'Horde/MIME/Viewer/source.php'; $pretty = highlight_string('<?php ' . $command . "\n", true); $pretty = str_replace(array('<?php', "\r\n", "\r", "<code><font color=\"#000000\">\n", "\n</code>", "\n</font></code>"), array('', "\n", "\n", '<code><font color="#000000">', '</code>', '</font></code>'), $pretty); $pretty = MIME_Viewer_Source::lineNumber(trim($pretty)); echo '<table width="100%" border="0" cellpadding="2" cellspacing="0"><tr><td class="header">' . _("PHP Code") . '</td></tr></table><br />'; echo $pretty; echo '<br /><table width="100%" border="0" cellpadding="2" cellspacing="0"><tr><td class="header">' . _("Results") . '</td></tr></table>'; echo '<table cellpadding="4" border="0"><tr><td class="text"><pre>'; eval($command);
<?php /** * $Horde: horde/admin/perms/index.php,v 1.7 2004/02/23 08:27:57 slusarz Exp $ * * Copyright 1999, 2000, 2001 Chuck Hagenbuch <*****@*****.**> * * See the enclosed file COPYING for license information (LGPL). If you * did not receive this file, see http://www.fsf.org/copyleft/lgpl.html. */ define('HORDE_BASE', dirname(__FILE__) . '/../..'); require_once HORDE_BASE . '/lib/base.php'; require_once HORDE_LIBS . 'Horde/Menu.php'; if (!Auth::isAdmin()) { Horde::authenticationFailureRedirect(); } $form = null; $cid = Util::getFormData('cid'); $title = _("Permissions Administration"); require HORDE_TEMPLATES . '/common-header.inc'; require HORDE_TEMPLATES . '/admin/common-header.inc'; $notification->notify(array('listeners' => 'status')); require_once HORDE_LIBS . 'Horde/Perms/UI.php'; $ui =& new Perms_UI($perms); $ui->renderTree($cid); require HORDE_TEMPLATES . '/common-footer.inc';
<?php /** * $Horde: chora/annotate.php,v 1.43 2004/01/17 22:57:25 jan Exp $ * * Copyright 2000-2004 Anil Madhavapeddy <*****@*****.**> * * See the enclosed file COPYING for license information (GPL). If you * did not receive this file, see http://www.fsf.org/copyleft/gpl.html. */ define('CHORA_BASE', dirname(__FILE__)); require_once CHORA_BASE . '/lib/base.php'; /* Spawn the file object. */ $fl =& $VC->getFileObject($where); /* Retrieve the desired revision from the GET variable. */ $rev = Util::getFormData('rev', '1.1'); if (!VC_Revision::valid($rev)) { Chora::fatal('404 Not Found', "Revision {$rev} not found"); } $ann =& $VC->getAnnotateObject($fl); Chora::checkError($lines = $ann->doAnnotate($rev)); $title = sprintf(_("Source Annotation of %s for version %s"), Text::htmlAllSpaces($where), $rev); $extraLink = sprintf('<a href="%s">%s</a> <b>|</b> <a href="%s">%s</a>', Chora::url('co', $where, array('r' => $rev)), _("View"), Chora::url('co', $where, array('r' => $rev, 'p' => 1)), _("Download")); require CHORA_TEMPLATES . '/common-header.inc'; Chora::menu(); require CHORA_TEMPLATES . '/headerbar.inc'; require CHORA_TEMPLATES . '/annotate/header.inc'; $author = ''; $style = 0; foreach ($lines as $line) { $lineno = $line['lineno'];
$notification->push(_("There was a problem starting the server: ") . $result->getMessage(), 'horde.error'); } else { $notification->push(_("The server was started."), 'horde.success'); } break; case 'kill': $wait = true; $result = $nwndriver->killServer(); if (is_a($result, 'PEAR_Error')) { $notification->push(_("There was a problem killing the server: ") . $result->getMessage(), 'horde.error'); } else { $notification->push(_("The server was killed."), 'horde.warning'); } case 'raw': $wait = true; $result = $nwndriver->sendCommand(Util::getFormData('command'), true); if (is_a($result, 'PEAR_Error')) { $notification->push(_("There was a problem sending the command: ") . $result->getMessage(), 'horde.error'); } else { $rawResult = $result; $notification->push(_("The command was accepted."), 'horde.success'); } } // select form to display if ($wait) { sleep(2); } if ($nwndriver->serverRunning()) { $title = _("Stop/Restart/Kill Server"); $form = 'kill.inc'; } else {
* $Horde: horde/services/links/delete.php,v 1.11 2004/01/25 19:33:25 chuck Exp $ * * Generic delete API for Horde_Links * * Copyright 2003-2004, Jeroen Huinink <*****@*****.**> * * See the enclosed file COPYING for license information (GPL). If you * did not receive this file, see http://www.fsf.org/copyleft/gpl.html. */ @define('HORDE_BASE', dirname(__FILE__) . '/../..'); require_once HORDE_BASE . '/lib/base.php'; require_once HORDE_LIBS . 'Horde/Links.php'; if (!Auth::isAuthenticated()) { Horde::authenticationFailureRedirect(); } $links =& Horde_Links::singleton($registry->getApp()); $link_data = @unserialize(Util::getFormData('link_data')); $return_url = Util::getFormData('return_url'); $result = $links->deleteLink($link_data); if (is_a($result, 'PEAR_Error')) { $notification->push($result, 'horde.error'); } elseif ($registry->hasMethod($link_data['link_params']['to_application'] . '/getLinkSummary')) { $summary = $registry->call($link_data['link_params']['to_application'] . '/getLinkSummary', array($link_data)); if (is_a($summary, 'PEAR_Error')) { $summary = $summary->getMessage(); } $notification->push(sprintf(_("The %s link to %s has been removed."), $link_data['link_params']['link_type'], $summary), 'horde.success'); } else { $notification->push(_("The link has been removed"), 'horde.success'); } header('Location: ' . $return_url);
* Copyright 1999-2004 Charles J. Hagenbuch <*****@*****.**> * Copyright 1999-2004 Jon Parise <*****@*****.**> * * See the enclosed file COPYING for license information (LGPL). If you * did not receive this file, see http://www.fsf.org/copyleft/lgpl.html. */ define('HORDE_BASE', dirname(__FILE__) . '/../..'); require_once HORDE_BASE . '/lib/base.php'; if (!Auth::isAdmin()) { Horde::fatal('Forbidden.', __FILE__, __LINE__); } /* Get form data. */ $setup = Util::getFormData('setup'); $type = Util::getFormData('type'); $save = Util::getFormData('save'); $clean = Util::getFormData('clean'); $filename = 'horde_setup_upgrade.php'; /* Check if this is only a request to clean up. */ if ($clean == 'tmp') { $tmp_dir = Horde::getTempDir(); if (unlink($tmp_dir . '/' . $filename)) { $notification->push(sprintf(_("Deleted setup upgrade script '%s'."), $tmp_dir . '/' . $filename), 'horde.success'); } else { $notification->push(sprintf(_("Could not delete setup upgrade script '%s'."), $tmp_dir . '/' . $filename), 'horde.error'); } $url = Horde::applicationUrl('admin/setup/index.php', true); header('Location: ' . $url); exit; } $data = ''; if ($setup == 'conf' && $type == 'php') {
/* Run through the action handlers */ switch ($actionID) { case RPC_SAVE: if (($to_edit = Util::getFormData('edit_server')) == null) { $to_edit = count($rpc_servers); $rpc_servers[] = array(); } $rpc_servers[$to_edit]['url'] = Util::getFormData('url'); $rpc_servers[$to_edit]['user'] = Util::getFormData('user'); $rpc_servers[$to_edit]['passwd'] = Util::getFormData('passwd'); $prefs->setValue('remote_summaries', serialize($rpc_servers)); $prefs->store(); $notification->push(sprintf(_("The server \"%s\" has been saved."), $rpc_servers[$to_edit]['url']), 'horde.success'); break; case RPC_DELETE: $to_delete = Util::getFormData('server'); if ($to_delete != -1) { $deleted_server = $rpc_servers[$to_delete]['url']; $server_list = array(); for ($i = 0; $i < count($rpc_servers); $i++) { if ($i == $to_delete) { continue; } $server_list[] = $rpc_servers[$i]; } $prefs->setValue('remote_summaries', serialize($server_list)); $chosenColumns = explode(';', $prefs->getValue('show_summaries')); if ($chosenColumns != array('')) { $newColumns = array(); foreach ($chosenColumns as $chosenColumn) { $chosenColumn = explode(',', $chosenColumn);
* Copyright 1999-2004 Charles Hagenbuch <*****@*****.**> * * See the enclosed file COPYING for license information (GPL). If you * did not receive this file, see http://www.fsf.org/copyleft/gpl.html. */ @define('CHORA_BASE', dirname(__FILE__)); require_once CHORA_BASE . '/lib/base.php'; // Exit if cvsgraph isn't active or it's not supported. if (empty($conf['paths']['cvsgraph']) || is_a($VC, 'VC_svn')) { header('Location: ' . Chora::url('cvs', $where)); exit; } if (@is_file($fullname . ',v')) { $root = escapeShellCmd($VC->sourceroot()); $file = escapeShellCmd($where . ',v'); if (Util::getFormData('show_image')) { // Pipe out the actual image. $args = array('c' => $conf['paths']['cvsgraph_conf'], 'r' => $root); // Build up the argument string. $argstr = ''; if (OS_WINDOWS) { foreach ($args as $key => $val) { $argstr .= "-{$key} \"{$val}\" "; } } else { foreach ($args as $key => $val) { $argstr .= "-{$key} '{$val}' "; } } header('Content-Type: image/png'); passthru($conf['paths']['cvsgraph'] . ' ' . $argstr . ' ' . $file);
/** * $Horde: horde/services/help/index.php,v 2.72 2004/02/14 01:36:27 chuck Exp $ * * Copyright 1999-2004 Jon Parise <*****@*****.**> * * See the enclosed file COPYING for license information (LGPL). If you * did not receive this file, see http://www.fsf.org/copyleft/lgpl.html. */ @define('HORDE_BASE', dirname(__FILE__) . '/../..'); require_once HORDE_BASE . '/lib/base.php'; require_once HORDE_LIBS . 'Horde/Help.php'; $title = _("Help"); $show = String::lower(Util::getFormData('show', 'index')); $module = String::lower(basename(Util::getFormData('module', 'horde'))); $topic = Util::getFormData('topic'); if ($module == 'admin') { $fileroot = $registry->getParam('fileroot'); $help_file = $fileroot . "/admin/locale/{$language}/help.xml"; $help_file_fallback = $fileroot . '/admin/locale/en_US/help.xml'; } else { $fileroot = $registry->getParam('fileroot', $module); $help_file = $fileroot . "/locale/{$language}/help.xml"; $help_file_fallback = $fileroot . '/locale/en_US/help.xml'; } if ($show == 'index') { require HORDE_TEMPLATES . '/help/index.inc'; } else { require HORDE_TEMPLATES . '/common-header.inc'; if ($show == 'menu') { require HORDE_TEMPLATES . '/help/menu.inc';
// Clean up $dir->close(); return rmdir($dirname); } // script global variables global $nwndriver; $admin = Auth::isAdmin('nwnadmin:admin'); $adminDelete = Auth::isAdmin('nwnadmin:admin', PERMS_DELETE); $saveDir = NWNAdmin::getSaveGamePath(); $serverUp = $nwndriver->serverRunning(); if ($admin && !$serverUp) { $notification->push(_("The server is down; save game loading is " . "unavailable.")); } // figure out what to do $actionId = Util::getFormData('actionId'); $saveName = Util::getFormData('saveName'); if (isset($actionId) && !isset($saveName)) { $notification->push(_("Invalid options! Try again..."), 'horde.warning'); } else { switch ($actionId) { case 'delete': $result = false; $length = strlen($conf['server']['root']); if ($adminDelete && substr($saveName, 0, $length) == $conf['server']['root']) { $saveName = str_replace('../', '', $saveName); $result = rmdirr(escapeshellcmd($saveName)); } if (!$result) { $notification->push(_("Could not delete the save game."), 'horde.error'); } else { $notification->push(_("Successfully deleted the saved game."), 'horde.success');