phpgroupware-cvs
[Top][All Lists]
Advanced

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

[Phpgroupware-cvs] CVS: setup setup_demo.php,1.24.2.3,1.24.2.4


From: Miles Lott <address@hidden>
Subject: [Phpgroupware-cvs] CVS: setup setup_demo.php,1.24.2.3,1.24.2.4
Date: Sat, 18 May 2002 12:49:02 -0400

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

Modified Files:
      Tag: Version-0_9_14-branch
        setup_demo.php 
Log Message:
do not try ACL inserts if account add fails (part of GNU Bug#382)

Index: setup_demo.php
===================================================================
RCS file: /cvsroot/phpgroupware/setup/setup_demo.php,v
retrieving revision 1.24.2.3
retrieving revision 1.24.2.4
diff -C2 -r1.24.2.3 -r1.24.2.4
*** setup_demo.php      1 May 2002 05:10:23 -0000       1.24.2.3
--- setup_demo.php      18 May 2002 16:48:59 -0000      1.24.2.4
***************
*** 24,28 ****
        // Authorize the user to use setup app and load the database
        // Does not return unless user is authorized
!       if (!$phpgw_setup->auth('Config') || $HTTP_POST_VARS['cancel'])
        {
                Header('Location: index.php');
--- 24,28 ----
        // Authorize the user to use setup app and load the database
        // Does not return unless user is authorized
!       if(!$phpgw_setup->auth('Config') || $HTTP_POST_VARS['cancel'])
        {
                Header('Location: index.php');
***************
*** 46,50 ****
        }
  
!       if (!$HTTP_POST_VARS['submit'])
        {
                $tpl_root = $phpgw_setup->setup_tpl_dir('setup');
--- 46,50 ----
        }
  
!       if(!$HTTP_POST_VARS['submit'])
        {
                $tpl_root = $phpgw_setup->setup_tpl_dir('setup');
***************
*** 89,98 ****
                $lname    = $HTTP_POST_VARS['lname'];
  
!               if ($passwd != $passwd2)
                {
                        echo lang('Passwords did not match, please re-enter') . 
'.';
                        exit;
                }
!               if (!$username)
                {
                        echo lang('You must enter a username for the admin') . 
'.';
--- 89,98 ----
                $lname    = $HTTP_POST_VARS['lname'];
  
!               if($passwd != $passwd2)
                {
                        echo lang('Passwords did not match, please re-enter') . 
'.';
                        exit;
                }
!               if(!$username)
                {
                        echo lang('You must enter a username for the admin') . 
'.';
***************
*** 103,107 ****
                /* Load up some configured values */
                $phpgw_setup->db->query("SELECT config_name,config_value FROM 
phpgw_config WHERE config_name LIKE 'ldap%' OR 
config_name='account_repository'",__LINE__,__FILE__);
!               while ($phpgw_setup->db->next_record())
                {
                        $config[$phpgw_setup->db->f('config_name')] = 
$phpgw_setup->db->f('config_value');
--- 103,107 ----
                /* Load up some configured values */
                $phpgw_setup->db->query("SELECT config_name,config_value FROM 
phpgw_config WHERE config_name LIKE 'ldap%' OR 
config_name='account_repository'",__LINE__,__FILE__);
!               while($phpgw_setup->db->next_record())
                {
                        $config[$phpgw_setup->db->f('config_name')] = 
$phpgw_setup->db->f('config_value');
***************
*** 152,156 ****
  
                /* Creation of the demo accounts is now optional - the checkbox 
is on by default. */
!               if ($HTTP_POST_VARS['create_demo'])
                {
                        /* Create records for demo accounts */
--- 152,156 ----
  
                /* Creation of the demo accounts is now optional - the checkbox 
is on by default. */
!               if($HTTP_POST_VARS['create_demo'])
                {
                        /* Create records for demo accounts */
***************
*** 175,178 ****
--- 175,182 ----
                                $accountid = 
add_account($accountname,$firstname,'Account','guest');
  
+                               if(!$accountid)
+                               {
+                                       break;
+                               }
                                $phpgw_setup->db->query("INSERT INTO 
phpgw_preferences (preference_owner, preference_value) VALUES ('$accountid', 
'$defaultprefs')",__LINE__,__FILE__);
                                $phpgw_setup->db->query("INSERT INTO phpgw_acl 
(acl_appname, acl_location, acl_account, acl_rights) VALUES ('preferences', 
'changepassword', ".$accountid.", 0)",__LINE__,__FILE__);
***************
*** 187,205 ****
  
                /* Create records for administrator account */
                $accountid = add_account($username,$fname,$lname,$passwd);
  
!               $phpgw_setup->db->query("INSERT INTO phpgw_preferences 
(preference_owner, preference_value) VALUES ('$accountid', 
'$defaultprefs')",__LINE__,__FILE__);
!               $phpgw_setup->db->query("INSERT INTO phpgw_acl (acl_appname, 
acl_location, acl_account, acl_rights) VALUES ('phpgw_group', 
'".$defaultgroupid."', $accountid, 1)",__LINE__,__FILE__);
!               $phpgw_setup->db->query("INSERT INTO phpgw_acl (acl_appname, 
acl_location, acl_account, acl_rights) VALUES ('phpgw_group', 
'".$admingroupid."', $accountid, 1)",__LINE__,__FILE__);
!               $phpgw_setup->db->query("INSERT INTO phpgw_acl (acl_appname, 
acl_location, acl_account, acl_rights) VALUES ('preferences', 'changepassword', 
".$accountid.", 1)",__LINE__,__FILE__);
!               $phpgw_setup->db->query("INSERT INTO phpgw_acl (acl_appname, 
acl_location, acl_account, acl_rights) VALUES ('admin', 'run', ".$accountid.", 
1)",__LINE__,__FILE__);
!               $phpgw_setup->db->query("INSERT INTO phpgw_acl (acl_appname, 
acl_location, acl_account, acl_rights) VALUES ('nntp', 'run', ".$accountid.", 
1)",__LINE__,__FILE__);
! 
!               if (is_array($demo_apps))
                {
!                       @reset($demo_apps);
!                       while(list($key,$demo_app) = each($demo_apps))
                        {
!                               $phpgw_setup->db->query("INSERT INTO phpgw_acl 
(acl_appname, acl_location, acl_account, acl_rights) VALUES ('".$demo_app."', 
'run', ".$accountid.", 1)",__LINE__,__FILE__);
                        }
                }
--- 191,213 ----
  
                /* Create records for administrator account */
+               unset($accountid);
                $accountid = add_account($username,$fname,$lname,$passwd);
  
!               if($accountid)
                {
!                       $phpgw_setup->db->query("INSERT INTO phpgw_preferences 
(preference_owner, preference_value) VALUES ('$accountid', 
'$defaultprefs')",__LINE__,__FILE__);
!                       $phpgw_setup->db->query("INSERT INTO phpgw_acl 
(acl_appname, acl_location, acl_account, acl_rights) VALUES ('phpgw_group', 
'".$defaultgroupid."', $accountid, 1)",__LINE__,__FILE__);
!                       $phpgw_setup->db->query("INSERT INTO phpgw_acl 
(acl_appname, acl_location, acl_account, acl_rights) VALUES ('phpgw_group', 
'".$admingroupid."', $accountid, 1)",__LINE__,__FILE__);
!                       $phpgw_setup->db->query("INSERT INTO phpgw_acl 
(acl_appname, acl_location, acl_account, acl_rights) VALUES ('preferences', 
'changepassword', ".$accountid.", 1)",__LINE__,__FILE__);
!                       $phpgw_setup->db->query("INSERT INTO phpgw_acl 
(acl_appname, acl_location, acl_account, acl_rights) VALUES ('admin', 'run', 
".$accountid.", 1)",__LINE__,__FILE__);
!                       $phpgw_setup->db->query("INSERT INTO phpgw_acl 
(acl_appname, acl_location, acl_account, acl_rights) VALUES ('nntp', 'run', 
".$accountid.", 1)",__LINE__,__FILE__);
! 
!                       if(@is_array($demo_apps))
                        {
!                               @reset($demo_apps);
!                               while(list($key,$demo_app) = each($demo_apps))
!                               {
!                                       $phpgw_setup->db->query("INSERT INTO 
phpgw_acl (acl_appname, acl_location, acl_account, acl_rights) VALUES 
('".$demo_app."', 'run', ".$accountid.", 1)",__LINE__,__FILE__);
!                               }
                        }
                }




reply via email to

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