Changes in tags table structure, tags related security areas added.
[fa-stable.git] / includes / main.inc
index b6791b8f771f841f28152885dc2b53aee8d18891..f52d88c6088a5d383ffa926f80dddab4c5d75484 100644 (file)
@@ -11,7 +11,6 @@
 ***********************************************************************/
 include_once($path_to_root . "/includes/db/connect_db.inc");
 
-include_once($path_to_root . "/includes/reserved.inc");
 include_once($path_to_root . "/includes/errors.inc");
 include_once($path_to_root . "/includes/types.inc");
 include_once($path_to_root . "/includes/systypes.inc");
@@ -19,34 +18,24 @@ include_once($path_to_root . "/includes/references.inc");
 include_once($path_to_root . "/includes/prefs/sysprefs.inc");
 include_once($path_to_root . "/includes/db/comments_db.inc");
 include_once($path_to_root . "/includes/db/sql_functions.inc");
+include_once($path_to_root . "/includes/db/audit_trail_db.inc");
+//include_once($path_to_root . "/includes/validation.inc");
 
 include_once($path_to_root . "/admin/db/users_db.inc");
 include_once($path_to_root . "/includes/ui/ui_view.inc");
 include_once($path_to_root . "/includes/ui/ui_controls.inc");
-include_once($path_to_root . "/installed_extensions.php");
        
 function page($title, $no_menu=false, $is_index=false, $onload="", $js="", $script_only=false)
 {
 
-       global $path_to_root, $installed_extensions;
+       global $path_to_root;
 
        $hide_menu = $no_menu;
 
-       if ($no_menu==false && count($installed_extensions))
-       {
-               global $applications;
-               foreach ($installed_extensions as $ext)
-               {
-                       $s = $applications['system'];
-                       array_pop($applications);
-                       $applications[$ext['name']] = $ext['title'];;
-                       $applications['system'] = $s;
-               }       
-       }       
        include($path_to_root . "/includes/page/header.inc");
 
        page_header($title, $no_menu, $is_index, $onload, $js);
-       error_box();
+//     error_box();
        if($script_only) {              
                echo '<noscript>';
                echo display_heading(_('This page is usable only with javascript enabled browsers.'));
@@ -66,17 +55,17 @@ function end_page($no_menu=false, $is_index=false)
        page_footer($no_menu, $is_index);
 }
 
-function flush_dir($path) 
+function flush_dir($path, $wipe = false
 {
        $dir = opendir($path);
        while(false !== ($fname = readdir($dir))) {
-               if($fname=='.' || $fname=='..' || $fname=='index.php') continue;
+               if($fname=='.' || $fname=='..' || (!$wipe && $fname=='index.php')) continue;
                if(is_dir($path.'/'.$fname)) {
-                   flush_dir($path.'/'.$fname);
-                   @rmdir($path.'/'.$fname);
+                   flush_dir($path.'/'.$fname, $wipe);
+                   if ($wipe) @rmdir($path.'/'.$fname);
                } else
                    @unlink($path.'/'.$fname);
-       }
+       }
 }
 
 function cache_js_file($fpath, $text) 
@@ -150,10 +139,11 @@ function js_compress($sJS)
                $inNormalComment = false;
        
                //loop through line's characters and take out any literal strings, replace them with ___i___ where i is the index of this string
-               for($j=0;$j<strlen($line);$j++)
+               $len = strlen($line);
+               for($j=0;$j<$len;$j++)
                {
-                       $c = substr($line,$j,1);
-                       $d = substr($line,$j,2);
+                       $c = $line[$j];         // this is _really_ faster than subst
+                       $d = $c.$line[$j+1];
        
                        //look for start of quote
                        if(!$inQuote && !$inComment)