| [ Index ] |
|
Code source de eGroupWare 1.2.106-2 |
1 <?php 2 // $Id: main.php 20295 2006-02-15 12:31:25Z $ 3 4 // Harvest script parameters and other variables. We do this even if 5 // register_globals=on; this way, we force the variables to be defined. 6 // (Which is better form in case the admin has warnings cranked all the 7 // way up). 8 9 require('lib/init.php'); // includes the header.inc.php, to prevent XSS attacks it has to be before setting the vars 10 11 $HTTP_REFERER = isset($_SERVER['HTTP_REFERER']) 12 ? $_SERVER['HTTP_REFERER'] : ''; 13 $REMOTE_ADDR = isset($_SERVER['REMOTE_ADDR']) 14 ? $_SERVER['REMOTE_ADDR'] : ''; 15 16 $action = isset($_GET['action']) 17 ? $_GET['action'] : ''; 18 $page = isset($_GET['page']) 19 ? $_GET['page'] : ''; 20 if (isset($_GET['lang'])) 21 { 22 $page = array( 23 'name' => $page, 24 'lang' => $_GET['lang'], 25 ); 26 } 27 $ver1 = isset($_GET['ver1']) 28 ? $_GET['ver1'] : ''; 29 $ver2 = isset($_GET['ver2']) 30 ? $_GET['ver2'] : ''; 31 $find = isset($_GET['find']) 32 ? $_GET['find'] : ''; 33 $version = isset($_GET['version']) 34 ? $_GET['version'] : ''; 35 $full = isset($_GET['full']) 36 ? $_GET['full'] : ''; 37 $min = isset($_GET['min']) 38 ? $_GET['min'] : ''; 39 $days = isset($_GET['days']) 40 ? $_GET['days'] : ''; 41 42 $Preview = isset($_POST['Preview']) 43 ? $_POST['Preview'] : ''; 44 $Save = isset($_POST['Save']) 45 ? $_POST['Save'] : ''; 46 $SaveAndContinue = isset($_POST['SaveAndContinue']) 47 ? $_POST['SaveAndContinue'] : ''; 48 $archive = isset($_POST['archive']) 49 ? $_POST['archive'] : ''; 50 $auth = isset($_POST['auth']) 51 ? $_POST['auth'] : ''; 52 $categories = isset($_POST['categories']) 53 ? $_POST['categories'] : ''; 54 $cols = isset($_POST['cols']) 55 ? $_POST['cols'] : ''; 56 $comment = isset($_POST['comment']) 57 ? $_POST['comment'] : ''; 58 $days = isset($_POST['days']) 59 ? $_POST['days'] : $days; 60 $discard = isset($_POST['discard']) 61 ? $_POST['discard'] : ''; 62 $document = isset($_POST['document']) 63 ? $_POST['document'] : ''; 64 $hist = isset($_POST['hist']) 65 ? $_POST['hist'] : ''; 66 $min = isset($_POST['min']) 67 ? $_POST['min'] : $min; 68 $nextver = isset($_POST['nextver']) 69 ? $_POST['nextver'] : ''; 70 $rows = isset($_POST['rows']) 71 ? $_POST['rows'] : ''; 72 $tzoff = isset($_POST['tzoff']) 73 ? $_POST['tzoff'] : ''; 74 $user = isset($_POST['user']) 75 ? $_POST['user'] : ''; 76 $referrer = isset($_POST['referrer']) 77 ? $_POST['referrer'] : ''; 78 79 require('parse/transforms.php'); 80 81 // To add an action=x behavior, add an entry to this array. First column 82 // is the file to load, second is the function to call, and third is how 83 // to treat it for rate-checking purposes ('view', 'edit', or 'search'). 84 $ActionList = array( 85 'xml' => array('wiki.xmlwiki.export','','view'), 86 'view' => array('action/view.php', 'action_view', 'view'), 87 'edit' => array('action/edit.php', 'action_edit', 'view'), 88 'save' => array('action/save.php', 'action_save', 'edit'), 89 'diff' => array('action/diff.php', 'action_diff', 'search'), 90 'find' => array('action/find.php', 'action_find', 'search'), 91 'history' => array('action/history.php', 'action_history', 92 'search'), 93 'prefs' => array('action/prefs.php', 'action_prefs', 'view'), 94 'macro' => array('action/macro.php', 'action_macro', 'search'), 95 'rss' => array('action/rss.php', 'action_rss', 'view'), 96 'style' => array('action/style.php', 'action_style', ''), 97 'admin' => array('action/admin.php','','') 98 ); 99 100 101 if(empty($action)) 102 { $action = 'view'; } 103 if(is_array($page) && empty($page['name']) || !is_array($page) && empty($page)) 104 { $page = $HomePage; } 105 106 // Confirm we have a valid page name. 107 if(!validate_page($page)) 108 { die($ErrorInvalidPage); } 109 110 // Don't let people do too many things too quickly. 111 if($ActionList[$action][2] != '') 112 { $pagestore->rateCheck($ActionList[$action][2],$_SERVER['REMOTE_ADDR']); } 113 114 // Dispatch the appropriate action. 115 if(!empty($ActionList[$action])) 116 { 117 if (count(explode('.',$ActionList[$action][0])) == 3) 118 { 119 ExecMethod($ActionList[$action][0]); 120 } 121 else 122 { 123 include($ActionList[$action][0]); 124 if ($ActionList[$action][1]) 125 $ActionList[$action][1](); 126 } 127 } 128 129 // Expire old versions, etc. 130 $pagestore->maintain(); 131 132 $GLOBALS['egw']->common->egw_footer();
titre
Description
Corps
titre
Description
Corps
titre
Description
Corps
titre
Corps
| Généré le : Sun Feb 25 17:20:01 2007 | par Balluche grâce à PHPXref 0.7 |