phpgroupware-cvs
[Top][All Lists]
Advanced

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

[Phpgroupware-cvs] CVS: phpgroupware login.php,1.78,1.79 logout.php,1.25


From: Dan Kuykendall <address@hidden>
Subject: [Phpgroupware-cvs] CVS: phpgroupware login.php,1.78,1.79 logout.php,1.25,1.26
Date: Thu, 30 May 2002 05:44:40 -0400

Update of /cvsroot/phpgroupware/phpgroupware
In directory subversions:/tmp/cvs-serv19238

Modified Files:
        login.php logout.php 
Log Message:
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

Index: login.php
===================================================================
RCS file: /cvsroot/phpgroupware/phpgroupware/login.php,v
retrieving revision 1.78
retrieving revision 1.79
diff -C2 -r1.78 -r1.79
*** login.php   27 May 2002 08:21:13 -0000      1.78
--- login.php   30 May 2002 09:44:38 -0000      1.79
***************
*** 16,20 ****
        $phpgw_info = array();
        $GLOBALS['phpgw_info']['flags'] = array(
!               'disable_template_class' => True,
                'login'                  => True,
                'currentapp'             => 'login',
--- 16,20 ----
        $phpgw_info = array();
        $GLOBALS['phpgw_info']['flags'] = array(
! //            'disable_template_class' => True,
                'login'                  => True,
                'currentapp'             => 'login',
***************
*** 32,109 ****
        }
                
-       
        $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']);
  
        // 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');
!               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']))
                {
!                       return $last_loginid;
                }
        }
  
!       function check_logoutcode($code)
        {
!               $GLOBALS['phpgw']->template = CreateObject('phpgwapi.Template');
                $GLOBALS['phpgw']->common = CreateObject('phpgwapi.common');
!               switch($code)
                {
                        case 1:
!                               return $GLOBALS['phpgw']->common->msgbox('You 
have been successfully logged out', True);
                                break;
                        case 2:
!                               return 
$GLOBALS['phpgw']->common->msgbox('Sorry, your login has expired', False);
                                break;
                        case 5:
!                               return $GLOBALS['phpgw']->common->msgbox('Bad 
login or password', False);
                                break;
                        case 10:
--- 32,75 ----
        }
                
        $GLOBALS['phpgw_info']['server']['template_dir'] = PHPGW_SERVER_ROOT . 
'/phpgwapi/templates/' . $GLOBALS['phpgw_info']['login_template_set'];
!       $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'])
        {
!               
$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;
        }
  
        function show_cookie()
        {
                /* This needs to be this way, because if someone doesnt want to 
use cookies, we shouldnt sneak one in */
!               if ($GLOBALS['HTTP_GET_VARS']['code'] != 5 && 
(isset($GLOBALS['phpgw_info']['server']['usecookies']) && 
$GLOBALS['phpgw_info']['server']['usecookies']))
                {
!                       return $GLOBALS['HTTP_COOKIE_VARS']['last_loginid'];
                }
        }
  
!       function check_logoutcode()
        {
!               //$GLOBALS['phpgw']->template = 
CreateObject('phpgwapi.Template');
                $GLOBALS['phpgw']->common = CreateObject('phpgwapi.common');
!               switch($GLOBALS['HTTP_GET_VARS']['code'])
                {
                        case 1:
!                               
$GLOBALS['phpgw_info']['flags']['msgbox_data']['You have been successfully 
logged out']=True;
                                break;
                        case 2:
!                               
$GLOBALS['phpgw_info']['flags']['msgbox_data']['Sorry, your login has 
expired']=False;
                                break;
                        case 5:
!                               
$GLOBALS['phpgw_info']['flags']['msgbox_data']['Bad login or password']=False;
                                break;
                        case 10:
***************
*** 111,118 ****
                                Setcookie('kp3');
                                Setcookie('domain');
!                               return $GLOBALS['phpgw']->common->msgbox('Your 
session could not be verified.',False);
                                break;
-                       default:
-                               return '&nbsp;';
                }
        }
--- 77,82 ----
                                Setcookie('kp3');
                                Setcookie('domain');
!                               
$GLOBALS['phpgw_info']['flags']['msgbox_data']['Your session could not be 
verified']=False;
                                break;
                }
        }
***************
*** 129,133 ****
        # 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))
        {
                # an X.509 subject looks like:
--- 93,97 ----
        # 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($GLOBALS['HTTP_GET_VARS']['code']))
        {
                # an X.509 subject looks like:
***************
*** 159,164 ****
        }
  
!       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 (getenv(REQUEST_METHOD) != 'POST' && !isset($PHP_AUTH_USER) 
&& !isset($HTTP_SERVER_VARS['SSL_CLIENT_S_DN']))
--- 123,128 ----
        }
  
!       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']))
***************
*** 170,174 ****
                if (! isset($GLOBALS['sessionid']) || ! $GLOBALS['sessionid'])
                {
!                       
$GLOBALS['phpgw']->redirect($GLOBALS['phpgw_info']['server']['webserver_url'] . 
'/login.php?cd=5');
                }
                else
--- 134,138 ----
                if (! isset($GLOBALS['sessionid']) || ! $GLOBALS['sessionid'])
                {
!                       
$GLOBALS['phpgw']->redirect($GLOBALS['phpgw_info']['server']['webserver_url'] . 
'/login.php?code=5');
                }
                else
***************
*** 176,180 ****
                        if ($GLOBALS['phpgw_forward'])
                        {
!                               while (list($name,$value) = 
each($HTTP_GET_VARS))
                                {
                                        if (ereg('phpgw_',$name))
--- 140,144 ----
                        if ($GLOBALS['phpgw_forward'])
                        {
!                               while (list($name,$value) = 
each($GLOBALS['HTTP_GET_VARS']))
                                {
                                        if (ereg('phpgw_',$name))
***************
*** 184,188 ****
                                }
                        }
!                       
$GLOBALS['phpgw']->redirect($GLOBALS['phpgw']->link('/home.php','cd=yes' . 
$extra_vars));
                }
        }
--- 148,152 ----
                                }
                        }
!                       
$GLOBALS['phpgw']->redirect($GLOBALS['phpgw']->link('/home.php','code=yes' . 
$extra_vars,True));
                }
        }
***************
*** 192,196 ****
                // If there is something wrong with this code TELL ME!
                // Commenting out the code will not fix it. (jengo)
!               if (isset($last_loginid))
                {
                        $accounts = CreateObject('phpgwapi.accounts');
--- 156,160 ----
                // If there is something wrong with this code TELL ME!
                // Commenting out the code will not fix it. (jengo)
!               if (isset($GLOBALS['HTTP_COOKIE_VARS']['last_loginid']))
                {
                        $accounts = CreateObject('phpgwapi.accounts');
***************
*** 210,214 ****
                        if (lang('loginscreen_message') != 
'loginscreen_message*')
                        {
!                               
$tmpl->set_var('lang_message',stripslashes(lang('loginscreen_message')));
                        }
                }
--- 174,178 ----
                        if (lang('loginscreen_message') != 
'loginscreen_message*')
                        {
!                               
$GLOBALS['phpgw']->template->set_var('phpgw_loginscreen_message',stripslashes(lang('loginscreen_message')));
                        }
                }
***************
*** 222,237 ****
                        if (lang('loginscreen_message') != 
'loginscreen_message*')
                        {
!                               
$tmpl->set_var('lang_message',stripslashes(lang('loginscreen_message')));
                        }
                }
        }
  
!       if (!isset($cd) || !$cd)
        {
!               $cd = '';
        }
  
        if ($GLOBALS['phpgw_info']['server']['show_domain_selectbox'])
        {
                reset($phpgw_domain);
                unset($domain_select);      // For security ... just in case
--- 186,202 ----
                        if (lang('loginscreen_message') != 
'loginscreen_message*')
                        {
!                               
$GLOBALS['phpgw']->template->set_var('phpgw_loginscreen_message',stripslashes(lang('loginscreen_message')));
                        }
                }
        }
  
!       if (!isset($GLOBALS['HTTP_GET_VARS']['code']) || 
!$GLOBALS['HTTP_GET_VARS']['code'])
        {
!               $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
***************
*** 245,252 ****
                        $domain_select .= '>' . $domain[0] . '</option>';
                }
!               $tmpl->set_var('select_domain',$domain_select);
        }
  
!       while (list($name,$value) = each($HTTP_GET_VARS))
        {
                if (ereg('phpgw_',$name))
--- 210,221 ----
                        $domain_select .= '>' . $domain[0] . '</option>';
                }
!               
$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($GLOBALS['HTTP_GET_VARS']))
        {
                if (ereg('phpgw_',$name))
***************
*** 260,276 ****
                $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');
  ?>
--- 229,254 ----
                $extra_vars = '?' . substr($extra_vars,1,strlen($extra_vars));
        }
!       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');
  ?>

Index: logout.php
===================================================================
RCS file: /cvsroot/phpgroupware/phpgroupware/logout.php,v
retrieving revision 1.25
retrieving revision 1.26
diff -C2 -r1.25 -r1.26
*** logout.php  4 Mar 2002 00:59:29 -0000       1.25
--- logout.php  30 May 2002 09:44:38 -0000      1.26
***************
*** 64,67 ****
        }
  
!       
$GLOBALS['phpgw']->redirect($GLOBALS['phpgw_info']['server']['webserver_url'].'/login.php?cd=1');
  ?>
--- 64,67 ----
        }
  
!       
$GLOBALS['phpgw']->redirect($GLOBALS['phpgw_info']['server']['webserver_url'].'/login.php?code=1',True);
  ?>




reply via email to

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