| 
     
      
      
      From: <ken...@us...> - 2008-07-22 13:16:29
       
   | 
Revision: 466
          http://andro.svn.sourceforge.net/andro/?rev=466&view=rev
Author:   kendowns
Date:     2008-07-22 13:16:34 +0000 (Tue, 22 Jul 2008)
Log Message:
-----------
Allows "matches" to be passed back for androSelect lookups, useful for multi-column primary keys.
Modified Paths:
--------------
    trunk/andro/lib/index_hidden.php
Modified: trunk/andro/lib/index_hidden.php
===================================================================
--- trunk/andro/lib/index_hidden.php	2008-07-22 13:14:30 UTC (rev 465)
+++ trunk/andro/lib/index_hidden.php	2008-07-22 13:16:34 UTC (rev 466)
@@ -670,9 +670,14 @@
    // Strip a leading slash from the value
    $gpletters=trim(gp('gp_letters'));
    
+   # KFD 7/21/08, experiment
+   $matches = aFromGP('match_');
+   
    // Pull the rows from handy library routine.
    if(gp('gpv')=='2') {
-       $rows=RowsForSelect($table_id_fk,$gpletters,array(),'',true);   
+       # KFD 7/21/08
+       $rows=RowsForSelect($table_id_fk,$gpletters,$matches,'',true);
+       #$rows=RowsForSelect($table_id_fk,$gpletters,array(),'',true);
    }
    else {
        $rows=rowsForSelect($table_id_fk,$gpletters);
@@ -1272,7 +1277,7 @@
        # Assign the template to spots where the legacy code will find it
        $AG['template'] = vgfGet('template');
    }
-   
+
    // First conditional fix contributed by Don Organ 9/07, $AG['template']
    // was getting lost on passes 2+
    if(ArraySafe($AG,'template')<>'') {
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
 | 
| 
     
      
      
      From: <ken...@us...> - 2008-07-28 14:10:54
       
   | 
Revision: 484
          http://andro.svn.sourceforge.net/andro/?rev=484&view=rev
Author:   kendowns
Date:     2008-07-28 14:11:01 +0000 (Mon, 28 Jul 2008)
Log Message:
-----------
Final structure of template selection.
Modified Paths:
--------------
    trunk/andro/lib/index_hidden.php
Modified: trunk/andro/lib/index_hidden.php
===================================================================
--- trunk/andro/lib/index_hidden.php	2008-07-28 14:09:57 UTC (rev 483)
+++ trunk/andro/lib/index_hidden.php	2008-07-28 14:11:01 UTC (rev 484)
@@ -115,26 +115,12 @@
 // >>> 
 // ==================================================================
 include_once('androLib.php');
-include_once('androLibDeprecated.php');
+if(configGet('deprecated','Y')=='Y') {
+    include_once('androLibDeprecated.php');
+}
 
-
-
 // ==================================================================
 // >>> 
-// >>> Load configuration options
-//
-// >>> Do this after the framework, so we can use it, but before
-// >>> the applib, which might override these settings
-// ==================================================================
-#  KFD 7/3/08, Final form here is to pull these two, but not
-#              template, that belongs below in index_hidden_template
-#
-vgfSet( 'x4welcome', configGet('x4welcome','N')       );
-vgfSet( 'x4menu'   , configGet('x4menu'   ,'N')       );
-
-
-// ==================================================================
-// >>> 
 // >>> Load the application library
 // >>> 
 // ==================================================================
@@ -174,26 +160,6 @@
 
 // ==================================================================
 // >>> 
-// >>> Redirections.  QUESTIONABLE PLACEMENT AND APPROACH
-// >>>                Almost definitely should be moved into
-// >>>                index_hidden_page
-// >>> 
-// ==================================================================
-// The parameter 'gp_pageal' means page to go to after a login.
-// Save it now.  Used originally for project cme.
-if(gpExists('gp_pageal')) {
-  SessionSet('clean',array('gp_page'=>gp('gp_pageal')));
-}
-   
-// The parameter 'gp_aftersave' means go to a page after saving
-// information somewhere else.  The program processPost will look
-// for this after saving and do a gpSet() to this value.
-if(gpExists('gp_aftersave')) {
-  SessionSet('gp_aftersave',gp('gp_aftersave'));
-}
-
-// ==================================================================
-// >>> 
 // >>> Determine the User ID, or UID
 // >>> 
 // ==================================================================
@@ -295,23 +261,41 @@
 
 // ==================================================================
 // >>> 
-// >>> Dispatch redirection.  We may convert a conventional
-// >>> "x2" call into an x4 call if force flags have been set
-// >>> set these flags in applib
+// >>> Dispatch redirection.  
 // >>> 
 // ==================================================================
-# First redirection is to x4 welcome page, the menu, if they
-# have turned on that flag.  If the x2 variable was passed with
-# a gp_page variable, that forces it to stay as x2.  This was put
-# in to allow old-fashioned processes.
-#
+
+# OLDER DEFUNCT CODE, REMOVE AFTER BETA GOES OUT
+/*
 if(vgfGet('x4welcome')=='Y' && gp('x4Page')=='' && LoggedIn()) {
     # if these two options are set, we don't try to force an x4
     if( !(gpExists('gp_page') && gpExists('x2')) ) { 
         gpSet('x4Page',vgaGet('nopage','menu'));
     }
 }
+*/
 
+
+#  This code is only for a single app which is running
+#  stable on a very old version of Andromeda.  When SDS
+#  upgrades that application, these functions will be
+#  moved into application code.
+#
+/*
+// The parameter 'gp_pageal' means page to go to after a login.
+// Save it now.  Used originally for project cme.
+if(gpExists('gp_pageal')) {
+  SessionSet('clean',array('gp_page'=>gp('gp_pageal')));
+}
+   
+// The parameter 'gp_aftersave' means go to a page after saving
+// information somewhere else.  The program processPost will look
+// for this after saving and do a gpSet() to this value.
+if(gpExists('gp_aftersave')) {
+  SessionSet('gp_aftersave',gp('gp_aftersave'));
+}
+*/
+
 // ==================================================================
 // >>> 
 // >>> Dispatching, pass execution to the relevant handler
@@ -342,6 +326,29 @@
     app_after_db_connect();
 }
 
+# KFD 7/23/08
+# If no page was passed in, we have to do default page
+# handling.  For this we must know if we are normally
+# in x4 mode or not.  Note that some other type of request
+# may have come in, such as gp_dropdown, which causes
+# this to be ignored.
+#
+if(gp('x4Page')=='' && gp('gp_page')=='') {
+    if(function_exists('app_nopage')) {
+        app_nopage();
+    }
+    else {
+        # for x4 apps only, if we have no page
+        # set it to the menu
+        $x4menu = configGet('x4menu');
+        if($x4menu=='Y' && LoggedIn()) {
+            gpSet('x4Page','menu');
+        }
+    }
+}
+
+
+
 // Entries made in the command box can rewrite get/post 
 // variables and affect downstream processing.  Do those
 // now if required.
@@ -414,21 +421,7 @@
        }
     }
     else {
-        include_once("androX4.php");
-        # KFD 6/14/08, loosen this to allow lib and application files both
-        #$file = strtolower($x4Page)=='menu'
-        #    ? fsDirTop()."lib/androX4Menu.php"
-        #    : fsDirTop()."application/x4$x4Page.php";
-        $class  = 'androX4';
-        #if(file_exists($file)) {
-        $file = strtolower($x4Page)=='menu' 
-            ? 'androX4Menu.php' 
-            : "x4$x4Page.php";
-        if(file_exists_incpath($file)) {
-            include_once($file);
-            $class = 'x4'.$x4Page;
-        }
-        $object = new $class();
+        $object = x4Object($x4Page);
         
         # Determine method and invoke it.  Notice any
         # direct output is considered an error
@@ -467,12 +460,12 @@
         #  Put things where the template expects to find them
         vgfSet('HTML',$GLOBALS['AG']['x4']['html']['*MAIN*']);
         foreach($GLOBALS['AG']['x4']['script'] as $script) {
-            elementAdd("jqueryDocumentReady",$script);
+            jqDocReady($script);
         }
 
         # DUPLICATE ALERT: This code copied from 
         #                  index_hidden_page() below
-        index_hidden_template();
+        index_hidden_template('x4');
         global $J;
         $mainframe               = $J['mainframe'];
         $my                      = $J['my'];
@@ -1220,7 +1213,7 @@
    // no buffering that the output is already done.
    if($obj_page->flag_buffer!=false) {
       // Work out what template we are using
-      index_hidden_template();
+      index_hidden_template('x2');
 
       // KFD 5/30/07, send back only main content if asked 
       if(gp('ajxBUFFER')==1) {
@@ -1269,8 +1262,56 @@
 
 
 
-function index_hidden_template() {
-   global $AG;
+function index_hidden_template($mode) {
+    # KFD 7/23/08.  Pull a configuration setting if they
+    #               made one
+    $candidate = configGet('cf_template');
+    
+    # KFD 7/23/08. Give application a chance to 
+    #              play with setting
+    if(function_exists('app_template')) {
+        vgfSet('template',app_template($candidate));
+    }
+    
+    # KFD 7/23/08. If no template has been set by vgfSet,
+    #              and the candidate is not empty, pick it
+    if($candidate!='' && vgfGet('template')=='') {
+        vgfSet('template',$candidate);
+    }
+    
+    # KFD 7/23/08. Finally, if we still don't have something,
+    #              pick according to mode
+    if(vgfGet('template')=='') {
+        if($mode=='x4') {
+            vgfSet('template','pixel2');
+        }
+        else {
+            vgfSet('template','rt_pixel');
+        }
+    }
+
+    # Tell the JOOMLA files that we are legit
+    # Fool them, that is...
+    define("_ANDROMEDA_JOOMLA",1); 
+    define("_JOOMLA_ANDROMEDA",1); 
+      
+    # Activate the template by creating public $J and calling funcs
+    global $J,$AG;
+    $J['TEMPLATE']=vgfGet('template');
+    JoomlaCompatibility($J['TEMPLATE']);
+    $aphp=$AG['dirs']['root'].'/templates/'.$J['TEMPLATE'].'/andromeda.php';
+    if(file_exists($aphp)) {
+        include($aphp);
+    }
+
+    
+    # <----- EARLY RETURN
+    # The rest of this is totally superseded, and can
+    # be removed after we go live with Beta 1
+    return;
+    
+    /*
+    global $AG;
    # KFD 7/3/08.  Have the vgfGet() value override anything else
    #
    if(vgfGet('template')<>'') {
@@ -1348,6 +1389,7 @@
          include($aphp);
       }
    }
+   */
    
 }
 
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
 | 
| 
     
      
      
      From: <ken...@us...> - 2008-08-08 19:46:11
       
   | 
Revision: 511
          http://andro.svn.sourceforge.net/andro/?rev=511&view=rev
Author:   kendowns
Date:     2008-08-08 19:46:19 +0000 (Fri, 08 Aug 2008)
Log Message:
-----------
Added direct database commands for select and insert.  Basic usage:
$a.json.init('x4Page','--table-name');
$a.json.addParm('db',' ins|sel|del|upd');
$a.json.addParm("x4v_COLUMN_ID",'value');  // data values
$a.json.addParm('x4w_COLUMN_ID",'value');  // where clause stuff
Modified Paths:
--------------
    trunk/andro/lib/index_hidden.php
Modified: trunk/andro/lib/index_hidden.php
===================================================================
--- trunk/andro/lib/index_hidden.php	2008-08-08 19:44:30 UTC (rev 510)
+++ trunk/andro/lib/index_hidden.php	2008-08-08 19:46:19 UTC (rev 511)
@@ -495,13 +495,10 @@
     // are four library routines we might call.
     $ra=$r1=false;
     switch(gp('db')) {
-    #case 'del'   : x4sqlDel($table,$whr);              break;
-    #case 'sel'   : $ra=x4sqlSel($table,$whr);          break;
-    case 'ins'   : $r1=x4sqlIns($table,$row,$rr);      break;
-    #case 'insset': x4sqlInsSet($table);                break;
-    #case 'upd'   : $r1=x4sqlUpd($table,$row,$whr,$rr); break;
-    #case 'bsrch' : searchBrowse($table,$whr);          break;
-    #case 'sql'   : x4sqlQuery(gp('x4xSQL'));           break;
+    case 'del'   : x4sqlDel($table,$whr);          break;
+    case 'sel'   : x4sqlSel($table,$whr);          break;
+    case 'ins'   : x4sqlIns($table,$row,$rr);      break;
+    case 'upd'   : x4sqlUpd($table,$row,$whr,$rr); break;
     }
 }
 
@@ -512,7 +509,40 @@
         x4Data('row',$row);
     }
 }
+function x4sqlDel($table,$whr) {
+    $view = ddView($table);
+    $awhere = array();
+    foreach($whr as $key=>$value) {
+        $awhere[] = "$key = $value";
+    }
+    $swhere = implode(' AND ',$awhere);
+    SQL("Delete from $view WHERE $swhere");
+    if(Errors()) {
+        x4Error(hErrors());
+    }
+}
 
+function x4sqlSel($table,$whr) {
+    $options = array();
+    if(gp('ob')<>'') {
+        $options=array('ob',gp('ob'));
+    }
+    x4Data('rows',SQLX_Select($table,'',$options));
+}
+function x4sqlUpd($table,$row,$whr) {
+    if(!isset($whr['skey'])) {
+        x4Error("The database update cannot be performed because the"
+            ." 'skey' column is not present.  This is very likely a"
+            ." programming error, please contact your programmer."
+        );
+    }
+    else {
+        $view = ddView($table);
+        $row = array_merge($row,$whr);
+        SQLX_Update($table,$row);
+    }
+}
+
 // ------------------------------------------------------------------
 // >> Ajax refresh a select that is 2nd column in foreign key
 // ------------------------------------------------------------------
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
 | 
| 
     
      
      
      From: <ken...@us...> - 2008-08-13 14:11:28
       
   | 
Revision: 524
          http://andro.svn.sourceforge.net/andro/?rev=524&view=rev
Author:   kendowns
Date:     2008-08-13 14:11:37 +0000 (Wed, 13 Aug 2008)
Log Message:
-----------
Small hardcoded tweak to allow new configuration pages to run in x4 mode in an x2 system.
Modified Paths:
--------------
    trunk/andro/lib/index_hidden.php
Modified: trunk/andro/lib/index_hidden.php
===================================================================
--- trunk/andro/lib/index_hidden.php	2008-08-13 14:09:16 UTC (rev 523)
+++ trunk/andro/lib/index_hidden.php	2008-08-13 14:11:37 UTC (rev 524)
@@ -326,6 +326,18 @@
     app_after_db_connect();
 }
 
+# KFD 8/13/08 Hardcoded insurance that the config pages
+#             always come up as x4 pages, since that is
+#             how they were coded.  Must also set a flag
+#             to keep menu in x2 mode.
+$x4Required = array(
+    'configfw','configapp','configinst','configuser','configconfirm'
+);
+if(in_array(gp('gp_page'),$x4Required)) {
+    gpSet('x4Page',gp('gp_page'));
+}
+
+
 # KFD 7/23/08
 # If no page was passed in, we have to do default page
 # handling.  For this we must know if we are normally
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
 | 
| 
     
      
      
      From: <ken...@us...> - 2008-08-19 01:15:57
       
   | 
Revision: 553
          http://andro.svn.sourceforge.net/andro/?rev=553&view=rev
Author:   kendowns
Date:     2008-08-19 01:16:06 +0000 (Tue, 19 Aug 2008)
Log Message:
-----------
Hugely important one-line change to command-line processing.
Modified Paths:
--------------
    trunk/andro/lib/index_hidden.php
Modified: trunk/andro/lib/index_hidden.php
===================================================================
--- trunk/andro/lib/index_hidden.php	2008-08-19 01:15:24 UTC (rev 552)
+++ trunk/andro/lib/index_hidden.php	2008-08-19 01:16:06 UTC (rev 553)
@@ -401,6 +401,19 @@
         ,'script'=>array()
     );
     
+    # EXPERIMENTAL. 
+    # KFD 8/18/08.  Having any gp vars might be screwing things
+    #               up, remove them.  Specifically it is screwing
+    #               up the gp_command
+#hprint_r($GLOBALS['AG']['clean']);
+    gpUnsetPrefix('gpx');
+    gpUnsetPrefix('gp_');
+    gpUnsetPrefix('x2t_');
+    gpUnset('gpContext');
+#hprint_r($GLOBALS['AG']['clean']);
+##echo ob_get_clean();
+#exit;
+    
     # If they are not logged in, or have timed out,
     # send a redirection command to the login page
     #
@@ -672,7 +685,11 @@
          gpSet('gpx_page',$table_id);
          gpSet('gp_mode' ,'browse');
          gpSet('gpx_mode','search');
-         $dd=dd_tableRef($table_id);
+         # KFD 8/18/08 MAJOR CHANGE.  Loading this up w/old code caused
+         #             things like viewname not to exist
+         #$dd=dd_tableRef($table_id);
+         $dd = ddTable($table_id);
+         # KFD 8/18/08 
          $cols = explode(',',$dd['projections']['_uisearch']);
          array_shift($cols);    // pop off the first one, assume it is the pk/code
          gpUnsetPrefix('x2t_'); // clear troublesome values 
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
 | 
| 
     
      
      
      From: <ken...@us...> - 2008-09-03 15:15:25
       
   | 
Revision: 604
          http://andro.svn.sourceforge.net/andro/?rev=604&view=rev
Author:   kendowns
Date:     2008-09-03 15:15:32 +0000 (Wed, 03 Sep 2008)
Log Message:
-----------
Changed template system to trap a "*" as the template and not use a Joomla template.  Necessary for compatibility with an older system that does not use Joomla templates.  All other code for this is still in there, this trick simply makes that code usable.
Modified Paths:
--------------
    trunk/andro/lib/index_hidden.php
Modified: trunk/andro/lib/index_hidden.php
===================================================================
--- trunk/andro/lib/index_hidden.php	2008-09-03 15:14:21 UTC (rev 603)
+++ trunk/andro/lib/index_hidden.php	2008-09-03 15:15:32 UTC (rev 604)
@@ -1349,6 +1349,14 @@
             vgfSet('template','rt_pixel');
         }
     }
+    
+    # KFD 9/2/08.  We still have one customer with a public 
+    #        interface that is not a Joomla template.  If the
+    #        template is "*" then we DO NOT set up Joomla
+    #        compatibility.  The application will use its own
+    #        file in the application directory that is specified
+    #        with vgaSet('html_pub').  
+    if(vgfGet('template')=='*') return;
 
     # Tell the JOOMLA files that we are legit
     # Fool them, that is...
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
 | 
| 
     
      
      
      From: <ken...@us...> - 2008-09-12 23:43:48
       
   | 
Revision: 661
          http://andro.svn.sourceforge.net/andro/?rev=661&view=rev
Author:   kendowns
Date:     2008-09-12 23:43:57 +0000 (Fri, 12 Sep 2008)
Log Message:
-----------
Allow a logout w/o wiping out session. Command is ?st2logout=1&st2keep=1
Modified Paths:
--------------
    trunk/andro/lib/index_hidden.php
Modified: trunk/andro/lib/index_hidden.php
===================================================================
--- trunk/andro/lib/index_hidden.php	2008-09-12 15:55:08 UTC (rev 660)
+++ trunk/andro/lib/index_hidden.php	2008-09-12 23:43:57 UTC (rev 661)
@@ -175,7 +175,13 @@
 
 // A logout command comes first
 if(gp('st2logout')<>'') {
-   SessionReset();
+    if(gp('st2keep')==1) {
+        SessionSet('UID',$AG['application']);
+        SessionSet('PWD',$AG['application']);
+    }
+    else {
+        SessionReset();
+    }
 }
 
 // This is the only place where we branch out of sequence to 
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
 | 
| 
     
      
      
      From: <ken...@us...> - 2008-10-08 13:45:11
       
   | 
Revision: 707
          http://andro.svn.sourceforge.net/andro/?rev=707&view=rev
Author:   kendowns
Date:     2008-10-08 13:45:01 +0000 (Wed, 08 Oct 2008)
Log Message:
-----------
Created dispatching for x6 pages.
Modified Paths:
--------------
    trunk/andro/lib/index_hidden.php
Modified: trunk/andro/lib/index_hidden.php
===================================================================
--- trunk/andro/lib/index_hidden.php	2008-10-08 13:44:27 UTC (rev 706)
+++ trunk/andro/lib/index_hidden.php	2008-10-08 13:45:01 UTC (rev 707)
@@ -334,13 +334,13 @@
     return;
 }
 
+# KFD 10/3/08, Rem'd out
+#// If gp_echo, just echo back.  This is for debugging of course.
+#if(gpExists('gp_echo')) {
+#    echo "echo|".gp('gp_echo');
+#    return;
+#}
 
-// If gp_echo, just echo back.  This is for debugging of course.
-if(gpExists('gp_echo')) {
-    echo "echo|".gp('gp_echo');
-    return;
-}
-
 // Everything after assumes we need a database connection
 // KFD 3/18/08 If a user has passed in an "impersonation" 
 // user_id, save that in the session
@@ -392,6 +392,16 @@
 // now if required.
 if(    gpExists('gp_command')) index_hidden_command();
 
+# KFD 10/3/08.  Assign an x6 page if we can find
+#               one, which will force an override
+#               of x4 or x2.
+$x6File = 'x6'.gp('x4Page',gp('gp_page')).'.php';
+$x6Page = '';
+if(file_exists_incpath($x6File)) {
+    $x6Page =  gp('x4Page',gp('gp_page'));
+}
+
+
 // Only one path can be chosen, and each path is completely
 // responsible for returning all headers, HTML or anything
 // else it wants to send back.
@@ -403,6 +413,7 @@
 elseif(gp('gp_fetchrow') <>'') index_hidden_fetchrow();
 elseif(gp('gp_sql')      <>'') index_hidden_sql();
 elseif(gp('gp_ajaxsql')  <>'') index_hidden_ajaxsql();
+elseif($x6Page           <>'') index_hidden_x6Dispatch($x6Page,$x6File);
 elseif(gp('x4Page')      <>'') index_hidden_x4Dispatch();
 else                           index_hidden_page();
 
@@ -414,6 +425,129 @@
 // DISPATCH DESTINATIONS
 // ==================================================================
 // ------------------------------------------------------------------
+// >> index_hidden_x6Dispatch
+// ------------------------------------------------------------------
+function index_hidden_x6Dispatch($x6Page,$x6File) {
+    
+    
+    
+    
+    # This is everything that *might* go back, make a place
+    # for all of it
+    $GLOBALS['AG']['x4'] = array(
+        'error'=>array()
+        ,'debug'=>array()
+        ,'notice'=>array()
+        ,'html'=>array()
+        ,'script'=>array()
+    );
+    
+    # If they are not logged in, or have timed out,
+    # send a redirection command to the login page
+    #
+#    if(!LoggedIn()) {
+#        if(gpExists('json')) {
+#            x4Script("window.location='index.php?gp_page=x_login'");
+#            echo json_encode_safe($GLOBALS['AG']['x4']);
+#        }
+#        else {
+#            echo "<script>window.location='index.php?gp_page=x_login'</script>";
+#        }
+#        return;
+#    }
+    
+    // This is very different from x4 for now, we
+    // assume we would not be here unless there were
+    // an x6 page.
+    //
+#    $x4Page = gp('x4Page');
+#    hidden('x4Page',$x4Page);  # makes form submits come back here
+#    if(gpExists('db')) {
+#        index_hidden_x4DB();
+#    }
+#    else if(file_exists("application/$x4Page.page.yaml")) {   
+#       include 'androPage.php';
+#       $obj_page = new androPage();
+#       if ($obj_page->flag_buffer) { ob_start(); }
+#       $obj_page->main($x4Page);
+#       if ($obj_page->flag_buffer) {
+#           x4HTML("*MAIN*",ob_get_clean());
+#       }
+#    }
+#    else {
+#        $object = x4Object($x4Page);
+
+    # Route to whatever methods are there
+    include('androX6.php');
+    include($x6File);
+    $x6Class = 'x6'.$x6Page;
+    $obj = new $x6Class();
+    ob_start();
+    $obj->html();
+    x4HTML('*MAIN*',ob_get_clean());
+    
+    
+        
+        
+        
+        # Determine method and invoke it.  Notice any
+        # direct output is considered an error
+#        $method = gp('x4Action','main');
+#        ob_start();
+#        $object->$method();
+#        $errors = ob_get_clean();
+#        if($errors <> '') {
+#            x4Error($errors);
+#        }
+#    }
+
+    # Put errors in that were reported by database operations
+    if(Errors()) {
+        $errs = errorsGet();
+        foreach($errs as $err) {
+            x4Error($err);
+        }
+    }
+    
+    # if the "json" flag is set, we return all output as JSON,
+    # otherwise we package it up with the normal template and
+    # return it as main content
+    if(gp('json')==1) {
+        echo json_encode_safe($GLOBALS['AG']['x4']);
+    }
+    else {
+        # Tell the client-side library to initialize the
+        # 'inert' HTML that it received from us.
+        #
+#        x4Script("x4.main()");
+        
+        # Don't need a form in x4 mode
+        vgaSet('NOFORM',true);
+
+        #  Put things where the template expects to find them
+        vgfSet('HTML',$GLOBALS['AG']['x4']['html']['*MAIN*']);
+        foreach($GLOBALS['AG']['x4']['script'] as $script) {
+            jqDocReady($script);
+        }
+
+        # DUPLICATE ALERT: This code copied from 
+        #                  index_hidden_page() below
+        index_hidden_template('x4');
+        global $J;
+        $mainframe               = $J['mainframe'];
+        $my                      = $J['my'];
+        $mosConfig_absolute_path = $J['mC_absolute_path'];
+        $mosConfig_live_site     = $J['mC_live_site'];
+        $template_color          = $J['template_color'];
+        $template_color = 'red';
+        $file
+            =$GLOBALS['AG']['dirs']['root'].'/templates/'
+            .$mainframe->GetTemplate()."/index.php";
+        include($file);
+    }
+    return;
+}
+// ------------------------------------------------------------------
 // >> index_hidden_x4Dispatch
 // ------------------------------------------------------------------
 function index_hidden_x4Dispatch() {
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
 | 
| 
     
      
      
      From: <ken...@us...> - 2008-10-13 20:12:44
       
   | 
Revision: 746
          http://andro.svn.sourceforge.net/andro/?rev=746&view=rev
Author:   kendowns
Date:     2008-10-13 20:12:38 +0000 (Mon, 13 Oct 2008)
Log Message:
-----------
Modified Paths:
--------------
    trunk/andro/lib/index_hidden.php
Modified: trunk/andro/lib/index_hidden.php
===================================================================
--- trunk/andro/lib/index_hidden.php	2008-10-13 20:11:53 UTC (rev 745)
+++ trunk/andro/lib/index_hidden.php	2008-10-13 20:12:38 UTC (rev 746)
@@ -428,10 +428,6 @@
 // >> index_hidden_x6Dispatch
 // ------------------------------------------------------------------
 function index_hidden_x6Dispatch($x6Page,$x6File) {
-    
-    
-    
-    
     # This is everything that *might* go back, make a place
     # for all of it
     $GLOBALS['AG']['x4'] = array(
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
 | 
| 
     
      
      
      From: <ken...@us...> - 2008-10-16 12:03:26
       
   | 
Revision: 750
          http://andro.svn.sourceforge.net/andro/?rev=750&view=rev
Author:   kendowns
Date:     2008-10-16 12:03:24 +0000 (Thu, 16 Oct 2008)
Log Message:
-----------
Began to put in code to recognize x6 pages and dispatch to them instead of x4 or x2.
Modified Paths:
--------------
    trunk/andro/lib/index_hidden.php
Modified: trunk/andro/lib/index_hidden.php
===================================================================
--- trunk/andro/lib/index_hidden.php	2008-10-16 12:02:05 UTC (rev 749)
+++ trunk/andro/lib/index_hidden.php	2008-10-16 12:03:24 UTC (rev 750)
@@ -395,13 +395,18 @@
 # KFD 10/3/08.  Assign an x6 page if we can find
 #               one, which will force an override
 #               of x4 or x2.
-$x6File = 'x6'.gp('x4Page',gp('gp_page')).'.php';
-$x6Page = '';
-if(file_exists_incpath($x6File)) {
-    $x6Page =  gp('x4Page',gp('gp_page'));
+$x6Page = gp('x6Page');
+$x6File = '';
+if($x6Page!='') {
+    $x6File = "x6$x6Page.php";
 }
+else {
+    $x6File = 'x6'.gp('x4Page',gp('gp_page')).'.php';
+    if(file_exists_incpath($x6File)) {
+        $x6Page =  gp('x4Page',gp('gp_page'));
+    }
+}
 
-
 // Only one path can be chosen, and each path is completely
 // responsible for returning all headers, HTML or anything
 // else it wants to send back.
@@ -437,65 +442,22 @@
         ,'html'=>array()
         ,'script'=>array()
     );
-    
-    # If they are not logged in, or have timed out,
-    # send a redirection command to the login page
-    #
-#    if(!LoggedIn()) {
-#        if(gpExists('json')) {
-#            x4Script("window.location='index.php?gp_page=x_login'");
-#            echo json_encode_safe($GLOBALS['AG']['x4']);
-#        }
-#        else {
-#            echo "<script>window.location='index.php?gp_page=x_login'</script>";
-#        }
-#        return;
-#    }
-    
-    // This is very different from x4 for now, we
-    // assume we would not be here unless there were
-    // an x6 page.
-    //
-#    $x4Page = gp('x4Page');
-#    hidden('x4Page',$x4Page);  # makes form submits come back here
-#    if(gpExists('db')) {
-#        index_hidden_x4DB();
-#    }
-#    else if(file_exists("application/$x4Page.page.yaml")) {   
-#       include 'androPage.php';
-#       $obj_page = new androPage();
-#       if ($obj_page->flag_buffer) { ob_start(); }
-#       $obj_page->main($x4Page);
-#       if ($obj_page->flag_buffer) {
-#           x4HTML("*MAIN*",ob_get_clean());
-#       }
-#    }
-#    else {
-#        $object = x4Object($x4Page);
+    x4debug($x6Page);
+ 
 
     # Route to whatever methods are there
     include('androX6.php');
     include($x6File);
     $x6Class = 'x6'.$x6Page;
     $obj = new $x6Class();
+    # now work out which method to call
+    $method = 'html';
+    if(gp('x6Action')<>'') {
+        $method = gp('x6Action');
+    }
     ob_start();
-    $obj->html();
+    $obj->$method();
     x4HTML('*MAIN*',ob_get_clean());
-    
-    
-        
-        
-        
-        # Determine method and invoke it.  Notice any
-        # direct output is considered an error
-#        $method = gp('x4Action','main');
-#        ob_start();
-#        $object->$method();
-#        $errors = ob_get_clean();
-#        if($errors <> '') {
-#            x4Error($errors);
-#        }
-#    }
 
     # Put errors in that were reported by database operations
     if(Errors()) {
@@ -512,12 +474,7 @@
         echo json_encode_safe($GLOBALS['AG']['x4']);
     }
     else {
-        # Tell the client-side library to initialize the
-        # 'inert' HTML that it received from us.
-        #
-#        x4Script("x4.main()");
-        
-        # Don't need a form in x4 mode
+        # Don't need a form in x6 mode
         vgaSet('NOFORM',true);
 
         #  Put things where the template expects to find them
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
 | 
| 
     
      
      
      From: <ken...@us...> - 2008-10-16 22:20:01
       
   | 
Revision: 757
          http://andro.svn.sourceforge.net/andro/?rev=757&view=rev
Author:   kendowns
Date:     2008-10-16 22:19:57 +0000 (Thu, 16 Oct 2008)
Log Message:
-----------
Changes to x6 dispatching
Modified Paths:
--------------
    trunk/andro/lib/index_hidden.php
Modified: trunk/andro/lib/index_hidden.php
===================================================================
--- trunk/andro/lib/index_hidden.php	2008-10-16 22:19:40 UTC (rev 756)
+++ trunk/andro/lib/index_hidden.php	2008-10-16 22:19:57 UTC (rev 757)
@@ -392,19 +392,50 @@
 // now if required.
 if(    gpExists('gp_command')) index_hidden_command();
 
-# KFD 10/3/08.  Assign an x6 page if we can find
-#               one, which will force an override
-#               of x4 or x2.
-$x6Page = gp('x6Page');
-$x6File = '';
-if($x6Page!='') {
-    $x6File = "x6$x6Page.php";
+# KFD 10/16/08. Beginning of x6 processing.  Load set of
+#               profiles if it exists.  These specify
+#               pre-defined profiles for pages
+$fx6profiles = fsDirTop().'generated/ddx6profiles.php';
+$GLOBALS['AG']['x6profiles'] = array();
+if(file_exists($fx6profiles)) {
+    include($fx6profiles);
 }
+#  This override allows us to change profiles in
+#  applib w/o running a build.
+if(function_exists('app_x6profiles')) {
+    app_x6profiles();
+}
+# Funny business. gp_page is always defined, so we have
+# to check if its blank.
+$x6pagecandidate = gp('gp_page');
+if($x6pagecandidate=='') {
+    $x6pagecandidate= gp('x4Page',gp('x6Page',''));
+}
+$x6Profile = arr($GLOBALS['AG']['x6profiles'],$x6pagecandidate,'');
+
+if($x6Profile<>'') {
+    # If a profile exists, we force x6 processing with 
+    # a profile but no file.  It will all be handled by
+    # built-in framework stuff. see x6 dispatching below
+    # for more details on how that works.
+    $x6Page = $x6pagecandidate;
+    $x6File = '';
+}
 else {
-    $x6File = 'x6'.gp('x4Page',gp('gp_page')).'.php';
-    if(file_exists_incpath($x6File)) {
-        $x6Page =  gp('x4Page',gp('gp_page'));
+    # KFD 10/3/08.  Assign an x6 page if we can find
+    #               one, which will force an override
+    #               of x4 or x2.
+    $x6Page = gp('x6Page');
+    $x6File = '';
+    if($x6Page!='') {
+        $x6File = "x6$x6Page.php";
     }
+    else {
+        $x6File = 'x6'.gp('x4Page',gp('gp_page')).'.php';
+        if(file_exists_incpath($x6File)) {
+            $x6Page =  gp('x4Page',gp('gp_page'));
+        }
+    }
 }
 
 // Only one path can be chosen, and each path is completely
@@ -418,7 +449,8 @@
 elseif(gp('gp_fetchrow') <>'') index_hidden_fetchrow();
 elseif(gp('gp_sql')      <>'') index_hidden_sql();
 elseif(gp('gp_ajaxsql')  <>'') index_hidden_ajaxsql();
-elseif($x6Page           <>'') index_hidden_x6Dispatch($x6Page,$x6File);
+elseif($x6Page           <>'') 
+    index_hidden_x6Dispatch($x6Page,$x6File,$x6Profile);
 elseif(gp('x4Page')      <>'') index_hidden_x4Dispatch();
 else                           index_hidden_page();
 
@@ -432,7 +464,7 @@
 // ------------------------------------------------------------------
 // >> index_hidden_x6Dispatch
 // ------------------------------------------------------------------
-function index_hidden_x6Dispatch($x6Page,$x6File) {
+function index_hidden_x6Dispatch($x6Page,$x6File,$x6Profile) {
     # This is everything that *might* go back, make a place
     # for all of it
     $GLOBALS['AG']['x4'] = array(
@@ -445,17 +477,45 @@
     x4debug($x6Page);
  
 
-    # Route to whatever methods are there
+    # Include the basic x6 class, and set a default for
+    # the class 
     include('androX6.php');
-    include($x6File);
-    $x6Class = 'x6'.$x6Page;
-    $obj = new $x6Class();
-    # now work out which method to call
-    $method = 'html';
-    if(gp('x6Action')<>'') {
+    $x6Class = 'androX6';
+    
+    # Figure out if we are loading a file or calling a
+    # plugin.  If a plugin has been called, that wins.
+    # If not, and a file exists, that wins.  Otherwise
+    # we are falling back to framework code.
+    if(gp('x6plugIn')<>'') {
+        $x6File  = '';
+        $x6Class = 'x6plugIn'.gp('x6plugIn');
+        include($x6Class.'.php');
+    }
+    elseif($x6File<>'' && file_exists_incpath($x6File)) {
+        include($x6File);
+        $x6Class = 'x6'.$x6Page;
+    }
+    
+    # now work out which method to call.  The resolution order is:
+    # - a profile always wins, call the profile
+    # - next an x6Action wins, call that
+    # - call html if it exists
+    if($x6Profile<>'') {
+        $method = 'profile_'.$x6Profile;
+    }
+    elseif (gp('x6Action')<>'') {
         $method = gp('x6Action');
     }
+    else {
+        $method = 'html';
+    }
+
+    # Create the object and do the job
     ob_start();
+    
+    $obj = new $x6Class();
+    $obj->dd   = ddTable($x6Page);
+    $obj->view = arr($obj->dd,'viewname','');
     $obj->$method();
     x4HTML('*MAIN*',ob_get_clean());
 
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
 | 
| 
     
      
      
      From: <ken...@us...> - 2008-10-19 00:28:03
       
   | 
Revision: 765
          http://andro.svn.sourceforge.net/andro/?rev=765&view=rev
Author:   kendowns
Date:     2008-10-19 00:27:59 +0000 (Sun, 19 Oct 2008)
Log Message:
-----------
Finalized resolution of pages, plugins, and json calls for x6 pages.
Modified Paths:
--------------
    trunk/andro/lib/index_hidden.php
Modified: trunk/andro/lib/index_hidden.php
===================================================================
--- trunk/andro/lib/index_hidden.php	2008-10-19 00:27:16 UTC (rev 764)
+++ trunk/andro/lib/index_hidden.php	2008-10-19 00:27:59 UTC (rev 765)
@@ -139,6 +139,9 @@
 }
 
 
+#$AG['tracefile'] = fsDirTop().'tmp/trace';
+#xdebug_start_trace($AG['tracefile']);
+
 // ==================================================================
 // >>>
 // >>> Load Andromeda Plugin Manager
@@ -392,52 +395,71 @@
 // now if required.
 if(    gpExists('gp_command')) index_hidden_command();
 
-# KFD 10/16/08. Beginning of x6 processing.  Load set of
-#               profiles if it exists.  These specify
-#               pre-defined profiles for pages
+# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 
+# KFD 10/17/08.  x6 Page Resolution
+#
+#
+$x6page    = '';
+$x6file    = '';
+$x6yaml    = '';
+$x6profile = '';
+$x6plugin  = '';
+$x6action  = '';
+
+# Get a candidate page to use to figure out the resolution
+$x6cand = gp('x6page');
+if($x6cand=='') {
+    $x6cand= gp('x4Page',gp('gp_page'));
+}
+
+# Work out if any x6 factor has been specified or exists.
+# If any of them do, it forces dispatching to go to x6.
+# The x6 dispatcher will then resolve what action to take.
+
+# A custom file for this page
+$x = "x6$x6cand.php";
+if(file_exists_incpath($x)) {
+    $x6file = $x;
+}
+
+# a Yaml file for this page
+$x = $x6cand.'.x6.yaml';
+if(file_exists_incpath($x)) {
+    $x6yaml = $x;
+}
+
+# A profile for this page specified either in the dd.yaml
+# or overridden in applib.
 $fx6profiles = fsDirTop().'generated/ddx6profiles.php';
 $GLOBALS['AG']['x6profiles'] = array();
 if(file_exists($fx6profiles)) {
     include($fx6profiles);
 }
-#  This override allows us to change profiles in
-#  applib w/o running a build.
 if(function_exists('app_x6profiles')) {
     app_x6profiles();
 }
-# Funny business. gp_page is always defined, so we have
-# to check if its blank.
-$x6pagecandidate = gp('gp_page');
-if($x6pagecandidate=='') {
-    $x6pagecandidate= gp('x4Page',gp('x6Page',''));
+if(isset($GLOBALS['AG']['x6profiles'][$x6cand])) {
+    $x6profile = $GLOBALS['AG']['x6profiles'][$x6cand];
 }
-$x6Profile = arr($GLOBALS['AG']['x6profiles'],$x6pagecandidate,'');
 
-if($x6Profile<>'') {
-    # If a profile exists, we force x6 processing with 
-    # a profile but no file.  It will all be handled by
-    # built-in framework stuff. see x6 dispatching below
-    # for more details on how that works.
-    $x6Page = $x6pagecandidate;
-    $x6File = '';
+# the action is always taken directly from request variables,
+# 
+$x6action = gp('x6action');
+$x6plugin = gp('x6plugIn');
+
+# Now if any of those were not empty, x6 it is
+if(gp('x6Page').$x6file.$x6yaml.$x6profile.$x6plugin.$x6action<>'') {
+    $x6page = $x6cand;
 }
-else {
-    # KFD 10/3/08.  Assign an x6 page if we can find
-    #               one, which will force an override
-    #               of x4 or x2.
-    $x6Page = gp('x6Page');
-    $x6File = '';
-    if($x6Page!='') {
-        $x6File = "x6$x6Page.php";
-    }
-    else {
-        $x6File = 'x6'.gp('x4Page',gp('gp_page')).'.php';
-        if(file_exists_incpath($x6File)) {
-            $x6Page =  gp('x4Page',gp('gp_page'));
-        }
-    }
-}
 
+# Ken's debugging to make sure assignments worked
+#echo "candidate -$x6cand- page -$x6page- file -$x6file- yaml -$x6yaml-
+#  profile -$x6profile- plugin -$x6plugin- action -$x6action-";
+#exit;    
+#
+# KFD 10/17/08.  x6 Page Resolution (END)
+# - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+
 // Only one path can be chosen, and each path is completely
 // responsible for returning all headers, HTML or anything
 // else it wants to send back.
@@ -449,11 +471,15 @@
 elseif(gp('gp_fetchrow') <>'') index_hidden_fetchrow();
 elseif(gp('gp_sql')      <>'') index_hidden_sql();
 elseif(gp('gp_ajaxsql')  <>'') index_hidden_ajaxsql();
-elseif($x6Page           <>'') 
-    index_hidden_x6Dispatch($x6Page,$x6File,$x6Profile);
+elseif($x6page           <>'') index_hidden_x6Dispatch(
+    $x6page,$x6file,$x6yaml,$x6profile,$x6plugin,$x6action
+);
 elseif(gp('x4Page')      <>'') index_hidden_x4Dispatch();
 else                           index_hidden_page();
 
+#xdebug_stop_trace();
+#echo "<pre style='background-color: white'>";
+#readfile($AG['tracefile'].'.xt');
 
 // All finished, disconnect and leave. 
 scDBConn_Pop();
@@ -464,7 +490,9 @@
 // ------------------------------------------------------------------
 // >> index_hidden_x6Dispatch
 // ------------------------------------------------------------------
-function index_hidden_x6Dispatch($x6Page,$x6File,$x6Profile) {
+function index_hidden_x6Dispatch(
+    $x6page,$x6file,$x6yaml,$x6profile,$x6plugin,$x6action
+) {
     # This is everything that *might* go back, make a place
     # for all of it
     $GLOBALS['AG']['x4'] = array(
@@ -474,49 +502,108 @@
         ,'html'=>array()
         ,'script'=>array()
     );
-    x4debug($x6Page);
+
+    # If they have already defined MPPages in applib, we will
+    # pick it up here with this global declaration.
+    #
+    # MPPages lists pages that may be accessed w/o login
+    global $MPPages;  
+    if(!is_array($MPPages)) {
+      $MPPages = array();
+    }
+    $MPPages['x_home']='Home Page';
+    $MPPages['x_login']='Login';
+    $MPPages['x_noauth']='Authorization Required';
+    $MPPages['x_password']="Password";
+    $MPPages['x_mpassword']="Member Password";
+    $MPPages['x_paypalipn']='Paypal IPN';
+
+    #$debug=" page -$x6page- file -$x6file- yaml -$x6yaml-
+    #    profile -$x6profile- plugin -$x6plugin- action -$x6action-";
+    #echo $debug;
+    #exit;
+    #x4Debug($debug);
+    
+    # Session timeouts.  Need to code for basic page access
+    # and code for ajax timeouts.
+    #echo $x6page;
+    #hprint_r($MPPages);
+    #echo in_array($x6page,array_keys($MPPages));
+    
+    if(!LoggedIn() && !in_array($x6page,array_keys($MPPages))){
+        if(gpExists('json')) {
+            x4Script("window.location='index.php?gp_page=x_login'");
+            echo json_encode($GLOBALS['AG']['x4']);
+        }
+        else {
+            echo "<script>window.location='index.php?gp_page=x_login'</script>";
+        }
+        return;
+    }
+    
  
 
     # Include the basic x6 class, and set a default for
-    # the class 
+    # the class and the method call
     include('androX6.php');
-    $x6Class = 'androX6';
+    $x6class = 'androX6';
+    $x6method= 'x6main';
     
-    # Figure out if we are loading a file or calling a
-    # plugin.  If a plugin has been called, that wins.
-    # If not, and a file exists, that wins.  Otherwise
-    # we are falling back to framework code.
-    if(gp('x6plugIn')<>'') {
-        $x6File  = '';
-        $x6Class = 'x6plugIn'.gp('x6plugIn');
-        include($x6Class.'.php');
+    # This is the core resolution where we figure out what class
+    # to use and what method to call.  It is a little complicated
+    # because we support 3 different kinds of pages (yaml, profile
+    # and custom) plus calls from plugins to refresh, plus JSON
+    # calls to do database stuff.
+    if($x6plugin<>'') {
+        # A plugin always wins.  A call to a plugin assumes that
+        # x6action is also specified.  We are going to instantiate
+        # the plugin and call the method named by x6action.
+        $x6file  = '';
+        $x6class = 'x6plugin'.$x6plugin;
+        $x6method= $x6action;
+        include($x6class.'.php');
     }
-    elseif($x6File<>'' && file_exists_incpath($x6File)) {
-        include($x6File);
-        $x6Class = 'x6'.$x6Page;
+    else {
+        # No plugin means we are either using the base andromeda
+        # class androX6, or using a custom class.  We only use
+        # a custom class if the programmer has supplied a file.
+        # So if that file exists we load that and use it.
+        if($x6file<>'') {
+            $x6class = 'x6'.$x6page;
+            include($x6class.'.php');
+        }
+            
+        # The next major decision is whether we are calling some
+        # specific action, or loading a page.  If an action was
+        # specified that wins.
+        if($x6action<>'') {
+            $x6method = $x6action;
+        }
+        else {
+            # Now we must be loading a page, because no plugin was
+            # specified and no action.  At this point all that is
+            # left to figure out is whether we load a profile or
+            # go for the default "html" routine.
+            if($x6profile<>'') {
+                $x6method = 'profile_'.$x6profile;
+            }
+            else {
+                $x6method = 'x6main';
+            }
+        }
     }
     
-    # now work out which method to call.  The resolution order is:
-    # - a profile always wins, call the profile
-    # - next an x6Action wins, call that
-    # - call html if it exists
-    if($x6Profile<>'') {
-        $method = 'profile_'.$x6Profile;
-    }
-    elseif (gp('x6Action')<>'') {
-        $method = gp('x6Action');
-    }
-    else {
-        $method = 'html';
-    }
-
-    # Create the object and do the job
+    # Ken's debugging code to make sure resolution worked
+    #echo "<br/>class -$x6class- method -$x6method-";
+    #exit;
+    
+    # Now everything is resolved.  We know what class to instantiate
+    # and what method to call, so go for it.
     ob_start();
-    
-    $obj = new $x6Class();
-    $obj->dd   = ddTable($x6Page);
+    $obj = new $x6class();
+    $obj->dd   = ddTable($x6page);
     $obj->view = arr($obj->dd,'viewname','');
-    $obj->$method();
+    $obj->$x6method();
     x4HTML('*MAIN*',ob_get_clean());
 
     # Put errors in that were reported by database operations
@@ -527,6 +614,8 @@
         }
     }
     
+    # CODE BELOW HERE WAS TAKEN FROM X4 UNCHANGED.
+    
     # if the "json" flag is set, we return all output as JSON,
     # otherwise we package it up with the normal template and
     # return it as main content
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
 | 
| 
     
      
      
      From: <ken...@us...> - 2008-10-20 19:36:59
       
   | 
Revision: 770
          http://andro.svn.sourceforge.net/andro/?rev=770&view=rev
Author:   kendowns
Date:     2008-10-20 19:36:56 +0000 (Mon, 20 Oct 2008)
Log Message:
-----------
Some logging stuff.
Modified Paths:
--------------
    trunk/andro/lib/index_hidden.php
Modified: trunk/andro/lib/index_hidden.php
===================================================================
--- trunk/andro/lib/index_hidden.php	2008-10-20 18:58:30 UTC (rev 769)
+++ trunk/andro/lib/index_hidden.php	2008-10-20 19:36:56 UTC (rev 770)
@@ -139,9 +139,6 @@
 }
 
 
-#$AG['tracefile'] = fsDirTop().'tmp/trace';
-#xdebug_start_trace($AG['tracefile']);
-
 // ==================================================================
 // >>>
 // >>> Load Andromeda Plugin Manager
@@ -290,41 +287,17 @@
 
 // ==================================================================
 // >>> 
-// >>> Dispatch redirection.  
+// >>> Turn on logging 
 // >>> 
 // ==================================================================
+# experimental
+#if(configGet('admin_logging','N')=='Y' && SessionGet('ROOT')) {
+#    if(function_exists('xdebug_start_code_coverage')) {
+#        xdebug_start_code_coverage();
+#    }
+#}
 
-# OLDER DEFUNCT CODE, REMOVE AFTER BETA GOES OUT
-/*
-if(vgfGet('x4welcome')=='Y' && gp('x4Page')=='' && LoggedIn()) {
-    # if these two options are set, we don't try to force an x4
-    if( !(gpExists('gp_page') && gpExists('x2')) ) { 
-        gpSet('x4Page',vgaGet('nopage','menu'));
-    }
-}
-*/
 
-
-#  This code is only for a single app which is running
-#  stable on a very old version of Andromeda.  When SDS
-#  upgrades that application, these functions will be
-#  moved into application code.
-#
-/*
-// The parameter 'gp_pageal' means page to go to after a login.
-// Save it now.  Used originally for project cme.
-if(gpExists('gp_pageal')) {
-  SessionSet('clean',array('gp_page'=>gp('gp_pageal')));
-}
-   
-// The parameter 'gp_aftersave' means go to a page after saving
-// information somewhere else.  The program processPost will look
-// for this after saving and do a gpSet() to this value.
-if(gpExists('gp_aftersave')) {
-  SessionSet('gp_aftersave',gp('gp_aftersave'));
-}
-*/
-
 // ==================================================================
 // >>> 
 // >>> Dispatching, pass execution to the relevant handler
@@ -337,13 +310,6 @@
     return;
 }
 
-# KFD 10/3/08, Rem'd out
-#// If gp_echo, just echo back.  This is for debugging of course.
-#if(gpExists('gp_echo')) {
-#    echo "echo|".gp('gp_echo');
-#    return;
-#}
-
 // Everything after assumes we need a database connection
 // KFD 3/18/08 If a user has passed in an "impersonation" 
 // user_id, save that in the session
@@ -477,12 +443,32 @@
 elseif(gp('x4Page')      <>'') index_hidden_x4Dispatch();
 else                           index_hidden_page();
 
-#xdebug_stop_trace();
-#echo "<pre style='background-color: white'>";
-#readfile($AG['tracefile'].'.xt');
-
 // All finished, disconnect and leave. 
 scDBConn_Pop();
+
+// One last thing...  If trace is on, display it now.
+#if(false) {
+if(configGet('admin_logging') && SessionGet('ROOT')) {
+    echo "<div style='background-color: white' id='admin_logging'>";
+    
+    # Use Donald's query stack here:
+    $count = count($GLOBALS['AG']['dbg']['sql']);
+    foreach($GLOBALS['AG']['dbg']['sql'] as $idx=>$q) {
+        $idx++;
+        echo "<h2 style='background-color: #D0D0D0'>Query $idx of $count</h3>";
+        echo "<b>Execution Time: </b>".number_format($q['time'],6);
+        echo "<br/>";
+        echo "<b>Query:</b>";
+        echo "<pre style='margin-left: 50px'>".$q['sql']."</pre>";
+        echo "<b>Stack:</b><div style='margin-left:50px'>";
+        hprint_r($q['stack']);
+        echo "</div>";
+    }
+    phpinfo();
+    echo "</div>";
+}
+
+
 return;
 // ==================================================================
 // DISPATCH DESTINATIONS
@@ -517,7 +503,7 @@
     $MPPages['x_password']="Password";
     $MPPages['x_mpassword']="Member Password";
     $MPPages['x_paypalipn']='Paypal IPN';
-
+    
     #$debug=" page -$x6page- file -$x6file- yaml -$x6yaml-
     #    profile -$x6profile- plugin -$x6plugin- action -$x6action-";
     #echo $debug;
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
 | 
| 
     
      
      
      From: <ken...@us...> - 2008-10-25 23:08:00
       
   | 
Revision: 795
          http://andro.svn.sourceforge.net/andro/?rev=795&view=rev
Author:   kendowns
Date:     2008-10-25 23:07:51 +0000 (Sat, 25 Oct 2008)
Log Message:
-----------
If a user is not logged in, fetches the correct Group_id_eff (for row- and column- level security) and sets it in the session.  This value is written during the build to generated/appinfo.php, where it is loaded to $AG['group_login'].
Modified Paths:
--------------
    trunk/andro/lib/index_hidden.php
Modified: trunk/andro/lib/index_hidden.php
===================================================================
--- trunk/andro/lib/index_hidden.php	2008-10-25 23:03:30 UTC (rev 794)
+++ trunk/andro/lib/index_hidden.php	2008-10-25 23:07:51 UTC (rev 795)
@@ -275,6 +275,11 @@
     }
 }
 
+// After all login activity, if the person is not logged in,
+// set an effective group id
+if(!LoggedIn()) {
+    SessionSet('GROUP_ID_EFF',arr($GLOBALS['AG'],'group_login',''));
+}
 
 // ==================================================================
 // >>> 
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
 | 
| 
     
      
      
      From: <ken...@us...> - 2008-10-30 13:40:59
       
   | 
Revision: 820
          http://andro.svn.sourceforge.net/andro/?rev=820&view=rev
Author:   kendowns
Date:     2008-10-30 13:40:58 +0000 (Thu, 30 Oct 2008)
Log Message:
-----------
Two big things:
1) Styles are now loaded up on the PHP side so you can make calculations of the sizes of screen elements.
2) x6.js is loaded automatically for all x6 pages, no need to do it in specific pages, and x6.init() is called automatically as well.
Modified Paths:
--------------
    trunk/andro/lib/index_hidden.php
Modified: trunk/andro/lib/index_hidden.php
===================================================================
--- trunk/andro/lib/index_hidden.php	2008-10-30 13:39:34 UTC (rev 819)
+++ trunk/andro/lib/index_hidden.php	2008-10-30 13:40:58 UTC (rev 820)
@@ -475,7 +475,7 @@
     # for the current template and skin, allowing downstream
     # code to determine how much space they have to work with
     #
-    $x6skin = arr($_COOKIE,'x6skin','');
+    $x6skin = arr($_COOKIE,'x6skin','win2k.gray.1024');
     if($x6skin!='') {
         $filename  = fsDirTop()."generated/x6skin.$x6skin.ser.txt";
         $serialized=file_get_contents($filename);
@@ -570,6 +570,13 @@
             else {
                 $x6method = 'x6main';
             }
+            
+            # If we are loading a page, we need the x6 javascript
+            # and the first command in jqDocReady should be to
+            # initialize the objects so downstrem code can make
+            # them visible.
+            jsInclude('clib/x6.js');
+            jqDocReady('x6.init()');
         }
     }
     
@@ -603,6 +610,10 @@
         echo json_encode_safe($GLOBALS['AG']['x4']);
     }
     else {
+        # Pass in the command to fade in and set focus
+        $fadeIn = "$('.fadein').fadeIn('slow',function() { x6.initFocus(); });";
+        jqDocReady($fadeIn);
+        
         # Don't need a form in x6 mode
         vgaSet('NOFORM',true);
 
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
 | 
| 
     
      
      
      From: <ken...@us...> - 2008-10-31 13:14:41
       
   | 
Revision: 834
          http://andro.svn.sourceforge.net/andro/?rev=834&view=rev
Author:   kendowns
Date:     2008-10-31 13:14:28 +0000 (Fri, 31 Oct 2008)
Log Message:
-----------
Modified Paths:
--------------
    trunk/andro/lib/index_hidden.php
Modified: trunk/andro/lib/index_hidden.php
===================================================================
--- trunk/andro/lib/index_hidden.php	2008-10-31 12:52:27 UTC (rev 833)
+++ trunk/andro/lib/index_hidden.php	2008-10-31 13:14:28 UTC (rev 834)
@@ -478,8 +478,10 @@
     $x6skin = arr($_COOKIE,'x6skin','win2k.gray.1024');
     if($x6skin!='') {
         $filename  = fsDirTop()."generated/x6skin.$x6skin.ser.txt";
-        $serialized=file_get_contents($filename);
-        $GLOBALS['AG']['x6skin'] = unserialize($serialized);
+        if(file_exists($filename)) {
+            $serialized=file_get_contents($filename);
+            $GLOBALS['AG']['x6skin'] = unserialize($serialized);
+        }
     }
     
 
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
 | 
| 
     
      
      
      From: <ken...@us...> - 2008-10-31 18:11:11
       
   | 
Revision: 837
          http://andro.svn.sourceforge.net/andro/?rev=837&view=rev
Author:   kendowns
Date:     2008-10-31 18:11:06 +0000 (Fri, 31 Oct 2008)
Log Message:
-----------
executes vgfset('x6',true) on x6 pages so other framework code can throw switches.
Modified Paths:
--------------
    trunk/andro/lib/index_hidden.php
Modified: trunk/andro/lib/index_hidden.php
===================================================================
--- trunk/andro/lib/index_hidden.php	2008-10-31 18:10:30 UTC (rev 836)
+++ trunk/andro/lib/index_hidden.php	2008-10-31 18:11:06 UTC (rev 837)
@@ -471,6 +471,8 @@
         ,'script'=>array()
     );
     
+    vgfSet('x6',true);
+    
     # This little bit of magic loads up the CSS information
     # for the current template and skin, allowing downstream
     # code to determine how much space they have to work with
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
 | 
| 
     
      
      
      From: <ken...@us...> - 2009-01-15 19:47:59
       
   | 
Revision: 1096
          http://andro.svn.sourceforge.net/andro/?rev=1096&view=rev
Author:   kendowns
Date:     2009-01-15 19:47:51 +0000 (Thu, 15 Jan 2009)
Log Message:
-----------
Corrected system where x2 pages override an x6 setting.
Modified Paths:
--------------
    trunk/andro/lib/index_hidden.php
Modified: trunk/andro/lib/index_hidden.php
===================================================================
--- trunk/andro/lib/index_hidden.php	2009-01-15 19:46:11 UTC (rev 1095)
+++ trunk/andro/lib/index_hidden.php	2009-01-15 19:47:51 UTC (rev 1096)
@@ -398,7 +398,7 @@
 
 # KFD 1/13/09.  If there is a "gp_page" and x2=1, turn off
 #               x6 processing
-if(gp('gp_page',false) && gp('x2')==1) {
+if(gp('gp_page',false) || gp('x2')==1) {
     $flagx6 = 'N';
 }
     
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
 | 
| 
     
      
      
      From: <ken...@us...> - 2008-11-03 19:22:40
       
   | 
Revision: 851
          http://andro.svn.sourceforge.net/andro/?rev=851&view=rev
Author:   kendowns
Date:     2008-11-03 16:00:08 +0000 (Mon, 03 Nov 2008)
Log Message:
-----------
Looks for config var flag_x6 to be "Y".  If so, assigns x6profile='conventional' if no other profile is chosen.
Modified Paths:
--------------
    trunk/andro/lib/index_hidden.php
Modified: trunk/andro/lib/index_hidden.php
===================================================================
--- trunk/andro/lib/index_hidden.php	2008-11-03 15:59:21 UTC (rev 850)
+++ trunk/andro/lib/index_hidden.php	2008-11-03 16:00:08 UTC (rev 851)
@@ -412,6 +412,11 @@
 if(isset($GLOBALS['AG']['x6profiles'][$x6cand])) {
     $x6profile = $GLOBALS['AG']['x6profiles'][$x6cand];
 }
+#else {
+#    if(configGet('flag_x6','N')=='Y' && $x6cand!='menu') {
+#        $x6profile = 'conventional';
+#    }
+#}
 
 # the action is always taken directly from request variables,
 # 
@@ -580,6 +585,7 @@
             # initialize the objects so downstrem code can make
             # them visible.
             jsInclude('clib/x6.js');
+            #jsInclude('clib/jquery.maskedinput-1.1.4.js');
             jqDocReady('x6.init()');
         }
     }
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
 | 
| 
     
      
      
      From: <ken...@us...> - 2008-11-17 14:52:53
       
   | 
Revision: 889
          http://andro.svn.sourceforge.net/andro/?rev=889&view=rev
Author:   kendowns
Date:     2008-11-17 14:52:44 +0000 (Mon, 17 Nov 2008)
Log Message:
-----------
Added processing of x6script to x6 pages
Modified Paths:
--------------
    trunk/andro/lib/index_hidden.php
Modified: trunk/andro/lib/index_hidden.php
===================================================================
--- trunk/andro/lib/index_hidden.php	2008-11-17 14:52:22 UTC (rev 888)
+++ trunk/andro/lib/index_hidden.php	2008-11-17 14:52:44 UTC (rev 889)
@@ -601,7 +601,17 @@
     $obj->dd   = ddTable($x6page);
     $obj->view = arr($obj->dd,'viewname','');
     $obj->$x6method();
-    x4HTML('*MAIN*',ob_get_clean());
+    x6HTML('*MAIN*',ob_get_clean());
+    
+    # Now if they made a "main" call, see if they want us to
+    # send back some script as well
+    if($x6method=='x6main') {
+        if(method_exists($obj,'x6script')) {
+            ob_start();
+            $obj->x6script();
+            x6script(ob_get_clean());
+        }
+    }
 
     # Put errors in that were reported by database operations
     if(Errors()) {
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
 | 
| 
     
      
      
      From: <ken...@us...> - 2008-12-01 12:37:47
       
   | 
Revision: 908
          http://andro.svn.sourceforge.net/andro/?rev=908&view=rev
Author:   kendowns
Date:     2008-12-01 12:37:44 +0000 (Mon, 01 Dec 2008)
Log Message:
-----------
Moved the fadein command to very last, so all page initialization is done before it loads.
Modified Paths:
--------------
    trunk/andro/lib/index_hidden.php
Modified: trunk/andro/lib/index_hidden.php
===================================================================
--- trunk/andro/lib/index_hidden.php	2008-12-01 12:37:00 UTC (rev 907)
+++ trunk/andro/lib/index_hidden.php	2008-12-01 12:37:44 UTC (rev 908)
@@ -630,19 +630,22 @@
         echo json_encode_safe($GLOBALS['AG']['x4']);
     }
     else {
-        # Pass in the command to fade in and set focus
-        $fadeIn = "$('.fadein').fadeIn('slow',function() { x6.initFocus(); });";
-        jqDocReady($fadeIn);
-        
         # Don't need a form in x6 mode
         vgaSet('NOFORM',true);
 
         #  Put things where the template expects to find them
         vgfSet('HTML',$GLOBALS['AG']['x4']['html']['*MAIN*']);
+        
+        #  If there was some script, add that in
         foreach($GLOBALS['AG']['x4']['script'] as $script) {
             jqDocReady($script);
         }
 
+        # The absolute very last command is the fade in
+        $fadeIn = "$('.fadein').fadeIn('slow',function() { x6.initFocus(); });";
+        jqDocReady($fadeIn);
+        
+        
         # DUPLICATE ALERT: This code copied from 
         #                  index_hidden_page() below
         index_hidden_template('x4');
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
 | 
| 
     
      
      
      From: <ken...@us...> - 2008-12-11 21:30:01
       
   | 
Revision: 949
          http://andro.svn.sourceforge.net/andro/?rev=949&view=rev
Author:   kendowns
Date:     2008-12-11 21:29:51 +0000 (Thu, 11 Dec 2008)
Log Message:
-----------
x6 dropdown support server-side.  
Modified Paths:
--------------
    trunk/andro/lib/index_hidden.php
Modified: trunk/andro/lib/index_hidden.php
===================================================================
--- trunk/andro/lib/index_hidden.php	2008-12-11 21:28:40 UTC (rev 948)
+++ trunk/andro/lib/index_hidden.php	2008-12-11 21:29:51 UTC (rev 949)
@@ -478,6 +478,23 @@
     
     vgfSet('x6',true);
     
+    # KFD 12/10/08, allow dynamic lookups. 
+    #
+    if(gp('x6select',false)) {
+        $table_id = gp('x6page');
+        $gpletters= gp('gpletters');
+        $matches  = array();
+        
+        $rows=RowsForSelect($table_id,$gpletters,$matches,'',true);
+        foreach($rows as $idx=>$row) {
+            unset($rows[$idx]['skey']);
+        }
+        x6Data('x6select',$rows);
+        echo json_encode_safe($GLOBALS['AG']['x4']);
+        return;
+    }
+    
+    
     # This little bit of magic loads up the CSS information
     # for the current template and skin, allowing downstream
     # code to determine how much space they have to work with
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
 | 
| 
     
      
      
      From: <ken...@us...> - 2008-12-19 14:46:12
       
   | 
Revision: 962
          http://andro.svn.sourceforge.net/andro/?rev=962&view=rev
Author:   kendowns
Date:     2008-12-19 14:46:09 +0000 (Fri, 19 Dec 2008)
Log Message:
-----------
Release 1 candidate for x6!!! 
One major change:  If the config var "flag_x6" is true, links will go to the "conventional" profile if none has been set in the dd.yaml.
Modified Paths:
--------------
    trunk/andro/lib/index_hidden.php
Modified: trunk/andro/lib/index_hidden.php
===================================================================
--- trunk/andro/lib/index_hidden.php	2008-12-19 14:44:58 UTC (rev 961)
+++ trunk/andro/lib/index_hidden.php	2008-12-19 14:46:09 UTC (rev 962)
@@ -356,11 +356,13 @@
         if($x4menu=='Y' && LoggedIn()) {
             gpSet('x4Page','menu');
         }
+        if(configGet('flag_x6','N')=='Y' && !gp('x6page',false)) {
+            gpSet('x6page','menu');
+        }
     }
 }
 
 
-
 // Entries made in the command box can rewrite get/post 
 // variables and affect downstream processing.  Do those
 // now if required.
@@ -377,6 +379,8 @@
 $x6plugin  = '';
 $x6action  = '';
 
+# Slip in a menu command
+
 # Get a candidate page to use to figure out the resolution
 $x6cand = gp('x6page');
 if($x6cand=='') {
@@ -394,10 +398,11 @@
 }
 
 # a Yaml file for this page
-$x = $x6cand.'.x6.yaml';
-if(file_exists_incpath($x)) {
-    $x6yaml = $x;
-}
+# KFD 12/14/08, never implemented this, rem'd out
+#$x = $x6cand.'.x6.yaml';
+#if(file_exists_incpath($x)) {
+#    $x6yaml = $x;
+#}
 
 # A profile for this page specified either in the dd.yaml
 # or overridden in applib.
@@ -423,10 +428,15 @@
 $x6action = gp('x6action');
 $x6plugin = gp('x6plugIn');
 
+# KFD 12/14/08, MAJOR CHANGE.  As of now, only the presence of
+#               'x6page' forces us to x6 dispatching.  This works
+#               out fine if the template is x6, which builds a menu
+#               full of x6 stuff.  No more resolution.
 # Now if any of those were not empty, x6 it is
-if(gp('x6Page').$x6file.$x6yaml.$x6profile.$x6plugin.$x6action<>'') {
-    $x6page = $x6cand;
-}
+$x6page = gp('x6page');
+#if(gp('x6Page').$x6file.$x6yaml.$x6profile.$x6plugin.$x6action<>'') {
+#    $x6page = $x6cand;
+#}
 
 # Ken's debugging to make sure assignments worked
 #echo "candidate -$x6cand- page -$x6page- file -$x6file- yaml -$x6yaml-
@@ -494,12 +504,16 @@
         return;
     }
     
+    # Make hidden variables for x6page and module
+    hidden('x6page',$x6page);
+    hidden('x6module',gp('x6module','X'));
     
     # This little bit of magic loads up the CSS information
     # for the current template and skin, allowing downstream
     # code to determine how much space they have to work with
     #
-    $x6skin = arr($_COOKIE,'x6skin','win2k.gray.1024');
+    $x6skin = arr($_COOKIE,'x6skin','Default.Gray.1024');
+    setCookie('x6skin',$x6skin);
     if($x6skin!='') {
         $filename  = fsDirTop()."generated/x6skin.$x6skin.ser.txt";
         if(file_exists($filename)) {
@@ -524,18 +538,8 @@
     $MPPages['x_mpassword']="Member Password";
     $MPPages['x_paypalipn']='Paypal IPN';
     
-    #$debug=" page -$x6page- file -$x6file- yaml -$x6yaml-
-    #    profile -$x6profile- plugin -$x6plugin- action -$x6action-";
-    #echo $debug;
-    #exit;
-    #x4Debug($debug);
-    
     # Session timeouts.  Need to code for basic page access
     # and code for ajax timeouts.
-    #echo $x6page;
-    #hprint_r($MPPages);
-    #echo in_array($x6page,array_keys($MPPages));
-    
     if(!LoggedIn() && !in_array($x6page,array_keys($MPPages))){
         if(gpExists('json')) {
             x4Script("window.location='index.php?gp_page=x_login'");
@@ -561,13 +565,17 @@
     # and custom) plus calls from plugins to refresh, plus JSON
     # calls to do database stuff.
     if($x6plugin<>'') {
+        # DEFUNCT.  We don't use plugins, they were an early
+        #           idea, but profiles and androHTML classes
+        #           made them unecessary.
+        
         # A plugin always wins.  A call to a plugin assumes that
         # x6action is also specified.  We are going to instantiate
         # the plugin and call the method named by x6action.
-        $x6file  = '';
-        $x6class = 'x6plugin'.$x6plugin;
-        $x6method= $x6action;
-        include($x6class.'.php');
+        #$x6file  = '';
+        #$x6class = 'x6plugin'.$x6plugin;
+        #$x6method= $x6action;
+        #include($x6class.'.php');
     }
     else {
         # No plugin means we are either using the base andromeda
@@ -607,6 +615,14 @@
         }
     }
     
+    # Final trap.  If the class is androX6 and the method
+    # is x6main, this means an unprogrammed page: there is
+    # no custom program file and no profile in the yaml.
+    # So we default to the conventional profile.
+    if($x6method=='x6main' && $x6class=='androX6') {
+        $x6method = 'profile_conventional';
+    }
+    
     # Ken's debugging code to make sure resolution worked
     #echo "<br/>class -$x6class- method -$x6method-";
     #exit;
@@ -615,8 +631,9 @@
     # and what method to call, so go for it.
     ob_start();
     $obj = new $x6class();
-    $obj->dd   = ddTable($x6page);
-    $obj->view = arr($obj->dd,'viewname','');
+    $obj->dd    = ddTable($x6page);
+    $obj->x6page= $x6page;
+    $obj->view  = arr($obj->dd,'viewname','');
     $obj->$x6method();
     x6HTML('*MAIN*',ob_get_clean());
     
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
 | 
| 
     
      
      
      From: <ken...@us...> - 2008-12-29 16:05:42
       
   | 
Revision: 1024
          http://andro.svn.sourceforge.net/andro/?rev=1024&view=rev
Author:   kendowns
Date:     2008-12-29 16:05:41 +0000 (Mon, 29 Dec 2008)
Log Message:
-----------
Modified default page selection so it will go to menu if you are a root user.
Modified Paths:
--------------
    trunk/andro/lib/index_hidden.php
Modified: trunk/andro/lib/index_hidden.php
===================================================================
--- trunk/andro/lib/index_hidden.php	2008-12-29 16:04:23 UTC (rev 1023)
+++ trunk/andro/lib/index_hidden.php	2008-12-29 16:05:41 UTC (rev 1024)
@@ -413,7 +413,7 @@
     $x6template= configGet('x6_template','');
     $x6group   = configGet('x6_group'   ,'');
     if($x6template!='') {
-        if(LoggedIn() && !inGroup($x6group)) {
+        if(LoggedIn() && (!inGroup($x6group) || SessionGet('ROOT')==1)) {
             $x6cand= gp('x4Page',gp('gp_page'));
             if($x6cand=='') {
                 $x6cand='menu';
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
 | 
| 
     
      
      
      From: <ken...@us...> - 2009-01-07 20:35:29
       
   | 
Revision: 1052
          http://andro.svn.sourceforge.net/andro/?rev=1052&view=rev
Author:   kendowns
Date:     2009-01-07 20:35:26 +0000 (Wed, 07 Jan 2009)
Log Message:
-----------
Slight fix to figuring out if we should go into x6
Modified Paths:
--------------
    trunk/andro/lib/index_hidden.php
Modified: trunk/andro/lib/index_hidden.php
===================================================================
--- trunk/andro/lib/index_hidden.php	2009-01-07 20:34:39 UTC (rev 1051)
+++ trunk/andro/lib/index_hidden.php	2009-01-07 20:35:26 UTC (rev 1052)
@@ -408,10 +408,15 @@
 $x6cand = gp('x6page');
 if($x6cand=='') {
     # If the x6template setting has been made, this is an
-    # x6 system.  The lack of a page for a non-public
-    # logged in user means menu
+    # x6 system.  If a user logs in and is in "x6_group", they
+    # will still see that public template.  If they are not in
+    # that group, they get sent to the x6 admin interface.
     $x6template= configGet('x6_template','');
     $x6group   = configGet('x6_group'   ,'');
+    #echo "<pre>";
+    #echo LoggedIn()." ".$x6template." -".$x6group."- ".inGroup($x6group)
+    #    ." -".SessionGet('ROOT',0).'-';
+    #echo "</pre>";
     if($x6template!='') {
         if(LoggedIn() && (!inGroup($x6group) || SessionGet('ROOT')==1)) {
             $x6cand= gp('x4Page',gp('gp_page'));
@@ -421,6 +426,7 @@
         }
     }
 }
+#echo "The candidate is -$x6cand-";
 if($x6cand!='') {
     $x6page = $x6cand;
 }
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
 |