massive and sweeping change to the link() function, the way the app loads up, to a single templates class instance, to a new template set structure which automaticly handles frames support. We will have much cleanup to do to get apps working again and have them following the new guidelines

This commit is contained in:
seek3r 2002-05-30 09:47:09 +00:00
parent 403f8722b1
commit 4a2729a720
26 changed files with 1026 additions and 790 deletions

142
login.php
View File

@ -15,7 +15,7 @@
$phpgw_info = array();
$GLOBALS['phpgw_info']['flags'] = array(
'disable_template_class' => True,
// 'disable_template_class' => True,
'login' => True,
'currentapp' => 'login',
'noheader' => True
@ -31,89 +31,53 @@
exit;
}
$GLOBALS['phpgw_info']['server']['template_dir'] = PHPGW_SERVER_ROOT . '/phpgwapi/templates/' . $GLOBALS['phpgw_info']['login_template_set'];
$tmpl = CreateObject('phpgwapi.Template', $GLOBALS['phpgw_info']['server']['template_dir']);
$GLOBALS['phpgw']->template = CreateObject('phpgwapi.Template', $GLOBALS['phpgw_info']['server']['template_dir']);
$GLOBALS['phpgw']->template->set_file('phpgw', 'phpgw.tpl');
$GLOBALS['phpgw']->template->set_file('login','login.tpl');
$GLOBALS['phpgw']->template->set_file('msgbox', 'msgbox.tpl');
// This is used for system downtime, to prevent new logins.
if ($GLOBALS['phpgw_info']['server']['deny_all_logins'])
{
$tmpl->set_file(array(
'login_form' => 'login_denylogin.tpl'
));
$tmpl->set_var('template_set','default');
$tmpl->pfp('loginout','login_form');
$GLOBALS['phpgw']->template->set_block('phpgw','phpgw_main_basic','phpgw_main');
$GLOBALS['phpgw']->template->set_block('login','login_form_deny','login_form');
$GLOBALS['phpgw']->template->set_var('template_set','default');
$GLOBALS['phpgw']->template->fp('phpgw_body','login_form');
$GLOBALS['phpgw']->template->pfp('out','phpgw_main');
exit;
}
// !! NOTE !!
// Do NOT and I repeat, do NOT touch ANYTHING to do with lang in this file.
// If there is a problem, tell me and I will fix it. (jengo)
/*
if ($code != 10 && $GLOBALS['phpgw_info']['server']['usecookies'] == False)
{
Setcookie('sessionid');
Setcookie('kp3');
Setcookie('domain');
}
*/
/* This is not working yet because I need to figure out a way to clear the $cd =1
if (isset($PHP_AUTH_USER) && $cd == '1')
{
Header('HTTP/1.0 401 Unauthorized');
Header('WWW-Authenticate: Basic realm="phpGroupWare"');
echo 'You have to re-authentificate yourself';
exit;
}
*/
if (! $deny_login && ! $GLOBALS['phpgw_info']['server']['show_domain_selectbox'])
{
$tmpl->set_file(array('login_form' => 'login.tpl'));
$tmpl->set_var('charset',lang('charset'));
}
elseif ($GLOBALS['phpgw_info']['server']['show_domain_selectbox'])
{
$tmpl->set_file(array('login_form' => 'login_selectdomain.tpl'));
$tmpl->set_var('charset',lang('charset'));
}
function show_cookie()
{
global $code, $last_loginid, $login;
//echo '$GLOBALS: <pre>';print_r($GLOBALS);echo '</pre>';
/* This needs to be this way, because if someone doesnt want to use cookies, we shouldnt sneak one in */
if ($code != 5 && (isset($GLOBALS['phpgw_info']['server']['usecookies']) && $GLOBALS['phpgw_info']['server']['usecookies']))
if ($GLOBALS['HTTP_GET_VARS']['code'] != 5 && (isset($GLOBALS['phpgw_info']['server']['usecookies']) && $GLOBALS['phpgw_info']['server']['usecookies']))
{
return $last_loginid;
return $GLOBALS['HTTP_COOKIE_VARS']['last_loginid'];
}
}
function check_logoutcode($code)
function check_logoutcode()
{
$GLOBALS['phpgw']->template = CreateObject('phpgwapi.Template');
//$GLOBALS['phpgw']->template = CreateObject('phpgwapi.Template');
$GLOBALS['phpgw']->common = CreateObject('phpgwapi.common');
switch($code)
switch($GLOBALS['HTTP_GET_VARS']['code'])
{
case 1:
return $GLOBALS['phpgw']->common->msgbox('You have been successfully logged out', True);
$GLOBALS['phpgw_info']['flags']['msgbox_data']['You have been successfully logged out']=True;
break;
case 2:
return $GLOBALS['phpgw']->common->msgbox('Sorry, your login has expired', False);
$GLOBALS['phpgw_info']['flags']['msgbox_data']['Sorry, your login has expired']=False;
break;
case 5:
return $GLOBALS['phpgw']->common->msgbox('Bad login or password', False);
$GLOBALS['phpgw_info']['flags']['msgbox_data']['Bad login or password']=False;
break;
case 10:
Setcookie('sessionid');
Setcookie('kp3');
Setcookie('domain');
return $GLOBALS['phpgw']->common->msgbox('Your session could not be verified.',False);
$GLOBALS['phpgw_info']['flags']['msgbox_data']['Your session could not be verified']=False;
break;
default:
return '&nbsp;';
}
}
@ -128,7 +92,7 @@
# Apache + mod_ssl style SSL certificate authentication
# Certificate (chain) verification occurs inside mod_ssl
if ($GLOBALS['phpgw_info']['server']['auth_type'] == 'sqlssl' && isset($HTTP_SERVER_VARS['SSL_CLIENT_S_DN']) && !isset($cd))
if ($GLOBALS['phpgw_info']['server']['auth_type'] == 'sqlssl' && isset($HTTP_SERVER_VARS['SSL_CLIENT_S_DN']) && !isset($GLOBALS['HTTP_GET_VARS']['code']))
{
# an X.509 subject looks like:
# /CN=john.doe/OU=Department/O=Company/C=xx/Email=john@comapy.tld/L=City/
@ -158,8 +122,8 @@
unset($sslattributes);
}
if (isset($HTTP_POST_VARS['passwd_type']) || $submit_x || $submit_y)
// isset($HTTP_POST_VARS['passwd']) && $HTTP_POST_VARS['passwd']) // enable konqueror to login via Return
if (isset($GLOBALS['HTTP_POST_VARS']['passwd_type']) || $submit_x || $submit_y)
// isset($GLOBALS['HTTP_POST_VARS']['passwd']) && $GLOBALS['HTTP_POST_VARS']['passwd']) // enable konqueror to login via Return
{
if (getenv(REQUEST_METHOD) != 'POST' && !isset($PHP_AUTH_USER) && !isset($HTTP_SERVER_VARS['SSL_CLIENT_S_DN']))
{
@ -169,13 +133,13 @@
if (! isset($GLOBALS['sessionid']) || ! $GLOBALS['sessionid'])
{
$GLOBALS['phpgw']->redirect($GLOBALS['phpgw_info']['server']['webserver_url'] . '/login.php?cd=5');
$GLOBALS['phpgw']->redirect($GLOBALS['phpgw_info']['server']['webserver_url'] . '/login.php?code=5');
}
else
{
if ($GLOBALS['phpgw_forward'])
{
while (list($name,$value) = each($HTTP_GET_VARS))
while (list($name,$value) = each($GLOBALS['HTTP_GET_VARS']))
{
if (ereg('phpgw_',$name))
{
@ -183,7 +147,7 @@
}
}
}
$GLOBALS['phpgw']->redirect($GLOBALS['phpgw']->link('/home.php','cd=yes' . $extra_vars));
$GLOBALS['phpgw']->redirect($GLOBALS['phpgw']->link('/home.php','code=yes' . $extra_vars,True));
}
}
else
@ -191,7 +155,7 @@
// !!! DONT CHANGE THESE LINES !!!
// If there is something wrong with this code TELL ME!
// Commenting out the code will not fix it. (jengo)
if (isset($last_loginid))
if (isset($GLOBALS['HTTP_COOKIE_VARS']['last_loginid']))
{
$accounts = CreateObject('phpgwapi.accounts');
$prefs = CreateObject('phpgwapi.preferences', $accounts->name2id($last_loginid));
@ -209,7 +173,7 @@
$GLOBALS['phpgw']->translation->add_app('loginscreen');
if (lang('loginscreen_message') != 'loginscreen_message*')
{
$tmpl->set_var('lang_message',stripslashes(lang('loginscreen_message')));
$GLOBALS['phpgw']->template->set_var('phpgw_loginscreen_message',stripslashes(lang('loginscreen_message')));
}
}
else
@ -221,18 +185,19 @@
$GLOBALS['phpgw']->translation->add_app('loginscreen');
if (lang('loginscreen_message') != 'loginscreen_message*')
{
$tmpl->set_var('lang_message',stripslashes(lang('loginscreen_message')));
$GLOBALS['phpgw']->template->set_var('phpgw_loginscreen_message',stripslashes(lang('loginscreen_message')));
}
}
}
if (!isset($cd) || !$cd)
if (!isset($GLOBALS['HTTP_GET_VARS']['code']) || !$GLOBALS['HTTP_GET_VARS']['code'])
{
$cd = '';
$GLOBALS['HTTP_GET_VARS']['code'] = '';
}
if ($GLOBALS['phpgw_info']['server']['show_domain_selectbox'])
{
$GLOBALS['phpgw']->template->set_block('login','login_form_select_domain','login_form');
reset($phpgw_domain);
unset($domain_select); // For security ... just in case
while ($domain = each($phpgw_domain))
@ -244,10 +209,14 @@
}
$domain_select .= '>' . $domain[0] . '</option>';
}
$tmpl->set_var('select_domain',$domain_select);
$GLOBALS['phpgw']->template->set_var('select_domain',$domain_select);
}
else
{
$GLOBALS['phpgw']->template->set_block('login','login_form_standard','login_form');
}
while (list($name,$value) = each($HTTP_GET_VARS))
while (list($name,$value) = each($GLOBALS['HTTP_GET_VARS']))
{
if (ereg('phpgw_',$name))
{
@ -259,18 +228,27 @@
{
$extra_vars = '?' . substr($extra_vars,1,strlen($extra_vars));
}
$tmpl->set_var('login_url', $GLOBALS['phpgw_info']['server']['webserver_url'] . '/login.php' . $extra_vars);
$tmpl->set_var('registration_url',$GLOBALS['phpgw_info']['server']['webserver_url'] . '/registration/');
$tmpl->set_var('website_title', $GLOBALS['phpgw_info']['server']['site_title']);
$tmpl->set_var('cd',check_logoutcode($cd));
$tmpl->set_var('cookie',show_cookie());
$tmpl->set_var('lang_username',lang('username'));
$tmpl->set_var('lang_phpgw_login',lang('phpGroupWare login'));
$tmpl->set_var('version',$GLOBALS['phpgw_info']['server']['versions']['phpgwapi']);
$tmpl->set_var('lang_password',lang('password'));
$tmpl->set_var('lang_login',lang('login'));
$tmpl->set_var('template_set',$GLOBALS['phpgw_info']['login_template_set']);
$tmpl->pfp('loginout','login_form');
check_logoutcode();
$GLOBALS['phpgw']->common->msgbox('', False,'phpgw_login_msgbox');
$GLOBALS['phpgw']->template->set_block('phpgw','phpgw_main_basic','phpgw_main');
$GLOBALS['phpgw']->template->set_var('phpgw_head_charset',lang('charset'));
$GLOBALS['phpgw']->template->set_var('phpgw_head_description','phpGroupWare - Login Page');
$GLOBALS['phpgw']->template->set_var('phpgw_head_keywords','phpGroupWare');
$GLOBALS['phpgw']->template->set_var('phpgw_head_base',$GLOBALS['phpgw_info']['server']['webserver_url'].'/');
$GLOBALS['phpgw']->template->set_var('phpgw_head_target','_self');
$GLOBALS['phpgw']->template->set_var('phpgw_head_browser_ico','favicon.ico');
$GLOBALS['phpgw']->template->set_var('phpgw_head_website_title', $GLOBALS['phpgw_info']['server']['site_title']);
$GLOBALS['phpgw']->template->set_var('phpgw_body_tags','bgcolor="#FFFFFF"');
$GLOBALS['phpgw']->template->set_var('login_url', 'login.php' . $extra_vars);
$GLOBALS['phpgw']->template->set_var('registration_url','registration/');
$GLOBALS['phpgw']->template->set_var('cookie',show_cookie());
$GLOBALS['phpgw']->template->set_var('lang_username',lang('username'));
$GLOBALS['phpgw']->template->set_var('lang_phpgw_login',lang('phpGroupWare login'));
$GLOBALS['phpgw']->template->set_var('version',$GLOBALS['phpgw_info']['server']['versions']['phpgwapi']);
$GLOBALS['phpgw']->template->set_var('lang_password',lang('password'));
$GLOBALS['phpgw']->template->set_var('lang_login',lang('login'));
$GLOBALS['phpgw']->template->set_var('template_set',$GLOBALS['phpgw_info']['login_template_set']);
$GLOBALS['phpgw']->template->fp('phpgw_body','login_form');
$GLOBALS['phpgw']->template->pfp('out','phpgw_main');
?>

View File

@ -63,5 +63,5 @@
Setcookie('domain');
}
$GLOBALS['phpgw']->redirect($GLOBALS['phpgw_info']['server']['webserver_url'].'/login.php?cd=1');
$GLOBALS['phpgw']->redirect($GLOBALS['phpgw_info']['server']['webserver_url'].'/login.php?code=1',True);
?>

View File

@ -26,6 +26,7 @@
/* relative filenames are relative to this pathname */
var $root = '';
var $oldroot = '';
/* $varkeys[key] = 'key'; $varvals[key] = 'value'; */
var $varkeys = array();
@ -55,26 +56,6 @@
{
$this->print = True;
}
/* This covers loading up the common tpl file and CSS data */
if(defined('PHPGW_TEMPLATE_DIR'))
{
$this->set_root(PHPGW_TEMPLATE_DIR);
$this->set_file('common', 'common.tpl');
}
else
{
$this->set_root(PHPGW_INCLUDE_ROOT.'/phpgwapi/templates/default');
$this->set_file('common', 'common.tpl');
}
/* This covers setting the theme values so that each app doesnt have to */
$theme_data = $GLOBALS['phpgw_info']['theme'];
unset($theme_data['css']);
$this->set_var($theme_data);
unset($theme_data);
$this->update_css();
/* Now move on to loading up the requested template set */
$this->set_root($root);
$this->set_unknowns($unknowns);
}
@ -96,6 +77,23 @@
}
}
function update_preload_images()
{
if(@is_array($GLOBALS['phpgw_info']['flags']['preload_images']))
{
$preload_image_string = '';
reset($GLOBALS['phpgw_info']['flags']['preload_images']);
//$css_string = '<STYLE type="text/css">'."\n";
while(list($key,$value) = each($GLOBALS['phpgw_info']['flags']['preload_images']))
{
$css_string .= "\n\t$key { $value } ";
}
$css_string .= "\n";
//$css_string .= '</STYLE>'."\n";
$this->set_var('phpgw_css',$css_string);
}
}
/* public: setroot(pathname $root)
* root: new template directory.
*/
@ -104,10 +102,16 @@
if (!is_dir($root))
{
$this->halt("set_root: $root is not a directory.");
return false;
return False;
}
$this->oldroot = $this->root;
$this->root = $root;
return true;
return True;
}
function reset_root()
{
$this->root = $this->oldroot;
}
/* public: set_unknowns(enum $unknowns)
@ -133,7 +137,7 @@
if ($filename == '')
{
$this->halt("set_file: For handle $handle filename is empty.");
return false;
return False;
}
$this->file[$handle] = $this->filename($filename);
}
@ -156,8 +160,9 @@
if (!$this->loadfile($parent))
{
$this->halt("subst: unable to load $parent.");
return false;
return False;
}
if ($name == '')
{
$name = $handle;
@ -165,9 +170,7 @@
$str = $this->get_var($parent);
$reg = "/<!--\s+BEGIN $handle\s+-->(.*)\n\s*<!--\s+END $handle\s+-->/sm";
preg_match_all($reg, $str, $m);
$str = preg_replace($reg, '{' . "$name}", $str);
$this->set_var($handle, $m[1][0]);
$this->set_var($parent, $str);
$this->set_var($name, $m[1][0]);
}
/* public: set_var(array $values)
@ -177,7 +180,7 @@
* varname: name of a variable that is to be defined
* value: value of that variable
*/
function set_var($varname, $value = '')
function set_var($varname, $value = '', $append=False)
{
if (!is_array($varname))
{
@ -188,7 +191,15 @@
print "scalar: set *$varname* to *$value*<br>\n";
}
$this->varkeys[$varname] = $this->varname($varname);
$this->varvals[$varname] = $value;
if ($append)
{
$this->varvals[$varname] = $this->get_var($varname).$value;
}
else
{
$this->varvals[$varname] = $value;
}
}
}
else
@ -203,7 +214,16 @@
print "array: set *$k* to *$v*<br>\n";
}
$this->varkeys[$k] = $this->varname($k);
$this->varvals[$k] = $v;
if ($append)
{
$this->varvals[$k] = $this->get_var($k).$v;
}
else
{
$this->varvals[$k] = $v;
}
}
}
}
@ -217,7 +237,7 @@
if (!$this->loadfile($handle))
{
$this->halt("subst: unable to load $handle.");
return false;
return False;
}
$str = $this->get_var($handle);
@ -235,7 +255,7 @@
function psubst($handle)
{
print $this->subst($handle);
return false;
return False;
}
/* public: parse(string $target, string $handle, boolean append)
@ -244,19 +264,12 @@
* handle: handle of template to substitute
* append: append to target handle
*/
function parse($target, $handle, $append = false)
function parse($target, $handle, $append = False)
{
if (!is_array($handle))
{
$str = $this->subst($handle);
if ($append)
{
$this->set_var($target, $this->get_var($target) . $str);
}
else
{
$this->set_var($target, $str);
}
$this->set_var($target, $str, $append);
}
else
{
@ -270,10 +283,10 @@
return $str;
}
function pparse($target, $handle, $append = false)
function pparse($target, $handle, $append = False)
{
print $this->parse($target, $handle, $append);
return false;
return False;
}
/* This is short for finish parse */
@ -331,14 +344,14 @@
if (!$this->loadfile($handle))
{
$this->halt("get_undefined: unable to load $handle.");
return false;
return False;
}
preg_match_all("/\{([^}]+)\}/", $this->get_var($handle), $m);
$m = $m[1];
if (!is_array($m))
{
return false;
return False;
}
reset($m);
while(list($k, $v) = each($m))
@ -355,7 +368,7 @@
}
else
{
return false;
return False;
}
}
@ -464,12 +477,12 @@
{
if (isset($this->varkeys[$handle]) and !empty($this->varvals[$handle]))
{
return true;
return True;
}
if (!isset($this->file[$handle]))
{
$this->halt("loadfile: $handle is not a valid handle.");
return false;
return False;
}
$filename = $this->file[$handle];
@ -477,11 +490,11 @@
if (empty($str))
{
$this->halt("loadfile: While loading $handle, $filename does not exist or is empty.");
return false;
return False;
}
$this->set_var($handle, $str);
return true;
return True;
}
/***************************************************************************/
@ -502,7 +515,7 @@
echo('<b>Halted.</b>');
}
$GLOBALS['phpgw']->common->phpgw_exit(True);
$GLOBALS['phpgw']->common->phpgw_exit();
}
/* public, override: haltmsg($msg)

View File

@ -440,8 +440,16 @@
}
if (!isset($this->file[$handle]))
{
$this->halt("loadfile: $handle is not a valid handle.");
return false;
if(isset($this->varvals[$handle])
{
return True;
}
else
{
$this->halt("loadfile: $handle is not a valid handle.");
return false;
}
}
$filename = $this->file[$handle];

View File

@ -982,6 +982,15 @@
function msgbox($text='',$type=True,$output='return')
{
if($output != 'return')
{
$return_result = False;
}
else
{
$return_result = True;
$output = 'phpgw_msgbox';
}
if ($text=='' && @isset($GLOBALS['phpgw_info']['flags']['msgbox_data']))
{
$text = $GLOBALS['phpgw_info']['flags']['msgbox_data'];
@ -991,10 +1000,10 @@
{
return;
}
$GLOBALS['phpgw']->template->set_block('common','msgbox_start');
$GLOBALS['phpgw']->template->set_block('common','msgbox_row');
$GLOBALS['phpgw']->template->set_block('common','msgbox_end');
$GLOBALS['phpgw']->template->fp('msgbox','msgbox_start');
$GLOBALS['phpgw']->template->set_block('msgbox','msgbox_start');
$GLOBALS['phpgw']->template->set_block('msgbox','msgbox_row');
$GLOBALS['phpgw']->template->set_block('msgbox','msgbox_end');
$GLOBALS['phpgw']->template->fp($output,'msgbox_start');
if (is_array($text))
{
@ -1024,7 +1033,7 @@
$GLOBALS['phpgw']->template->set_var('msgbox_img',$this->image('phpgwapi','msgbox_bad'));
$GLOBALS['phpgw']->template->set_var('msgbox_img_alt','ERROR');
}
$GLOBALS['phpgw']->template->fp('msgbox','msgbox_row',True);
$GLOBALS['phpgw']->template->fp($output,'msgbox_row',True);
}
}
else
@ -1041,18 +1050,13 @@
$GLOBALS['phpgw']->template->set_var('msgbox_img',$this->image('phpgwapi','msgbox_bad'));
$GLOBALS['phpgw']->template->set_var('msgbox_img_alt','ERROR');
}
$GLOBALS['phpgw']->template->fp('msgbox','msgbox_row',True);
$GLOBALS['phpgw']->template->fp($output,'msgbox_row',True);
}
$GLOBALS['phpgw']->template->fp('msgbox','msgbox_end',True);
$GLOBALS['phpgw']->template->fp($output,'msgbox_end',True);
if($output == 'out')
if($return_result)
{
$GLOBALS['phpgw']->template->pfp('out', 'msgbox');
return;
}
else /* covers the default of 'return' */
{
return $GLOBALS['phpgw']->template->varvals['msgbox'];
return $GLOBALS['phpgw']->template->varvals[$output];
}
}
@ -1143,17 +1147,6 @@
$GLOBALS['phpgw_info']['navbar']['logout']['url'] = $GLOBALS['phpgw']->link('/logout.php');
$GLOBALS['phpgw_info']['navbar']['logout']['icon'] = $this->image('phpgwapi',Array('logout','nonav'));
$GLOBALS['phpgw_info']['navbar']['logout']['icon_hover'] = $this->image_on('phpgwapi',Array('logout','nonav'),'-over');
/*************************************************************************\
* If they are using frames, we need to set some variables *
\*************************************************************************/
if(((isset($GLOBALS['phpgw_info']['user']['preferences']['common']['useframes']) &&
$GLOBALS['phpgw_info']['user']['preferences']['common']['useframes']) &&
$GLOBALS['phpgw_info']['server']['useframes'] == 'allowed') ||
($GLOBALS['phpgw_info']['server']['useframes'] == 'always'))
{
$GLOBALS['phpgw_info']['flags']['navbar_target'] = 'phpgw_body';
}
}
/*!
@ -1162,6 +1155,7 @@
*/
function phpgw_header($forceheader = True, $forcenavbar = True)
{
/*
if($forceheader)
{
$GLOBALS['phpgw_info']['flags']['noheader'] = False;
@ -1173,16 +1167,22 @@
if (!@$GLOBALS['phpgw_info']['flags']['noheader'])
{
include(PHPGW_INCLUDE_ROOT . '/phpgwapi/templates/' . $GLOBALS['phpgw_info']['server']['template_set'] . '/head.inc.php');
$GLOBALS['phpgw']->template->set_root(PHPGW_TEMPLATE_DIR);
include(PHPGW_TEMPLATE_DIR.'/head.inc.php');
$GLOBALS['phpgw']->template->reset_root();
}
if(!function_exists('parse_navbar'))
{
$GLOBALS['phpgw']->template->set_root(PHPGW_TEMPLATE_DIR);
$this->navbar(False);
include(PHPGW_INCLUDE_ROOT . '/phpgwapi/templates/' . $GLOBALS['phpgw_info']['server']['template_set'] . '/navbar.inc.php');
include(PHPGW_TEMPLATE_DIR.'/navbar.inc.php');
$GLOBALS['phpgw']->template->reset_root();
}
if (!@$GLOBALS['phpgw_info']['flags']['nonavbar'] && !@$GLOBALS['phpgw_info']['flags']['navbar_target'])
{
$GLOBALS['phpgw']->template->set_root(PHPGW_TEMPLATE_DIR);
parse_navbar();
$GLOBALS['phpgw']->template->reset_root();
}
//elseif (!@$GLOBALS['phpgw_info']['flags']['noheader'] && function_exists('parse_nonavbar'))
//{
@ -1190,9 +1190,9 @@
//}
if (!@$GLOBALS['phpgw_info']['flags']['noheader'] && !@$GLOBALS['phpgw_info']['flags']['nonavbar'])
{
$this->msgbox('',False,'out');
$GLOBALS['phpgw']->hooks->process('after_navbar');
}
*/
}
/*!
@ -1214,47 +1214,70 @@
include(PHPGW_APP_INC . '/header.inc.php');
}
}
/*!
@function phpgw_appfooter
@abstract load footer.inc.php for an application
*/
function phpgw_appfooter()
{
if (!is_array(MENUACTION))
{
list($app,$class,$method) = explode('.',MENUACTION);
if (is_array($GLOBALS[$class]->public_functions) && $GLOBALS[$class]->public_functions['footer'])
{
$GLOBALS[$class]->footer();
}
}
elseif (file_exists(PHPGW_APP_INC . '/footer.inc.php'))
{
include(PHPGW_APP_INC . '/footer.inc.php');
}
}
function phpgw_footer()
{
global $HTMLCOMPLIANT;
if (!isset($GLOBALS['phpgw_info']['flags']['nofooter']) || !$GLOBALS['phpgw_info']['flags']['nofooter'])
if(!defined('PHPGW_FOOTER_RAN'))
{
if((file_exists(PHPGW_APP_INC . '/footer.inc.php') || MENUACTION) &&
$GLOBALS['phpgw_info']['flags']['currentapp'] != 'home' &&
$GLOBALS['phpgw_info']['flags']['currentapp'] != 'login' &&
$GLOBALS['phpgw_info']['flags']['currentapp'] != 'logout' &&
!@$GLOBALS['phpgw_info']['flags']['noappfooter'])
define('PHPGW_FOOTER_RAN',True);
if (!isset($GLOBALS['phpgw_info']['flags']['nofooter']) || !$GLOBALS['phpgw_info']['flags']['nofooter'])
{
if(MENUACTION)
if($GLOBALS['phpgw_info']['flags']['currentapp'] != 'home' &&
$GLOBALS['phpgw_info']['flags']['currentapp'] != 'login' &&
$GLOBALS['phpgw_info']['flags']['currentapp'] != 'logout' &&
!@$GLOBALS['phpgw_info']['flags']['noappfooter'])
{
list($app,$class,$method) = explode('.',MENUACTION);
if(is_array($GLOBALS[$class]->public_functions) && $GLOBALS[$class]->public_functions['footer'])
{
// eval("\$GLOBALS[$class]->footer();");
$GLOBALS[$class]->footer();
}
elseif(file_exists(PHPGW_APP_INC.'/footer.inc.php'))
{
include(PHPGW_APP_INC . '/footer.inc.php');
}
}
elseif(file_exists(PHPGW_APP_INC.'/footer.inc.php'))
{
include(PHPGW_APP_INC . '/footer.inc.php');
$this->phpgw_appfooter();
}
$GLOBALS['phpgw']->db->disconnect();
$this->msgbox('',False,'phpgw_msgbox');
$GLOBALS['phpgw']->template->pfp('out','phpgw_main');
/*
$GLOBALS['phpgw']->template->p('phpgw_head');
$GLOBALS['phpgw']->template->p('phpgw_navbar_start');
$this->msgbox('',False);
$GLOBALS['phpgw']->template->fp('phpgw_msgbox');
$GLOBALS['phpgw']->template->p('phpgw_appspace');
$GLOBALS['phpgw']->template->set_root(PHPGW_TEMPLATE_DIR);
parse_navbar_end();
$GLOBALS['phpgw']->template->reset_root();
$GLOBALS['phpgw']->hooks->process('navbar_end');
$GLOBALS['phpgw']->template->p('phpgw_navbar_end');
$GLOBALS['phpgw']->template->p('phpgw_footer');
$GLOBALS['phpgw']->template->parse('phpgw_main_body','login_form');
$GLOBALS['phpgw']->template->pfp('out','phpgw_main');
*/
}
$GLOBALS['phpgw']->db->disconnect();
parse_navbar_end();
}
/* Clean up mcrypt */
if (@is_object($GLOBALS['phpgw']->crypto))
{
$GLOBALS['phpgw']->crypto->cleanup();
unset($GLOBALS['phpgw']->crypto);
/* Clean up mcrypt */
if (@is_object($GLOBALS['phpgw']->crypto))
{
$GLOBALS['phpgw']->crypto->cleanup();
unset($GLOBALS['phpgw']->crypto);
}
}
// echo 'an app is trying to run the phpgw_footer() more than once<br>';
}
function hex2bin($data)

View File

@ -116,12 +116,23 @@
function redirect($url = '')
{
$iis = @strpos($GLOBALS['HTTP_ENV_VARS']['SERVER_SOFTWARE'], 'IIS', 0);
if ( !$url )
if (!$url)
{
$url = $GLOBALS['PHP_SELF'];
}
if ( $iis )
if(@isset($GLOBALS['phpgw_info']['server']['enforce_ssl']) && $GLOBALS['phpgw_info']['server']['enforce_ssl'] && !$GLOBALS['HTTP_SERVER_VARS']['HTTPS'])
{
if(substr($url ,0,4) != 'http')
{
$url = 'https://'.$GLOBALS['phpgw_info']['server']['hostname'].$url;
}
else
{
$url = str_replace ( 'http:', 'https:', $url);
}
}
if ($iis)
{
echo "\n<HTML>\n<HEAD>\n<TITLE>Redirecting to $url</TITLE>";
echo "\n<META HTTP-EQUIV=REFRESH CONTENT=\"0; URL=$url\">";

View File

@ -878,117 +878,109 @@
\*************************************************************************/
function link($url, $extravars = '')
{
$kp3 = get_var('kp3',Array('COOKIE','GET'));
/* first we process the $url to build the full scriptname */
$full_scriptname = True;
if (! $kp3)
$url_firstchar = substr($url ,0,1);
if ($url_firstchar == '/' && $GLOBALS['phpgw_info']['server']['webserver_url'] == '/')
{
$kp3 = $GLOBALS['phpgw_info']['user']['kp3'];
$full_scriptname = False;
}
// Explicit hack to work around problems with php running as CGI on windows
// please let us know if this doesn't work for you!
// I am not sure how my changes will affect the following.
// Could someone with access to a Windows install check it ? (jengo)
/* if (! $url && (PHP_OS == 'Windows' || PHP_OS == 'OS/2' || PHP_OS == 'WIN32' || PHP_OS == 'WIN16'))
if ($url_firstchar != '/')
{
$exe = strpos($GLOBALS['PHP_SELF'],'php.exe');
if ($exe != false) {
$exe += 7; // strlen('php.exe')
$url_root = split ('/', $GLOBALS['phpgw_info']['server']['webserver_url']);
$url = (strlen($url_root[0])? $url_root[0].'//':'') . $url_root[2];
$url .= substr($PHP_SELF,$exe,strlen($GLOBALS['PHP_SELF'])-$exe);
$app = $GLOBALS['phpgw_info']['flags']['currentapp'];
if ($app != 'home' && $app != 'login' && $app != 'logout')
{
$url = $app.'/'.$url;
}
}
*/
$url = $GLOBALS['phpgw_info']['server']['webserver_url'] . $url;
// This needs to be tested as well. (jengo)
/* if (! $url)
{
$url_root = split ('/', $GLOBALS['phpgw_info']['server']['webserver_url']);
// Some hosting providers have their paths screwy.
// If the value from $PHP_SELF is not what you expect, you can use this to patch it
// It will need to be adjusted to your specific problem tho.
//
//$patched_php_self = str_replace('/php4/php/phpgroupware', '/phpgroupware', $GLOBALS['PHP_SELF']);
$patched_php_self = $GLOBALS['PHP_SELF'];
$url = (strlen($url_root[0])? $url_root[0].'//':'') . $url_root[2] . $patched_php_self;
}
*/
// build the extravars string from a array
if($full_scriptname)
{
$webserver_url_count = strlen($GLOBALS['phpgw_info']['server']['webserver_url'])-1;
if(substr($GLOBALS['phpgw_info']['server']['webserver_url'] ,$webserver_url_count,1) != '/' && $url_firstchar != '/')
{
$url = $GLOBALS['phpgw_info']['server']['webserver_url'] .'/'. $url;
}
else
{
$url = $GLOBALS['phpgw_info']['server']['webserver_url'] . $url;
}
}
if(@isset($GLOBALS['phpgw_info']['server']['enforce_ssl']) && $GLOBALS['phpgw_info']['server']['enforce_ssl'] && !$GLOBALS['HTTP_SERVER_VARS']['HTTPS'])
{
if(substr($url ,0,4) != 'http')
{
$url = 'https://'.$GLOBALS['phpgw_info']['server']['hostname'].$url;
}
else
{
$url = str_replace ( 'http:', 'https:', $url);
}
}
/* Now we process the extravars into a proper url format */
/* if its not an array, then we turn it into one */
/* We do this to help prevent any duplicates from being sent. */
if (!is_array($extravars) && $extravars != '')
{
$a = explode('&', $extravars);
$i = 0;
while ($i < count($a))
{
$b = split('=', $a[$i]);
$new_extravars[$b[0]] = $b[1];
$i++;
}
$extravars = $new_extravars;
unset($new_extravars);
}
/* if using frames we make sure there is a framepart */
if(@defined('PHPGW_USE_FRAMES') && PHPGW_USE_FRAMES)
{
if (!isset($extravars['framepart']))
{
$extravars['framepart']='body';
}
}
/* add session params if not using cookies */
if (@!$GLOBALS['phpgw_info']['server']['usecookies'])
{
$kp3 = get_var('kp3',Array('COOKIE','GET'));
if (!$kp3)
{
$kp3 = $GLOBALS['phpgw_info']['user']['kp3'];
}
$extravars['sessionid'] = @$GLOBALS['phpgw_info']['user']['sessionid'];
$extravars['kp3'] = $kp3;
$extravars['domain'] = @$GLOBALS['phpgw_info']['user']['domain'];
}
/* if we end up with any extravars then we generate the url friendly string */
/* and return the result */
if (is_array($extravars))
{
reset($extravars);
while(list($key,$value) = each($extravars))
{
if (!empty($new_extravars))
{
$new_extravars .= '&';
}
$new_extravars .= "$key=$value";
$new_extravars .= $key.'='.htmlentities(urlencode($value));
}
// This needs to be explictly reset to a string variable type for PHP3
/* This needs to be explictly reset to a string variable type for PHP3 */
settype($extravars,'string');
$extravars = $new_extravars;
unset($new_extravars);
return $url .= '?' . $extravars;
}
if (isset($GLOBALS['phpgw_info']['server']['usecookies']) && $GLOBALS['phpgw_info']['server']['usecookies'])
{
if ($extravars)
{
$url .= '?' . $extravars;
}
}
else
{
$sessionID = 'sessionid=' . @$GLOBALS['phpgw_info']['user']['sessionid'];
$sessionID .= '&kp3=' . $kp3;
$sessionID .= '&domain=' . @$GLOBALS['phpgw_info']['user']['domain'];
// This doesn't belong in the API.
// Its up to the app to pass this value. (jengo)
// Putting it into the app requires a massive number of updates in email app.
// Until that happens this needs to stay here (seek3r)
if (isset($GLOBALS['phpgw_info']['flags']['newsmode']) &&
$GLOBALS['phpgw_info']['flags']['newsmode'])
{
$url .= '&newsmode=on';
}
if ($extravars)
{
$url .= '?' . $extravars . '&' . $sessionID;
}
else
{
$url .= '?' . $sessionID;
}
}
/* $url = str_replace('/?', '/index.php?', $url);
$webserver_url_count = strlen($GLOBALS['phpgw_info']['server']['webserver_url']);
$slash_check = strtolower(substr($url ,0,1));
if (substr($url ,0,$webserver_url_count) != $GLOBALS['phpgw_info']['server']['webserver_url'])
{
$app = $GLOBALS['phpgw_info']['flags']['currentapp'];
if ($slash_check == '/')
{
$url = $GLOBALS['phpgw_info']['server']['webserver_url'] . $url;
}
elseif ($app == 'home' || $app == 'logout' || $app == 'login')
{
$url = $GLOBALS['phpgw_info']['server']['webserver_url'].'/'.$url;
}
else
{
$url = $GLOBALS['phpgw_info']['server']['webserver_url'].'/'.$app.'/'.$url;
}
} */
//echo "$url\n";
/* if no extravars then we return the cleaned up url/scriptname */
return $url;
}
}

View File

@ -841,117 +841,109 @@
\*************************************************************************/
function link($url, $extravars = '')
{
$kp3 = get_var('kp3',Array('COOKIE','GET'));
/* first we process the $url to build the full scriptname */
$full_scriptname = True;
if (! $kp3)
$url_firstchar = substr($url ,0,1);
if ($url_firstchar == '/' && $GLOBALS['phpgw_info']['server']['webserver_url'] == '/')
{
$kp3 = $GLOBALS['phpgw_info']['user']['kp3'];
$full_scriptname = False;
}
// Explicit hack to work around problems with php running as CGI on windows
// please let us know if this doesn't work for you!
// I am not sure how my changes will affect the following.
// Could someone with access to a Windows install check it ? (jengo)
/* if (! $url && (PHP_OS == 'Windows' || PHP_OS == 'OS/2' || PHP_OS == 'WIN32' || PHP_OS == 'WIN16'))
if ($url_firstchar != '/')
{
$exe = strpos($GLOBALS['PHP_SELF'],'php.exe');
if ($exe != false) {
$exe += 7; // strlen('php.exe')
$url_root = split ('/', $GLOBALS['phpgw_info']['server']['webserver_url']);
$url = (strlen($url_root[0])? $url_root[0].'//':'') . $url_root[2];
$url .= substr($PHP_SELF,$exe,strlen($GLOBALS['PHP_SELF'])-$exe);
$app = $GLOBALS['phpgw_info']['flags']['currentapp'];
if ($app != 'home' && $app != 'login' && $app != 'logout')
{
$url = $app.'/'.$url;
}
}
*/
$url = $GLOBALS['phpgw_info']['server']['webserver_url'] . $url;
// This needs to be tested as well. (jengo)
/* if (! $url)
{
$url_root = split ('/', $GLOBALS['phpgw_info']['server']['webserver_url']);
// Some hosting providers have their paths screwy.
// If the value from $PHP_SELF is not what you expect, you can use this to patch it
// It will need to be adjusted to your specific problem tho.
//
//$patched_php_self = str_replace('/php4/php/phpgroupware', '/phpgroupware', $GLOBALS['PHP_SELF']);
$patched_php_self = $GLOBALS['PHP_SELF'];
$url = (strlen($url_root[0])? $url_root[0].'//':'') . $url_root[2] . $patched_php_self;
}
*/
// build the extravars string from a array
if($full_scriptname)
{
$webserver_url_count = strlen($GLOBALS['phpgw_info']['server']['webserver_url'])-1;
if(substr($GLOBALS['phpgw_info']['server']['webserver_url'] ,$webserver_url_count,1) != '/' && $url_firstchar != '/')
{
$url = $GLOBALS['phpgw_info']['server']['webserver_url'] .'/'. $url;
}
else
{
$url = $GLOBALS['phpgw_info']['server']['webserver_url'] . $url;
}
}
if(@isset($GLOBALS['phpgw_info']['server']['enforce_ssl']) && $GLOBALS['phpgw_info']['server']['enforce_ssl'] && !$GLOBALS['HTTP_SERVER_VARS']['HTTPS'])
{
if(substr($url ,0,4) != 'http')
{
$url = 'https://'.$GLOBALS['phpgw_info']['server']['hostname'].$url;
}
else
{
$url = str_replace ( 'http:', 'https:', $url);
}
}
/* Now we process the extravars into a proper url format */
/* if its not an array, then we turn it into one */
/* We do this to help prevent any duplicates from being sent. */
if (!is_array($extravars) && $extravars != '')
{
$a = explode('&', $extravars);
$i = 0;
while ($i < count($a))
{
$b = split('=', $a[$i]);
$new_extravars[$b[0]] = $b[1];
$i++;
}
$extravars = $new_extravars;
unset($new_extravars);
}
/* if using frames we make sure there is a framepart */
if(@defined('PHPGW_USE_FRAMES') && PHPGW_USE_FRAMES)
{
if (!isset($extravars['framepart']))
{
$extravars['framepart']='body';
}
}
/* add session params if not using cookies */
if (@!$GLOBALS['phpgw_info']['server']['usecookies'])
{
$kp3 = get_var('kp3',Array('COOKIE','GET'));
if (!$kp3)
{
$kp3 = $GLOBALS['phpgw_info']['user']['kp3'];
}
$extravars['sessionid'] = @$GLOBALS['phpgw_info']['user']['sessionid'];
$extravars['kp3'] = $kp3;
$extravars['domain'] = @$GLOBALS['phpgw_info']['user']['domain'];
}
/* if we end up with any extravars then we generate the url friendly string */
/* and return the result */
if (is_array($extravars))
{
reset($extravars);
while(list($key,$value) = each($extravars))
{
if (!empty($new_extravars))
{
$new_extravars .= '&';
}
$new_extravars .= "$key=$value";
$new_extravars .= $key.'='.htmlentities(urlencode($value));
}
// This needs to be explictly reset to a string variable type for PHP3
/* This needs to be explictly reset to a string variable type for PHP3 */
settype($extravars,'string');
$extravars = $new_extravars;
unset($new_extravars);
return $url .= '?' . $extravars;
}
if (isset($GLOBALS['phpgw_info']['server']['usecookies']) && $GLOBALS['phpgw_info']['server']['usecookies'])
{
if ($extravars)
{
$url .= '?' . $extravars;
}
}
else
{
$sessionID = 'sessionid=' . @$GLOBALS['phpgw_info']['user']['sessionid'];
$sessionID .= '&kp3=' . $kp3;
$sessionID .= '&domain=' . @$GLOBALS['phpgw_info']['user']['domain'];
// This doesn't belong in the API.
// Its up to the app to pass this value. (jengo)
// Putting it into the app requires a massive number of updates in email app.
// Until that happens this needs to stay here (seek3r)
if (isset($GLOBALS['phpgw_info']['flags']['newsmode']) &&
$GLOBALS['phpgw_info']['flags']['newsmode'])
{
$url .= '&newsmode=on';
}
if ($extravars)
{
$url .= '?' . $extravars . '&' . $sessionID;
}
else
{
$url .= '?' . $sessionID;
}
}
/* $url = str_replace('/?', '/index.php?', $url);
$webserver_url_count = strlen($GLOBALS['phpgw_info']['server']['webserver_url']);
$slash_check = strtolower(substr($url ,0,1));
if (substr($url ,0,$webserver_url_count) != $GLOBALS['phpgw_info']['server']['webserver_url'])
{
$app = $GLOBALS['phpgw_info']['flags']['currentapp'];
if ($slash_check == '/')
{
$url = $GLOBALS['phpgw_info']['server']['webserver_url'] . $url;
}
elseif ($app == 'home' || $app == 'logout' || $app == 'login')
{
$url = $GLOBALS['phpgw_info']['server']['webserver_url'].'/'.$url;
}
else
{
$url = $GLOBALS['phpgw_info']['server']['webserver_url'].'/'.$app.'/'.$url;
}
} */
//echo "$url\n";
/* if no extravars then we return the cleaned up url/scriptname */
return $url;
}
}

View File

@ -340,87 +340,146 @@
}
}
function registervar($varname, $valuetype = 'alpha', $posttype = 'post', $allowblank = True)
function reg_var($varname, $method = 'any', $valuetype = 'alphanumeric',$default_value='',$register=True)
{
switch ($posttype)
if($method == 'any')
{
case 'get':
$posttype = 'HTTP_GET_VARS';
break;
case 'cookie':
$posttype = 'HTTP_COOKIE_VARS';
break;
default :
$posttype = 'HTTP_POST_VARS';
$method = Array('POST','GET','COOKIE','SERVER','GLOBAL','DEFAULT');
}
if (isset($GLOBALS[$posttype][$varname]))
elseif(!is_array($method))
{
if (!is_array($GLOBALS[$posttype][$varname]))
$method = Array($method);
}
$cnt = count($method);
for($i=0;$i<$cnt;$i++)
{
switch(strtoupper($method[$i]))
{
if ($allowblank == True && $GLOBALS[$posttype][$varname] == '')
{
$GLOBALS['phpgw_info'][$GLOBALS['phpgw_info']['flags']['currentapp']][$varname] = $GLOBALS[$posttype][$varname];
return 'Post';
}
else
{
if (sanitize($GLOBALS[$posttype][$varname],$valuetype) == 1)
case 'DEFAULT':
if($default_value)
{
$GLOBALS['phpgw_info'][$GLOBALS['phpgw_info']['flags']['currentapp']][$varname] = $GLOBALS[$posttype][$varname];
return 'Post';
$value = $default_value;
$i = $cnt+1; /* Found what we were looking for, now we end the loop */
}
break;
case 'GLOBAL':
if(@isset($GLOBALS[$varname]))
{
$value = $GLOBALS[$varname];
$i = $cnt+1;
}
break;
case 'POST':
case 'GET':
case 'COOKIE':
case 'SERVER':
if(phpversion() >= '4.2.0')
{
$meth = '_'.strtoupper($method[$i]);
}
else
{
return False;
$meth = 'HTTP_'.strtoupper($method[$i]).'_VARS';
}
}
return False;
if(@isset($GLOBALS[$meth][$varname]))
{
$value = $GLOBALS[$meth][$varname];
$i = $cnt+1;
}
break;
default:
if(@isset($GLOBALS[strtoupper($method[$i])][$varname]))
{
$value = $GLOBALS[strtoupper($method[$i])][$varname];
$i = $cnt+1;
}
break;
}
}
if (@!isset($value))
{
$value = $default_value;
}
if (@!is_array($value))
{
if ($value == '')
{
$result = $value;
}
else
{
if (is_array($valuetype))
if (sanitize($value,$valuetype) == 1)
{
reset($GLOBALS[$posttype][$varname]);
$isvalid = True;
while(list($key, $value) = each($GLOBALS[$posttype][$varname]))
{
if ($allowblank == True && $GLOBALS[$posttype][$varname][$key] == '')
{
}
else
{
if (sanitize($GLOBALS[$posttype][$varname][$key],$valuetype[$key]) == 1)
{
}
else
{
$isvalid = False;
}
}
}
if ($isvalid)
{
$GLOBALS['phpgw_info'][$GLOBALS['phpgw_info']['flags']['currentapp']][$varname] = $GLOBALS[$posttype][$varname];
return 'Post';
}
else
{
return 'Session';
}
return False;
$result = $value;
}
else
{
$result = $default_value;
}
}
return False;
}
elseif (count($GLOBALS[$posttype]) == 0)
{
return 'Session';
}
else
{
return False;
reset($value);
while(list($k, $v) = each($value))
{
if ($v == '')
{
$result[$k] = $v;
}
else
{
if (is_array($valuetype))
{
$vt = $valuetype[$k];
}
else
{
$vt = $valuetype;
}
if (sanitize($v,$vt) == 1)
{
$result[$k] = $v;
}
else
{
if (is_array($default_value))
{
$result[$k] = $default_value[$k];
}
else
{
$result[$k] = $default_value;
}
}
}
}
}
if($register)
{
$GLOBALS['phpgw_info'][$GLOBALS['phpgw_info']['flags']['currentapp']][$varname] = $result;
}
return $result;
}
/*!
@function get_var
@abstract retrieve a value from either a POST, GET, COOKIE, SERVER or from a class variable.
@author skeeter
@discussion This function is used to retrieve a value from a user defined order of methods.
@syntax get_var('id',array('HTTP_POST_VARS'||'POST','HTTP_GET_VARS'||'GET','HTTP_COOKIE_VARS'||'COOKIE','GLOBAL','DEFAULT'));
@example $this->id = get_var('id',array('HTTP_POST_VARS'||'POST','HTTP_GET_VARS'||'GET','HTTP_COOKIE_VARS'||'COOKIE','GLOBAL','DEFAULT'));
@param $variable name
@param $method ordered array of methods to search for supplied variable
@param $default_value (optional)
*/
function get_var($variable,$method='any',$default_value='')
{
return reg_var($variable,$method,'any',$default_value,False);
}
/*!
@ -442,63 +501,6 @@
}
}
/*!
@function get_var
@abstract retrieve a value from either a POST, GET, COOKIE, SERVER or from a class variable.
@author skeeter
@discussion This function is used to retrieve a value from a user defined order of methods.
@syntax get_var('id',array('HTTP_POST_VARS'||'POST','HTTP_GET_VARS'||'GET','HTTP_COOKIE_VARS'||'COOKIE','GLOBAL','DEFAULT'));
@example $this->id = get_var('id',array('HTTP_POST_VARS'||'POST','HTTP_GET_VARS'||'GET','HTTP_COOKIE_VARS'||'COOKIE','GLOBAL','DEFAULT'));
@param $variable name
@param $method ordered array of methods to search for supplied variable
@param $default_value (optional)
*/
function get_var($variable,$method,$default_value='')
{
for($i=0;$i<count($method);$i++)
{
switch(strtoupper($method[$i]))
{
case 'DEFAULT':
if($default_value)
{
$var = $default_value;
}
break;
case 'GLOBAL':
if(@isset($GLOBALS[$variable]))
{
$var = $GLOBALS[$variable];
}
break;
case 'POST':
case 'GET':
case 'COOKIE':
case 'SERVER':
if(phpversion() >= '4.2.0')
{
$meth = '_'.strtoupper($method[$i]);
}
else
{
$meth = 'HTTP_'.strtoupper($method[$i]).'_VARS';
}
if(@isset($GLOBALS[$meth][$variable]))
{
$var = $GLOBALS[$meth][$variable];
}
break;
default:
if(@isset($GLOBALS[strtoupper($method[$i])][$variable]))
{
$var = $GLOBALS[strtoupper($method[$i])][$variable];
}
break;
}
}
return (@$var?$var:'');
}
/*!
@function CreateObject
@abstract Load a class and include the class file if not done so already.

View File

@ -79,11 +79,8 @@
/* Make sure the developer is following the rules. */
if (!isset($GLOBALS['phpgw_info']['flags']['currentapp']))
{
/* This object does not exist yet. */
/* $GLOBALS['phpgw']->log->write(array('text'=>'W-MissingFlags, currentapp flag not set'));*/
echo '<b>!!! YOU DO NOT HAVE YOUR $GLOBALS[\'phpgw_info\'][\'flags\'][\'currentapp\'] SET !!!';
echo '<br>!!! PLEASE CORRECT THIS SITUATION !!!</b>';
$msgstring = '<b>!!! YOU DO NOT HAVE YOUR $GLOBALS[\'phpgw_info\'][\'flags\'][\'currentapp\'] SET !!!<br>!!! PLEASE CORRECT THIS SITUATION !!!</b>';
$GLOBALS['phpgw_info']['flags']['msgbox_data'][$msgstring]=False;
}
magic_quotes_runtime(false);
@ -232,11 +229,6 @@
}
unset($cache_query);
unset($server_info_cache);
if(@isset($GLOBALS['phpgw_info']['server']['enforce_ssl']) && !$HTTPS)
{
Header('Location: https://' . $GLOBALS['phpgw_info']['server']['hostname'] . $GLOBALS['phpgw_info']['server']['webserver_url'] . $REQUEST_URI);
exit;
}
/************************************************************************\
* Required classes *
@ -282,6 +274,11 @@
{
if ($GLOBALS['phpgw_info']['flags']['currentapp'] == 'login')
{
if(@isset($GLOBALS['phpgw_info']['server']['enforce_ssl']) && $GLOBALS['phpgw_info']['server']['enforce_ssl'] && !$GLOBALS['HTTP_SERVER_VARS']['HTTPS'])
{
Header('Location: https://'.$GLOBALS['phpgw_info']['server']['hostname'].$GLOBALS['HTTP_SERVER_VARS']['REQUEST_URI']);
exit;
}
if (@$login != '')
{
$login_array = explode("@",$login);
@ -301,13 +298,15 @@
{
if (! $GLOBALS['phpgw']->session->verify())
{
Header('Location: ' . $GLOBALS['phpgw']->redirect($GLOBALS['phpgw']->session->link('/login.php','cd=10')));
Header('Location: ' . $GLOBALS['phpgw']->redirect($GLOBALS['phpgw']->session->link('/login.php','code=10')));
exit;
}
$GLOBALS['phpgw']->datetime = CreateObject('phpgwapi.datetime');
/* A few hacker resistant constants that will be used throught the program */
$GLOBALS['phpgw_info']['user']['preferences']['common']['template_set'] = 'default';
define('PHPGW_TEMPLATE_DIR', ExecMethod('phpgwapi.phpgw.common.get_tpl_dir', 'phpgwapi'));
define('PHPGW_IMAGES_DIR', ExecMethod('phpgwapi.phpgw.common.get_image_path', 'phpgwapi'));
define('PHPGW_IMAGES_FILEDIR', ExecMethod('phpgwapi.phpgw.common.get_image_dir', 'phpgwapi'));
@ -317,6 +316,105 @@
define('PHPGW_IMAGES', ExecMethod('phpgwapi.phpgw.common.get_image_path'));
define('PHPGW_APP_IMAGES_DIR', ExecMethod('phpgwapi.phpgw.common.get_image_dir'));
/*************************************************************************\
* These lines load up the templates class and set some default values *
\*************************************************************************/
$GLOBALS['phpgw']->template = CreateObject('phpgwapi.Template',PHPGW_TEMPLATE_DIR);
$GLOBALS['phpgw']->template->set_file('common', 'common.tpl');
$GLOBALS['phpgw']->template->set_file('phpgw', 'phpgw.tpl');
$GLOBALS['phpgw']->template->set_file('msgbox', 'msgbox.tpl');
/* This will bring in the template sets parts definitions */
if (file_exists(PHPGW_TEMPLATE_DIR . '/parts.inc.php'))
{
include(PHPGW_TEMPLATE_DIR . '/parts.inc.php');
}
$val = $GLOBALS['phpgw']->template->get_var('phpgw_top_height');
if (empty($val))
{
$GLOBALS['phpgw']->template->set_var('phpgw_top_height','10');
}
$val = $GLOBALS['phpgw']->template->get_var('phpgw_left_width');
if (empty($val))
{
$GLOBALS['phpgw']->template->set_var('phpgw_left_width','10');
}
$val = $GLOBALS['phpgw']->template->get_var('phpgw_right_width');
if (empty($val))
{
$GLOBALS['phpgw']->template->set_var('phpgw_right_width','10');
}
$val = $GLOBALS['phpgw']->template->get_var('phpgw_bottom_height');
if (empty($val))
{
$GLOBALS['phpgw']->template->set_var('phpgw_bottom_height','10');
}
$GLOBALS['phpgw']->template->set_var('phpgw_head_charset',lang('charset'));
$GLOBALS['phpgw']->template->set_var('phpgw_head_description','phpGroupWare');
$GLOBALS['phpgw']->template->set_var('phpgw_head_keywords','phpGroupWare');
if(@isset($GLOBALS['phpgw_info']['server']['enforce_ssl']) && $GLOBALS['phpgw_info']['server']['enforce_ssl'] && !$GLOBALS['HTTP_SERVER_VARS']['HTTPS'])
{
$GLOBALS['phpgw']->template->set_var('phpgw_head_base','https://'.$GLOBALS['phpgw_info']['server']['hostname'].$GLOBALS['phpgw_info']['server']['webserver_url'].'/');
}
else
{
$GLOBALS['phpgw']->template->set_var('phpgw_head_base',$GLOBALS['phpgw_info']['server']['webserver_url'].'/');
}
$GLOBALS['phpgw']->template->set_var('phpgw_head_browser_ico','favicon.ico');
$GLOBALS['phpgw']->template->set_var('phpgw_head_website_title', $GLOBALS['phpgw_info']['server']['site_title']);
/*************************************************************************\
* If they are using frames, we need to set some variables *
\*************************************************************************/
if(@isset($GLOBALS['HTTP_GET_VARS']['framepart']) &&
( $GLOBALS['HTTP_GET_VARS']['framepart'] == 'unsupported' ||
$GLOBALS['HTTP_GET_VARS']['framepart'] == 'top' ||
$GLOBALS['HTTP_GET_VARS']['framepart'] == 'left' ||
$GLOBALS['HTTP_GET_VARS']['framepart'] == 'body' ||
$GLOBALS['HTTP_GET_VARS']['framepart'] == 'right' ||
$GLOBALS['HTTP_GET_VARS']['framepart'] == 'bottom'
))
{
define('PHPGW_FRAME_PART',$GLOBALS['HTTP_GET_VARS']['framepart']);
}
else
{
define('PHPGW_FRAME_PART','start');
}
//$GLOBALS['phpgw_info']['server']['useframes'] = 'always';
if(((isset($GLOBALS['phpgw_info']['user']['preferences']['common']['useframes']) &&
$GLOBALS['phpgw_info']['user']['preferences']['common']['useframes'] &&
$GLOBALS['phpgw_info']['server']['useframes'] == 'allowed') ||
$GLOBALS['phpgw_info']['server']['useframes'] == 'always') &&
PHPGW_FRAME_PART != 'unsupported')
{
define('PHPGW_USE_FRAMES',True);
define('PHPGW_NAVBAR_TARGET','body');
if (PHPGW_FRAME_PART == 'start')
{
$GLOBALS['phpgw']->template->set_var('phpgw_top_link',$GLOBALS['phpgw']->session->link('home.php','framepart=top'));
$GLOBALS['phpgw']->template->set_var('phpgw_right_link',$GLOBALS['phpgw']->session->link('home.php','framepart=right'));
$GLOBALS['phpgw']->template->set_var('phpgw_body_link',$GLOBALS['phpgw']->session->link('home.php','framepart=body'));
$GLOBALS['phpgw']->template->set_var('phpgw_left_link',$GLOBALS['phpgw']->session->link('home.php','framepart=left'));
$GLOBALS['phpgw']->template->set_var('phpgw_bottom_link',$GLOBALS['phpgw']->session->link('home.php','framepart=bottom'));
$GLOBALS['phpgw']->template->set_block('phpgw','phpgw_main_frames','phpgw_main');
}
else
{
$GLOBALS['phpgw']->template->set_block('phpgw','phpgw_main_basic','phpgw_main');
}
}
else
{
define('PHPGW_USE_FRAMES',False);
define('PHPGW_NAVBAR_TARGET','_self');
$GLOBALS['phpgw']->template->set_block('phpgw','phpgw_main_tables','phpgw_main');
}
$GLOBALS['phpgw']->template->set_var('phpgw_head_target',PHPGW_NAVBAR_TARGET);
/* define('PHPGW_APP_IMAGES_DIR', $GLOBALS['phpgw']->common->get_image_dir()); */
/* Moved outside of this logic
@ -394,8 +492,6 @@
/* complety back screen and not know whats going on */
echo '<body bgcolor="FFFFFF">';
$GLOBALS['phpgw']->log->write(array('text'=>'F-Abort, No themes found'));
exit;
}
if (isset($GLOBALS['phpgw_info']['theme']['hovlink'])
@ -417,54 +513,141 @@
{
include(PHPGW_APP_TPL . '/css.inc.php');
}
unset($theme_to_load);
/* This covers setting the theme values so that each app doesnt have to */
$theme_data = $GLOBALS['phpgw_info']['theme'];
unset($theme_data['css']);
$GLOBALS['phpgw']->template->set_var($theme_data);
unset($theme_data);
$GLOBALS['phpgw']->template->update_css();
// if(!PHPGW_USE_FRAMES || (PHPGW_USE_FRAMES && PHPGW_NAVBAR_TARGET != 'body'))
// {
$GLOBALS['phpgw']->common->navbar();
// }
/*************************************************************************\
* These lines load up the templates class *
* load up top part if appropriate *
\*************************************************************************/
if(!@$GLOBALS['phpgw_info']['flags']['disable_Template_class'])
if(!PHPGW_USE_FRAMES || PHPGW_FRAME_PART == 'top')
{
$GLOBALS['phpgw']->template = CreateObject('phpgwapi.Template',PHPGW_APP_TPL);
}
/*************************************************************************\
* Verify that the users session is still active otherwise kick them out *
\*************************************************************************/
if ($GLOBALS['phpgw_info']['flags']['currentapp'] != 'home' &&
$GLOBALS['phpgw_info']['flags']['currentapp'] != 'preferences' &&
$GLOBALS['phpgw_info']['flags']['currentapp'] != 'about')
{
// This will need to use ACL in the future
if (! $GLOBALS['phpgw_info']['user']['apps'][$GLOBALS['phpgw_info']['flags']['currentapp']] ||
(@$GLOBALS['phpgw_info']['flags']['admin_only'] &&
! $GLOBALS['phpgw_info']['user']['apps']['admin']))
if(!PHPGW_USE_FRAMES)
{
$GLOBALS['phpgw']->log->write(array('text'=>'W-Permissions, Attempted to access %1','p1'=>$GLOBALS['phpgw_info']['flags']['currentapp']));
$GLOBALS['phpgw_info']['flags']['msgbox_data']['Access not permitted']=False;
$GLOBALS['phpgw']->common->phpgw_header();
$GLOBALS['phpgw']->common->phpgw_exit(True);
$output = 'phpgw_top';
}
else
{
$output = 'phpgw_body';
}
if(function_exists('parse_toppart'))
{
parse_toppart($output);
}
if(PHPGW_USE_FRAMES)
{
$GLOBALS['phpgw']->common->phpgw_footer();
}
}
/*************************************************************************\
* Load the header unless the developer turns it off *
* load up left part if appropriate *
\*************************************************************************/
$GLOBALS['phpgw']->common->phpgw_header(False, False);
/*************************************************************************\
* Load the app include files if the exists *
\*************************************************************************/
/* Then the include file */
if (! preg_match ("/phpgwapi/i", PHPGW_APP_INC) && file_exists(PHPGW_APP_INC . '/functions.inc.php') && !MENUACTION)
if(!PHPGW_USE_FRAMES || PHPGW_FRAME_PART == 'left')
{
include(PHPGW_APP_INC . '/functions.inc.php');
if(!PHPGW_USE_FRAMES)
{
$output = 'phpgw_left';
}
else
{
$output = 'phpgw_body';
}
if(function_exists('parse_leftpart'))
{
parse_leftpart($output);
}
if(PHPGW_USE_FRAMES)
{
$GLOBALS['phpgw']->common->phpgw_footer();
}
}
if (!@$GLOBALS['phpgw_info']['flags']['noappheader'])
/*************************************************************************\
* load up right part if appropriate *
\*************************************************************************/
if(!PHPGW_USE_FRAMES || PHPGW_FRAME_PART == 'right')
{
$GLOBALS['phpgw']->common->phpgw_appheader();
if(!PHPGW_USE_FRAMES)
{
$output = 'phpgw_right';
}
else
{
$output = 'phpgw_body';
}
if(function_exists('parse_rightpart'))
{
parse_rightpart($output);
}
if(PHPGW_USE_FRAMES)
{
$GLOBALS['phpgw']->common->phpgw_footer();
}
}
/*************************************************************************\
* load up bottom part if appropriate *
\*************************************************************************/
if(!PHPGW_USE_FRAMES || PHPGW_FRAME_PART == 'bottom')
{
if(!PHPGW_USE_FRAMES)
{
$output = 'phpgw_bottom';
}
else
{
$output = 'phpgw_body';
}
if(function_exists('parse_bottompart'))
{
parse_bottompart($output);
}
if(PHPGW_USE_FRAMES)
{
// $GLOBALS['phpgw']->common->phpgw_footer();
}
}
/*************************************************************************\
* load up body/appspace if appropriate *
\*************************************************************************/
if(!PHPGW_USE_FRAMES || PHPGW_FRAME_PART == 'body')
{
/* Verify that user has rights to the currentapp */
$continue_app_data = True;
if ($GLOBALS['phpgw_info']['flags']['currentapp'] != 'home' &&
$GLOBALS['phpgw_info']['flags']['currentapp'] != 'preferences' &&
$GLOBALS['phpgw_info']['flags']['currentapp'] != 'about')
{
// This will need to use ACL in the future
if (! $GLOBALS['phpgw_info']['user']['apps'][$GLOBALS['phpgw_info']['flags']['currentapp']] ||
(@$GLOBALS['phpgw_info']['flags']['admin_only'] &&
! $GLOBALS['phpgw_info']['user']['apps']['admin']))
{
$GLOBALS['phpgw']->log->write(array('text'=>'W-Permissions, Attempted to access %1','p1'=>$GLOBALS['phpgw_info']['flags']['currentapp']));
$GLOBALS['phpgw_info']['flags']['msgbox_data']['Access not permitted']=False;
$continue_app_data = False;
$GLOBALS['phpgw']->template->set_var('phpgw_body',"user has no rights to this app!!!<br>\n");
//$GLOBALS['phpgw']->common->phpgw_display();
//$GLOBALS['phpgw']->common->phpgw_exit(True);
}
}
if($continue_app_data)
{
$GLOBALS['phpgw']->template->set_root(PHPGW_APP_TPL);
if (! preg_match ("/phpgwapi/i", PHPGW_APP_INC) && file_exists(PHPGW_APP_INC . '/functions.inc.php') && !MENUACTION)
{
include(PHPGW_APP_INC . '/functions.inc.php');
}
}
}
}
error_reporting(E_ERROR | E_WARNING | E_PARSE);

View File

@ -1,10 +0,0 @@
<!-- BEGIN footer -->
<P>
<table border="0" cellspacing="0" cellpadding="0" width="100%" bgcolor="{table_bg_color}">
<TR>
<TD align="center">{msg}<br></TD>
</TR>
</Table>
<!-- END footer -->

View File

@ -1,7 +0,0 @@
<!-- BEGIN frames -->
<html>
<frameset rows="{frame_size}" border="0">
{frames_}
</frameset>
</html>
<!-- END frames -->

View File

@ -1,3 +0,0 @@
<!-- BEGIN frame_body -->
<frame src="{body_link}" name="phpgw_body">
<!-- END frame_body -->

View File

@ -1,3 +0,0 @@
<!-- BEGIN frame_navbar -->
<frame src="{navbar_link}" name="phpgw_navbar" scrolling="no">
<!-- END frame_navbar -->

View File

@ -1,46 +0,0 @@
<?php
/**************************************************************************\
* phpGroupWare *
* http://www.phpgroupware.org *
* -------------------------------------------- *
* This program is free software; you can redistribute it and/or modify it *
* under the terms of the GNU General Public License as published by the *
* Free Software Foundation; either version 2 of the License, or (at your *
* option) any later version. *
\**************************************************************************/
/* $Id$ */
$app_css = '';
if(@isset($GLOBALS['HTTP_GET_VARS']['menuaction']))
{
list($app,$class,$method) = explode('.',$GLOBALS['HTTP_GET_VARS']['menuaction']);
if(is_array($GLOBALS[$class]->public_functions) && $GLOBALS[$class]->public_functions['css'])
{
$app_css = $GLOBALS[$class]->css();
}
}
$bodyheader = 'BGCOLOR="'.$GLOBALS['phpgw_info']['theme']['bg_color'].'"';
if ($GLOBALS['phpgw_info']['server']['htmlcompliant'])
{
$bodyheader .= ' ALINK="'.$GLOBALS['phpgw_info']['theme']['alink'].'" LINK="'.$GLOBALS['phpgw_info']['theme']['link'].'" VLINK="'.$GLOBALS['phpgw_info']['theme']['vlink'].'"';
}
$tpl = CreateObject('phpgwapi.Template',PHPGW_TEMPLATE_DIR);
$tpl->set_unknowns('remove');
$tpl->set_file(array('head' => 'head.tpl'));
$var = Array (
'img_icon' => PHPGW_IMAGES_DIR . '/favicon.ico',
'img_shortcut' => PHPGW_IMAGES_DIR . '/favicon.ico',
'charset' => lang('charset'),
'font_family' => $GLOBALS['phpgw_info']['theme']['font'],
'website_title' => $GLOBALS['phpgw_info']['server']['site_title'],
'body_tags' => $bodyheader,
'app_css' => $app_css
);
$tpl->set_var($var);
$tpl->pfp('out','head');
unset($tpl);
?>

View File

@ -1,26 +0,0 @@
<!-- BEGIN head -->
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<HTML>
<HEAD>
<META http-equiv="Content-Type" content="text/html; charset={charset}">
<META name="AUTHOR" content="phpGroupWare http://www.phpgroupware.org">
<META NAME="description" CONTENT="phpGroupWare">
<META NAME="keywords" CONTENT="phpGroupWare">
<meta name="robots" content="none">
<LINK REL="ICON" href="{img_icon}" type="image/x-ico">
<LINK REL="SHORTCUT ICON" href="{img_shortcut}">
<STYLE type="text/css">
<!--
a { text-decoration:none; }
A:link{ text-decoration:none }
A:visted{ text-decoration:none }
A:active{ text-decoration:none }
body { margin-top: 0px; margin-right: 0px; margin-left: 0px; font-family: {font_family} }
.tablink { color: #000000; }
{app_css}
-->
</STYLE>
<TITLE>{website_title}</TITLE>
</HEAD>
<BODY {body_tags}>
<!-- END Head -->

Binary file not shown.

After

Width:  |  Height:  |  Size: 43 B

View File

@ -1,20 +1,7 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<HTML>
<!-- BEGIN login_form -->
<HEAD>
<META http-equiv="Content-Type" content="text/html; charset={charset}">
<META name="AUTHOR" content="phpGroupWare http://www.phpgroupware.org">
<META NAME="description" CONTENT="phpGroupWare login screen">
<META NAME="keywords" CONTENT="phpGroupWare login screen">
<TITLE>{website_title} - Login</TITLE>
</HEAD>
<BODY bgcolor="#FFFFFF">
<!-- BEGIN login_form_standard -->
<A href="http://www.phpgroupware.org"><img src="phpgwapi/templates/{template_set}/images/logo.gif" alt="phpGroupWare" border="0"></a>
<p>&nbsp;</p>
<CENTER>{lang_message}</CENTER>
<CENTER>{phpgw_loginscreen_message}</CENTER>
<p>&nbsp;</p>
<TABLE bgcolor="#000000" border="0" cellpadding="0" cellspacing="0" width="40%" align="CENTER">
@ -33,7 +20,7 @@
<input type="hidden" name="passwd_type" value="text">
<TABLE border="0" align="CENTER" bgcolor="#486591" width="100%" cellpadding="0" cellspacing="0">
<TR bgcolor="#e6e6e6">
<TD colspan="2" align="CENTER">{cd}</TD>
<TD colspan="2" align="CENTER">{phpgw_login_msgbox}</TD>
</TR>
<TR bgcolor="#e6e6e6">
<TD align="RIGHT"><font color="#000000">{lang_username}:&nbsp;</font></TD>
@ -51,6 +38,59 @@
</TR>
</TABLE>
</FORM>
</TD>
</TR>
</TABLE>
</TD>
</TR>
</TABLE>
<!-- END login_form_standard -->
<!-- BEGIN login_form_select_domain -->
<A href="http://www.phpgroupware.org"><img src="phpgwapi/templates/{template_set}/images/logo.gif" alt="phpGroupWare" border="0"></a>
<p>&nbsp;</p>
<CENTER>{phpgw_loginscreen_message}</CENTER>
<p>&nbsp;</p>
<TABLE bgcolor="#000000" border="0" cellpadding="0" cellspacing="0" width="50%" align="CENTER">
<TR>
<TD>
<TABLE border="0" width="100%" bgcolor="#486591" cellpadding="2" cellspacing="1">
<TR bgcolor="#486591">
<TD align="LEFT" valign="MIDDLE">
<font color="#fefefe">&nbsp;phpGroupWare</font>
</TD>
</TR>
<TR bgcolor="#e6e6e6">
<TD valign="BASELINE">
<FORM method="post" action="{login_url}">
<TABLE border="0" align="CENTER" bgcolor="#486591" width="100%" cellpadding="0" cellspacing="0">
<TR bgcolor="#e6e6e6">
<TD colspan="3" align="CENTER">{phpgw_login_msgbox}</TD>
</TR>
<TR bgcolor="#e6e6e6">
<TD align="RIGHT"><font color="#000000">{lang_username}:</font></TD>
<TD align="RIGHT"><input name="login" value="{cookie}"></TD>
<TD align="LEFT">&nbsp;@&nbsp;<select name="logindomain">{select_domain}</select></TD>
</TR>
<TR bgcolor="#e6e6e6">
<TD align="RIGHT"><font color="#000000">{lang_password}:</font></TD>
<TD align="RIGHT"><input name="passwd" type="password" onChange="this.form.submit()"></TD>
<TD>&nbsp;</TD>
</TR>
<TR bgcolor="#e6e6e6">
<TD colspan="3" align="CENTER">
<input type="submit" value="{lang_login}" name="submitit">
</TD>
</TR>
<TR bgcolor="#e6e6e6">
<TD colspan="3" align="RIGHT">
<font color="#000000" size="-1">{version}</font>
</TD>
</TR>
</TABLE>
</FORM>
</TD>
</TR>
@ -58,6 +98,15 @@
</TD>
</TR>
</TABLE>
<!-- END login_form_select_domain -->
<!-- END login_form -->
</HTML>
<!-- BEGIN login_form_deny -->
<A href="http://www.phpgroupware.org"><img src="phpgwapi/templates/{template_set}/images/logo.gif" alt="phpGroupWare" border="0"></a>
<TABLE border="0" height="94%" width="100%">
<TR>
<TD align="CENTER">
Opps! You caught us in the middle of a system upgrade.<br>Please, check back with us shortly.
</TD>
</TR>
</TABLE>
<!-- END login_form_deny -->

View File

@ -1,14 +0,0 @@
<!-- BEGIN form -->
<BODY bgcolor="#FFFFFF">
<A href="http://www.phpgroupware.org"><img src="phpgwapi/templates/{template_set}/images/logo.gif" alt="phpGroupWare" border="0"></a>
<TABLE border="0" height="94%" width="100%">
<TR>
<TD align="CENTER">
Opps! You caught us in the middle of a system upgrade.<br>Please, check back with us shortly.
</TD>
</TR>
</TABLE>
<!-- END form -->

View File

@ -1,70 +0,0 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<HTML>
<!-- BEGIN login_form -->
<HEAD>
<META http-equiv="Content-Type" content="text/html; charset={charset}">
<META name="AUTHOR" content="phpGroupWare http://www.phpgroupware.org">
<META NAME="description" CONTENT="phpGroupWare login screen">
<META NAME="keywords" CONTENT="phpGroupWare login screen">
<TITLE>{website_title} - Login</TITLE>
</HEAD>
<BODY bgcolor="#FFFFFF">
<A href="http://www.phpgroupware.org"><img src="phpgwapi/templates/{template_set}/images/logo.gif" alt="phpGroupWare" border="0"></a>
<p>&nbsp;</p>
<CENTER>{lang_message}</CENTER>
<p>&nbsp;</p>
<TABLE bgcolor="#000000" border="0" cellpadding="0" cellspacing="0" width="50%" align="CENTER">
<TR>
<TD>
<TABLE border="0" width="100%" bgcolor="#486591" cellpadding="2" cellspacing="1">
<TR bgcolor="#486591">
<TD align="LEFT" valign="MIDDLE">
<font color="#fefefe">&nbsp;phpGroupWare</font>
</TD>
</TR>
<TR bgcolor="#e6e6e6">
<TD valign="BASELINE">
<FORM method="post" action="{login_url}">
<TABLE border="0" align="CENTER" bgcolor="#486591" width="100%" cellpadding="0" cellspacing="0">
<TR bgcolor="#e6e6e6">
<TD colspan="3" align="CENTER">
{cd}
</TD>
</TR>
<TR bgcolor="#e6e6e6">
<TD align="RIGHT"><font color="#000000">{lang_username}:</font></TD>
<TD align="RIGHT"><input name="login" value="{cookie}"></TD>
<TD align="LEFT">&nbsp;@&nbsp;<select name="logindomain">{select_domain}</select></TD>
</TR>
<TR bgcolor="#e6e6e6">
<TD align="RIGHT"><font color="#000000">{lang_password}:</font></TD>
<TD align="RIGHT"><input name="passwd" type="password" onChange="this.form.submit()"></TD>
<TD>&nbsp;</TD>
</TR>
<TR bgcolor="#e6e6e6">
<TD colspan="3" align="CENTER">
<input type="submit" value="{lang_login}" name="submitit">
</TD>
</TR>
<TR bgcolor="#e6e6e6">
<TD colspan="3" align="RIGHT">
<font color="#000000" size="-1">{version}</font>
</TD>
</TR>
</TABLE>
</FORM>
</TD>
</TR>
</TABLE>
</TD>
</TR>
</TABLE>
<!-- END login_form -->
</HTML>

View File

@ -0,0 +1,11 @@
<!-- BEGIN msgbox_start -->
<CENTER><TABLE border=1 bgcolor="{row_on}">
<!-- END msgbox_start -->
<!-- BEGIN msgbox_row -->
<TR><TD bgcolor="white"><img src="{msgbox_img}" ALT="{msgbox_img_alt}"> {msgbox_text}</TD></TR>
<!-- END msgbox_row -->
<!-- BEGIN msgbox_end -->
</TABLE></CENTER>
<!-- END msgbox_end -->

View File

@ -1,15 +0,0 @@
<!-- BEGIN navbar -->
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr bgcolor="{navbar_color}">
<td align="left" nowrap>{user_info}</td>
<td align="right">{applications}</td>
</tr>
</table>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td align="left">{powered_by}</td>
<td align="right">{current_users}</td>
</tr>
</table>
<center>{messages}</center>
<!-- END navbar -->

View File

@ -1 +0,0 @@
<td align="{align}" width="{width}">{value}</td>

View File

@ -11,17 +11,16 @@
/* $Id$ */
function parse_navbar($force = False)
{
$tpl = createobject('phpgwapi.Template',PHPGW_TEMPLATE_DIR);
$tpl->set_unknowns('remove');
$GLOBALS['phpgw']->template->set_var('phpgw_top_height','10%');
$GLOBALS['phpgw']->template->set_var('phpgw_left_width','0');
$GLOBALS['phpgw']->template->set_var('phpgw_right_width','0');
$GLOBALS['phpgw']->template->set_var('phpgw_bottom_height','5%');
$tpl->set_file(
array(
'navbar' => 'navbar.tpl',
'navbar_app' => 'navbar_app.tpl'
)
);
function parse_toppart($output)
{
$GLOBALS['phpgw']->template->set_file('parts','parts.tpl');
$GLOBALS['phpgw']->template->set_block('parts','top_part');
$GLOBALS['phpgw']->template->set_block('parts','top_part_app');
$var['navbar_color'] = $GLOBALS['phpgw_info']['theme']['navbar_bg'];
@ -59,8 +58,8 @@
$var['value'] = '<a href="' . $app[1]['url'] . '"' . $target . '>' . $title . '</a>';
$var['align'] = 'center';
$tpl->set_var($var);
$tpl->parse('applications','navbar_app',True);
$GLOBALS['phpgw']->template->set_var($var);
$GLOBALS['phpgw']->template->parse('applications','top_part_app',True);
}
}
if ($GLOBALS['phpgw_info']['user']['preferences']['common']['navbar_format'] == 'text')
@ -68,11 +67,11 @@
$var['navbar_color'] = $GLOBALS['phpgw_info']['theme']['bg_color'];
$var['align'] = 'right';
$var['value'] = $GLOBALS['phpgw']->common->create_tabs($tabs,$selected,-1);
$tpl->set_var($var);
$tpl->parse('applications','navbar_app',True);
$GLOBALS['phpgw']->template->set_var($var);
$GLOBALS['phpgw']->template->parse('applications','top_part_app',True);
}
if ($GLOBALS['phpgw_info']['server']['showpoweredbyon'] == 'top')
if ($GLOBALS['phpgw_info']['server']['showpoweredbyon'] == 'top')
{
$var['powered_by'] = lang('Powered by phpGroupWare version x',$GLOBALS['phpgw_info']['server']['versions']['phpgwapi']);
}
@ -109,30 +108,26 @@
{
$var['messages'] = $api_messages . '<br>' . checkcode($cd);
}
$tpl->set_var($var);
$tpl->pfp('out','navbar');
return;
$GLOBALS['phpgw']->template->set_var($var);
$GLOBALS['phpgw']->template->fp($output,'top_part');
}
function parse_navbar_end()
function parse_bottompart($output)
{
if ($GLOBALS['phpgw_info']['server']['showpoweredbyon'] == 'bottom')
{
$tpl = createobject('phpgwapi.Template',PHPGW_TEMPLATE_DIR);
$tpl->set_unknowns('remove');
$tpl->set_file(
array(
'footer' => 'footer.tpl'
)
);
$GLOBALS['phpgw']->template->set_file('parts','parts.tpl');
$GLOBALS['phpgw']->template->set_block('parts','bottom_part');
$var = Array(
'table_bg_color' => $GLOBALS['phpgw_info']['theme']['navbar_bg'],
'bg_color' => $GLOBALS['phpgw_info']['theme']['bg_color'],
'msg' => "<p><p>\n".lang('Powered by phpGroupWare version x',$GLOBALS['phpgw_info']['server']['versions']['phpgwapi']),
'version' => $GLOBALS['phpgw_info']['server']['versions']['phpgwapi']
);
$tpl->set_var($var);
$GLOBALS['phpgw']->hooks->process('navbar_end');
$tpl->pfp('out','footer');
$GLOBALS['phpgw']->template->set_var($var);
$GLOBALS['phpgw']->template->fp($output,'bottom_part');
}
else
{
$GLOBALS['phpgw']->template->set_var($output,'');
}
}

View File

@ -0,0 +1,27 @@
<!-- BEGIN top_part -->
<TABLE width="100%" border="0" cellspacing="0" cellpadding="0">
<TR bgcolor="{navbar_color}">
<TD align="left" nowrap>{user_info}</TD>
<TD align="right">{applications}</TD>
</TR>
</TABLE>
<TABLE width="100%" border="0" cellspacing="0" cellpadding="0">
<TR>
<TD align="left">{powered_by}</TD>
<TD align="right">{current_users}</TD>
</TR>
</TABLE>
<CENTER>{messages}</CENTER>
<!-- END top_part -->
<!-- BEGIN bottom_part -->
<TABLE border="0" cellspacing="0" cellpadding="0" width="100%" bgcolor="{bg_color}">
<TR>
<TD align="CENTER">{msg}<BR></TD>
</TR>
</Table>
<!-- END bottom_part -->
<!-- BEGIN top_part_app -->
<td align="{align}" width="{width}">{value}</td>
<!-- END top_part_app -->

View File

@ -0,0 +1,147 @@
<!-- BEGIN phpgw_main_tables -->
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<HTML>
<HEAD>
<META http-equiv="Content-Type" content="text/html; charset={phpgw_head_charset}">
<META name="AUTHOR" content="phpGroupWare http://www.phpgroupware.org">
<META NAME="description" CONTENT="{phpgw_head_description}">
<META NAME="keywords" CONTENT="{phpgw_head_keywords}">
<META name="robots" content="none">
<BASE target="{phpgw_head_target}">
<LINK REL="ICON" href="{phpgw_head_browser_ico}" type="image/x-ico">
<LINK REL="SHORTCUT ICON" href="{phpgw_head_browser_ico}">
<TITLE>{phpgw_head_website_title}</TITLE>
<script language="JavaScript" type="text/javascript">
<!--
function MM_swapImgRestore() { //v3.0
var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}
function MM_preloadImages() { //v3.0
var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}
function MM_findObj(n, d) { //v4.0
var p,i,x; if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
if(!x && document.getElementById) x=document.getElementById(n); return x;
}
function MM_swapImage() { //v3.0
var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}
function multiLoad(top_doc,left_doc,body_doc,right_doc,bottom_doc) {
if(top_doc != null){parent.top.location.href=top_doc;}
if(left_doc != null){parent.left.location.href=left_doc;}
if(body_doc != null){parent.body.location.href=body_doc;}
if(right_doc != null){parent.right.location.href=right_doc;}
if(bottom_doc != null){parent.bottom.location.href=bottom_doc;}
}
//-->
</script>
{phpgw_head_tags}
</HEAD>
<BODY {phpgw_body_tags} onLoad="{phpgw_body_onload}">
<TABLE border="0" width="100%" height="%100" cellspacing="0" cellpadding="0">
<TR>
<TD width="100%" height="{phpgw_top_height}" align="left" valign="top" colspan="3">{phpgw_top}</TD>
</TR>
<TR>
<TD width="{phpgw_left_width}" height="100%" align="left" valign="top">{phpgw_left}</TD>
<TD width="100%" height="100%" align="left" valign="top">{phpgw_msgbox}{phpgw_body}</TD>
<TD width="{phpgw_right_width}" height="100%" align="right" valign="top">{phpgw_right}</TD>
</TR>
<TR>
<TD width="100%" height="{phpgw_bottom_height}" align="left" valign="top" colspan="3">{phpgw_bottom}</TD>
</TR>
</TABLE>
</BODY>
</HTML>
<!-- END phpgw_main_tables -->
<!-- BEGIN phpgw_main_basic -->
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<HTML>
<HEAD>
<META http-equiv="Content-Type" content="text/html; charset={phpgw_head_charset}">
<META name="AUTHOR" content="phpGroupWare http://www.phpgroupware.org">
<META NAME="description" CONTENT="{phpgw_head_description}">
<META NAME="keywords" CONTENT="{phpgw_head_keywords}">
<META name="robots" content="none">
<BASE target="{phpgw_head_target}">
<LINK REL="ICON" href="{phpgw_head_browser_ico}" type="image/x-ico">
<LINK REL="SHORTCUT ICON" href="{phpgw_head_browser_ico}">
<TITLE>{phpgw_head_website_title}</TITLE>
<script language="JavaScript" type="text/javascript">
<!--
function MM_swapImgRestore() { //v3.0
var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}
function MM_preloadImages() { //v3.0
var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}
function MM_findObj(n, d) { //v4.0
var p,i,x; if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
if(!x && document.getElementById) x=document.getElementById(n); return x;
}
function MM_swapImage() { //v3.0
var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}
function multiLoad(top_doc,left_doc,body_doc,right_doc,bottom_doc) {
if(top_doc != null){parent.top.location.href=top_doc;}
if(left_doc != null){parent.left.location.href=left_doc;}
if(body_doc != null){parent.body.location.href=body_doc;}
if(right_doc != null){parent.right.location.href=right_doc;}
if(bottom_doc != null){parent.bottom.location.href=bottom_doc;}
}
//-->
</script>
{phpgw_head_tags}
</HEAD>
<BODY {phpgw_body_tags} onLoad="{phpgw_body_onload}">
{phpgw_msgbox}
{phpgw_body}
</BODY>
</HTML>
<!-- END phpgw_main_basic -->
<!-- BEGIN phpgw_main_frames -->
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<HTML>
<HEAD>
<META http-equiv="Content-Type" content="text/html; charset={phpgw_head_charset}">
<META name="AUTHOR" content="phpGroupWare http://www.phpgroupware.org">
<META NAME="description" CONTENT="{phpgw_head_description}">
<META NAME="keywords" CONTENT="{phpgw_head_keywords}">
<META name="robots" content="none">
<BASE target="{phpgw_head_target}">
<LINK REL="ICON" href="{phpgw_head_browser_ico}" type="image/x-ico">
<LINK REL="SHORTCUT ICON" href="{phpgw_head_browser_ico}">
<TITLE>{phpgw_head_website_title}</TITLE>
<FRAMESET frameborder="0" border="0" framespacing="0" ROWS="{phpgw_top_height},*,{phpgw_bottom_height}">
<FRAME MARGINWIDTH=0 MARGINHEIGHT=0 SRC="{phpgw_top_link}" NAME="top" SCROLLING=NO>
<FRAMESET frameborder="0" border="0" framespacing="0" COLS="{phpgw_left_width},*,{phpgw_right_width}">
<FRAME MARGINWIDTH=0 MARGINHEIGHT=0 SRC="{phpgw_left_link}" NAME="left" SCROLLING=NO>
<FRAME MARGINWIDTH=0 MARGINHEIGHT=0 SRC="{phpgw_body_link}" NAME="body">
<FRAME MARGINWIDTH=0 MARGINHEIGHT=0 SRC="{phpgw_right_link}" NAME="right" SCROLLING=NO>
</FRAMESET>
<FRAME MARGINWIDTH=0 MARGINHEIGHT=0 SRC="{phpgw_bottom_link}" NAME="bottom" SCROLLING=NO>
<NOFRAMES>
<P>phpGroupWare is configured to use frames, but your browser does not support them.<BR>
<A href="{phpgw_link}&framepart=unsupported">click here to force non-frames mode</A>
</NOFRAMES>
</FRAMESET>
</HEAD>
</HTML>
<!-- END phpgw_main_frames -->