phpgroupware-cvs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Phpgroupware-cvs] sitemgr/sitemgr-link index.php,1.7.2.1,1.7.2.2


From: Dave Hall <address@hidden>
Subject: [Phpgroupware-cvs] sitemgr/sitemgr-link index.php,1.7.2.1,1.7.2.2
Date: Mon, 01 Dec 2003 00:04:05 +0000

Update of /cvsroot/phpgroupware/sitemgr/sitemgr-link
In directory subversions:/tmp/cvs-serv4853

Modified Files:
      Tag: Version-0_9_16-branch
        index.php 
Log Message:
fix for linking to multiple sites - bit of a hack - but it works & fixes 
problems


Index: index.php
===================================================================
RCS file: /cvsroot/phpgroupware/sitemgr/sitemgr-link/index.php,v
retrieving revision 1.7.2.1
retrieving revision 1.7.2.2
diff -C2 -d -r1.7.2.1 -r1.7.2.2
*** index.php   23 Jun 2003 20:31:21 -0000      1.7.2.1
--- index.php   1 Dec 2003 00:04:03 -0000       1.7.2.2
***************
*** 25,62 ****
                die();
        }
        $sites_bo = createobject('sitemgr.Sites_BO');
!       $siteinfo = $sites_bo->get_currentsiteinfo();
!       $location = $siteinfo['site_url'];
!       $dir = $siteinfo['site_dir'];
!       $sitemgr_info['site_url'] = $location;
!       if ($location && file_exists($dir . '/functions.inc.php'))
        {
!               require_once($dir . '/functions.inc.php');
                
!               $GLOBALS['phpgw']->redirect(sitemgr_link(array("PHPSESSID" => 
session_id())));
!               exit;
!       }
!       else
!       {
!               $GLOBALS['phpgw']->common->phpgw_header();
!               echo parse_navbar();
!               $aclbo = CreateObject('sitemgr.ACL_BO', True);
!               echo '<table width="50%"><tr><td>';
!               if ($aclbo->is_admin())
                {
!                       echo lang('Before the public web site can be viewed, 
you must configure the various locations and preferences.  Please go to the 
sitemgr setup page by following this link:') . 
!                         '<a href="' . 
!                         $GLOBALS['phpgw']->link('/index.php', 
'menuaction=sitemgr.Common_UI.DisplayPrefs') . 
!                         '">' .
!                         lang('sitemgr setup page') .
!                         '</a>. ' .
!                         lang('Note that you may get this message if your 
preferences are incorrect.  For example, if config.inc.php is not found in the 
directory that you specified.');
                }
                else
                {
!                       echo lang('Your administrator has not yet setup the web 
content manager for public viewing.  Go bug your administrator to get their 
butt in gear.');
                }
!               echo '</td></tr></table>';
!               $GLOBALS['phpgw']->common->phpgw_footer();
        }
  ?>
--- 25,98 ----
                die();
        }
+ 
        $sites_bo = createobject('sitemgr.Sites_BO');
!       
!       
if((isset($GLOBALS['phpgw_info']['user']['preferences']['sitemgr-link']['default_site'])
!                       && 
$GLOBALS['phpgw_info']['user']['preferences']['sitemgr-link']['default_site'] 
!= 0)
!               || isset($_GET['site_id'])
!               ||  ($sites_bo->getnumberofsites() == 1)
!       )
        {
!               if($sites_bo->getnumberofsites() != 1) //if one site then there 
is only one choice
!               {
!                       
$GLOBALS['phpgw_info']['user']['preferences']['sitemgr']['currentsite'] 
!                               = (isset($_GET['site_id']) ? $_GET['site_id'] 
!                                       : 
$GLOBALS['phpgw_info']['user']['preferences']['sitemgr']['currentsite']);
!               }
                
!               $siteinfo = $sites_bo->get_currentsiteinfo();
!               $location = $siteinfo['site_url'];
!               $dir = $siteinfo['site_dir'];
!               $sitemgr_info['site_url'] = $location;
!               if ($location && file_exists($dir . '/functions.inc.php'))
                {
!                       require_once($dir . '/functions.inc.php');
!               
!                       
$GLOBALS['phpgw']->redirect(sitemgr_link(array("PHPSESSID" => session_id())));
!                       exit;
                }
                else
                {
!                       $GLOBALS['phpgw']->common->phpgw_header();
!                       echo parse_navbar();
!                       $aclbo = CreateObject('sitemgr.ACL_BO', True);
!                       echo '<table width="50%"><tr><td>';
!                       if ($aclbo->is_admin())
!                       {
!                               echo lang('Before the public web site can be 
viewed, you must configure the various locations and preferences.  Please go to 
the sitemgr setup page by following this link:') . 
!                                 '<a href="' . 
!                                 $GLOBALS['phpgw']->link('/index.php', 
'menuaction=sitemgr.Common_UI.DisplayPrefs') . 
!                                 '">' .
!                                 lang('sitemgr setup page') .
!                                 '</a>. ' .
!                                 lang('Note that you may get this message if 
your preferences are incorrect.  For example, if config.inc.php is not found in 
the directory that you specified.');
!                       }
!                       else
!                       {
!                               echo lang('Your administrator has not yet setup 
the web content manager for public viewing.  Please contact your administrator 
to get this fixed.');
!                       }
!                       echo '</td></tr></table>';
!                       $GLOBALS['phpgw']->common->phpgw_footer();
                }
!       }
!       else
!       {
!               $sbox = createObject('phpgwapi.sbox2');
!               $sites = array(0 => lang('please select'));
!               foreach($sites_bo->list_sites(False) as $key => $data)
!               {
!                       $sites[$key] = $data['site_name'];
!               }
!               $GLOBALS['phpgw']->common->phpgw_header();
!               echo parse_navbar();
!               // i know this bad, but it is a quick thing - for now.
!               ?>
!                       <h2><?php echo lang('select site to view') ?></h2>
!                       <form>
!                               <?php echo lang('goto') . ': ' . 
$sbox->getArrayItem('site_id', 0, $sites, False); ?>
!                               <input type="submit" name="go" value="<?php 
echo lang('go'); ?>" /> 
!                       </form>
!                       <br />&nbsp;
!               <?php
        }
  ?>





reply via email to

[Prev in Thread] Current Thread [Next in Thread]